/* ============================================================================
   SHUI001 · pages.css（Midnight Ledger · 个人中心 / 战绩详情）
   owner: frontend-pages（C），见 docs/REDESIGN_BRIEF.md §2/§4/§5

   设计系统：
   - 深墨底（--ink/--bg）+ 细 hairline 分隔 + 索引 micro 标签（01 — ...）
   - 大号等宽 tabular 数字；黄铜（--brass）只用于价值/赢家/边缘光；
     钴蓝（--cobalt）用于交互；绯红（--crimson）用于负值；色板仅含墨色/象牙/黄铜/钴蓝/绯红。
   - 令牌优先引用 base.css :root（brief §1）；若 base 尚未定义则用 brief 同值兜底，
     因此本文件可独立工作，也不与重设计后的 base.css 冲突。
   - 组件类统一 .pg- 前缀，自包含实现，不依赖旧组件类；按钮一律 ≥44px。
   - 支持 1440 / 820 / 390；prefers-reduced-motion / transparency / contrast 降级。
   ==========================================================================*/

/* ============================================================================
 * 1. 页面级令牌（= docs/REDESIGN_BRIEF.md §1；引用 base.css 新令牌时自动跟随）
 * ==========================================================================*/
.pg-root,
.pg-session-body,
#modal-root {
  /* Ink & surfaces */
  --pg-ink: #08090c;
  --pg-bg: #0a0c10;
  --pg-bg-soft: #0e1116;
  --pg-surface: #12151a;
  --pg-panel: #171b22;
  --pg-panel-2: #1d222a;
  --pg-hairline: var(--hairline, rgba(242, 238, 230, .08));
  --pg-hairline-strong: var(--hairline-strong, rgba(242, 238, 230, .14));
  /* Text */
  --pg-text: #f2eee6;
  --pg-text-bright: #fbf8f2;
  --pg-text-dim: #a6a29a;
  --pg-text-faint: #6c6862;
  /* Accents */
  --pg-cobalt: var(--cobalt, #6e8dff);
  --pg-cobalt-hi: var(--cobalt-hi, #9bb0ff);
  --pg-cobalt-dim: var(--cobalt-dim, rgba(110, 141, 255, .16));
  --pg-brass: var(--brass, #d8b26b);
  --pg-brass-hi: var(--brass-hi, #eac98d);
  --pg-brass-dim: var(--brass-dim, rgba(216, 178, 107, .14));
  --pg-crimson: var(--crimson, #e06f6f);
  --pg-crimson-dim: var(--crimson-dim, rgba(224, 111, 111, .14));
  /* Shape & elevation */
  --pg-r-sm: var(--r-sm, 10px);
  --pg-r-md: var(--r-md, 14px);
  --pg-r-lg: var(--r-lg, 18px);
  --pg-r-xl: var(--r-xl, 24px);
  --pg-shadow-float: var(--shadow-float, 0 24px 80px rgba(0, 0, 0, .55), 0 2px 10px rgba(0, 0, 0, .35));
  --pg-shadow-card: 0 1px 0 rgba(242, 238, 230, .03) inset, 0 18px 44px rgba(0, 0, 0, .26);
  /* Motion */
  --pg-ease-spring: var(--ease-spring, cubic-bezier(.22, .9, .28, 1));
  --pg-ease-out: var(--ease-out, cubic-bezier(.2, .7, .3, 1));
  --pg-dur-fast: var(--dur-fast, .14s);
  --pg-dur-base: var(--dur-base, .24s);
  --pg-dur-slow: var(--dur-slow, .42s);
  /* Type */
  --pg-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB",
    "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --pg-font-num: ui-monospace, "SF Mono", "JetBrains Mono", "Roboto Mono", Menlo, monospace;
  --pg-track-display: -.035em;
  --pg-track-title: -.02em;
  --pg-track-body: .005em;
  --pg-track-micro: .14em;
  /* Layout */
  --pg-page-max: 1280px;
  --pg-gutter: 32px;
}

/* ============================================================================
 * 2. 画布与页面骨架
 * ==========================================================================*/
#screen-profile,
#screen-history {
  min-height: calc(100dvh - var(--header-h, 64px));
  background-color: #0a0c10;
  background-image: linear-gradient(180deg, #0e1116 0, rgba(14, 17, 22, 0) 260px);
  color: #f2eee6;
}

.pg-root {
  min-height: 100%;
  color: var(--pg-text);
  font-family: var(--pg-font);
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: var(--pg-track-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.pg-root *,
.pg-session-body * {
  box-sizing: border-box;
}

.pg-root [hidden],
.pg-session-body [hidden] {
  display: none !important;
}

.pg-page {
  max-width: var(--pg-page-max);
  margin: 0 auto;
  padding: clamp(26px, 4.4vw, 54px) clamp(16px, 4vw, 32px) calc(52px + env(safe-area-inset-bottom));
  min-width: 0;
}

.pg-ico {
  flex: none;
  display: block;
}

.pg-num {
  font-family: var(--pg-font-num);
  font-variant-numeric: tabular-nums;
}

/* 语义色（限制在页面作用域，避免与 table.css 的全局类冲突） */
.pg-root .is-win,
.pg-session-body .is-win { color: var(--pg-brass); }
.pg-root .is-lose,
.pg-session-body .is-lose { color: var(--pg-crimson); }
.pg-root .is-flat,
.pg-session-body .is-flat { color: var(--pg-text-dim); }

.pg-truncate {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pg-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================================
 * 3. 排版层级（brief §2）
 * ==========================================================================*/
.pg-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 26px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--pg-hairline);
}
.pg-head-main { min-width: 0; }

.pg-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: var(--pg-track-micro);
  text-transform: uppercase;
  color: var(--pg-text-faint);
}
.pg-index {
  color: var(--pg-brass);
  font-family: var(--pg-font-num);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
}
.pg-eyebrow-rule {
  display: block;
  width: 26px;
  height: 1px;
  background: var(--pg-hairline-strong);
}
.pg-eyebrow-text { text-transform: uppercase; }

.pg-title {
  margin: 0 0 8px;
  font-size: clamp(30px, 3.6vw, 40px);
  line-height: 1.06;
  letter-spacing: var(--pg-track-title);
  font-weight: 700;
  color: var(--pg-text-bright);
  text-wrap: balance;
}
.pg-sub {
  margin: 0;
  max-width: 58ch;
  color: var(--pg-text-dim);
  font-size: 13.5px;
  line-height: 1.6;
}
.pg-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.pg-micro {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: var(--pg-track-micro);
  text-transform: uppercase;
  color: var(--pg-text-faint);
}

/* ============================================================================
 * 4. 通用控件
 * ==========================================================================*/
.pg-btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--pg-r-md);
  border: 1px solid var(--pg-hairline-strong);
  background: var(--pg-panel);
  color: var(--pg-text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: .004em;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition:
    background-color var(--pg-dur-fast) var(--pg-ease-out),
    border-color var(--pg-dur-fast) var(--pg-ease-out),
    color var(--pg-dur-fast) var(--pg-ease-out),
    opacity var(--pg-dur-fast) var(--pg-ease-out),
    transform 120ms var(--pg-ease-spring);
}
.pg-btn:hover:not(:disabled) {
  background: var(--pg-panel-2);
  border-color: var(--pg-hairline-strong);
}
.pg-btn:active:not(:disabled) { transform: scale(.98); }
.pg-btn:disabled { opacity: .5; cursor: not-allowed; }
.pg-btn-ghost {
  background: transparent;
  border-color: var(--pg-hairline);
  color: var(--pg-text-dim);
}
.pg-btn-ghost:hover:not(:disabled) {
  background: var(--pg-panel);
  border-color: var(--pg-hairline-strong);
  color: var(--pg-text-bright);
}
.pg-btn-primary {
  background: var(--pg-cobalt);
  border-color: transparent;
  color: var(--pg-ink);
  font-weight: 600;
}
.pg-btn-primary:hover:not(:disabled) {
  background: var(--pg-cobalt-hi);
  border-color: transparent;
  color: var(--pg-ink);
}
.pg-btn-sm { padding: 0 12px; font-size: 13px; }

.pg-icon-btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--pg-text-dim);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition:
    background-color var(--pg-dur-fast) var(--pg-ease-out),
    color var(--pg-dur-fast) var(--pg-ease-out),
    border-color var(--pg-dur-fast) var(--pg-ease-out),
    transform 120ms var(--pg-ease-spring);
}
.pg-icon-btn:hover:not(:disabled) {
  color: var(--pg-text-bright);
  background: var(--pg-panel);
  border-color: var(--pg-hairline);
}
.pg-icon-btn:active:not(:disabled) { transform: scale(.96); }
.pg-icon-btn-round { border-radius: 999px; }

.pg-link-btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--pg-text-dim);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--pg-dur-fast) var(--pg-ease-out);
}
.pg-link-btn:hover { color: var(--pg-cobalt-hi); }

