/* ============================================================
   弈林英雄榜 · 小程序高保真原型 共享设计系统 v3.0
   在 glm-5.2 v2.0 基础上统一修复：
   1) Hero 统一深棕渐变（消除深褐/藏青两批不一致）
   2) 卡片间距统一 12px，页面边距 16px，卡片内边距统一
   3) 图标统一 24px 线性 SVG（stroke 1.6），选中态实心
   4) 所有徽章/按钮/文字垂直居中（flex 对齐，禁止 margin 凑位置）
   ============================================================ */

:root {
  /* 色彩 */
  --c-primary: #C8392E;        /* 象棋红 */
  --c-primary-dark: #A82E24;
  --c-gold: #D4A24C;           /* 暗金点缀 */
  --c-gold-light: #E8C584;
  --c-bg: #F5EFE0;             /* 木纹米色背景 */
  --c-card: #FFFCF5;           /* 卡片背景 */
  --c-tabbar: #FAF6EC;         /* Tab 外容器 */
  --c-ink: #2B2B3A;            /* 主文字（微暖化的深色） */
  --c-ink-2: #6B6B80;          /* 次要文字 */
  --c-ink-3: #9B9BAE;          /* 辅助文字 */
  --c-line: #E9DFC8;           /* 木纹描边 */
  --c-green: #2E7D32;          /* 胜/成功 */
  --c-orange: #ED6C02;         /* 进行中/关注/新 */
  --c-medal-gold: #FFD700;
  --c-medal-silver: #C0C0C0;
  --c-medal-bronze: #CD7F32;

  /* Hero 统一深棕渐变（所有页面一致） */
  --hero-grad: linear-gradient(160deg, #3D2B1F 0%, #2A1E15 100%);
  --hero-ink: #F5EFE0;
  --hero-ink-2: rgba(245, 239, 224, .62);

  /* 间距标尺（8pt 网格） */
  --page-x: 16px;              /* 页面左右边距 */
  --stack-gap: 12px;           /* 卡片纵向间距（全平台统一） */
  --card-pad: 16px;            /* 卡片内边距（全平台统一） */
  --sect-gap: 20px;            /* 区块标题距上区块 */

  /* 圆角 */
  --r-card: 12px;
  --r-btn: 22px;
  --r-pill: 999px;

  /* 字号 */
  --fs-page-title: 20px;
  --fs-sect: 16px;
  --fs-body: 14px;
  --fs-aux: 12px;
  --fs-badge: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #E8E2D2;
  color: var(--c-ink);
  display: flex; justify-content: center;
}

/* 手机画布 375×812 */
.phone {
  width: 375px; height: 812px; min-height: 812px;
  background: var(--c-bg);
  display: flex; flex-direction: column;
  overflow: hidden; position: relative;
  box-shadow: 0 8px 40px rgba(43, 32, 20, .18);
}

/* ---------- 状态栏 62px ---------- */
.statusbar {
  height: 62px; flex: none;
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 0 22px 10px;
  color: var(--hero-ink);
  font-size: 14px; font-weight: 600;
}
.statusbar.on-light { color: var(--c-ink); }
.statusbar .sb-icons { display: flex; align-items: center; gap: 6px; }
.statusbar svg { display: block; }

/* ---------- 导航栏 52px（所有元素垂直居中于同一轴线） ---------- */
.navbar {
  height: 52px; flex: none;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--page-x);
  background: var(--hero-grad);
  color: var(--hero-ink);
}
.navbar .nav-title {
  position: absolute; left: 0; right: 0; text-align: center;
  font-size: 17px; font-weight: 600; pointer-events: none;
}
.navbar { position: relative; }
.nav-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--hero-ink); background: none; border: none; cursor: pointer;
}
.nav-btn:active { background: rgba(255,255,255,.12); }
.nav-brand { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; }
.nav-brand .logo-dot {
  width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #E05A4B, var(--c-primary));
  border: 1.5px solid var(--c-gold);
  display: flex; align-items: center; justify-content: center;
  color: #FFE9B0; font-size: 15px; font-weight: 700;
}

/* ---------- Hero（统一深棕渐变 + 统一装饰） ---------- */
.hero {
  flex: none;
  background: var(--hero-grad);
  color: var(--hero-ink);
  padding: 16px var(--page-x) 20px;
  position: relative; overflow: hidden;
}
.hero .deco {
  position: absolute; right: -24px; bottom: -30px;
  width: 130px; height: 130px; border-radius: 50%;
  border: 2px solid rgba(212, 162, 76, .25);
  display: flex; align-items: center; justify-content: center;
  color: rgba(212, 162, 76, .22); font-size: 56px; font-weight: 700;
  pointer-events: none;
}
.hero-title { font-size: var(--fs-page-title); font-weight: 700; }
.hero-sub { font-size: var(--fs-aux); color: var(--hero-ink-2); margin-top: 4px; }

/* ---------- 内容区 ---------- */
.content {
  flex: 1; overflow-y: auto;
  padding: var(--page-x) var(--page-x) 20px;
  display: flex; flex-direction: column; gap: var(--stack-gap);
  scrollbar-width: none;
}
.content::-webkit-scrollbar { display: none; }
.content.no-pad-top { padding-top: 0; }

