html,
body {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
}

.app-wrap {
  position: relative;
  width: min(390px, 100vw);
  min-height: 844px;
  margin: 0 auto;
  padding: 20px 16px 40px;
  overflow: hidden;
  border-radius: 24px;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.92), rgba(246, 242, 251, 0.2) 24%),
    linear-gradient(180deg, #f6f2fb 0%, #efe6fb 100%);
  box-shadow: 0 24px 60px rgba(56, 31, 90, 0.18);
}

.app-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(248, 244, 253, 0.2), rgba(234, 223, 247, 0.08)),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 42%);
  pointer-events: none;
}

.app-wrap > * {
  position: relative;
  z-index: 1;
}

/* 顶栏：始终一行。返回圆钮 + 标题固定宽度，右侧入口放不下时横向滑动 */
.app-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  margin-bottom: 16px;
  flex-wrap: nowrap;
}

.topbar-back {
  position: relative;
  flex: none;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(128, 128, 128, 0.32);
  border-radius: 50%;
  background: rgba(128, 128, 128, 0.16);
  color: inherit;
}

.topbar-back::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 12px;
  width: 9px;
  height: 9px;
  border-left: 2.5px solid currentColor;
  border-bottom: 2.5px solid currentColor;
  transform: rotate(45deg);
}

.topbar-title {
  flex: none;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
}

.topbar-actions::-webkit-scrollbar {
  display: none;
}

.topbar-actions .ghost-button {
  flex: none;
  min-height: 32px;
  padding: 0 12px;
  border-color: rgba(128, 128, 128, 0.3);
  background: rgba(128, 128, 128, 0.16);
  color: inherit;
  font-size: 12px;
}

.ghost-button,
.action-button,
.link-button,
.inline-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.ghost-button,
.action-button,
.link-button,
.inline-link {
  color: #7b58b1;
  background: #d0d0d0;
  border: 1px solid #bdbdbd;
  box-shadow: none;
}

.hero-panel,
.section-card,
.role-card,
.info-card,
.list-row,
.mail-card,
.chat-bubble,
.reward-node,
.battle-row,
.result-card,
.pool-card,
.station-card,
.opponent-card,
.inventory-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #eadff7;
  border-radius: 22px;
  box-shadow: 0 12px 28px rgba(80, 50, 120, 0.08);
}

.hero-panel {
  display: grid;
  gap: 18px;
  padding: 22px;
  margin-bottom: 18px;
}

.tag-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f0e6ff;
  color: #7746ad;
  font-size: 12px;
  font-weight: 700;
}

.page-title {
  margin: 12px 0 8px;
  font-size: 30px;
}

.page-subtitle {
  display: none;
}

.profile-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.profile-chip,
.stat-chip,
.quick-chip,
.pool-odds,
.inventory-pill,
.topic-chip {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 16px;
  background: #f8f3ff;
  color: #6b5f7f;
  font-size: 12px;
}

.profile-chip strong,
.stat-chip strong {
  color: #2f2440;
  font-size: 16px;
}

.section-card {
  padding: 18px;
  margin-bottom: 16px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head h2,
.section-head h3,
.section-title {
  margin: 0;
  font-size: 18px;
}

.section-note {
  display: none;
}

.grid-two,
.grid-three,
.grid-four,
.role-grid,
.stat-grid,
.pool-grid,
.station-grid,
.opponent-grid,
.reward-grid,
.inventory-grid,
.mail-grid {
  display: grid;
  gap: 12px;
}

.grid-two,
.pool-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-three,
.role-grid,
.station-grid,
.opponent-grid,
.mail-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-four,
.stat-grid,
.reward-grid,
.inventory-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.role-card,
.info-card,
.pool-card,
.station-card,
.opponent-card,
.inventory-card,
.reward-node,
.mail-card,
.result-card {
  padding: 14px;
}

.role-avatar,
.result-avatar {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  object-fit: cover;
  background: #f4ecff;
}

.role-card-head,
.flex-row,
.list-row,
.mail-card,
.inventory-card,
.result-card,
.opponent-card,
.station-card,
.pool-card,
.chat-bubble {
  display: flex;
  gap: 12px;
}

.role-card-head,
.flex-row,
.mail-card,
.inventory-card,
.result-card,
.opponent-card,
.station-card,
.pool-card {
  align-items: flex-start;
}

.role-card-content,
.flex-grow {
  flex: 1;
  min-width: 0;
}

.role-meta,
.muted,
.mini-copy,
.reward-copy,
.timeline-copy {
  color: #766985;
  font-size: 13px;
  line-height: 1.7;
}

.pill-row,
.action-row,
.topic-row,
.reward-row,
.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-chip,
.topic-chip,
.inventory-pill {
  flex-direction: row;
  align-items: center;
  min-height: 32px;
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #eee6fb;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, #8b54dc 0%, #c786ff 100%);
}

.list-stack,
.timeline-stack,
.track-stack,
.chat-stack,
.table-like {
  display: grid;
  gap: 10px;
}

.list-row,
.battle-row {
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
}

.list-key,
.card-title {
  color: #2f2440;
  font-size: 15px;
  font-weight: 700;
}

.list-value {
  color: #7b6d90;
  font-size: 13px;
}

.battle-score {
  font-size: 28px;
  font-weight: 700;
  color: #5d3497;
}

.chat-bubble {
  padding: 14px;
}

.chat-bubble.user {
  background: #f4ebff;
}

.chat-bubble.npc {
  background: #fff;
}

.chat-author {
  min-width: 62px;
  color: #704aa5;
  font-weight: 700;
}

.table-row {
  display: grid;
  grid-template-columns: 72px 1fr 1fr;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #faf7ff;
  color: #6e627f;
  font-size: 13px;
}

.table-row.header {
  background: #f0e7ff;
  color: #5e4193;
  font-weight: 700;
}

.small-copy {
  font-size: 12px;
  color: #8a7d9b;
}

.state-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f0e7ff;
  color: #7247aa;
  font-size: 12px;
  font-weight: 700;
}

.state-badge.win {
  background: #e8f8ef;
  color: #25744a;
}

.state-badge.loss {
  background: #fff1f3;
  color: #ac425f;
}

@media (max-width: 860px) {
  .grid-three,
  .grid-four,
  .role-grid,
  .stat-grid,
  .station-grid,
  .opponent-grid,
  .reward-grid,
  .inventory-grid,
  .mail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .app-wrap {
    width: 100vw;
    min-height: 100vh;
    padding: 16px 12px 32px;
    border-radius: 0;
    box-shadow: none;
  }

  .section-head,
  .list-row,
  .battle-row,
  .table-row,
  .role-card-head,
  .mail-card,
  .inventory-card,
  .result-card,
  .opponent-card,
  .station-card,
  .pool-card,
  .chat-bubble {
    display: block;
  }

  .profile-strip,
  .grid-two,
  .grid-three,
  .grid-four,
  .role-grid,
  .stat-grid,
  .pool-grid,
  .station-grid,
  .opponent-grid,
  .reward-grid,
  .inventory-grid,
  .mail-grid {
    grid-template-columns: 1fr;
  }

  .table-row {
    grid-template-columns: 1fr;
  }

  .page-title {
    font-size: 26px;
  }
}