.pg-replay-btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--pg-hairline);
  background: transparent;
  color: var(--pg-text-dim);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color var(--pg-dur-fast) var(--pg-ease-out),
    border-color var(--pg-dur-fast) var(--pg-ease-out),
    color var(--pg-dur-fast) var(--pg-ease-out),
    transform 120ms var(--pg-ease-spring);
}
.pg-replay-btn:hover:not(:disabled) {
  background: var(--pg-panel);
  border-color: var(--pg-hairline-strong);
  color: var(--pg-text-bright);
}
.pg-replay-btn:active:not(:disabled) { transform: scale(.97); }
.pg-replay-btn:disabled { opacity: .38; cursor: not-allowed; }

.pg-input {
  min-height: 44px;
  width: 100%;
  max-width: 100%;
  padding: 0 14px;
  border-radius: var(--pg-r-sm);
  border: 1px solid var(--pg-hairline-strong);
  background: var(--pg-bg-soft);
  color: var(--pg-text);
  font-family: inherit;
  font-size: 14px;
  letter-spacing: var(--pg-track-body);
  transition: border-color var(--pg-dur-fast) var(--pg-ease-out), box-shadow var(--pg-dur-fast) var(--pg-ease-out);
}
.pg-input::placeholder { color: var(--pg-text-faint); }
.pg-input:focus {
  outline: none;
  border-color: var(--pg-cobalt);
  box-shadow: 0 0 0 3px var(--pg-cobalt-dim);
}
.pg-input:disabled { opacity: .6; }

