/* ============================================================
   一柠 · 雀庄助手 — 设计系统
   参考：和音雀庄助手（暖橙渐变 + 奶油白卡片 + 日式和风）
   ============================================================ */

:root {
  color-scheme: light;
  --brand: #F08C1C;
  --brand-deep: #E67E12;
  --brand-soft: #F7A63E;
  --brand-pale: #FBD9A6;
  --brand-wash: #FFF4E3;
  --bg: #FFF7EC;
  --card: #FFFFFF;
  --ink: #3D2E1E;
  --ink-2: #6E5F4B;
  --ink-3: #9A8A72;
  --gold: #C9A063;
  --gold-deep: #A87E3F;
  --red: #FF4D4D;
  --mint: #4FBFA5;
  --mint-soft: #E5F7F1;
  --blue: #4FA8D8;
  --blue-soft: #E3F4FA;
  --line: #F3E7D3;
  --radius: 18px;
  --radius-s: 12px;
  --shadow: 0 8px 22px rgba(214, 158, 74, 0.14);
  --shadow-s: 0 3px 10px rgba(214, 158, 74, 0.10);
  --header-grad: linear-gradient(168deg, #F7A63E 0%, #F0921E 58%, #F6BE72 100%);
  --btn-grad: linear-gradient(135deg, #F7A63E, #EF8512);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg); color: var(--ink);
  line-height: 1.5; min-height: 100vh; min-height: 100dvh;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select { font: inherit; color: var(--ink); border: 0; outline: none; background: transparent; }
/* 原生 select 弹层强制浅色（避免系统深色模式下的黑底深字） */
select option, select optgroup { color: var(--ink); background: #fff; }
svg { display: block; }
.mono { font-family: ui-monospace, 'DM Mono', SFMono-Regular, Menlo, Consolas, monospace; }
.muted { color: var(--ink-2); font-size: .8125rem; }
.hidden-field { display: none !important; }

/* ---------- 顶部头区 ---------- */
.app-header {
  position: relative;
  padding: 14px 16px 14px;
  background: var(--header-grad);
  color: #fff;
  border-radius: 0 0 26px 26px;
  overflow: hidden;
}
.app-header::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .55;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='1.6' opacity='.35'%3E%3Ccircle cx='24' cy='26' r='7'/%3E%3Ccircle cx='24' cy='26' r='2'/%3E%3Cpath d='M24 19v-4M24 33v4M31 26h4M17 26h-4M29 21l3-3M19 31l-3 3M29 31l3 3M19 21l-3-3'/%3E%3Ccircle cx='92' cy='78' r='7'/%3E%3Ccircle cx='92' cy='78' r='2'/%3E%3Cpath d='M92 71v-4M92 85v4M99 78h4M85 78h-4M97 73l3-3M87 83l-3 3M97 83l3 3M87 73l-3-3'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 150px 150px;
}
.header-row { position: relative; display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px;
  background: rgba(255, 255, 255, .92); color: var(--brand-deep);
  font-family: 'Ma Shan Zheng', 'Noto Serif SC', serif; font-size: 1.5rem; line-height: 38px; text-align: center;
  box-shadow: var(--shadow-s); flex: none;
}
.header-title { font-size: 1.0625rem; font-weight: 700; letter-spacing: .5px; flex: 1; text-shadow: 0 1px 2px rgba(180,110,20,.25); }
.header-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: rgba(255, 255, 255, .28); border: 1.5px solid rgba(255,255,255,.75);
  color: #fff; font-size: .875rem; font-weight: 700;
}
.header-avatar.logged { background: #fff; color: var(--brand-deep); border-color: #fff; }

/* 通知铃铛 */
.header-bell { position: relative; width: 34px; height: 34px; border-radius: 50%; flex: none; background: rgba(255,255,255,.28); border: 1.5px solid rgba(255,255,255,.75); color: #fff; display: flex; align-items: center; justify-content: center; }
.header-bell svg { width: 17px; height: 17px; }
.bell-badge { position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--red); color: #fff; font-size: .5625rem; font-weight: 800; font-style: normal; display: flex; align-items: center; justify-content: center; border: 1.5px solid #fff; }
.bell-badge[hidden] { display: none; }
.header-bell.promotion-alert { background: linear-gradient(145deg, #fff1a8, #f09a36); border-color: rgba(255,255,255,.98); color: #8a4d17; box-shadow: 0 0 0 4px rgba(255,227,112,.23), 0 5px 16px rgba(139,73,17,.28); animation: promotion-bell-pulse 2.4s ease-in-out infinite; }
.header-bell.promotion-alert::after { content: '🎉'; font-size: 1.04rem; line-height: 1; filter: drop-shadow(0 1px 1px rgba(117,64,19,.2)); }
.header-bell.promotion-alert svg { display: none; }
@keyframes promotion-bell-pulse { 0%, 100% { box-shadow: 0 0 0 4px rgba(255,227,112,.2), 0 5px 16px rgba(139,73,17,.24); } 50% { box-shadow: 0 0 0 7px rgba(255,227,112,.08), 0 6px 20px rgba(139,73,17,.36); } }
@media (prefers-reduced-motion: reduce) { .header-bell.promotion-alert { animation: none; } }

/* 通知列表 */
.notif-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.notif-actions .outline-btn { padding: 6px 14px; font-size: .75rem; }
.notif-list { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.notif-row { display: flex; align-items: flex-start; gap: 10px; text-align: left; background: var(--bg); border-radius: 13px; padding: 12px 14px; }
.notif-row .notif-dot { width: 8px; height: 8px; border-radius: 50%; background: transparent; margin-top: 7px; flex: none; }
.notif-row.unread { background: var(--brand-wash); }
.notif-row.unread .notif-dot { background: var(--red); box-shadow: 0 0 0 3px rgba(255, 77, 77, .15); }
.notif-row.promotion { background: linear-gradient(105deg, #fff1cf, #fffaf0); border: 1px solid rgba(222, 166, 66, .34); }
.notif-row.promotion .notif-dot { width: 30px; height: 30px; margin-top: 0; display: grid; place-items: center; border-radius: 10px; background: linear-gradient(145deg, #f8c95f, #c66b27); color: #fff8df; font-family: 'Noto Serif SC', serif; font-size: .75rem; font-weight: 900; box-shadow: 0 4px 10px rgba(160, 84, 22, .24); }
.notif-row.promotion.unread .notif-dot { box-shadow: 0 0 0 3px rgba(240, 140, 28, .15), 0 4px 10px rgba(160, 84, 22, .24); }
.notif-row div { flex: 1; min-width: 0; }
.notif-row b { display: block; font-size: .8125rem; font-weight: 700; }
.notif-row small { display: block; font-size: .6875rem; color: var(--ink-2); margin-top: 1px; }
.notif-row .notif-time { color: var(--ink-3); font-size: .625rem; margin-top: 3px; }

.store-pill {
  position: relative; margin-top: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 100%; padding: 7px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .92); color: var(--ink);
  font-size: .8125rem; font-weight: 500; box-shadow: var(--shadow-s);
}
.store-pill .pill-icon { width: 15px; height: 15px; color: var(--brand); }
.store-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-pill.in-store { color: var(--brand-deep); }

/* 首页吉祥物横幅 */
.hero-band { position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; margin: 6px -16px -40px; padding: 10px 26px 52px; min-height: 128px; }
.hero-banner {
  position: relative; z-index: 1;
  background: rgba(255, 255, 255, .94); border-radius: 16px;
  padding: 10px 30px 12px; text-align: center; box-shadow: var(--shadow);
  transform: rotate(-2deg);
}
.hero-brush { display: block; font-family: 'Ma Shan Zheng', 'Noto Serif SC', serif; font-size: 2rem; color: var(--ink); line-height: 1.15; letter-spacing: 6px; }
.hero-banner small { display: block; font-size: .5625rem; color: var(--gold-deep); letter-spacing: 3px; font-style: italic; font-weight: 600; }
.hero-mascot { position: relative; z-index: 1; width: 112px; height: 108px; flex: none; filter: drop-shadow(0 6px 10px rgba(180,110,20,.18)); animation: bob 3.2s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.hero-mascot .arm { transform-box: view-box; transform-origin: 118px 150px; animation: wave 1.6s ease-in-out infinite; }
@keyframes wave { 0%, 100% { transform: rotate(34deg); } 50% { transform: rotate(44deg); } }
.hero-mascot .tw { animation: twinkle 2.8s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.hero-sakura { position: absolute; right: 18px; top: 4px; width: 66px; height: 66px; opacity: .9;
  background: radial-gradient(circle at 50% 42%, #FFD9E3 22%, transparent 23%),
              radial-gradient(circle at 26% 62%, #FFD9E3 20%, transparent 21%),
              radial-gradient(circle at 74% 62%, #FFD9E3 20%, transparent 21%),
              radial-gradient(circle at 50% 50%, #FFC9D8 34%, transparent 36%);
  clip-path: circle(50% at 50% 50%); border-radius: 50%;
}
/* 非首页时收起横幅 */
body:not([data-view="home"]) .hero-band { display: none; }

/* ---------- 主内容 ---------- */
#view-root { padding: 24px max(16px, env(safe-area-inset-right)) calc(96px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); display: flex; flex-direction: column; gap: 14px; }
body:not([data-view="home"]) #view-root { padding-top: 18px; }
.view { display: flex; flex-direction: column; gap: 14px; }
.view[hidden] { display: none; }

.section-head { display: flex; align-items: baseline; gap: 8px; padding: 4px 4px 0; }
.eyebrow { font-size: .625rem; font-weight: 700; letter-spacing: 2px; color: var(--gold-deep); text-transform: uppercase; }
.eyebrow.accent { color: var(--brand); }
.section-head h2 { font-size: 1.0625rem; font-weight: 800; flex: 1; }
.text-btn { color: var(--brand); font-size: .8125rem; font-weight: 600; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-s); padding: 16px; }
.card-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.card-head h3 { font-size: .9375rem; font-weight: 700; }

/* 首页功能入口 */
.entry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.entry-card {
  position: relative; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-s); padding: 16px 14px 12px; text-align: left;
  display: flex; flex-direction: column; gap: 2px;
  clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 0 100%);
  transition: transform .12s ease;
}
.entry-card:active { transform: scale(.97); }
.entry-card svg { width: 26px; height: 26px; color: var(--brand); margin-bottom: 8px; }
.entry-card svg.mint { color: var(--mint); }
.entry-card b { font-size: .9375rem; font-weight: 700; }
.entry-card i { font-size: .625rem; color: var(--gold-deep); font-style: italic; font-weight: 600; letter-spacing: .5px; }

/* 店铺卡 */
.store-card-head { display: flex; align-items: center; gap: 8px; }
.store-card-head b { font-size: 1rem; font-weight: 800; flex: 1; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: none; }
.dot.on { background: var(--mint); box-shadow: 0 0 0 3px var(--mint-soft); }
.tag { font-size: .6875rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; flex: none; }
.tag.ghost { background: var(--brand-wash); color: var(--brand-deep); }
.tag.ok { background: var(--mint-soft); color: #1E8A70; }
.tag.warn { background: #FFEBEB; color: var(--red); }
.store-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.store-meta .tag { background: var(--bg); color: var(--ink-2); }

/* 统计条 */
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 14px 8px; }
.strip-item { text-align: center; }
.strip-item strong { display: block; font-size: 1.125rem; font-weight: 900; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strip-item span { font-size: .6875rem; color: var(--ink-2); }

/* 通用列表 */
.list { padding: 6px 14px; }
.list .empty { text-align: center; color: var(--ink-3); font-size: .8125rem; padding: 18px 0; }

/* ---------- 排行榜 ---------- */
#lb-card { padding: 8px 12px 12px; }
.lb-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--bg); border-radius: 999px; padding: 4px; margin: 10px 6px 4px; }
.lb-tab { min-height: 40px; border-radius: 999px; font-size: .8125rem; font-weight: 700; color: var(--ink-2); }
.lb-tab.active { background: #fff; color: var(--brand-deep); box-shadow: 0 2px 8px rgba(214, 158, 74, .22); }
.lb-head { display: grid; grid-template-columns: 44px 30px 1fr 76px 68px; gap: 8px; padding: 10px 6px 8px; font-size: .6875rem; color: var(--ink-3); font-weight: 600; }
.lb-row { display: grid; grid-template-columns: 44px 30px 1fr 76px 68px; gap: 8px; align-items: center; padding: 11px 6px; border-top: 1px solid var(--line); }
/* 段位榜：段位列 + 平均顺位列 */
#lb-body.lb-mode-tier .lb-head, #lb-body.lb-mode-tier .lb-row { grid-template-columns: 44px 30px 1fr 76px 76px; }
.lb-tier { display: flex; align-items: center; justify-content: flex-end; gap: 5px; font-size: .75rem; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.tier-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.tier-dot.g-novice { background: #C9BFAF; }
.tier-dot.g-grade { background: #7FA8C8; }
.tier-dot.g-dan { background: #F08C1C; }
.tier-dot.g-highdan { background: #D9480F; }
.lb-avg { text-align: right; font-size: .8125rem; font-weight: 700; color: var(--ink); }
/* 行内段位徽章（榜单专用小尺寸） */
.lb-row .tier-badge { width: 32px; height: 32px; font-size: .8125rem; border-width: 2px; box-shadow: 0 2px 6px rgba(180, 120, 40, .25); }
.lb-row.me .tier-badge { box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(240, 140, 28, .45); }
/* 「我的排名」条内小徽章 */
.me-rank-bar .tier-badge { width: 26px; height: 26px; font-size: .75rem; border-width: 1.5px; flex: none; }
.lb-head span:nth-child(4), .lb-head span:nth-child(5) { text-align: right; }
.lb-rank { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .8125rem; font-weight: 800; color: var(--ink-2); background: var(--bg); }
.lb-rank.m1 { background: linear-gradient(135deg, #FFD34E, #F5A623); color: #7A4A00; box-shadow: 0 3px 8px rgba(245, 166, 35, .35); }
.lb-rank.m2 { background: linear-gradient(135deg, #E3E8EF, #B9C4D1); color: #4A5A6A; }
.lb-rank.m3 { background: linear-gradient(135deg, #F0BE90, #D28B5B); color: #6B3A12; }
.lb-name { display: flex; flex-direction: column; min-width: 0; }
.lb-name b { font-size: .875rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-name small { font-size: .625rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-rate { text-align: right; font-size: .75rem; color: var(--ink-2); font-weight: 600; }
.lb-pts { text-align: right; font-size: .9375rem; font-weight: 900; color: var(--brand-deep); }
.lb-row.me { background: var(--brand-wash); border-radius: 12px; border-top-color: transparent; }
.me-rank-bar {
  position: fixed; left: 16px; right: 16px; bottom: calc(78px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  background: linear-gradient(135deg, #E9B268, #D89A4A); color: #fff;
  border-radius: 999px; box-shadow: var(--shadow); font-size: .8125rem; font-weight: 600;
  z-index: 25;
}
/* 悬浮条出现时给榜单留出底部空间，避免最后一行被遮挡 */
#view-leaderboard.has-me-bar { padding-bottom: 52px; }
.me-rank-bar b { font-size: .9375rem; }

/* ---------- 战绩 ---------- */
.profile-band {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 16px 18px; border-radius: var(--radius);
  background: var(--header-grad); color: #fff;
  box-shadow: var(--shadow); overflow: hidden;
}
.avatar-lg { width: 52px; height: 52px; border-radius: 50%; background: #fff; border: 2px solid rgba(255,255,255,.9); box-shadow: var(--shadow-s); display: flex; align-items: center; justify-content: center; font-size: 1.25rem; font-weight: 800; color: var(--brand-deep); flex: none; }
.profile-band-text { flex: 1; min-width: 0; }
.profile-band-text b { display: block; font-size: 1.0625rem; font-weight: 800; color: #fff; text-shadow: 0 1px 2px rgba(180,110,20,.3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-band-text small { color: rgba(255,255,255,.85); font-size: .75rem; }
.rank-badge { width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(135deg, #FFC37E, #F08C1C); color: #fff; font-size: 1.125rem; font-weight: 900; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow); border: 2px solid rgba(255,255,255,.7); flex: none; }

.stat-hero .hero-cols { display: grid; grid-template-columns: repeat(3, 1fr); }
.hero-col { text-align: center; }
.hero-col strong { display: block; font-size: 1.375rem; font-weight: 900; }
.hero-col span { font-size: .6875rem; color: var(--ink-2); }
.progress-wrap { margin-top: 14px; }
.progress { height: 8px; border-radius: 999px; background: #F7EDD9; overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 999px; background: var(--btn-grad); transition: width .4s ease; }
.progress-wrap small { display: block; margin-top: 6px; font-size: .6875rem; color: var(--ink-2); text-align: center; }

.rate-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.rate-cell { background: var(--card); border-radius: var(--radius-s); box-shadow: var(--shadow-s); padding: 10px 4px 8px; text-align: center; }
.rate-cell strong { display: block; font-size: .9375rem; font-weight: 900; }
.rate-cell span { font-size: .625rem; color: var(--ink-2); white-space: nowrap; }
.rate-cell small { display: block; font-size: .5625rem; color: var(--gold-deep); font-weight: 600; }

.dist-row { display: grid; grid-template-columns: 44px 1fr 44px; gap: 10px; align-items: center; padding: 6px 0; }
.dist-row label { font-size: .75rem; color: var(--ink-2); font-weight: 600; }
.dist-track { height: 10px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.dist-track i { display: block; height: 100%; border-radius: 999px; transition: width .4s ease; }
.dist-row em { font-style: normal; font-size: .75rem; font-weight: 700; text-align: right; }
.dist-fill-1 { background: linear-gradient(90deg, #FFD34E, #F5A623); }
.dist-fill-2 { background: linear-gradient(90deg, #DDE3EA, #B9C4D1); }
.dist-fill-3 { background: linear-gradient(90deg, #F0BE90, #D28B5B); }
.dist-fill-4 { background: linear-gradient(90deg, #E4D6C2, #CBB9A0); }

.game-row { display: flex; align-items: center; gap: 10px; padding: 11px 2px; border-top: 1px solid var(--line); }
.game-row:first-child { border-top: 0; }
.game-main { flex: 1; min-width: 0; }
.game-main b { display: block; font-size: .8125rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-main small { font-size: .6875rem; color: var(--ink-3); }
.game-pts { text-align: right; flex: none; }
.game-pts b { display: block; font-size: .9375rem; font-weight: 900; color: var(--brand-deep); }
.game-pts small { font-size: .6875rem; color: var(--ink-2); }

/* ---------- 段位系统 ---------- */
/* 徽章基础：圆形，组配色由 g-* 提供（与底图/品牌同一暖色语言） */
.rank-badge { display: flex; align-items: center; justify-content: center; font-weight: 900; }
.rank-badge.g-novice { background: linear-gradient(135deg, #E8E2D8, #C9BFAF); color: #6E5F4B; }
.rank-badge.g-grade { background: linear-gradient(135deg, #BFD8E8, #7FA8C8); color: #1F4E6E; }
.rank-badge.g-dan { background: linear-gradient(135deg, #FFD98C, #F08C1C); color: #7A4A00; }
.rank-badge.g-highdan { background: linear-gradient(135deg, #FF9A76, #D9480F); color: #FFF3E6; }

/* 战绩页段位卡 */
.tier-card { padding: 2px 0 0; }
.tier-head { display: flex; align-items: center; gap: 12px; }
.tier-badge {
  width: 56px; height: 56px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 900;
  border: 2.5px solid rgba(255, 255, 255, .9);
  box-shadow: var(--shadow-s);
}
.tier-badge.lg { width: 64px; height: 64px; font-size: 1.75rem; }
.tier-badge img { width: 100%; height: 100%; object-fit: contain; display: block; filter: drop-shadow(0 3px 4px rgba(86, 48, 18, .22)); }
.tier-title { flex: 1; min-width: 0; }
.tier-title b { display: flex; align-items: center; gap: 8px; font-size: 1.125rem; font-weight: 800; }
.tier-title small { display: block; margin-top: 2px; font-size: .75rem; color: var(--ink-2); }
.tier-group { font-size: .5625rem; font-weight: 700; letter-spacing: 1px; color: #fff; background: var(--gold); padding: 2px 8px; border-radius: 999px; }

.tier-bars { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.tier-metric { display: flex; align-items: center; gap: 10px; }
.tm-label { width: 44px; flex: none; font-size: .75rem; font-weight: 700; color: var(--ink-2); }
.tm-bar { flex: 1; height: 10px; border-radius: 999px; background: #F7EDD9; overflow: hidden; }
.tm-bar i { display: block; height: 100%; border-radius: 999px; transition: width .4s ease; }
.tm-bar .fill-games { background: linear-gradient(90deg, #9EC5DE, #6FA3C8); }
.tm-bar .fill-ok { background: linear-gradient(90deg, #7FD6BD, #3FAE92); }
.tm-bar .fill-over { background: linear-gradient(90deg, #FFA08C, #E8563C); }
.tm-value { width: 84px; flex: none; text-align: right; font-size: .75rem; font-weight: 700; color: var(--ink-2); }
.tm-value.ok { color: #1E8A70; }
.tm-value.over { color: var(--red); }

.tier-guide { margin-top: 10px; font-size: .75rem; color: var(--ink-2); background: var(--bg); border-radius: 10px; padding: 8px 12px; line-height: 1.6; }
.tier-guide b { color: var(--brand-deep); }
.tier-guide.over { background: #FFF1EC; color: #A8440A; }
.tier-guide.over b { color: #A8440A; }
.tier-guide.max { background: linear-gradient(135deg, #FFF2D9, #FFE7C4); color: #8A5A00; font-weight: 700; text-align: center; }
.tier-guide.max.gold { box-shadow: inset 0 0 0 1.5px rgba(240, 140, 28, .35); }

/* 窗口序列 + 前瞻预算表（公式战页面同款） */
.tier-seq-wrap, .tier-budget-wrap { margin-top: 12px; padding: 10px 12px; background: var(--bg); border-radius: 12px; }
.tier-seq-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.tier-seq-head span:last-child { font-size: .6875rem; color: var(--ink-2); font-weight: 600; }
.tier-seq { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.seq-group { display: inline-flex; gap: 4px; }
.tier-seq b {
  width: 22px; height: 22px; border-radius: 6px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: #fff; color: var(--ink); border: 1px solid var(--brand-pale);
  font-size: .75rem; font-weight: 800;
}
.tier-seq b.oldest { background: var(--brand); color: #fff; border-color: var(--brand-deep); }
.tier-seq-note { display: block; margin-top: 6px; font-size: .6875rem; color: var(--brand-deep); }
.tier-budget { display: flex; flex-direction: column; }
.tb-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 2px; border-top: 1px dashed var(--line); font-size: .75rem; color: var(--ink-2);
}
.tb-row:first-child { border-top: 0; }
.tb-row b { color: var(--brand-deep); }

/* 段位一览弹层 */
.tier-ladder { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; max-height: 52vh; overflow-y: auto; overscroll-behavior: contain; padding: 2px; }
.tier-row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 14px; border: 1.5px solid transparent; }
.tier-row .tier-badge { width: 38px; height: 38px; font-size: 1rem; border-width: 2px; }
.tier-row-main { flex: 1; min-width: 0; }
.tier-row-main b { display: block; font-size: .875rem; font-weight: 800; }
.tier-row-main small { font-size: .6875rem; color: var(--ink-2); }
.tier-row.done { opacity: .78; }
.tier-row.done .tier-row-main b::after { content: ' ✓'; color: #1E8A70; font-size: .75rem; }
.tier-row.current { border-color: var(--brand); background: var(--brand-wash); box-shadow: 0 3px 10px rgba(240, 140, 28, .18); }
.tier-row .t-cur { font-style: normal; font-size: .625rem; font-weight: 800; color: #fff; background: var(--brand); padding: 3px 9px; border-radius: 999px; flex: none; }

/* ---------- 个人中心 ---------- */
.member-card {
  position: relative; border-radius: var(--radius); padding: 18px 18px 16px;
  background: var(--header-grad); color: #fff; box-shadow: var(--shadow); overflow: hidden;
}
.member-card::after { content: '柠'; position: absolute; right: -12px; bottom: -22px; font-family: 'Ma Shan Zheng', serif; font-size: 6rem; opacity: .14; }
.member-top { position: relative; display: flex; align-items: center; gap: 14px; }
.member-avatar {
  position: relative; width: 58px; height: 58px; border-radius: 50%; flex: none;
  background: rgba(255, 255, 255, .92); border: 2px solid rgba(255, 255, 255, .8);
  display: flex; align-items: center; justify-content: center;
  color: var(--brand-deep); font-weight: 800; font-size: 1.375rem;
  font-family: 'Ma Shan Zheng', serif; box-shadow: var(--shadow-s);
}
.member-avatar.avatar-img { background-size: cover; background-position: center; }
.member-avatar .cam {
  position: absolute; right: -3px; bottom: -3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; color: var(--brand-deep); font-size: .6875rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(180, 110, 20, .3); font-family: 'Noto Sans SC', sans-serif;
}
.member-info { position: relative; flex: 1; min-width: 0; }
.member-name-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.member-name-row b { font-size: 1.125rem; font-weight: 800; color: #fff; text-shadow: 0 1px 2px rgba(180, 110, 20, .3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-edit {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  background: rgba(255, 255, 255, .22); border: 1px solid rgba(255, 255, 255, .45); color: #fff;
  font-size: .75rem; display: flex; align-items: center; justify-content: center;
}
.member-info > small { display: block; margin-top: 2px; font-size: .75rem; color: rgba(255, 255, 255, .85); }
.ach-chip {
  margin-top: 10px; display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .22); border: 1px solid rgba(255, 255, 255, .5);
  color: #fff; font-size: .6875rem; font-weight: 700;
}
.ach-chip svg { width: 13px; height: 13px; }
.member-tag { position: absolute; top: 16px; right: 16px; background: rgba(255,255,255,.25); border: 1px solid rgba(255,255,255,.5); padding: 3px 10px; border-radius: 999px; font-size: .6875rem; font-weight: 600; }

.menu { padding: 4px 16px; }
.menu button { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 13px 0; border-top: 1px solid var(--line); }
.menu button:first-child { border-top: 0; }
.menu svg { width: 21px; height: 21px; color: var(--brand); flex: none; }
.menu div { flex: 1; min-width: 0; }
.menu b { display: block; font-size: .875rem; font-weight: 700; }
.menu small { font-size: .6875rem; color: var(--ink-2); }
.menu small em { font-style: normal; color: var(--brand-deep); }
.menu i { font-style: normal; color: var(--ink-3); font-size: 1.125rem; }
.menu button.menu-highlight svg { color: var(--blue); }
.menu button.menu-danger svg { color: var(--red); }
.menu button.menu-danger b { color: var(--red); }
.foot-note { text-align: center; font-size: .6875rem; color: var(--ink-3); padding: 4px 0 8px; }

/* ---------- 底部 Tab ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; color: var(--ink-3); border-radius: 12px; }
.tab svg { width: 22px; height: 22px; }
.tab span { font-size: .625rem; font-weight: 600; }
.tab.active { color: var(--brand); }
.tab.active span { font-weight: 800; }

/* ---------- 全屏面板（录分/抽风/扫码） ---------- */
.panel {
  position: fixed; inset: 0; z-index: 60; background: var(--bg);
  transform: translateY(100%); transition: transform .3s cubic-bezier(.32,.72,.28,1);
  display: flex; flex-direction: column; visibility: hidden;
}
.panel.open { transform: none; visibility: visible; }
.panel-header {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; background: var(--header-grad); color: #fff;
  padding-top: calc(12px + env(safe-area-inset-top));
}
.panel-header h2 { flex: 1; font-size: 1rem; font-weight: 800; text-align: center; }
.back-btn { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.25); color: #fff; font-size: 1.25rem; line-height: 1; flex: none; }
.panel-tag { font-size: .6875rem; font-weight: 600; background: rgba(255,255,255,.25); padding: 3px 10px; border-radius: 999px; flex: none; }
.panel-body { flex: 1; overflow-y: auto; padding: 14px 16px calc(28px + env(safe-area-inset-bottom)); padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); display: flex; flex-direction: column; gap: 12px; overscroll-behavior: contain; }
/* 下方子项禁止 flex 收缩：.pick-list 带 overflow:auto，其 flex 自动最小尺寸为 0，
   一旦允许收缩，面板内容超高时高度亏空会全部砸在选人列表上，把它压成一条细缝 */
.panel-body > * { flex-shrink: 0; }

.tool-row { display: flex; gap: 8px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: #fff; border-radius: 999px; padding: 7px 12px; font-size: .75rem; font-weight: 600; color: var(--ink); box-shadow: var(--shadow-s); }
.chip.pill { flex: none; max-width: 46%; overflow: hidden; white-space: nowrap; }
.search-box { flex: 1; display: flex; align-items: center; gap: 6px; background: #fff; border-radius: 999px; padding: 7px 12px; box-shadow: var(--shadow-s); }
.search-box svg { width: 15px; height: 15px; color: var(--ink-3); flex: none; }
.search-box input { flex: 1; font-size: .8125rem; min-width: 0; }

.pick-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pick-tab {
  padding: 9px 0; border-radius: 14px; background: #fff; color: var(--ink-2);
  font-size: .8125rem; font-weight: 700; box-shadow: var(--shadow-s); text-align: center;
}
.pick-tab.active { background: var(--blue-soft); color: #2C7DA8; }
/* 上限按四家整行预留（4×57px 行高 + 内边距），常见「店内在店正好 4 人」时不产生内部死滚动 */
.pick-list { padding: 4px 14px; max-height: 272px; overflow-y: auto; overscroll-behavior: contain; }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.pick-row:first-child { border-top: 0; }
.pick-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-wash); color: var(--brand-deep); font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; font-size: .875rem; }
.pick-main { flex: 1; min-width: 0; }
.pick-main b { display: block; font-size: .8125rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-main small { display: block; font-size: .625rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-badge { font-size: .5625rem; font-weight: 700; background: var(--mint-soft); color: #1E8A70; padding: 2px 6px; border-radius: 999px; flex: none; }
.pick-add { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-wash); color: var(--brand-deep); font-size: 1.125rem; font-weight: 700; flex: none; line-height: 1; }
.pick-add.done { background: var(--mint-soft); color: #1E8A70; }

.seat-card { padding: 12px 14px; }
.seat-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.seat-row.remaining { border-bottom: 1px dashed var(--line); padding-bottom: 10px; margin-bottom: 4px; }
.seat-row.remaining span { font-size: .8125rem; color: var(--ink-2); font-weight: 600; flex: 1; }
.seat-row.remaining strong { font-size: 1.25rem; font-weight: 900; color: var(--brand-deep); }
.seat-row.remaining strong.zero { color: var(--mint); }
.wind-badge { width: 32px; height: 32px; border-radius: 9px; background: var(--btn-grad); color: #fff; font-size: .9375rem; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; box-shadow: var(--shadow-s); }
.seat-player { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; }
.seat-player em { font-style: normal; color: var(--ink-3); font-size: .8125rem; }
.seat-player.filled { background: var(--brand-wash); border: 1px solid var(--brand-pale); border-radius: 999px; padding: 5px 6px 5px 12px; }
.seat-player.filled b { font-size: .8125rem; font-weight: 700; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat-player .remove { width: 26px; height: 26px; border-radius: 50%; background: rgba(230, 126, 18, .15); color: var(--brand-deep); font-size: .875rem; line-height: 1; flex: none; }
.seat-score { width: 92px; text-align: right; font-size: .9375rem; font-weight: 800; background: var(--bg); border-radius: 10px; padding: 8px 10px; flex: none; -moz-appearance: textfield; appearance: textfield; }
.seat-score::-webkit-outer-spin-button, .seat-score::-webkit-inner-spin-button { -webkit-appearance: none; }
.seat-score:disabled { opacity: .45; }
.seat-hint { font-size: .6875rem; padding-top: 6px; }

.mode-seg { display: grid; grid-template-columns: 1fr 1fr; background: #fff; border-radius: 999px; padding: 4px; box-shadow: var(--shadow-s); }
.seg { padding: 8px 0; border-radius: 999px; font-size: .8125rem; font-weight: 700; color: var(--ink-2); text-align: center; }
.seg.active { background: var(--btn-grad); color: #fff; }

.form-card { padding: 12px 16px; }
.form-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; }
.form-row + .form-row { border-top: 1px solid var(--line); }
.form-row label { font-size: .8125rem; color: var(--ink-2); font-weight: 600; flex: none; width: 60px; }
.form-row select { flex: 1; font-size: .875rem; font-weight: 700; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%); background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.form-row input { flex: 1; font-size: .8125rem; min-width: 0; }
.form-row .count { font-size: .625rem; color: var(--ink-3); flex: none; }

.primary-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--btn-grad); color: #fff; font-weight: 800; font-size: .9375rem;
  padding: 12px 22px; border-radius: 999px; box-shadow: 0 6px 16px rgba(240, 140, 28, .35);
  transition: transform .12s ease, opacity .12s ease;
}
.primary-btn:active { transform: scale(.97); }
.primary-btn:disabled { opacity: .45; box-shadow: none; }
.primary-btn.full { width: 100%; }
.outline-btn { background: #fff; color: var(--brand-deep); border: 1.5px solid var(--brand-pale); font-weight: 700; font-size: .875rem; padding: 10px 18px; border-radius: 999px; }

/* 抽风面板 */
/* 座次结果卡（开局定座） */
.seat-hint-inline { margin-left: auto; font-size: .625rem; }
.seat-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.seat-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 14px;
  background: var(--bg); border: 1px solid transparent;
  min-height: 56px;
}
.seat-item.dealer { background: var(--brand-wash); }
.seat-item.mine { border-color: var(--brand); background: var(--brand-wash); box-shadow: 0 3px 10px rgba(240, 140, 28, .18); }
.seat-wind {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 800; color: #fff; background: var(--btn-grad);
  box-shadow: var(--shadow-s);
}
.seat-wind.w1 { background: linear-gradient(135deg, #DDE3EA, #B9C4D1); }
.seat-wind.w2 { background: linear-gradient(135deg, #F0BE90, #D28B5B); }
.seat-wind.w3 { background: linear-gradient(135deg, #E4D6C2, #CBB9A0); }
.seat-name { flex: 1; min-width: 0; }
.seat-name b { display: block; font-size: .875rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat-name small { font-size: .625rem; color: var(--brand-deep); font-weight: 700; }
.seat-you { flex: none; font-size: .625rem; font-weight: 700; color: var(--brand-deep); background: #fff; padding: 3px 9px; border-radius: 999px; }

/* 空态：给出下一步行动指引，不留空白 */
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 20px 12px 16px; text-align: center; }
.empty-state .es-icon { width: 44px; height: 44px; border-radius: 14px; background: var(--brand-wash); color: var(--brand-deep); font-weight: 800; display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.empty-state b { font-size: .875rem; font-weight: 700; }
.empty-state small { font-size: .75rem; color: var(--ink-3); line-height: 1.6; max-width: 240px; }
.token-line { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0; }
.token-line code { flex: 1; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8125rem; background: var(--bg); border-radius: 10px; padding: 9px 10px; word-break: break-all; line-height: 1.4; }
.token-line .chip { flex: none; }
.draw-me { display: flex; align-items: center; gap: 12px; }
.draw-me-text { flex: 1; }
.draw-me-text b { display: block; font-size: .9375rem; font-weight: 800; }
.draw-me-text small { font-size: .75rem; color: var(--ink-2); }
.draw-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); }
.draw-row:first-child { border-top: 0; }
.draw-state { font-size: .6875rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--bg); color: var(--ink-3); flex: none; }
.draw-state.did { background: var(--blue-soft); color: #2C7DA8; }
.draw-state.wind { background: var(--btn-grad); color: #fff; }
.draw-result { text-align: center; }
.draw-result .wind-line { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 8px 0; }
.draw-result .wind-line .wind-badge { width: 38px; height: 38px; font-size: 1.125rem; }
.draw-result .wind-line b { flex: 1; text-align: left; font-size: .9375rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.draw-result .wind-line small { color: var(--ink-2); font-size: .75rem; flex: none; }

/* 扫桌开局向导 */
.table-flow-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.table-flow-head .tf-text { flex: 1; min-width: 0; }
.table-flow-head b { display: block; font-size: 1.0625rem; font-weight: 800; }
.table-flow-head small { font-size: .75rem; }
.table-fresh-hint, .table-waiting-hint { text-align: center; padding: 10px 6px 2px; line-height: 1.8; }
.table-search { margin-bottom: 2px; }
#table-picking .primary-btn, #table-picking .outline-btn, #table-fresh .primary-btn { margin-top: 10px; }

/* 进行中对局悬浮条 */
.session-pill {
  position: fixed; left: 16px; right: 16px; bottom: calc(78px + env(safe-area-inset-bottom)); z-index: 25;
  display: flex; align-items: center; gap: 8px; padding: 11px 16px;
  background: linear-gradient(135deg, #4FA8D8, #2C7DA8); color: #fff;
  border-radius: 999px; box-shadow: 0 6px 16px rgba(44, 125, 168, .35);
  font-size: .8125rem; font-weight: 700; text-align: left;
}
.session-pill[hidden] { display: none; }
.session-pill .sp-dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; flex: none; animation: sp-pulse 1.6s ease-in-out infinite; }
.session-pill span:nth-child(2) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-pill i { font-style: normal; font-size: 1.05rem; flex: none; opacity: .85; }
@keyframes sp-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* 扫码 */
.scan-card { text-align: center; }
.scan-frame { position: relative; width: 100%; aspect-ratio: 4 / 3; background: #2A2118; border-radius: var(--radius-s); overflow: hidden; }
.scan-frame video { width: 100%; height: 100%; object-fit: cover; }
.scan-guide { position: absolute; left: 50%; top: 50%; width: 62%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 18px; box-shadow: 0 0 0 2000px rgba(20, 14, 8, .45); outline: 2px solid rgba(255,255,255,.9); outline-offset: -2px; }
.scan-frame.no-cam::after {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1.6' opacity='.75'%3E%3Cpath d='M4 8V6a2 2 0 0 1 2-2h2M16 4h2a2 2 0 0 1 2 2v2M20 16v2a2 2 0 0 1-2 2h-2M8 20H6a2 2 0 0 1-2-2v-2'/%3E%3Ccircle cx='12' cy='12' r='3.2'/%3E%3C/svg%3E") center / 56px 56px no-repeat;
}
.scan-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.manual-row { display: flex; gap: 8px; margin-top: 8px; }
.manual-row input { flex: 1; min-width: 0; background: var(--bg); border-radius: 999px; padding: 10px 14px; font-size: .8125rem; }
.manual-row .primary-btn { padding: 10px 20px; }

/* ---------- 底部弹层 ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(43, 30, 14, .45); opacity: 0; visibility: hidden; transition: opacity .25s ease; }
.sheet-backdrop.open { opacity: 1; visibility: visible; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--card); border-radius: 24px 24px 0 0;
  padding: 22px 20px calc(24px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .3s cubic-bezier(.32,.72,.28,1);
  max-height: 82vh; max-height: 82dvh; overflow-y: auto;
}
.sheet-backdrop.open .sheet { transform: none; }
.sheet-close { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%; background: var(--bg); color: var(--ink-2); font-size: 1.05rem; line-height: 1; }
.brush-logo { display: block; width: 44px; height: 44px; margin: 0 auto 10px; border-radius: 14px; background: var(--brand-wash); color: var(--brand-deep); font-family: 'Ma Shan Zheng', serif; font-size: 1.75rem; line-height: 44px; text-align: center; }
.sheet h2 { text-align: center; font-size: 1.125rem; font-weight: 800; }
.sheet-sub { text-align: center; margin-top: 2px; }
.sheet form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.sheet label { display: block; font-size: .75rem; color: var(--ink-2); font-weight: 600; }
.sheet label input { display: block; width: 100%; margin-top: 6px; background: var(--bg); border-radius: 12px; padding: 12px 14px; font-size: .9375rem; }
.sheet .text-btn { display: block; margin: 14px auto 0; font-size: .8125rem; }
.auth-message { min-height: 20px; margin-top: 10px; text-align: center; font-size: .75rem; color: var(--red); }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.sheet-actions .outline-btn { padding: 11px 0; }
.sheet-actions .primary-btn { padding: 11px 0; }
#prompt-form label { margin-top: 12px; }
#prompt-form:empty { display: none; }

/* 成就 */
.ach-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.ach-row { display: flex; align-items: center; gap: 12px; background: var(--bg); border-radius: 14px; padding: 12px 14px; }
.ach-row .ach-icon { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex: none; background: #EFE8DC; color: var(--ink-3); }
.ach-row.unlocked .ach-icon { background: var(--btn-grad); color: #fff; box-shadow: 0 4px 10px rgba(240,140,28,.3); }
.ach-row div { flex: 1; min-width: 0; }
.ach-row b { display: block; font-size: .875rem; font-weight: 700; }
.ach-row small { font-size: .6875rem; color: var(--ink-2); }
.ach-row em { font-style: normal; font-size: .6875rem; font-weight: 700; color: var(--ink-3); flex: none; }
.ach-row.unlocked em { color: var(--brand); }
.ach-tasks { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.ach-task { display: flex; align-items: center; gap: 8px; font-size: .75rem; color: var(--ink-2); background: var(--brand-wash); border-radius: 10px; padding: 8px 12px; }
.ach-task b { color: var(--ink); font-weight: 700; }
.ach-task .task-state { margin-left: auto; font-size: .6875rem; font-weight: 700; color: var(--brand-deep); }
.ach-task.done .task-state { color: #1E8A70; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 90;
  transform: translate(-50%, 16px); max-width: 82vw;
  background: rgba(61, 46, 30, .92); color: #fff; font-size: .8125rem; font-weight: 500;
  padding: 10px 18px; border-radius: 999px; text-align: center;
  opacity: 0; visibility: hidden; transition: all .25s ease; pointer-events: none;
}
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

/* ---------- PC 引导页 ---------- */
.pc-gate { display: none; }
html.player-desktop #app { display: none; }
html.player-desktop .panel,
html.player-desktop .sheet-backdrop,
html.player-desktop .toast { display: none; }
html.player-desktop .pc-gate {
  display: flex; position: fixed; inset: 0; z-index: 100; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #FFF7EC, #FBE8CB); padding: 20px;
}
.pc-gate-card { background: #fff; border-radius: 24px; box-shadow: var(--shadow); padding: 36px 32px; max-width: 460px; width: 100%; text-align: center; }
.gate-mark { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 20px; background: var(--brand-wash); color: var(--brand-deep); font-family: 'Ma Shan Zheng', serif; font-size: 2.25rem; line-height: 64px; }
.pc-gate-card h1 { font-size: 1.25rem; font-weight: 800; margin: 6px 0; }
.pc-gate-card p { color: var(--ink-2); font-size: .875rem; margin-bottom: 18px; }
#score-query { display: flex; gap: 8px; }
#score-query input { flex: 1; background: var(--bg); border-radius: 999px; padding: 11px 16px; font-size: .875rem; }
.query-result { margin-top: 14px; font-size: .8125rem; color: var(--ink-2); text-align: left; word-break: break-all; }
.query-result b { color: var(--ink); }
.pc-gate-card small { display: block; margin-top: 16px; color: var(--ink-3); font-size: .6875rem; }

/* ---------- 战绩分享图与公开落地页 ---------- */
.share-sheet { max-height: 90vh; }
.share-canvas-wrap { margin-top: 14px; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-s); background: var(--bg); }
.share-canvas-wrap canvas { display: block; width: 100%; height: auto; }
.share-actions { margin-top: 14px; }
.share-btn { margin-top: 12px; }
.public-stats { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.public-stat-row { display: flex; align-items: center; gap: 10px; background: var(--bg); border-radius: 13px; padding: 12px 14px; }
.public-stat-row b { font-size: 1.125rem; font-weight: 900; color: var(--brand-deep); }
.public-stat-row span { flex: 1; font-size: .8125rem; color: var(--ink-2); }
.public-stat-row .rank-badge { width: 36px; height: 36px; font-size: .9375rem; border-radius: 50%; background: linear-gradient(135deg, #FFC37E, #F08C1C); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; }

/* ---------- 徽章精致化：图片作为主体，底板负责层次 ---------- */
.tier-badge,
.rank-badge,
.public-stat-row .rank-badge {
  position: relative;
  background: transparent !important;
  border: 0;
  box-shadow: none;
  overflow: visible;
}
.tier-badge::before,
.rank-badge::before {
  display: none;
}
.tier-badge img,
.rank-badge img {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 7px 5px rgba(83, 46, 18, .20));
}
.tier-head {
  position: relative;
  margin: -4px -4px 16px;
  padding: 14px 12px 14px 8px;
  border: 1px solid rgba(215, 170, 93, .24);
  border-radius: 18px;
  background: linear-gradient(105deg, rgba(255,250,239,.94), rgba(255,246,224,.62));
  box-shadow: inset 0 1px rgba(255,255,255,.85), 0 7px 18px rgba(129, 78, 26, .06);
}
.tier-head::after {
  content: '';
  position: absolute;
  left: 84px;
  right: 18px;
  bottom: 8px;
  height: 1px;
  background: linear-gradient(90deg, rgba(202,151,69,.28), transparent);
}
.tier-head .tier-badge.lg { width: 78px; height: 78px; margin: -3px 3px -3px -2px; }
.tier-title b { color: #3b2a1d; letter-spacing: .02em; }
.tier-title small { color: #8b7259; }
.tier-bars { padding: 0 6px; }
.tier-metric { padding: 9px 0; }
.tm-label { color: #70563c; font-weight: 700; }
.tm-bar { background: #f2e7d0; box-shadow: inset 0 1px 3px rgba(133,92,35,.12); }

#lb-card { padding: 15px 18px 17px; border: 1px solid rgba(215,170,93,.22); box-shadow: 0 14px 30px rgba(117,71,28,.08); }
.lb-head { padding: 8px 8px 13px; color: #9a8064; letter-spacing: .08em; border-bottom: 1px solid #f0e5d2; }
.lb-row { min-height: 70px; padding: 10px 8px; border-top: 1px solid #f3e9d9; transition: background .2s, transform .2s; }
.lb-row:hover { background: #fffaf1; transform: translateX(2px); }
.lb-row .tier-badge { width: 48px; height: 48px; }
.lb-row.me { background: linear-gradient(90deg, #fff1d5, #fffaf1); border: 1px solid rgba(221,160,55,.28); }
.lb-name b { color: #34261d; font-size: .9375rem; }
.lb-tier { color: #5f4936; font-size: .8125rem; }
.lb-avg { color: #3f2b1c; font-size: 1rem; letter-spacing: .03em; }
.me-rank-bar { background: linear-gradient(110deg, #b97429, #e4a34a); box-shadow: 0 10px 24px rgba(151,85,24,.22); }
.me-rank-bar .tier-badge { width: 38px; height: 38px; }
.tier-row { padding: 11px 14px; background: linear-gradient(90deg, #fffaf0, #fffdf9); border-color: rgba(215,170,93,.12); }
.tier-row .tier-badge { width: 50px; height: 50px; }
.tier-row.current { background: linear-gradient(90deg, #fff0ce, #fffaf1); border-color: rgba(213,148,37,.42); box-shadow: 0 6px 16px rgba(161,99,25,.10); }

/* ---------- 可访问性与动效降级 ---------- */
.primary-btn { text-shadow: 0 1px 1px rgba(150, 82, 0, .30); }
.btn-icon, .pill-icon { width: 17px; height: 17px; }
:focus-visible { outline: 2.5px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.panel-header :focus-visible, .app-header :focus-visible, .tabbar :focus-visible { outline-color: #fff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .hero-mascot { animation: none; }
}

/* 窄屏加固 */
@media (max-width: 359px) {
  .lb-head, .lb-row { grid-template-columns: 32px 24px minmax(0, 1fr) 60px 58px; gap: 5px; }
  .lb-rank { width: 24px; height: 24px; font-size: .6875rem; }
  .lb-name small { display: none; }
  .lb-pts { font-size: .8125rem; }
  .lb-rate { font-size: .625rem; }
  .seat-score { width: 76px; }
  #view-root { padding-left: 12px; padding-right: 12px; }
}

/* 桌面宽度下的移动布局约束 */
@media (min-width: 480px) {
  .app-header, #view-root { max-width: 560px; margin: 0 auto; width: 100%; }
  .tabbar { max-width: 560px; margin: 0 auto; }
}
/* 平板及以上：入口卡与数据格横向铺开 */
@media (min-width: 620px) {
  .app-header, #view-root, .tabbar { max-width: 640px; }
  .entry-grid { grid-template-columns: repeat(4, 1fr); }
  .rate-grid { grid-template-columns: repeat(8, 1fr); }
  .rate-cell { padding: 10px 2px 8px; }
  .rate-cell strong { font-size: .8125rem; }
}

:root {
  --brand: #b94b32;
  --brand-deep: #8d2e25;
  --brand-soft: #d77a4b;
  --brand-pale: #e8b879;
  --brand-wash: #f5e4c4;
  --bg: #17130f;
  --card: #fbf4e5;
  --ink: #2c2119;
  --ink-2: #6f5b48;
  --ink-3: #a58b6c;
  --gold: #c99b4d;
  --gold-deep: #946b2e;
  --red: #c84a3b;
  --mint: #4e9c86;
  --mint-soft: #dceee6;
  --blue: #5d91a2;
  --blue-soft: #e0edf0;
  --line: #dec696;
  --radius: 20px;
  --radius-s: 14px;
  --shadow: 0 18px 40px rgba(0, 0, 0, .24);
  --shadow-s: 0 8px 20px rgba(0, 0, 0, .16);
  --header-grad: linear-gradient(135deg, #241a15 0%, #39251d 54%, #742d25 100%);
  --btn-grad: linear-gradient(135deg, #c7603d, #8c2d24);
}

html { background: #17130f; }
body {
  background:
    radial-gradient(circle at 18% 5%, rgba(198, 155, 77, .12), transparent 28rem),
    radial-gradient(circle at 86% 20%, rgba(185, 75, 50, .12), transparent 24rem),
    #17130f;
  color: #f8edd7;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .16;
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.06) 0 1px, transparent 1px 5px);
  mix-blend-mode: soft-light;
  z-index: -1;
}
#app { background: transparent; }
.app-header {
  background: var(--header-grad);
  border-bottom: 1px solid rgba(224, 198, 150, .48);
  border-radius: 0 0 32px 32px;
  box-shadow: 0 16px 30px rgba(0, 0, 0, .25);
  padding: 16px 16px 14px;
}
.app-header::before {
  opacity: .35;
  background-image:
    linear-gradient(135deg, transparent 45%, rgba(222,198,150,.16) 46%, transparent 47%),
    radial-gradient(circle at 20% 30%, rgba(238,209,144,.22) 0 1px, transparent 2px),
    radial-gradient(circle at 80% 70%, rgba(238,209,144,.18) 0 1px, transparent 2px);
  background-size: 84px 84px, 42px 42px, 57px 57px;
}
.header-row { min-height: 40px; }
.brand-mark {
  width: 40px;
  height: 40px;
  line-height: 40px;
  border: 1px solid rgba(236, 207, 150, .72);
  border-radius: 13px;
  background: linear-gradient(145deg, #ecd39b, #b66b39);
  color: #54251d;
  box-shadow: inset 0 1px rgba(255,255,255,.5), 0 5px 12px rgba(0,0,0,.24);
}
.header-title { color: #fff4df; letter-spacing: 1.5px; }
.header-bell, .header-avatar {
  background: rgba(20, 14, 10, .34);
  border-color: rgba(236, 207, 150, .58);
}
.store-pill {
  margin-top: 14px;
  background: rgba(250, 239, 211, .95);
  border: 1px solid rgba(211, 166, 89, .55);
  color: #4d3326;
  box-shadow: 0 6px 15px rgba(0,0,0,.16);
}
.store-pill .pill-icon { color: var(--brand); }
.hero-band {
  margin: 10px -16px -42px;
  min-height: 150px;
  padding: 14px 22px 54px;
  justify-content: space-between;
  overflow: hidden;
}
.hero-band::before {
  content: '';
  position: absolute;
  width: 230px;
  height: 230px;
  right: -76px;
  top: -64px;
  border: 1px solid rgba(237, 207, 151, .34);
  border-radius: 50%;
  box-shadow: 0 0 0 18px rgba(237, 207, 151, .05), 0 0 0 38px rgba(237, 207, 151, .04);
}
.hero-banner {
  margin-left: 12px;
  padding: 13px 17px 14px;
  background: rgba(24, 17, 13, .65);
  border: 1px solid rgba(235, 203, 143, .55);
  border-radius: 5px;
  box-shadow: inset 0 0 0 4px rgba(177, 119, 50, .12), 0 10px 20px rgba(0,0,0,.18);
  transform: rotate(-2deg);
}
.hero-banner::before {
  content: '雀庄成绩志';
  display: block;
  color: #dfbc75;
  font-size: .56rem;
  letter-spacing: 3px;
  margin-bottom: 3px;
}
.hero-brush { color: #f8e4bd; font-size: 2.15rem; letter-spacing: 8px; }
.hero-banner small { color: #d3a85f; letter-spacing: 2px; }
.hero-mascot { display: none; }
.hero-sakura { display: none; }
.hero-band::after {
  content: '';
  position: relative;
  z-index: 1;
  display: block;
  width: 136px;
  height: 136px;
  margin: -4px 14px -18px 0;
  background: url('assets/rank-badges/8级.png') center / contain no-repeat;
  filter: drop-shadow(0 12px 8px rgba(0,0,0,.38));
}
#view-root { padding-top: 28px; }
body:not([data-view="home"]) #view-root { padding-top: 24px; }
.section-head { padding: 6px 4px 0; }
.section-head h2 { color: #f5e6ca; letter-spacing: .08em; }
.eyebrow { color: #d2aa62; letter-spacing: 2.5px; }
.text-btn { color: #e3b56b; }
.card, .entry-card, .member-card {
  border: 1px solid rgba(207, 169, 101, .46);
  box-shadow: var(--shadow-s), inset 0 1px rgba(255,255,255,.66);
}
.card {
  background: linear-gradient(145deg, #fff8ea, #f3e6cf);
}
.entry-grid { gap: 10px; }
.entry-card {
  min-height: 116px;
  padding: 17px 14px 14px;
  background: linear-gradient(145deg, #fff9ec, #eee0c4);
  border-radius: 18px;
  clip-path: none;
  overflow: hidden;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.entry-card::before {
  content: '';
  position: absolute;
  right: -21px;
  top: -21px;
  width: 56px;
  height: 56px;
  border: 1px solid rgba(181, 128, 55, .32);
  transform: rotate(45deg);
}
.entry-card:active { transform: translateY(1px); box-shadow: 0 4px 10px rgba(0,0,0,.12); }
.entry-card svg { color: var(--brand); }
.entry-card svg.mint { color: var(--mint); }
.entry-card b { color: #33231b; }
.entry-card i { color: var(--gold-deep); }
.store-card, .list, .dist-card { border-color: rgba(207, 169, 101, .46); }
.store-card-head b, .card-head h3, .list b { color: #33231b; }
.muted, .list small, .rate-cell span, .rate-cell small { color: #765f48; }
.store-meta .tag { background: #f0e0c2; }
.stat-strip { background: linear-gradient(100deg, #fcf2dc, #e7d1a8); }
.strip-item strong { color: #6f2e24; }
.strip-item span { color: #795e43; }
.profile-band {
  border: 1px solid rgba(228, 194, 126, .58);
  background: linear-gradient(135deg, #9d3d2d, #3b211b 70%);
  box-shadow: var(--shadow);
}
.profile-band-text b { color: #fff0ce; }
.profile-band-text small { color: #eacb96; }
.rank-badge { background: transparent !important; }
.rank-badge img { filter: drop-shadow(0 7px 6px rgba(0,0,0,.32)); }
.stat-hero { background: linear-gradient(145deg, #fff8e8, #ead6af); }
.tier-head { background: linear-gradient(105deg, #fff8e9, #eddab6); border-color: rgba(179, 127, 52, .34); }
.tier-title b { color: #3b281c; }
.tier-title small, .tm-label { color: #80684c; }
.tm-bar { background: #dfcda8; }
.tier-guide { background: #ead9b7; color: #674a2e; }
.tier-seq b { background: #c89449; color: #fff9ed; }
.tier-seq b.oldest { background: #a94432; }
.tier-budget-wrap { border-color: #ddc89e; }
.lb-head { color: #8b7255; border-bottom-color: #deca9f; }
#lb-card { background: linear-gradient(145deg, #fff8e9, #ead8b4); border-color: rgba(207,169,101,.55); }
.lb-row { border-top-color: #e3d1ad; }
.lb-row:hover { background: #f9edda; }
.lb-row.me { background: linear-gradient(90deg, #f1d39a, #fbefd9); border-color: rgba(166, 99, 37, .34); }
.lb-name b, .lb-avg { color: #33231b; }
.lb-name small, .lb-tier { color: #765e43; }
.me-rank-bar { background: linear-gradient(110deg, #a84431, #d28d44); border: 1px solid rgba(242,211,153,.5); }
.me-rank-bar .tier-badge img { filter: drop-shadow(0 4px 4px rgba(0,0,0,.3)); }
.member-card { background: linear-gradient(135deg, #542920, #9c412f 60%, #c68a48); }
.member-info b { color: #fff0cf; }
.member-info small { color: #e9ca95; }
.member-tag { background: rgba(255,241,207,.18); border-color: rgba(255,231,181,.42); color: #ffe7b5; }
.menu { background: linear-gradient(145deg, #fff8e9, #eee0c5); }
.menu button { border-bottom-color: #e3d1ad; }
.menu button b { color: #39291e; }
.menu button small { color: #866d51; }
.menu button svg { color: var(--brand); }
.menu-highlight { background: #f4e1bd; }
.menu-danger b { color: #9b332b !important; }
.foot-note { color: #af916b; }
.tabbar {
  background: rgba(28, 20, 15, .96);
  border: 1px solid rgba(220, 182, 106, .42);
  box-shadow: 0 -10px 30px rgba(0,0,0,.28);
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
}
.tab { color: #9c8466; }
.tab.active { color: #e2ad5a; }
.tab.active::before { background: #d29645; box-shadow: 0 0 0 4px rgba(210,150,69,.12); }
.panel { background: #17130f; }
.panel-header { background: linear-gradient(135deg, #332018, #742d25); border-bottom-color: rgba(223,183,104,.35); }
.panel-header h2, .back-btn { color: #fff0d0; }
.panel-tag { background: rgba(241,211,158,.14); color: #eac27c; border-color: rgba(235,199,127,.35); }
.panel-body > .card, .panel-body .card { background: linear-gradient(145deg, #fff8e9, #ead8b5); }
.sheet-backdrop { background: rgba(12, 8, 6, .72); backdrop-filter: blur(5px); }
.sheet { background: linear-gradient(145deg, #fff8eb, #ead8b7); border-top: 1px solid #e5c98e; box-shadow: 0 -18px 40px rgba(0,0,0,.3); }
.sheet h2, .sheet label { color: #3c2b1f; }
.sheet-close { background: #ead8b7; color: #79583b; }
.sheet label input, #score-query input, .manual-row input { background: #f4e6cd; border: 1px solid #dcc393; color: #3c2b1f; }
.primary-btn { background: var(--btn-grad); box-shadow: 0 7px 16px rgba(121,43,28,.26); }
.outline-btn { border-color: #bd8740; color: #8d5728; }
.tier-row { background: linear-gradient(90deg, #fff7e6, #f0dfbf); border-color: rgba(195,151,79,.25); }
.tier-row.current { background: linear-gradient(90deg, #e8c37e, #f8e6c0); border-color: #c58d3d; }
.tier-row-main b { color: #39291e; }
.tier-row-main small { color: #80684c; }
.session-pill { background: linear-gradient(135deg, #a94432, #c68b45); box-shadow: 0 8px 20px rgba(0,0,0,.28); }
.toast { background: rgba(29, 19, 13, .94); border: 1px solid rgba(226,181,99,.45); }
.pc-gate { background: radial-gradient(circle at 20% 10%, #6c2b25, transparent 36rem), #17130f; }
.pc-gate-card { background: linear-gradient(145deg, #fff8eb, #ead8b7); border: 1px solid #d8b77b; }
.pc-gate-card h1 { color: #3d2a1f; }
.pc-gate-card p, .pc-gate-card small { color: #765d43; }

@media (max-width: 520px) {
  .hero-band { min-height: 138px; padding-left: 10px; padding-right: 8px; }
  .hero-banner { margin-left: 0; }
  .hero-band::after { width: 116px; height: 116px; margin-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  body::before { display: none; }
}

/* 段位徽章放大预览 */
.tier-preview-badge {
  cursor: zoom-in;
}
.tier-preview-badge:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 4px;
  border-radius: 14px;
}
.badge-preview-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(49, 31, 12, .62);
  backdrop-filter: blur(9px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease, visibility .22s ease;
}
.badge-preview-backdrop.open {
  opacity: 1;
  visibility: visible;
}
.badge-preview-card {
  position: relative;
  width: min(88vw, 330px);
  min-height: 310px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 34px 24px 25px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 28px;
  background:
    linear-gradient(125deg, rgba(255,255,255,.7), transparent 40%, rgba(255,255,255,.26)),
    linear-gradient(145deg, color-mix(in srgb, var(--brand-wash) 88%, white), #f2dbb5);
  box-shadow: 0 22px 60px rgba(32, 20, 9, .34), inset 0 1px rgba(255,255,255,.95);
  transform: scale(.92) translateY(8px);
  transition: transform .28s cubic-bezier(.22,.8,.26,1);
  overflow: hidden;
}
.badge-preview-backdrop.open .badge-preview-card { transform: scale(1) translateY(0); }
.badge-preview-card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .4;
  background: repeating-linear-gradient(112deg, transparent 0 28px, rgba(255,255,255,.5) 29px 31px, transparent 32px 72px);
  mix-blend-mode: screen;
}
.badge-preview-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--ink-2);
  background: rgba(255,255,255,.6);
  font-size: 1.2rem;
  line-height: 1;
}
.badge-preview-image {
  position: relative;
  z-index: 1;
  width: min(58vw, 190px);
  height: min(58vw, 190px);
  margin: 12px 0 12px;
  object-fit: contain;
  filter: drop-shadow(0 15px 9px rgba(91, 53, 18, .3));
  animation: preview-badge-float 4.8s ease-in-out infinite;
}
.badge-preview-card h2 {
  position: relative;
  z-index: 1;
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 900;
}
.badge-preview-card p {
  position: relative;
  z-index: 1;
  margin-top: 4px;
  color: var(--ink-3);
  font-size: .6875rem;
}
@keyframes preview-badge-float {
  0%, 100% { transform: translateY(2px) rotate(-1deg); }
  50% { transform: translateY(-5px) rotate(1deg); }
}
@media (prefers-reduced-motion: reduce) {
  .badge-preview-image { animation: none; }
}

/* ---------- 对局流程精修：选人 → 定座 → 录分 ---------- */
#panel-game .panel-header,
#panel-draw .panel-header,
#panel-table .panel-header {
  position: sticky;
  top: 0;
  z-index: 4;
  box-shadow: 0 4px 14px rgba(130, 77, 20, .12);
}
#panel-game .panel-body,
#panel-draw .panel-body,
#panel-table .panel-body {
  background:
    radial-gradient(circle at 100% 0, rgba(255, 214, 148, .18), transparent 30%),
    linear-gradient(180deg, #fff8ed 0%, var(--bg) 42%, #fffaf4 100%);
}
#panel-game .game-flow {
  order: -2;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  border: 1px solid rgba(215, 170, 93, .25);
  border-radius: 17px;
  background: linear-gradient(115deg, rgba(255,255,255,.96), rgba(255,243,215,.86));
  box-shadow: inset 0 1px rgba(255,255,255,.95), 0 6px 16px rgba(142, 87, 27, .07);
}
.game-flow-mark {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(145deg, #f7b14c, #db7716);
  box-shadow: 0 5px 12px rgba(218, 119, 22, .25);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: .04em;
}
.game-flow > div { min-width: 0; }
.game-flow .eyebrow { display: block; color: var(--gold-deep); font-size: .5625rem; letter-spacing: .14em; }
.game-flow b { display: block; margin-top: 1px; color: var(--ink); font-size: .9375rem; font-weight: 900; }
.game-flow small { display: block; margin-top: 2px; color: var(--ink-2); font-size: .6875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-flow > strong { min-width: 38px; color: var(--brand-deep); font-size: .875rem; text-align: right; }
#panel-game .mode-seg { order: -1; border: 1px solid rgba(215, 170, 93, .18); }
#panel-game .tool-row { padding-top: 2px; }
#panel-game .pick-tabs { gap: 8px; }
#panel-game .pick-tab { border: 1px solid transparent; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
#panel-game .pick-tab:active { transform: scale(.98); }
#panel-game .pick-tab.active { border-color: rgba(79, 168, 216, .22); box-shadow: 0 5px 12px rgba(79, 168, 216, .12); }
#panel-game .pick-list,
#panel-game .seat-card,
#panel-game .form-card {
  border: 1px solid rgba(215, 170, 93, .16);
  box-shadow: 0 7px 18px rgba(131, 80, 28, .06), inset 0 1px rgba(255,255,255,.88);
}
#panel-game .pick-row { transition: background .16s ease, padding-left .16s ease; }
#panel-game .pick-row:has(.pick-add:not(.done)):active { padding-left: 4px; background: #fffaf1; }
#panel-game .pick-add:disabled { cursor: default; opacity: 1; }
#panel-game .pick-add.done { box-shadow: inset 0 0 0 1px rgba(79, 191, 165, .18); }
#panel-game .seat-card { background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(255,249,239,.95)); }
#panel-game .seat-row.remaining { padding: 3px 2px 11px; }
#panel-game .seat-row.remaining strong { letter-spacing: .04em; transition: color .18s ease; }
#panel-game .seat-row.remaining strong.over { color: var(--red); }
#panel-game .seat-score:focus { background: #fff; box-shadow: inset 0 0 0 1.5px rgba(240, 140, 28, .45), 0 0 0 3px rgba(240, 140, 28, .1); }
#panel-game #game-submit { margin-top: 2px; min-height: 48px; box-shadow: 0 8px 18px rgba(240, 140, 28, .28); }
#panel-game .foot-note { margin-bottom: 4px; }

/* 抽风结果：把等待态、座次态和结束动作分层 */
#panel-draw .draw-me {
  position: relative;
  overflow: hidden;
  min-height: 74px;
  padding: 17px 18px;
  border: 1px solid rgba(215, 170, 93, .22);
  background: linear-gradient(118deg, #fffdf8, #fff0d2);
  box-shadow: inset 0 1px rgba(255,255,255,.95), 0 8px 18px rgba(145, 89, 26, .08);
}
#panel-draw .draw-me::after {
  content: '座';
  position: absolute;
  right: 17px;
  bottom: -20px;
  color: rgba(211, 145, 53, .12);
  font-family: 'Ma Shan Zheng', serif;
  font-size: 5.2rem;
  line-height: 1;
}
#panel-draw .draw-me-text { position: relative; z-index: 1; }
#panel-draw .draw-me-text b { font-size: 1.05rem; }
#panel-draw .draw-me-text small { display: block; margin-top: 3px; color: var(--brand-deep); }
.draw-progress {
  order: -1;
  padding: 0 4px;
  color: var(--ink-3);
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-align: center;
}
#panel-draw #draw-players { border: 1px solid rgba(215, 170, 93, .16); box-shadow: 0 7px 18px rgba(131, 80, 28, .06); }
#panel-draw .draw-row { padding: 13px 2px; }
#panel-draw .draw-state.wind { box-shadow: 0 4px 9px rgba(240, 140, 28, .18); }
#panel-draw .draw-result {
  border: 1px solid rgba(215, 170, 93, .25);
  background: linear-gradient(145deg, #fffdf8, #fff2d7);
  box-shadow: 0 10px 22px rgba(131, 80, 28, .09);
}
#panel-draw #draw-finish { min-height: 48px; margin-top: 2px; }
#panel-draw #draw-dissolve { color: #b45035; border-color: rgba(180, 80, 53, .24); }

/* 扫桌向导：创建、选人和等待状态保持同一层级 */
#panel-table .table-flow-head,
#panel-table #table-pick-list {
  border: 1px solid rgba(215, 170, 93, .18);
  box-shadow: 0 7px 18px rgba(131, 80, 28, .06);
}
#panel-table .table-flow-head { background: linear-gradient(118deg, #fffdf8, #fff0d2); }
#panel-table .table-fresh-hint,
#panel-table .table-waiting-hint { padding: 17px 12px 7px; }
#panel-table #table-create,
#panel-table #table-start-draw { min-height: 48px; }
#panel-table #table-start-draw:disabled { background: linear-gradient(135deg, #e8d7bd, #d4c0a4); color: #fff; opacity: .88; }
#panel-table .pick-add { transition: transform .15s ease, background .15s ease; }
#panel-table .pick-add:active { transform: scale(.92); }

@media (max-width: 359px) {
  #panel-game .game-flow { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 9px; padding: 11px; }
  .game-flow-mark { width: 36px; height: 36px; border-radius: 11px; }
  .game-flow b { font-size: .875rem; }
  .game-flow small { font-size: .625rem; }
}

:root {
  --brand: #f08c1c;
  --brand-deep: #d96d12;
  --brand-soft: #f7a63e;
  --brand-pale: #fbd9a6;
  --brand-wash: #fff4e3;
  --bg: #fff7ec;
  --card: #fffdf8;
  --ink: #3d2e1e;
  --ink-2: #6e5f4b;
  --ink-3: #9a8a72;
  --gold: #c9a063;
  --gold-deep: #a87e3f;
  --red: #e35c4c;
  --mint: #4fbfa5;
  --mint-soft: #e5f7f1;
  --blue: #4fa8d8;
  --blue-soft: #e3f4fa;
  --line: #f1dfc3;
  --shadow: 0 10px 28px rgba(214, 158, 74, .16);
  --shadow-s: 0 4px 13px rgba(214, 158, 74, .12);
  --header-grad: linear-gradient(168deg, #f7a63e 0%, #f0921e 58%, #f6be72 100%);
  --btn-grad: linear-gradient(135deg, #f7a63e, #ed7c15);
}

html { background: var(--bg); }
body {
  background:
    radial-gradient(circle at 6% 6%, rgba(255,255,255,.78), transparent 22rem),
    linear-gradient(180deg, #fff8ee 0%, #fff5e7 55%, #fff9f1 100%);
  color: var(--ink);
}
body::before {
  opacity: .08;
  background-image: repeating-linear-gradient(0deg, rgba(181,128,54,.2) 0 1px, transparent 1px 6px);
  mix-blend-mode: multiply;
}
.app-header {
  background: var(--header-grad);
  border-bottom: 0;
  border-radius: 0 0 28px 28px;
  box-shadow: 0 8px 22px rgba(214, 133, 32, .2);
  padding: 14px 16px 14px;
}
.app-header::before {
  opacity: .55;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='1.6' opacity='.35'%3E%3Ccircle cx='24' cy='26' r='7'/%3E%3Ccircle cx='24' cy='26' r='2'/%3E%3Cpath d='M24 19v-4M24 33v4M31 26h4M17 26h-4M29 21l3-3M19 31l-3 3M29 31l3 3M19 21l-3-3'/%3E%3Ccircle cx='92' cy='78' r='7'/%3E%3Ccircle cx='92' cy='78' r='2'/%3E%3Cpath d='M92 71v-4M92 85v4M99 78h4M85 78h-4M97 73l3-3M87 83l-3 3M97 83l3 3M87 73l-3-3'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 150px 150px;
}
.brand-mark {
  border: 0;
  background: rgba(255,255,255,.94);
  color: var(--brand-deep);
  box-shadow: 0 4px 12px rgba(180,110,20,.18);
}
.header-title { color: #fff; text-shadow: 0 1px 2px rgba(180,110,20,.25); }
.header-bell, .header-avatar { background: rgba(255,255,255,.22); border-color: rgba(255,255,255,.72); }
.store-pill { background: rgba(255,255,255,.94); border: 0; color: var(--ink); box-shadow: var(--shadow-s); }
.store-pill .pill-icon { color: var(--brand); }
.hero-band {
  margin: 6px -16px -40px;
  min-height: 128px;
  padding: 10px 26px 52px;
  justify-content: center;
  overflow: visible;
}
.hero-band::before { display: none; }
.hero-banner {
  margin-left: 0;
  padding: 10px 30px 12px;
  background: rgba(255,255,255,.94);
  border: 0;
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.hero-banner::before { display: none; }
.hero-brush { color: var(--ink); }
.hero-banner small { color: var(--gold-deep); }
.hero-mascot { display: block; filter: drop-shadow(0 6px 10px rgba(180,110,20,.18)); }
.hero-sakura { display: block; }
.hero-band::after { display: none; }
#view-root { padding-top: 24px; }
body:not([data-view="home"]) #view-root { padding-top: 18px; }
.section-head h2 { color: var(--ink); letter-spacing: 0; }
.eyebrow { color: var(--gold-deep); }
.text-btn { color: var(--brand); }
.card, .entry-card, .member-card {
  border: 0;
  box-shadow: var(--shadow-s);
}
.card { background: var(--card); }
.entry-card {
  min-height: 112px;
  padding: 16px 14px 12px;
  background: linear-gradient(145deg, #fff, #fffaf1);
  border-radius: var(--radius);
  box-shadow: var(--shadow-s);
}
.entry-card::before { display: none; }
.entry-card:active { transform: scale(.97); box-shadow: var(--shadow-s); }
.entry-card svg { color: var(--brand); }
.entry-card svg.mint { color: var(--mint); }
.entry-card b { color: var(--ink); }
.entry-card i { color: var(--gold-deep); }
.store-card, .list, .dist-card { border: 0; }
.store-card-head b, .card-head h3, .list b { color: var(--ink); }
.muted, .list small, .rate-cell span, .rate-cell small { color: var(--ink-2); }
.store-meta .tag { background: var(--bg); }
.stat-strip { background: var(--card); }
.strip-item strong { color: var(--ink); }
.strip-item span { color: var(--ink-2); }
.profile-band {
  border: 0;
  background: var(--header-grad);
  box-shadow: var(--shadow);
}
.profile-band-text b { color: #fff; }
.profile-band-text small { color: rgba(255,255,255,.85); }
.rank-badge { background: transparent !important; }
.rank-badge img { filter: drop-shadow(0 7px 5px rgba(83,46,18,.2)); }
.stat-hero { background: var(--card); }
.tier-head { background: linear-gradient(105deg, rgba(255,250,239,.94), rgba(255,246,224,.62)); border-color: rgba(215,170,93,.24); }
.tier-title b { color: var(--ink); }
.tier-title small, .tm-label { color: var(--ink-2); }
.tm-bar { background: #f2e7d0; }
.tier-guide { background: var(--brand-wash); color: var(--ink-2); }
.tier-seq b { background: var(--brand); }
.tier-seq b.oldest { background: var(--brand-deep); }
.tier-budget-wrap { border-color: var(--line); }
#lb-card { background: var(--card); border: 0; box-shadow: var(--shadow-s); }
.lb-head { color: var(--ink-3); border-bottom-color: var(--line); }
.lb-row { border-top-color: var(--line); }
.lb-row:hover { background: #fffaf1; }
.lb-row.me { background: var(--brand-wash); border-color: transparent; }
.lb-name b, .lb-avg { color: var(--ink); }
.lb-name small, .lb-tier { color: var(--ink-2); }
.me-rank-bar { background: linear-gradient(110deg, #b97429, #e4a34a); box-shadow: 0 10px 24px rgba(151,85,24,.22); border: 0; }
.member-card { background: var(--header-grad); }
.member-info b { color: #fff; }
.member-info small { color: rgba(255,255,255,.85); }
.member-tag { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.45); color: #fff; }
.menu { background: var(--card); }
.menu button { border-bottom-color: var(--line); }
.menu button b { color: var(--ink); }
.menu button small { color: var(--ink-2); }
.menu-highlight { background: var(--brand-wash); }
.menu-danger b { color: #c43e37 !important; }
.foot-note { color: var(--ink-3); }
.tabbar {
  background: rgba(255,255,255,.96);
  border: 0;
  box-shadow: 0 -4px 16px rgba(140,96,30,.12);
}
.tab { color: var(--ink-3); }
.tab.active { color: var(--brand); }
.tab.active::before { background: var(--brand); box-shadow: 0 0 0 4px rgba(240,140,28,.12); }
.panel { background: var(--bg); }
.panel-header { background: var(--header-grad); border-bottom-color: transparent; }
.panel-header h2, .back-btn { color: #fff; }
.panel-tag { background: rgba(255,255,255,.18); color: #fff; border-color: rgba(255,255,255,.45); }
.panel-body > .card, .panel-body .card { background: var(--card); }
.sheet-backdrop { background: rgba(61,46,30,.45); backdrop-filter: none; }
.sheet { background: var(--card); border-top: 0; box-shadow: 0 -12px 30px rgba(100,65,25,.18); }
.sheet h2, .sheet label { color: var(--ink); }
.sheet-close { background: var(--bg); color: var(--ink-2); }
.sheet label input, #score-query input, .manual-row input { background: var(--bg); border: 0; color: var(--ink); }
.primary-btn { background: var(--btn-grad); box-shadow: 0 6px 14px rgba(240,140,28,.28); }
.outline-btn { border-color: var(--brand-pale); color: var(--brand-deep); }
.tier-row { background: linear-gradient(90deg, #fffaf0, #fffdf9); border-color: rgba(215,170,93,.12); }
.tier-row.current { background: linear-gradient(90deg, #fff0ce, #fffaf1); border-color: rgba(213,148,37,.42); }
.tier-row-main b { color: var(--ink); }
.tier-row-main small { color: var(--ink-2); }
.session-pill { background: linear-gradient(135deg, #4fa8d8, #2c7da8); box-shadow: 0 6px 16px rgba(44,125,168,.35); }
.toast { background: rgba(61,46,30,.92); border: 0; }
.pc-gate { background: linear-gradient(160deg, #fff7ec, #fbe8cb); }
.pc-gate-card { background: #fff; border: 0; }
.pc-gate-card h1 { color: var(--ink); }
.pc-gate-card p, .pc-gate-card small { color: var(--ink-2); }

@media (max-width: 520px) {
  .hero-band { min-height: 128px; padding-left: 26px; padding-right: 26px; }
  .hero-banner { margin-left: 0; }
  .hero-mascot { width: 112px; height: 108px; }
}

/* ---------- 雀庄首页精修：突出开局，保留轻快的原始气质 ---------- */
.hero-band { align-items: center; }
.hero-banner {
  min-width: 188px;
  padding: 11px 17px 12px;
  transform: rotate(-1.5deg);
}
.hero-kicker {
  display: block;
  margin-bottom: 3px;
  color: var(--gold-deep);
  font-size: .59rem;
  font-weight: 800;
  letter-spacing: 2px;
}
.hero-brush {
  font-size: 1.68rem;
  line-height: 1.18;
  letter-spacing: 3px;
}
.hero-banner small {
  margin-top: 5px;
  font-size: .48rem;
  letter-spacing: 1px;
  white-space: nowrap;
}
.hero-mascot { margin-left: -5px; }
.entry-card {
  min-height: 119px;
  justify-content: flex-start;
}
.entry-card:first-child {
  background: linear-gradient(145deg, #f6a33d, #ed7d15);
  color: #fff;
  box-shadow: 0 8px 18px rgba(225, 125, 20, .22);
}
.entry-card:first-child svg,
.entry-card:first-child b,
.entry-card:first-child i,
.entry-card:first-child .entry-note { color: #fff; }
.entry-card:nth-child(3), .entry-card:nth-child(4) { min-height: 105px; }
.entry-card .entry-note {
  display: block;
  margin-top: 5px;
  color: var(--ink-2);
  font-size: .65rem;
  line-height: 1.35;
}
.entry-card:first-child .entry-note { color: rgba(255,255,255,.9); }
.entry-card i { font-size: .58rem; }
.store-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(110deg, #fffdf8, #fff7e9);
}
.store-card::after {
  content: '雀';
  position: absolute;
  right: 14px;
  bottom: -15px;
  color: rgba(240,140,28,.08);
  font: 4.3rem 'Ma Shan Zheng', serif;
  pointer-events: none;
}
.section-head { min-height: 28px; }
.section-head h2 { letter-spacing: .02em; }
.stat-strip { border: 1px solid rgba(240, 195, 121, .42); }
.strip-item + .strip-item { border-left: 1px solid var(--line); }
.strip-item strong { color: var(--brand-deep); }
.list { border: 1px solid rgba(240, 195, 121, .34); }
.tabbar { min-height: 64px; }
.tab { min-height: 48px; justify-content: center; }
.tab.active::before { transition: transform .2s ease, opacity .2s ease; }

@media (max-width: 520px) {
  .hero-band { padding-left: 18px; padding-right: 18px; }
  .hero-banner { min-width: 177px; padding-left: 14px; padding-right: 14px; }
  .hero-brush { font-size: 1.5rem; letter-spacing: 2px; }
  .hero-banner small { font-size: .43rem; letter-spacing: .6px; }
  .hero-mascot { width: 106px; height: 104px; margin-left: -2px; }
}
/* ---------- 排行榜精修：段位徽章是主视觉，个人排行条只在有数据时出现 ---------- */
#lb-body.lb-mode-tier .lb-head,
#lb-body.lb-mode-tier .lb-row { grid-template-columns: 36px 60px minmax(0, 1fr) 52px 66px; }
#lb-body.lb-mode-tier .lb-row { min-height: 82px; padding-top: 11px; padding-bottom: 11px; }
.lb-row .tier-badge { position: relative; width: 60px; height: 60px; border-radius: 50%; border: 0; overflow: visible; isolation: isolate; }
.lb-row .tier-badge::before { display: none; }
.lb-row .tier-badge img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 5px rgba(105,63,23,.25)); }
.lb-row.me .tier-badge::before { display: none; }
.lb-rank { width: 34px; height: 34px; font-size: .875rem; }
.me-rank-bar { min-height: 50px; bottom: calc(76px + env(safe-area-inset-bottom)); padding: 8px 14px; border: 1px solid rgba(255,235,190,.72); background: linear-gradient(105deg, #b76524, #e3a34d 70%, #f0c477); box-shadow: 0 8px 20px rgba(144,81,20,.28); }
.me-rank-bar[hidden] { display: none !important; }
.me-rank-label { color: rgba(255,247,224,.82); font-size: .625rem; letter-spacing: .12em; writing-mode: vertical-rl; line-height: 1; }
.me-rank-bar b { color: #fff; font-size: .9375rem; white-space: nowrap; }
.me-rank-name { max-width: 82px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff8e8; font-weight: 700; }
.me-rank-value { margin-left: auto; color: #fff7e2; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.me-rank-bar .tier-badge { width: 44px; height: 44px; border-radius: 50%; }
.me-rank-bar .tier-badge::before { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: rgba(255,255,255,.22); }
.me-rank-bar .tier-badge img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; }
#view-leaderboard.has-me-bar { padding-bottom: 66px; }
@media (max-width: 359px) {
  #lb-body.lb-mode-tier .lb-head, #lb-body.lb-mode-tier .lb-row { grid-template-columns: 28px 50px minmax(0,1fr) 48px 56px; gap: 5px; }
  .lb-row .tier-badge { width: 50px; height: 50px; }
  .lb-row { min-height: 70px; }
  .me-rank-name { display: none; }
  .me-rank-value { font-size: .625rem; }
}

/* 战绩页：当前段位作为视觉主体，避免重复徽章与厚重圆环 */
#rec-hero .tier-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 14px;
  padding: 18px 16px 16px;
}
#rec-hero .tier-head > .tier-badge {
  grid-column: 1 / -1;
  justify-self: center;
  width: 108px !important;
  height: 108px !important;
  margin: -2px 0 0;
}
#rec-hero .tier-head > .tier-badge,
#rec-hero .tier-head > .tier-badge::before {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
#rec-hero .tier-head > .tier-badge::before { display: none !important; }
#rec-hero .tier-head > .tier-badge img {
  filter: drop-shadow(0 7px 5px rgba(105,63,23,.24));
}
#rec-hero .tier-head .tier-title { grid-column: 1; min-width: 0; }
#rec-hero .tier-head > .text-btn {
  grid-column: 2;
  grid-row: 2;
  align-self: center;
  white-space: nowrap;
}
#sheet-tiers .tier-row {
  min-height: 76px;
  gap: 14px;
}
#sheet-tiers .tier-row .tier-badge {
  width: 56px !important;
  height: 56px !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
#sheet-tiers .tier-row .tier-badge::before { display: none !important; }

/* ---------- 段位全息闪卡：色谱跟随段位徽章组别 ---------- */
#rec-hero.stat-hero {
  --holo-deep: #9f7342;
  --holo-main: #f4dcae;
  --holo-light: #fff9e9;
  --holo-accent: #d89a45;
  background: linear-gradient(145deg, var(--holo-light), var(--holo-main));
  border: 1px solid color-mix(in srgb, var(--holo-accent) 30%, transparent);
  box-shadow: 0 14px 30px color-mix(in srgb, var(--holo-deep) 13%, transparent), inset 0 1px rgba(255,255,255,.95);
  overflow: hidden;
}
#rec-hero:has(.tier-card-grade) {
  --holo-deep: #477eaa;
  --holo-main: #c5e7ef;
  --holo-light: #f4fcff;
  --holo-accent: #63b7ca;
}
#rec-hero:has(.tier-card-dan) {
  --holo-deep: #a66b20;
  --holo-main: #f2d390;
  --holo-light: #fff9e9;
  --holo-accent: #e2a72c;
}
#rec-hero:has(.tier-card-high-dan) {
  --holo-deep: #9b3e35;
  --holo-main: #f0b1a0;
  --holo-light: #fff5ee;
  --holo-accent: #d36c69;
}
#rec-hero .tier-card { position: relative; z-index: 0; }
#rec-hero .tier-head {
  position: relative;
  isolation: isolate;
  min-height: 218px;
  margin: -6px -6px 16px;
  padding: 15px 16px 17px;
  border: 1px solid color-mix(in srgb, var(--holo-accent) 43%, #fff 35%);
  border-radius: 23px;
  background:
    linear-gradient(122deg, rgba(255,255,255,.76), transparent 29%, rgba(255,255,255,.28) 50%, transparent 72%),
    linear-gradient(148deg, color-mix(in srgb, var(--holo-light) 92%, white), color-mix(in srgb, var(--holo-main) 76%, white));
  box-shadow: inset 0 1px rgba(255,255,255,.95), inset 0 -12px 26px color-mix(in srgb, var(--holo-accent) 11%, transparent), 0 12px 24px color-mix(in srgb, var(--holo-deep) 13%, transparent);
  overflow: hidden;
}
#rec-hero .tier-head::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: -45% -28%;
  pointer-events: none;
  opacity: .55;
  transform: rotate(-18deg);
  background: repeating-linear-gradient(112deg, transparent 0 26px, rgba(255,255,255,.48) 27px 29px, transparent 30px 68px);
  mix-blend-mode: screen;
  animation: holo-sweep 8s ease-in-out infinite;
}
#rec-hero .tier-head::after {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 9px;
  height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--holo-accent) 55%, transparent), transparent);
}
#rec-hero .tier-head > .tier-badge {
  filter: drop-shadow(0 9px 5px color-mix(in srgb, var(--holo-deep) 25%, transparent));
}
#rec-hero .tier-head .tier-title b { color: color-mix(in srgb, var(--holo-deep) 78%, #2f261e); }
#rec-hero .tier-head .tier-title small { color: color-mix(in srgb, var(--holo-deep) 72%, #8b7259); }
#rec-hero .tier-head .tier-group {
  color: color-mix(in srgb, var(--holo-deep) 85%, #2b211b);
  background: color-mix(in srgb, var(--holo-accent) 28%, white);
  border: 1px solid color-mix(in srgb, var(--holo-accent) 35%, transparent);
}
#rec-hero .tier-head > .text-btn {
  position: relative;
  z-index: 1;
  color: color-mix(in srgb, var(--holo-deep) 92%, #8b4b18);
  font-weight: 800;
}
#rec-hero .tier-bars { position: relative; z-index: 1; }
#rec-hero .tm-bar { background: color-mix(in srgb, var(--holo-accent) 12%, white); }
#rec-hero .tm-bar i { box-shadow: 0 0 8px color-mix(in srgb, var(--holo-accent) 32%, transparent); }
#rec-hero .hero-cols {
  position: relative;
  margin: 0 -4px -4px;
  padding: 11px 5px 1px;
  border-top: 1px solid color-mix(in srgb, var(--holo-accent) 24%, transparent);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--holo-accent) 8%, transparent), transparent);
}
#rec-hero .hero-col strong { color: color-mix(in srgb, var(--holo-deep) 88%, #5b3717); }
#rec-hero .hero-col span { color: color-mix(in srgb, var(--holo-deep) 64%, #9a8064); }

@keyframes holo-sweep {
  0%, 30% { transform: translateX(-8%) rotate(-18deg); opacity: .25; }
  58%, 74% { transform: translateX(8%) rotate(-18deg); opacity: .62; }
  100% { transform: translateX(18%) rotate(-18deg); opacity: .25; }
}

/* 段位一览同步使用轻量全息材质，当前段位增加浮起层次 */
#sheet-tiers .tier-row {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-width: 1px;
  border-color: color-mix(in srgb, var(--row-accent, #c9a063) 28%, transparent);
  background: linear-gradient(105deg, var(--row-light, #fffdf8), var(--row-main, #f5e7cb));
  box-shadow: inset 0 1px rgba(255,255,255,.8), 0 3px 10px color-mix(in srgb, var(--row-deep, #9f7342) 8%, transparent);
}
#sheet-tiers .tier-row::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: -60% -20%;
  transform: rotate(-18deg);
  pointer-events: none;
  background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.65) 49%, transparent 58%);
  opacity: .6;
}
#sheet-tiers .tier-row.g-grade { --row-deep: #477eaa; --row-main: #d9f0f4; --row-light: #f7fdff; --row-accent: #63b7ca; }
#sheet-tiers .tier-row.g-dan { --row-deep: #a66b20; --row-main: #f8e4ac; --row-light: #fffaf0; --row-accent: #e2a72c; }
#sheet-tiers .tier-row.g-highdan { --row-deep: #9b3e35; --row-main: #f4c7b7; --row-light: #fff7f1; --row-accent: #d36c69; }
#sheet-tiers .tier-row.g-novice { --row-deep: #8d765c; --row-main: #efe5d6; --row-light: #fffdf9; --row-accent: #c9a063; }
#sheet-tiers .tier-row > * { position: relative; z-index: 1; }
#sheet-tiers .tier-row.current {
  border-color: color-mix(in srgb, var(--row-accent) 72%, #fff 8%);
  box-shadow: inset 0 1px rgba(255,255,255,.9), 0 7px 18px color-mix(in srgb, var(--row-deep) 18%, transparent);
  transform: translateY(-1px);
}
#sheet-tiers .tier-row .t-cur { background: color-mix(in srgb, var(--row-deep) 82%, var(--row-accent)); }
#sheet-tiers .tier-row .tier-row-main b { color: color-mix(in srgb, var(--row-deep) 85%, #31251d); }
#sheet-tiers .tier-row .tier-row-main small { color: color-mix(in srgb, var(--row-deep) 65%, #8b7259); }

@media (prefers-reduced-motion: reduce) {
  #rec-hero .tier-head::before { animation: none; }
}

@media (max-width: 359px) {
  #rec-hero .tier-head { min-height: 210px; padding-left: 12px; padding-right: 12px; }
  #rec-hero .tier-head > .tier-badge { width: 96px !important; height: 96px !important; }
}

/* 主段位徽章：悬浮伪 3D、柔和辉光与金属扫光 */
#rec-hero .tier-head > .tier-badge {
  position: relative;
  transform-style: preserve-3d;
  will-change: transform, filter;
  animation: tier-badge-float 5.8s ease-in-out infinite;
  filter: drop-shadow(0 12px 7px color-mix(in srgb, var(--holo-deep) 28%, transparent));
}
#rec-hero .tier-head > .tier-badge::after {
  content: '';
  position: absolute;
  z-index: -1;
  left: 15%;
  right: 15%;
  bottom: 2%;
  height: 29%;
  border-radius: 50%;
  background: radial-gradient(ellipse, color-mix(in srgb, var(--holo-accent) 42%, white) 0%, transparent 72%);
  filter: blur(9px);
  opacity: .72;
  transform: translateZ(-12px) scaleX(1.08);
  animation: tier-badge-aura 4.6s ease-in-out infinite;
}
#rec-hero .tier-head > .tier-badge::before {
  content: '';
  position: absolute;
  z-index: 2;
  inset: 3%;
  display: block !important;
  pointer-events: none;
  border-radius: 38%;
  background: linear-gradient(125deg, transparent 25%, rgba(255,255,255,.72) 43%, transparent 57%);
  mix-blend-mode: screen;
  opacity: 0;
  transform: translateX(-125%) skewX(-15deg);
  animation: tier-badge-glint 6.8s ease-in-out infinite;
}
#rec-hero .tier-head > .tier-badge img {
  position: relative;
  z-index: 1;
  transform: translateZ(10px);
  transform-origin: 50% 76%;
  filter: drop-shadow(0 8px 4px color-mix(in srgb, var(--holo-deep) 31%, transparent)) saturate(1.06) contrast(1.03);
  animation: tier-badge-sheen 5.8s ease-in-out infinite;
}
@keyframes tier-badge-float {
  0%, 100% { transform: translate3d(0, 1px, 0) rotateX(0deg) rotateY(-1deg); }
  28% { transform: translate3d(-1px, -5px, 8px) rotateX(2deg) rotateY(2deg); }
  62% { transform: translate3d(1px, -7px, 12px) rotateX(-1deg) rotateY(-2deg); }
}
@keyframes tier-badge-aura {
  0%, 100% { opacity: .42; transform: translateZ(-12px) scaleX(.92); }
  50% { opacity: .9; transform: translateZ(-12px) scaleX(1.14); }
}
@keyframes tier-badge-glint {
  0%, 37% { opacity: 0; transform: translateX(-125%) skewX(-15deg); }
  49% { opacity: .78; }
  62%, 100% { opacity: 0; transform: translateX(125%) skewX(-15deg); }
}
@keyframes tier-badge-sheen {
  0%, 100% { filter: drop-shadow(0 8px 4px color-mix(in srgb, var(--holo-deep) 31%, transparent)) saturate(1.04) contrast(1.02); }
  50% { filter: drop-shadow(0 11px 6px color-mix(in srgb, var(--holo-deep) 38%, transparent)) saturate(1.12) contrast(1.06) brightness(1.04); }
}

@media (prefers-reduced-motion: reduce) {
  #rec-hero .tier-head > .tier-badge,
  #rec-hero .tier-head > .tier-badge::before,
  #rec-hero .tier-head > .tier-badge::after,
  #rec-hero .tier-head > .tier-badge img { animation: none; }
}

/* ---------- 升段庆祝：徽章聚光、金属扫光与轻量粒子 ---------- */
.rank-promotion-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(45, 25, 12, .68);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s ease, visibility .28s ease;
}
.rank-promotion-backdrop.open { opacity: 1; visibility: visible; }
.rank-promotion-card {
  position: relative;
  width: min(100%, 360px);
  min-height: 500px;
  overflow: hidden;
  isolation: isolate;
  padding: 30px 24px 24px;
  border: 1px solid rgba(255, 232, 174, .86);
  border-radius: 30px;
  background:
    radial-gradient(circle at 50% 24%, rgba(255, 252, 222, .98) 0 13%, transparent 37%),
    linear-gradient(145deg, #fff9e7 0%, #f6d48c 54%, #b8662b 100%);
  box-shadow: 0 24px 70px rgba(28, 13, 4, .42), inset 0 1px rgba(255,255,255,.95), inset 0 -18px 42px rgba(122, 51, 12, .18);
  text-align: center;
  transform: translateY(22px) scale(.94);
  transition: transform .46s cubic-bezier(.22, 1.35, .36, 1);
}
.rank-promotion-backdrop.open .rank-promotion-card { transform: translateY(0) scale(1); }
.rank-promotion-card::before,
.rank-promotion-card::after {
  content: '';
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 36%;
  width: 390px;
  height: 390px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.rank-promotion-card::before { border: 1px solid rgba(255,255,255,.56); box-shadow: 0 0 0 14px rgba(255,255,255,.08), 0 0 0 29px rgba(255,255,255,.06); }
.rank-promotion-card::after { background: repeating-conic-gradient(from 4deg, rgba(255,255,255,.28) 0 2deg, transparent 2deg 16deg); mask-image: radial-gradient(circle, #000 0 32%, transparent 72%); animation: promotion-rays 18s linear infinite; }
.promotion-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.24);
  color: #744522;
  font-size: 1.6rem;
  line-height: 1;
}
.promotion-kicker { display: block; color: #966321; font-size: .625rem; font-weight: 900; letter-spacing: .28em; }
.promotion-seal { display: grid; place-items: center; width: 42px; height: 42px; margin: 17px auto -8px; border: 1px solid rgba(167, 73, 29, .48); border-radius: 50%; color: #a24a25; font-family: 'Ma Shan Zheng', serif; font-size: 1.45rem; transform: rotate(-10deg); box-shadow: inset 0 0 0 4px rgba(255,255,255,.22); }
.promotion-badge-wrap { position: relative; width: 190px; height: 190px; margin: 4px auto 2px; display: grid; place-items: center; animation: promotion-badge-float 4.8s 1s ease-in-out infinite; }
.promotion-halo { position: absolute; inset: 19px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.8) 0 18%, rgba(255,231,139,.7) 37%, transparent 72%); filter: blur(8px); animation: promotion-breathe 3.8s ease-in-out infinite; }
.promotion-badge { position: relative; z-index: 1; width: 174px; height: 174px; object-fit: contain; filter: drop-shadow(0 17px 8px rgba(104, 51, 17, .3)) saturate(1.08); animation: promotion-badge-in .8s .12s both cubic-bezier(.22, 1.25, .36, 1); }
.promotion-greeting { margin: 7px 0 2px; color: #a26726; font-family: 'Ma Shan Zheng', serif; font-size: 1.15rem; }
#rank-promotion-title { margin: 0; color: #5f321e; font-family: 'Noto Serif SC', serif; font-size: 1.72rem; font-weight: 900; letter-spacing: .06em; }
#rank-promotion-message { min-height: 40px; margin: 9px auto 17px; color: #7e5838; font-size: .78rem; line-height: 1.7; }
.promotion-confirm { position: relative; z-index: 2; min-height: 46px; padding: 10px 28px; border: 1px solid rgba(255,255,255,.64); background: linear-gradient(135deg, #b95028, #d88d35); box-shadow: 0 9px 19px rgba(133, 58, 21, .26); }
.promotion-sparkles { position: absolute; inset: 0; pointer-events: none; }
.promotion-sparkles i { position: absolute; left: 50%; top: 38%; width: 7px; height: 7px; border-radius: 2px; background: #fff8c9; box-shadow: 0 0 12px 3px rgba(255,246,180,.72); opacity: 0; transform: rotate(calc(var(--spark-index) * 30deg)) translateY(-112px) scale(.2); animation: promotion-spark 2.2s calc(var(--spark-index) * .07s) ease-out infinite; }
@keyframes promotion-badge-in { from { opacity: 0; transform: scale(.55) rotate(-14deg); } to { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes promotion-badge-float { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-7px) rotate(1deg); } }
@keyframes promotion-breathe { 0%, 100% { opacity: .45; transform: scale(.84); } 50% { opacity: .9; transform: scale(1.08); } }
@keyframes promotion-rays { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes promotion-spark { 0% { opacity: 0; transform: rotate(calc(var(--spark-index) * 30deg)) translateY(-26px) scale(.2); } 20% { opacity: 1; } 100% { opacity: 0; transform: rotate(calc(var(--spark-index) * 30deg)) translateY(-148px) scale(1); } }
html.player-desktop .rank-promotion-backdrop { display: none; }
@media (max-width: 380px) { .rank-promotion-card { min-height: 470px; padding-left: 18px; padding-right: 18px; } .promotion-badge-wrap { width: 170px; height: 170px; } .promotion-badge { width: 156px; height: 156px; } }
@media (prefers-reduced-motion: reduce) {
  .rank-promotion-card::after, .promotion-halo, .promotion-badge-wrap, .promotion-badge, .promotion-sparkles i { animation: none; }
  .promotion-badge { opacity: 1; transform: none; }
}

/* 排行榜列语义：排名奖牌 / 用户头像 / 玩家 / 段位图 / Rate */
#lb-body.lb-mode-tier .lb-head,
#lb-body.lb-mode-tier .lb-row { grid-template-columns: 42px 42px minmax(0,1fr) 70px 62px; }
#lb-body.lb-mode-tier .lb-head span:nth-child(2) { font-size: 0; }
#lb-body.lb-mode-tier .lb-head span:nth-child(2)::after { content: '头像'; font-size: .6875rem; }
.lb-avatar {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(145deg, #fff4dc, #f2c77e);
  border: 2px solid rgba(255,255,255,.9);
  color: var(--brand-deep);
  font-size: .875rem;
  font-weight: 800;
  box-shadow: 0 3px 9px rgba(170,114,35,.2);
}
.lb-avatar.avatar-img { background-size: cover; background-position: center; }
.lb-games { display: block; margin-top: 2px; color: var(--ink-3); font-size: .7rem; font-weight: 600; letter-spacing: .03em; }
.lb-tier { display: flex; align-items: center; justify-content: center; min-width: 0; }
.lb-tier .tier-badge,
.lb-tier .tier-badge.lb-tier-badge {
  width: 64px;
  height: 64px;
  border-radius: 0;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  filter: none;
}
.lb-tier .tier-badge::before { display: none !important; }
.lb-tier .tier-badge img { filter: drop-shadow(0 4px 3px rgba(105,63,23,.22)); }
.lb-rank.m1, .lb-rank.m2, .lb-rank.m3 {
  position: relative;
  z-index: 0;
  font-family: 'Noto Serif SC', serif;
  font-weight: 900;
  border: 1px solid rgba(255,255,255,.72);
}
.lb-rank.m1::before, .lb-rank.m2::before, .lb-rank.m3::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -12px;
  width: 27px;
  height: 17px;
  transform: translateX(-50%);
  clip-path: polygon(0 100%, 0 25%, 25% 47%, 50% 0, 75% 47%, 100% 25%, 100% 100%);
  border-radius: 2px 2px 5px 5px;
  border: 1px solid rgba(255,255,255,.6);
  z-index: 0;
}
.lb-rank.m1::before { background: linear-gradient(135deg, #ffe996, #e69a10); }
.lb-rank.m2::before { background: linear-gradient(135deg, #fff, #aebbc8); }
.lb-rank.m3::before { background: linear-gradient(135deg, #f6c69e, #bc6e42); }
.lb-rank.m1 { background: linear-gradient(145deg, #ffe17a, #f2aa1f); color: #845100; }
.lb-rank.m2 { background: linear-gradient(145deg, #f2f4f7, #b9c3cf); color: #566675; }
.lb-rank.m3 { background: linear-gradient(145deg, #f3c19b, #ce8151); color: #743914; }
.lb-rank:not(.m1):not(.m2):not(.m3) { font-size: .8125rem; }
@media (max-width: 359px) {
  #lb-body.lb-mode-tier .lb-head, #lb-body.lb-mode-tier .lb-row { grid-template-columns: 30px 38px minmax(0,1fr) 56px 56px; gap: 5px; }
  .lb-avatar { width: 36px; height: 36px; }
  .lb-tier .tier-badge, .lb-tier .tier-badge.lb-tier-badge { width: 54px; height: 54px; }
}