.sect-title {
  font-size: var(--fs-sect); font-weight: 700;
  margin-top: calc(var(--sect-gap) - var(--stack-gap));
  display: flex; align-items: center; justify-content: space-between;
}
.sect-title:first-child { margin-top: 0; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--c-card);
  border: 1px solid var(--c-line);
  border-radius: var(--r-card);
  padding: var(--card-pad);
  flex: none;
}
.card.highlight {
  border: 1.5px solid var(--c-primary);
  box-shadow: 0 2px 10px rgba(200, 57, 46, .12);
}
.card-dark {
  background: linear-gradient(160deg, #3D2B1F, #2A1E15);
  border: none; color: var(--hero-ink);
}

/* ---------- 徽章（统一 22px 高，文字严格居中） ---------- */
.badge {
  height: 22px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  border-radius: 5px;
  font-size: var(--fs-badge); font-weight: 600; line-height: 1;
  white-space: nowrap; flex: none;
}
.badge-red    { background: var(--c-primary); color: #fff; }
.badge-green  { background: var(--c-green); color: #fff; }
.badge-gold   { background: var(--c-gold); color: #3D2B1F; }
.badge-gray   { background: #F0EDE6; color: var(--c-ink-2); }
.badge-dark   { background: #3D3B4E; color: #EDEAF2; }
.badge-orange { background: #FFF3E0; color: var(--c-orange); }
.badge-outline-red { background: #FFF; border: 1px solid var(--c-primary); color: var(--c-primary); }
.badge-dot::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor;
}

/* ---------- 按钮 ---------- */
.btn {
  height: 40px; padding: 0 20px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: var(--r-btn); border: none; cursor: pointer;
  font-size: 14px; font-weight: 600; line-height: 1;
}
.btn-primary { background: var(--c-primary); color: #fff; }
.btn-primary:active { background: var(--c-primary-dark); }
.btn-dark { background: #33332F; color: var(--c-gold); }
.btn-outline { background: transparent; border: 1px solid #DDD5C2; color: var(--c-ink); }
.btn-outline-red { background: #FFF; border: 1px solid var(--c-primary); color: var(--c-primary); }
.btn-sm { height: 32px; padding: 0 14px; font-size: 12px; }
.btn .icon { display: flex; }

/* 文字按钮 */
.link-more {
  display: inline-flex; align-items: center; gap: 2px;
  font-size: var(--fs-aux); color: var(--c-ink-3); font-weight: 500;
  background: none; border: none; cursor: pointer; line-height: 1;
}

/* ---------- 底部 Tab 栏（胶囊式，总高 83px 含 21px 安全区） ---------- */
.tabbar {
  flex: none; height: 83px;
  background: var(--c-tabbar);
  padding: 8px 8px 21px;
}
.tabbar-inner {
  height: 54px; background: #FFF;
  border: 1px solid var(--c-line); border-radius: 27px;
  display: flex; align-items: stretch; padding: 4px;
}
.tab-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  border-radius: 23px; cursor: pointer;
  color: var(--c-ink-3);
  text-decoration: none;
}
.tab-item .icon { display: flex; }
.tab-item .tab-label { font-size: 10px; font-weight: 500; line-height: 1; }
.tab-item.active { background: var(--c-primary); color: #fff; }
.tab-item.active .tab-label { font-weight: 600; }

/* ---------- 奖牌 SVG 体系（统一 28px 网格） ---------- */
.medal { width: 28px; height: 32px; flex: none; display: block; }
.medal.lg { width: 32px; height: 36px; }

/* ---------- 圆点（先后手标识） ---------- */
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.dot-red { background: var(--c-primary); }
.dot-black { background: #2B2B3A; }
.dot-gold { background: var(--c-gold); }

/* ---------- 空态（新增规范） ---------- */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 32px; text-align: center; gap: 12px;
}
.empty .empty-icon {
  width: 72px; height: 72px; border-radius: 50%;
  background: #F0EADA; display: flex; align-items: center; justify-content: center;
  color: #C9BC9C;
}
.empty .empty-title { font-size: 15px; font-weight: 600; color: var(--c-ink-2); }
.empty .empty-desc { font-size: var(--fs-aux); color: var(--c-ink-3); line-height: 1.6; }

/* ---------- 信息行（左右布局，基线对齐） ---------- */
.info-row {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 7px 0; font-size: var(--fs-body);
}
.info-row .k { color: var(--c-ink-2); flex: none; }
.info-row .v { color: var(--c-ink); font-weight: 500; text-align: right; }

/* ---------- 列表行（图标+文字+箭头，统一 48px 热区） ---------- */
.list-row {
  display: flex; align-items: center; gap: 12px;
  min-height: 48px;
}
.list-row .row-icon {
  width: 24px; height: 24px; flex: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--c-primary);
}
.list-row .row-main { flex: 1; min-width: 0; }
.list-row .row-title { font-size: var(--fs-body); font-weight: 600; }
.list-row .row-sub { font-size: var(--fs-aux); color: var(--c-ink-3); margin-top: 3px; }
.list-row .row-arrow { color: var(--c-ink-3); flex: none; display: flex; }

/* ---------- 金色分隔（楚河汉界） ---------- */
.river-divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--c-gold); font-size: 12px; font-weight: 600;
  letter-spacing: 2px; padding: 4px 0;
}
.river-divider::before, .river-divider::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--c-gold), transparent);
}

/* ---------- 头像（棋子造型） ---------- */
.avatar {
  width: 56px; height: 56px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700;
  border: 2px solid var(--c-gold);
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.avatar-red { background: radial-gradient(circle at 35% 30%, #E05A4B, var(--c-primary)); color: #FFE9B0; }
.avatar-black { background: radial-gradient(circle at 35% 30%, #4A4A5E, #23233A); color: var(--c-gold); }

/* 段位徽章（金色渐变胶囊） */
.rank-badge {
  height: 30px; padding: 0 14px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, #E8C584, var(--c-gold));
  color: #4A3210; font-size: 13px; font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5);
}

/* 弹层（授权引导等） */
.mask {
  position: absolute; inset: 0; z-index: 20;
  background: rgba(20, 14, 8, .55);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  width: 100%; background: var(--c-card);
  border-radius: 16px 16px 0 0;
  padding: 24px 20px 34px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