.pg-btn:focus-visible,
.pg-icon-btn:focus-visible,
.pg-link-btn:focus-visible,
.pg-replay-btn:focus-visible,
.pg-seg-btn:focus-visible,
.pg-session-card:focus-visible,
.pg-avatar-btn:focus-visible,
.pg-input:focus-visible {
  outline: 2px solid var(--pg-cobalt-hi);
  outline-offset: 2px;
}

.pg-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--pg-hairline);
  background: rgba(242, 238, 230, .03);
  color: var(--pg-text-dim);
  font-size: 11px;
  font-style: normal;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: .01em;
  white-space: nowrap;
}
.pg-tag-solo {
  color: var(--pg-cobalt-hi);
  border-color: rgba(110, 141, 255, .28);
  background: var(--pg-cobalt-dim);
}
.pg-tag-multi {
  color: var(--pg-brass-hi);
  border-color: rgba(216, 178, 107, .3);
  background: var(--pg-brass-dim);
}
.pg-tag-me {
  color: var(--pg-cobalt-hi);
  border-color: rgba(110, 141, 255, .3);
  background: var(--pg-cobalt-dim);
}
.pg-tag-ai {
  color: var(--pg-text-dim);
  border-color: var(--pg-hairline);
  background: transparent;
}

.pg-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--pg-hairline-strong);
  border-top-color: var(--pg-brass);
  animation: pg-spin .9s linear infinite;
}
@keyframes pg-spin {
  to { transform: rotate(360deg); }
}

.pg-field-error {
  margin: 6px 0 0;
  color: var(--pg-crimson);
  font-size: 12.5px;
  line-height: 1.5;
}
.pg-hint {
  margin: 0;
  color: var(--pg-text-dim);
  font-size: 11.5px;
  line-height: 1.5;
}

/* ============================================================================
 * 5. Profile · 用户头图区
 * ==========================================================================*/
.pg-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(188px, 236px);
  gap: 28px;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--pg-hairline);
  border-radius: var(--pg-r-xl);
  background:
    linear-gradient(180deg, rgba(29, 34, 42, .72), rgba(18, 21, 26, .94)),
    var(--pg-surface);
  box-shadow: var(--pg-shadow-card);
  overflow: hidden;
}
.pg-hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(216, 178, 107, .32), transparent);
  pointer-events: none;
}

.pg-hero-id {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.4vw, 24px);
  min-width: 0;
}

.pg-avatar-btn {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex: none;
  width: clamp(88px, 9vw, 112px);
  height: clamp(88px, 9vw, 112px);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.pg-avatar {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(120% 120% at 30% 18%, #1d222a 0%, #0e1116 100%);
  border: 1px solid var(--pg-hairline-strong);
  box-shadow:
    0 0 0 1px rgba(216, 178, 107, .22),
    0 18px 40px rgba(0, 0, 0, .45);
  transition:
    transform var(--pg-dur-base) var(--pg-ease-spring),
    box-shadow var(--pg-dur-base) var(--pg-ease-out);
}
.pg-avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}
.pg-avatar-fallback {
  color: var(--pg-text-dim);
  font-family: var(--pg-font-num);
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1;
  user-select: none;
}
.pg-avatar-badge {
  position: absolute;
  inset: auto 0 0;
  z-index: 2;
  display: grid;
  place-items: center;
  height: 34%;
  padding-bottom: 4px;
  border-radius: 0 0 50% 50%;
  background: linear-gradient(180deg, rgba(8, 9, 12, 0), rgba(8, 9, 12, .84));
  color: var(--pg-brass-hi);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .12em;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--pg-dur-base) var(--pg-ease-out), transform var(--pg-dur-base) var(--pg-ease-out);
  pointer-events: none;
}
.pg-avatar-btn:hover .pg-avatar {
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px rgba(216, 178, 107, .42),
    0 0 0 5px rgba(216, 178, 107, .07),
    0 22px 46px rgba(0, 0, 0, .5);
}
.pg-avatar-btn:hover .pg-avatar-badge,
.pg-avatar-btn:focus-visible .pg-avatar-badge {
  opacity: 1;
  transform: translateY(0);
}
.pg-avatar-btn:active .pg-avatar { transform: scale(.985); }
.pg-avatar-btn:disabled .pg-avatar-badge { opacity: 0; }
.pg-avatar.is-busy .pg-avatar-img { opacity: .35; }
.pg-avatar-busy {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  background: rgba(8, 9, 12, .42);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.pg-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  opacity: 0;
  pointer-events: none;
}

.pg-id {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pg-id-handle {
  font-family: var(--pg-font-num);
  font-size: 12.5px;
  letter-spacing: .02em;
  color: var(--pg-text-dim);
}
.pg-id-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.pg-id-name {
  margin: 0;
  min-width: 0;
  font-size: clamp(26px, 3.2vw, 34px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: var(--pg-track-title);
  color: var(--pg-text-bright);
  overflow-wrap: anywhere;
}
.pg-id-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 6px;
  color: var(--pg-text-dim);
  font-size: 12.5px;
}
.pg-id-meta b {
  color: var(--pg-text);
  font-family: var(--pg-font-num);
  font-size: 12.5px;
  font-weight: 600;
}
.pg-dot {
  display: inline-block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--pg-text-faint);
  flex: none;
}

.pg-name-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.pg-name-form .pg-input { width: min(260px, 100%); }
.pg-name-form.is-busy { opacity: .85; }

.pg-hero-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  padding-left: clamp(16px, 2.4vw, 28px);
  border-left: 1px solid var(--pg-hairline);
}
.pg-upload-btn { width: 100%; }
.pg-hero-quick {
  width: 100%;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--pg-hairline);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pg-quick-value {
  font-family: var(--pg-font-num);
  font-size: clamp(24px, 2.6vw, 30px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.pg-hero-last {
  font-family: var(--pg-font-num);
  font-size: 11.5px;
  color: var(--pg-text-dim);
}
.pg-hero-last-quiet { font-family: var(--pg-font); }

/* ============================================================================
 * 6. 数据条（统计卡）
 * ==========================================================================*/
.pg-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}
.pg-stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pg-stat {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--pg-hairline);
  border-radius: var(--pg-r-lg);
  background: var(--pg-surface);
  overflow: hidden;
}
.pg-stat::after {
  content: "";
  position: absolute;
  top: 0;
  left: 18px;
  width: 28px;
  height: 1px;
  background: var(--pg-brass);
  opacity: .5;
  pointer-events: none;
}
.pg-stat-label {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: var(--pg-track-micro);
  text-transform: uppercase;
  color: var(--pg-text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pg-stat-value {
  font-family: var(--pg-font-num);
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  color: var(--pg-text-bright);
}
.pg-stat-foot {
  font-size: 11.5px;
  color: var(--pg-text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================================
 * 7. 区块 / 最近对局列表
 * ==========================================================================*/
.pg-section { margin-top: clamp(28px, 4vw, 44px); }
.pg-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.pg-section-heading { min-width: 0; }
.pg-section-heading .pg-micro { margin-bottom: 8px; }
.pg-section-title {
  margin: 0;
  font-size: clamp(20px, 2.2vw, 24px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: var(--pg-track-title);
  color: var(--pg-text-bright);
}
.pg-section-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.pg-section-meta {
  color: var(--pg-text-dim);
  font-size: 11.5px;
  white-space: nowrap;
}

.pg-recent {
  border: 1px solid var(--pg-hairline);
  border-radius: var(--pg-r-lg);
  background: var(--pg-surface);
  overflow: hidden;
}
.pg-recent-row {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr) 104px 96px;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-top: 1px solid var(--pg-hairline);
  transition: background-color var(--pg-dur-fast) var(--pg-ease-out);
}
.pg-recent-row:first-child { border-top: 0; }
.pg-recent-row:hover { background: rgba(242, 238, 230, .022); }
.pg-recent-time {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.pg-recent-time b {
  font-family: var(--pg-font-num);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--pg-text);
  font-variant-numeric: tabular-nums;
}
.pg-recent-time small {
  font-size: 11px;
  color: var(--pg-text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pg-recent-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.pg-recent-room {
  font-size: 14px;
  font-weight: 600;
  color: var(--pg-text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pg-recent-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11.5px;
  color: var(--pg-text-dim);
}
.pg-recent-pnl {
  font-family: var(--pg-font-num);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.01em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.pg-recent-row .pg-replay-btn { justify-self: end; }

/* ============================================================================
 * 8. 空状态
 * ==========================================================================*/
.pg-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: clamp(28px, 4vw, 44px) 20px;
  text-align: center;
  border: 1px solid var(--pg-hairline);
  border-radius: var(--pg-r-lg);
  background: var(--pg-surface);
}
.pg-empty-img {
  width: min(220px, 58%);
  height: auto;
  margin-bottom: 6px;
  opacity: .85;
}
.pg-empty-crest {
  width: auto;
  height: 84px;
  max-width: 100%;
  margin-bottom: 6px;
  opacity: .7;
}
.pg-empty-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--pg-text-bright);
}
.pg-empty-text {
  margin: 0 0 10px;
  max-width: 46ch;
  color: var(--pg-text-dim);
  font-size: 12.5px;
  line-height: 1.6;
}
.pg-empty-compact {
  padding: 30px 20px;
  border-style: dashed;
  background: transparent;
}
/* 嵌在带边框容器里的空状态不再套一层卡片 */
.pg-recent > .pg-empty,
.pg-panel .pg-hlist > .pg-empty {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.pg-foot-note {
  margin: clamp(28px, 4vw, 44px) 0 0;
  text-align: center;
  font-size: 11px;
  letter-spacing: .02em;
  color: var(--pg-text-dim);
}

/* ============================================================================
 * 9. 战绩 · 盈亏曲线卡
 * ==========================================================================*/
.pg-chart-card {
  margin-top: 20px;
  padding: clamp(18px, 2.4vw, 24px) clamp(16px, 2.4vw, 24px) 14px;
  border: 1px solid var(--pg-hairline);
  border-radius: var(--pg-r-lg);
  background: var(--pg-surface);
}
.pg-chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.pg-chart-heading { min-width: 0; }
.pg-chart-heading .pg-micro { margin-bottom: 8px; }
.pg-chart-title {
  margin: 0;
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: var(--pg-track-title);
  color: var(--pg-text-bright);
}
.pg-chart-head-value {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex: none;
}
.pg-chart-total {
  font-family: var(--pg-font-num);
  font-size: clamp(22px, 2.6vw, 28px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pg-chart-wrap {
  position: relative;
  margin-top: 16px;
  min-height: 196px;
}
.pg-chart {
  position: relative;
  width: 100%;
  min-height: 196px;
  overflow: hidden;
}
.pg-chart .uplot { max-width: 100%; }
.pg-chart .u-cursor-x { border-right-color: rgba(242, 238, 230, .18) !important; }
.pg-chart-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 196px;
  color: var(--pg-text-dim);
  font-size: 12.5px;
}
.pg-chart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 196px;
  padding: 20px;
  text-align: center;
}
.pg-chart-empty-rule {
  display: block;
  width: 56px;
  height: 1px;
  margin-bottom: 10px;
  background: linear-gradient(90deg, transparent, var(--pg-brass), transparent);
  opacity: .6;
}
@media (min-width: 641px) {
  .pg-chart-empty { min-height: 240px; }
}
.pg-chart-empty-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--pg-text);
}
.pg-chart-empty-text {
  margin: 0;
  font-size: 12px;
  color: var(--pg-text-dim);
}
.pg-chart-tip {
  position: absolute;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: var(--pg-r-sm);
  border: 1px solid var(--pg-hairline-strong);
  background: rgba(10, 12, 16, .94);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .42);
  transform: translate(-50%, -100%);
  pointer-events: none;
  white-space: nowrap;
}
.pg-tip-label {
  font-size: 10.5px;
  color: var(--pg-text-dim);
  font-variant-numeric: tabular-nums;
}
.pg-tip-value {
  font-family: var(--pg-font-num);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.pg-chart-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--pg-hairline);
  font-size: 11px;
  color: var(--pg-text-dim);
}
.pg-chart-legend {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.pg-legend-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pg-brass);
  box-shadow: 0 0 0 3px var(--pg-brass-dim);
}

/* ============================================================================
 * 10. 战绩 · 手牌流水面板
 * ==========================================================================*/
.pg-panel {
  margin-top: clamp(28px, 4vw, 44px);
  border: 1px solid var(--pg-hairline);
  border-radius: var(--pg-r-lg);
  background: var(--pg-surface);
  overflow: hidden;
}
.pg-panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 18px 14px;
}
.pg-panel-heading { min-width: 0; }
.pg-panel-heading .pg-micro { margin-bottom: 8px; }
.pg-panel-title {
  margin: 0;
  font-size: clamp(20px, 2.2vw, 24px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: var(--pg-track-title);
  color: var(--pg-text-bright);
}
.pg-panel-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.pg-panel-count {
  font-size: 11.5px;
  color: var(--pg-text-dim);
  white-space: nowrap;
}

.pg-seg {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--pg-hairline);
  background: var(--pg-bg-soft);
}
.pg-seg-btn {
  -webkit-appearance: none;
  appearance: none;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--pg-text-dim);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  transition:
    background-color var(--pg-dur-fast) var(--pg-ease-out),
    color var(--pg-dur-fast) var(--pg-ease-out);
}
.pg-seg-btn:hover { color: var(--pg-text-bright); }
.pg-seg-btn.active {
  background: var(--pg-cobalt-dim);
  color: var(--pg-cobalt-hi);
}

.pg-hhead,
.pg-hrow {
  display: grid;
  grid-template-columns: 118px 76px minmax(140px, 1fr) 88px 104px 100px 92px;
  align-items: center;
  gap: 12px;
}
.pg-hhead {
  padding: 10px 18px;
  border-top: 1px solid var(--pg-hairline);
  border-bottom: 1px solid var(--pg-hairline);
  background: rgba(242, 238, 230, .02);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: var(--pg-track-micro);
  text-transform: uppercase;
  color: var(--pg-text-faint);
}
.pg-hhead > span:nth-child(4),
.pg-hhead > span:nth-child(5),
.pg-hhead > span:nth-child(6),
.pg-hhead > span:nth-child(7) { text-align: right; }

.pg-hrow {
  padding: 13px 18px;
  border-bottom: 1px solid var(--pg-hairline);
  transition: background-color var(--pg-dur-fast) var(--pg-ease-out);
}
.pg-hrow:last-child { border-bottom: 0; }
.pg-hrow:hover { background: rgba(242, 238, 230, .022); }
.pg-hcell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.pg-hcell b {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--pg-text);
}
.pg-hcell small {
  font-size: 11px;
  color: var(--pg-text-dim);
}
.pg-hc-time b {
  font-family: var(--pg-font-num);
  font-size: 12.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.pg-hc-mode { align-items: flex-start; }
.pg-hc-hand,
.pg-hc-pot { align-items: flex-end; }
.pg-hc-hand .pg-num,
.pg-hc-pot .pg-num {
  font-family: var(--pg-font-num);
  font-size: 12.5px;
  color: var(--pg-text-dim);
  font-variant-numeric: tabular-nums;
}
.pg-hc-pnl { align-items: flex-end; }
.pg-hc-pnl .pg-num {
  font-family: var(--pg-font-num);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.pg-hc-replay { align-items: flex-end; }

/* ============================================================================
 * 11. 战绩 · 整局战绩卡片
 * ==========================================================================*/
.pg-sessions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 12px;
}
.pg-session-card {
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 44px;
  padding: 16px 18px;
  border: 1px solid var(--pg-hairline);
  border-radius: var(--pg-r-lg);
  background: var(--pg-surface);
  color: var(--pg-text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    transform var(--pg-dur-base) var(--pg-ease-spring),
    border-color var(--pg-dur-fast) var(--pg-ease-out),
    background-color var(--pg-dur-fast) var(--pg-ease-out),
    box-shadow var(--pg-dur-base) var(--pg-ease-out);
}
.pg-session-card:hover {
  transform: translateY(-1px);
  border-color: rgba(110, 141, 255, .32);
  background: var(--pg-panel);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .28);
}
.pg-session-card:active { transform: scale(.995); }
.pg-session-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
.pg-session-room {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--pg-text-bright);
  min-width: 0;
}
.pg-session-time {
  flex: none;
  font-family: var(--pg-font-num);
  font-size: 11px;
  color: var(--pg-text-dim);
  font-variant-numeric: tabular-nums;
}
.pg-session-meta {
  font-size: 11.5px;
  color: var(--pg-text-dim);
}
.pg-session-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid var(--pg-hairline);
}
.pg-session-pnl {
  font-family: var(--pg-font-num);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
}
.pg-session-rank {
  font-size: 11.5px;
  color: var(--pg-text-dim);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pg-session-cta {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--pg-cobalt-hi);
  white-space: nowrap;
}

/* ============================================================================
 * 12. 整局战绩详情（modal 内容）
 * ==========================================================================*/
.pg-session-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: var(--pg-text);
  font-family: var(--pg-font);
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: var(--pg-track-body);
}
.pg-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.pg-summary-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--pg-hairline);
  border-radius: var(--pg-r-sm);
  background: var(--pg-surface);
}
.pg-summary-item b {
  font-family: var(--pg-font-num);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.15;
  color: var(--pg-text-bright);
  font-variant-numeric: tabular-nums;
}

.pg-st-wrap {
  border: 1px solid var(--pg-hairline);
  border-radius: var(--pg-r-md);
  background: var(--pg-surface);
  overflow: hidden;
}
.pg-st-head,
.pg-st-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 108px 108px;
  align-items: center;
  gap: 8px;
}
.pg-st-head {
  padding: 9px 12px;
  border-bottom: 1px solid var(--pg-hairline);
  background: rgba(242, 238, 230, .02);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: var(--pg-track-micro);
  text-transform: uppercase;
  color: var(--pg-text-faint);
}
.pg-st-head > .pg-st-score,
.pg-st-head > .pg-st-pnl { text-align: right; }
.pg-st-table { display: flex; flex-direction: column; }
.pg-st-row {
  position: relative;
  padding: 10px 12px;
  border-bottom: 1px solid var(--pg-hairline);
}
.pg-st-row:last-child { border-bottom: 0; }
.pg-st-row.is-me { background: rgba(216, 178, 107, .06); }
.pg-st-row.is-me::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 2px;
  background: var(--pg-brass);
}
.pg-st-cell { min-width: 0; }
.pg-st-rank {
  font-family: var(--pg-font-num);
  font-size: 12.5px;
  color: var(--pg-text-dim);
  font-variant-numeric: tabular-nums;
}
.pg-st-name {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.pg-st-name b {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--pg-text);
  min-width: 0;
}
.pg-st-score,
.pg-st-pnl {
  font-family: var(--pg-font-num);
  font-size: 13px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pg-st-score { color: var(--pg-text-dim); }
.pg-st-pnl { font-weight: 600; }
.pg-session-empty {
  padding: 16px;
  text-align: center;
  color: var(--pg-text-dim);
  font-size: 12.5px;
}

.pg-pay {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--pg-hairline);
  border-radius: var(--pg-r-md);
  background: var(--pg-surface);
}
.pg-pay-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.pg-pay-title {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: var(--pg-track-micro);
  text-transform: uppercase;
  color: var(--pg-text-faint);
}
.pg-pay-hint {
  font-size: 11.5px;
  color: var(--pg-text-dim);
  white-space: nowrap;
}
.pg-pay-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: var(--pg-r-sm);
  background: rgba(242, 238, 230, .03);
  font-size: 13px;
}
.pg-pay-side {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--pg-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pg-pay-arrow {
  flex: none;
  color: var(--pg-text-faint);
}
.pg-pay-amt {
  margin-left: auto;
  flex: none;
  font-family: var(--pg-font-num);
  font-weight: 600;
  color: var(--pg-brass);
  font-variant-numeric: tabular-nums;
}
.pg-pay-empty {
  font-size: 12.5px;
  color: var(--pg-text-dim);
}
.pg-session-note {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--pg-text-dim);
}

/* ============================================================================
 * 13. 响应式：1440 / 820 / 390（外加 1024、700、560、480 断点）
 * ==========================================================================*/
@media (max-width: 1180px) {
  .pg-hhead,
  .pg-hrow { grid-template-columns: 108px 72px minmax(120px, 1fr) 84px 96px 92px 88px; gap: 10px; }
}

@media (max-width: 1023px) {
  .pg-page { --pg-gutter: 24px; }
  .pg-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pg-stats:not(.pg-stats-4) .pg-stat:nth-child(5) { grid-column: span 2; }
  .pg-stats-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pg-hhead,
  .pg-hrow { grid-template-columns: 104px 70px minmax(110px, 1fr) 96px 92px 88px; }
  .pg-hhead > span:nth-child(4),
  .pg-hc-hand { display: none; }
  .pg-hhead > span:nth-child(5) { text-align: right; }
  .pg-hhead > span:nth-child(6),
  .pg-hhead > span:nth-child(7) { text-align: right; }
}

@media (max-width: 900px) {
  .pg-head { align-items: flex-start; }
  .pg-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .pg-hero-aside {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 16px;
    padding: 16px 0 0;
    border-left: 0;
    border-top: 1px solid var(--pg-hairline);
  }
  .pg-upload-btn { width: auto; }
  .pg-hero-aside .pg-hint { order: 3; flex: 1 1 100%; }
  .pg-hero-quick {
    margin-left: auto;
    width: auto;
    min-width: 160px;
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
    align-items: flex-end;
  }
}

@media (max-width: 700px) {
  .pg-head {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding-bottom: 20px;
    margin-bottom: 20px;
  }
  .pg-head-actions { justify-content: flex-start; }
  .pg-head-actions .pg-btn { flex: 1 1 0; }
  .pg-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pg-stats .pg-stat:nth-child(5) { grid-column: 1 / -1; }

  .pg-recent-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "time pnl"
      "main replay";
    gap: 6px 12px;
    padding: 14px;
  }
  .pg-recent-time { grid-area: time; }
  .pg-recent-main { grid-area: main; }
  .pg-recent-pnl { grid-area: pnl; align-self: start; }
  .pg-recent-row .pg-replay-btn { grid-area: replay; align-self: center; }

  .pg-panel-head { align-items: stretch; flex-direction: column; }
  .pg-panel-tools { justify-content: space-between; }
  .pg-seg { flex: 1 1 auto; }
  .pg-seg-btn { flex: 1 1 0; padding: 0 10px; }

  .pg-hhead { display: none; }
  .pg-hlist {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    background: var(--pg-bg-soft);
  }
  .pg-hrow {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "time time pnl"
      "mode room pnl"
      "hand pot replay";
    gap: 4px 10px;
    padding: 14px;
    border: 1px solid var(--pg-hairline);
    border-radius: var(--pg-r-md);
    background: var(--pg-panel);
  }
  .pg-hrow:hover { background: var(--pg-panel); }
  .pg-hc-time { grid-area: time; }
  .pg-hc-mode { grid-area: mode; align-items: flex-start; }
  .pg-hc-room { grid-area: room; align-items: flex-start; }
  .pg-hc-hand {
    grid-area: hand;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
  }
  .pg-hc-pot {
    grid-area: pot;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
  }
  .pg-hc-pot::before {
    content: "底池";
    font-size: 11px;
    color: var(--pg-text-dim);
  }
  .pg-hc-hand .pg-num,
  .pg-hc-pot .pg-num { white-space: nowrap; }
  .pg-hc-pnl { grid-area: pnl; align-items: flex-end; align-self: start; }
  .pg-hc-replay { grid-area: replay; align-items: flex-end; }
  .pg-hc-mode .pg-tag { font-size: 10.5px; padding: 1px 7px; }

  .pg-sessions { grid-template-columns: minmax(0, 1fr); }

  .pg-chart-head { gap: 10px; }
  .pg-chart-foot { gap: 6px; }
}

@media (max-width: 560px) {
  .pg-page {
    padding-top: 22px;
    padding-left: 14px;
    padding-right: 14px;
  }
  .pg-title { font-size: clamp(28px, 8.4vw, 34px); }
  .pg-head-actions { flex-wrap: wrap; }
  .pg-head-actions .pg-btn { flex: 1 1 calc(50% - 5px); }
  .pg-hero { padding: 18px; border-radius: var(--pg-r-lg); }
  .pg-hero-id { gap: 14px; }
  .pg-avatar-btn {
    width: 82px;
    height: 82px;
  }
  .pg-id-name { font-size: 23px; }
  .pg-id-meta { font-size: 11.5px; gap: 4px 8px; }
  .pg-hero-aside { gap: 10px; }
  .pg-upload-btn { flex: 1 1 100%; width: 100%; }
  .pg-hero-quick { min-width: 0; flex: 1 1 100%; align-items: flex-start; }
  .pg-quick-value { font-size: 24px; }
  .pg-stats { gap: 10px; }
  .pg-stat { padding: 14px; }
  .pg-stat-label { font-size: 10px; }
  .pg-stat-value { font-size: 22px; }
  .pg-section-tools { width: 100%; justify-content: space-between; }
  .pg-empty { padding: 26px 16px; }
  .pg-empty-img { width: min(180px, 64%); }
  .pg-chart-card { padding: 16px 14px 12px; }
  .pg-chart-total { font-size: 22px; }
  .pg-panel-head { padding: 16px 14px 12px; }
  .pg-panel-tools { flex-direction: column; align-items: stretch; gap: 8px; }
  .pg-panel-count { text-align: right; }
  .pg-name-form .pg-input { width: 100%; }
  .pg-name-form .pg-btn { flex: 1 1 0; }
}

@media (max-width: 480px) {
  .pg-summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pg-st-head,
  .pg-st-row { grid-template-columns: 36px minmax(0, 1fr) 78px 76px; gap: 6px; }
  .pg-st-head { font-size: 9.5px; }
  .pg-st-name b { font-size: 12.5px; }
  .pg-st-score,
  .pg-st-pnl { font-size: 12px; }
  .pg-pay-row { flex-wrap: wrap; gap: 4px 8px; }
  .pg-pay-amt { margin-left: 0; width: 100%; text-align: right; }
  .pg-pay-side { max-width: 42%; }
}

/* 竖屏手机：固定底部 TabBar + 手势条留出安全间距，避免内容被遮住 */
@media (max-width: 700px) {
  .pg-page { padding-bottom: calc(var(--tabbar-h, 64px) + 26px + env(safe-area-inset-bottom)); }
}

/* ============================================================================
 * 14. 无障碍降级
 * ==========================================================================*/
@media (prefers-reduced-motion: reduce) {
  .pg-root *,
  .pg-root *::before,
  .pg-root *::after,
  .pg-session-body *,
  .pg-session-body *::before,
  .pg-session-body *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .pg-spinner {
    animation: none;
    border-top-color: var(--pg-brass);
    opacity: .8;
  }
  .pg-avatar-btn:hover .pg-avatar,
  .pg-session-card:hover { transform: none; }
}

@media (prefers-reduced-transparency: reduce) {
  #screen-profile,
  #screen-history { background-image: none; }
  .pg-hero {
    background: var(--pg-surface);
  }
  .pg-chart-tip {
    background: #0a0c10;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .pg-avatar-busy {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: rgba(8, 9, 12, .72);
  }
}

@media (prefers-contrast: more) {
  .pg-root,
  .pg-session-body {
    --pg-hairline: rgba(242, 238, 230, .2);
    --pg-hairline-strong: rgba(242, 238, 230, .32);
    --pg-text-dim: #c4c0b8;
    --pg-text-faint: #9c988f;
  }
  .pg-btn,
  .pg-input,
  .pg-stat,
  .pg-recent,
  .pg-panel,
  .pg-chart-card,
  .pg-session-card,
  .pg-hero,
  .pg-st-wrap,
  .pg-pay { border-width: 1.5px; }
}
