/* ============================================================
   入卷 · 设计系统 v1（2026-09）
   方向：Raycast 系深色产品界面。冷黑底 + 一束余烬光做唯一品牌强调；
   Inter / 系统无衬线，紧字距大字重；语义四色（探索青 / 战斗玫红 / 成功绿 / 告警琥珀）
   + 六枚玩家专属色；填充卡片 + 投影 + 12/16 圆角；发丝线只做分隔。
   母题：篝火余烬（同桌那束光）。
   ============================================================ */
@import url('/static/assets/fonts/fonts.css');

:root {
  /* 底与面 */
  --bg: #0a0b0f; --bg-1: #0f1116; --bg-2: #14171d; --bg-3: #1a1e26; --bg-4: #222731; --bg-5: #2b313d;
  /* 字 */
  --fg: #f4f5f7; --fg-2: #b7bcc5; --fg-3: #7f8691; --fg-4: #525966;
  /* 线 */
  --line: rgba(255,255,255,.07); --line-2: rgba(255,255,255,.12); --line-3: rgba(255,255,255,.2);
  /* 品牌：余烬 */
  --ember: #ff6a3d; --ember-2: #ff3d5a; --ember-3: #ffa06a;
  --ember-soft: rgba(255,106,61,.14); --ember-line: rgba(255,106,61,.38); --ember-glow: rgba(255,106,61,.55);
  /* 语义 */
  --teal: #3ccfcf; --teal-soft: rgba(60,207,207,.12);
  --rose: #ff4d6d; --rose-soft: rgba(255,77,109,.12);
  --green: #4ade80; --green-soft: rgba(74,222,128,.12);
  --amber: #ffb547; --amber-soft: rgba(255,181,71,.12);
  --violet: #a78bfa; --violet-soft: rgba(167,139,250,.12);
  --gold: #ffd166; --gold-soft: rgba(255,209,102,.14);
  --sky: #4cc3ff; --sky-soft: rgba(76,195,255,.12);
  /* 玩家专属色（avatar.js 按 user_id 哈希分配） */
  --p1: #ff6a3d; --p2: #4cc3ff; --p3: #a3e635; --p4: #b48cff; --p5: #ff7ab6; --p6: #ffb547;
  /* 圆角与阴影 */
  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 22px;
  --shadow-1: 0 1px 0 rgba(255,255,255,.035) inset, 0 10px 30px -14px rgba(0,0,0,.7);
  --shadow-2: 0 1px 0 rgba(255,255,255,.05) inset, 0 24px 60px -24px rgba(0,0,0,.8);
  --shadow-pop: 0 1px 0 rgba(255,255,255,.06) inset, 0 40px 90px -30px rgba(0,0,0,.9);
  /* 字体 */
  --sans: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", system-ui, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  /* 字号阶梯（七档） */
  --t-xs: 11.5px; --t-sm: 13px; --t-base: 15px; --t-md: 17px; --t-lg: 20px; --t-xl: 26px; --t-2xl: 34px;
  /* 动效 */
  --ease: cubic-bezier(.2,.7,.2,1);
  --spring: linear(0 0%, .0143 1.3%, .0576 2.7%, .1287 4.2%, .2251 5.8%, .3438 7.6%, .481 9.5%, .6309 11.6%, .7868 13.9%, .9407 16.3%, 1.0836 18.9%, 1.2059 21.6%, 1.2983 24.3%, 1.3543 27.1%, 1.3695 29.9%, 1.3437 32.7%, 1.2809 35.5%, 1.1882 38.3%, 1.0757 41.1%, .9552 43.9%, .8388 46.7%, .7375 49.5%, .6594 52.3%, .6096 55.1%, .5901 57.9%, .6001 60.7%, .6362 63.5%, .6928 66.3%, .7629 69.1%, .8393 71.9%, .9152 74.7%, .9848 77.5%, 1.0435 80.3%, 1.0882 83.1%, 1.1172 85.9%, 1.1305 88.7%, 1.1293 91.5%, 1.1156 94.3%, 1.0926 97.1%, 1.0636 100%);
  --spring-soft: linear(0 0%, .0201 2%, .0785 4%, .1697 6%, .2861 8%, .4193 10%, .5605 12%, .7013 14%, .8339 16%, .9519 18%, 1.0503 20%, 1.1258 22%, 1.1768 24%, 1.2037 26%, 1.2084 28%, 1.1938 30%, 1.1636 32%, 1.1218 34%, 1.0724 36%, 1.0196 38%, .9669 40%, .9174 42%, .8737 44%, .8377 46%, .8107 48%, .7934 50%, .7861 52%, .7883 54%, .7993 56%, .8179 58%, .8425 60%, .8714 62%, .9027 64%, .9346 66%, .9655 68%, .9938 70%, 1.0184 72%, 1.0384 74%, 1.0531 76%, 1.0623 78%, 1.0661 80%, 1.0648 82%, 1.0591 84%, 1.0498 86%, 1.0379 88%, 1.0245 90%, 1.0106 92%, .9973 94%, .9853 96%, .9755 98%, .9683 100%);
  --w: 1200px;
}

/* ---------- reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  background: var(--bg); color: var(--fg);
  font: 400 var(--t-base)/1.6 var(--sans);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
}
/* 页面顶部一束余烬光，全站共用（不遮内容，只让黑不死） */
.bg-glow { position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60% 40% at 50% -8%, rgba(255,106,61,.16), transparent 60%),
    radial-gradient(40% 30% at 85% 0%, rgba(255,61,90,.07), transparent 60%),
    linear-gradient(180deg, transparent, rgba(0,0,0,.35) 100%); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.015em; line-height: 1.2; text-wrap: balance; }
h1 { font-size: var(--t-2xl); } h2 { font-size: var(--t-lg); } h3 { font-size: var(--t-base); } h4 { font-size: var(--t-sm); }
p { margin: 0; }
button { font: inherit; color: inherit; }
code, kbd, .mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
::selection { background: rgba(255,106,61,.35); }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- 文本 ---------- */
.eyebrow { font: 500 12px/1 var(--mono); letter-spacing: .06em; color: var(--fg-3); text-transform: uppercase; }
.eyebrow.ember { color: var(--ember); }
.lede { color: var(--fg-2); font-size: var(--t-base); line-height: 1.7; max-width: 60ch; }
.dim { color: var(--fg-3); }
.muted { color: var(--fg-3); }
.small { font-size: var(--t-sm); }
.tiny { font-size: var(--t-xs); }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 7px;
  border-radius: 999px; background: var(--bg-3); color: var(--fg-2); font: 600 12px/1 var(--mono); margin-left: 8px; vertical-align: 3px; }
.count.ember { background: var(--ember-soft); color: var(--ember); }

/* ---------- 容器 ---------- */
.wrap { width: min(var(--w), 100%); margin: 0 auto; padding: 0 clamp(16px, 3vw, 32px); position: relative; z-index: 1; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 34px 0 22px; }
.page-head h1 { font-size: clamp(26px, 3vw, 34px); margin-top: 8px; }
.page-head .lede { margin-top: 8px; font-size: var(--t-base); }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 30px 0 14px; }
.sec-head h2 { font-size: var(--t-lg); }
.sec-head p { color: var(--fg-3); font-size: var(--t-sm); margin-top: 4px; }
.sec-head .link { color: var(--fg-3); font-size: var(--t-sm); font-weight: 500; }
.sec-head .link:hover { color: var(--fg); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 10px;
  font: 600 14px/1 var(--sans); color: var(--fg);
  background: var(--bg-3); border: 1px solid var(--line-2);
  cursor: pointer; white-space: nowrap; user-select: none; text-decoration: none;
  transition: transform .45s var(--spring-soft), background .2s, border-color .2s, box-shadow .3s, opacity .2s, color .2s;
}
.btn:hover { background: var(--bg-4); border-color: var(--line-3); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.primary {
  background: linear-gradient(135deg, #ff7a4d, #ff4d5f); border-color: transparent; color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.28) inset, 0 12px 28px -12px rgba(255,90,70,.75);
}
.btn.primary:hover { background: linear-gradient(135deg, #ff8a5f, #ff5a6c); box-shadow: 0 1px 0 rgba(255,255,255,.3) inset, 0 16px 34px -12px rgba(255,90,70,.9); }
.btn.light { background: #fff; color: #0d0e11; border-color: transparent;
  box-shadow: 0 1px 0 rgba(255,255,255,.5) inset, 0 12px 30px -12px rgba(255,255,255,.45); }
.btn.light:hover { background: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.5) inset, 0 16px 36px -12px rgba(255,255,255,.6); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--bg-3); }
.btn.quiet { background: transparent; border-color: transparent; color: var(--fg-2); }
.btn.quiet:hover { background: var(--bg-3); color: var(--fg); border-color: transparent; }
.btn.danger { color: var(--rose); border-color: rgba(255,77,109,.3); background: rgba(255,77,109,.06); }
.btn.danger:hover { background: rgba(255,77,109,.14); border-color: rgba(255,77,109,.5); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn.xl { height: 52px; padding: 0 28px; font-size: 16px; border-radius: 14px; }
.btn.icon { width: 38px; padding: 0; }
.btn.icon.sm { width: 32px; }
.btn.block { width: 100%; }
.text-button { border: 0; background: none; color: var(--fg-3); cursor: pointer; font: 500 13.5px var(--sans); padding: 4px 6px; border-radius: 6px; }
.text-button:hover { color: var(--fg); background: var(--bg-3); }
.link-quiet { color: var(--fg-3); font-size: var(--t-sm); font-weight: 500; }
.link-quiet:hover { color: var(--fg); }

/* 分段控件 */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; }
.seg button { height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--fg-3);
  font: 500 13px/1 var(--sans); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  transition: background .2s, color .2s; }
.seg button:hover { color: var(--fg); }
.seg button.active { background: var(--bg-4); color: var(--fg); box-shadow: 0 1px 0 rgba(255,255,255,.05) inset, 0 4px 10px -6px rgba(0,0,0,.6); }
.seg button .count { margin-left: 0; height: 18px; min-width: 18px; font-size: 11px; background: var(--bg-5); }
.seg button.active .count { background: var(--ember-soft); color: var(--ember); }

/* ---------- 表单 ---------- */
input, select, textarea {
  font: 400 var(--t-base)/1.45 var(--sans); color: var(--fg);
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px;
  padding: 9px 12px; width: 100%; outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
input::placeholder, textarea::placeholder { color: var(--fg-4); }
input:hover, select:hover, textarea:hover { border-color: var(--line-3); }
input:focus, textarea:focus, select:focus { border-color: var(--ember-line); box-shadow: 0 0 0 3px var(--ember-soft); background: var(--bg-1); }
input:disabled, textarea:disabled, select:disabled { opacity: .5; cursor: not-allowed; }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237f8691' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; }
select option { background: var(--bg-3); color: var(--fg); }
textarea { resize: vertical; min-height: 88px; }
label.field { display: block; font: 500 12.5px/1 var(--sans); color: var(--fg-3); margin: 16px 0 7px; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }

/* 开关 */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); cursor: pointer; }
.switch-row:first-of-type { border-top: 0; }
.switch-row span { display: flex; flex-direction: column; gap: 3px; }
.switch-row b { font-weight: 600; font-size: var(--t-base); }
.switch-row small { color: var(--fg-3); font-size: var(--t-sm); }
.switch-row input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch { display: inline-block; flex: none; width: 42px; height: 24px; border-radius: 999px; background: var(--bg-4); position: relative; transition: background .25s; border: 1px solid var(--line-2); }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .35s var(--spring-soft); box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.switch-row input:checked + .switch { background: var(--ember); border-color: transparent; }
.switch-row input:checked + .switch::after { transform: translateX(18px); }
.switch-row.loading { opacity: .5; }

/* ---------- 卡片 / 面 ---------- */
.card { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.card.raised { background: var(--bg-2); box-shadow: var(--shadow-2); }
.card.interactive { transition: transform .5s var(--spring-soft), border-color .2s, box-shadow .3s, background .2s; cursor: pointer; }
.card.interactive:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: var(--shadow-2); background: var(--bg-2); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.card-h h3 { font-size: 13.5px; font-weight: 600; letter-spacing: .01em; display: flex; align-items: center; gap: 8px; }
.card-h h3 svg, .card-h h3 .gi { width: 15px; height: 15px; color: var(--fg-3); }
.card-h .spacer { flex: 1; }
.card-b { padding: 14px 16px; }
.panel { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.divider { height: 1px; background: var(--line); margin: 14px 0; }

/* 数据小块 */
.stat-tile { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: var(--r); background: var(--bg-2); border: 1px solid var(--line); min-width: 0; }
.stat-tile span { font-size: var(--t-xs); color: var(--fg-3); font-weight: 500; letter-spacing: .02em; }
.stat-tile b { font: 600 var(--t-lg)/1.1 var(--mono); color: var(--fg); letter-spacing: -.01em; }
.stat-tile b small { font-size: 12px; color: var(--fg-3); font-weight: 500; margin-left: 3px; }
.stat-tile.hp b { color: var(--green); } .stat-tile.hp.wounded b { color: var(--amber); } .stat-tile.hp.critical b { color: var(--rose); }
.stat-tile.accent b { color: var(--ember); }

/* ---------- 标签 / 状态 ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px;
  font: 500 12px/1 var(--sans); color: var(--fg-2); background: var(--bg-3); border: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.chip svg, .chip .gi { width: 12px; height: 12px; }
.chip.sm { height: 20px; padding: 0 7px; font-size: 11px; }
.chip.lg { height: 28px; padding: 0 12px; font-size: 13px; }
.chip.mono { font-family: var(--mono); font-size: 11.5px; }
.chip[data-tone="green"] { color: var(--green); background: var(--green-soft); border-color: rgba(74,222,128,.28); }
.chip[data-tone="teal"]  { color: var(--teal);  background: var(--teal-soft);  border-color: rgba(60,207,207,.28); }
.chip[data-tone="rose"]  { color: var(--rose);  background: var(--rose-soft);  border-color: rgba(255,77,109,.28); }
.chip[data-tone="amber"] { color: var(--amber); background: var(--amber-soft); border-color: rgba(255,181,71,.28); }
.chip[data-tone="violet"]{ color: var(--violet);background: var(--violet-soft);border-color: rgba(167,139,250,.28); }
.chip[data-tone="ember"] { color: var(--ember); background: var(--ember-soft); border-color: var(--ember-line); }
.chip[data-tone="gold"]  { color: var(--gold);  background: var(--gold-soft);  border-color: rgba(255,209,102,.3); }
.chip[data-tone="sky"]   { color: var(--sky);   background: var(--sky-soft);   border-color: rgba(76,195,255,.28); }
.chip[data-tone="grey"]  { color: var(--fg-3); }
.chip.pulse .dot { animation: pulse 1.6s ease-in-out infinite; box-shadow: 0 0 8px currentColor; }

/* 通用在线点 */
.online-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px rgba(74,222,128,.6); flex: none; }
.online-dot.off { background: var(--fg-4); box-shadow: none; }

/* ---------- 头像 ---------- */
.rj-avatar {
  --s: 32px; --ink: var(--fg-4);
  display: inline-grid; place-items: center; flex: none; position: relative;
  width: var(--s); height: var(--s); border-radius: 50%; overflow: hidden;
  background: var(--bg-3); vertical-align: middle; user-select: none; color: #fff;
  box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--ink) 55%, transparent);
}
.rj-avatar img { width: 100%; height: 100%; object-fit: cover; }
.rj-avatar.glyph { background: color-mix(in srgb, var(--ink) 78%, #000 22%); font: 700 calc(var(--s) * .44)/1 var(--sans); letter-spacing: 0; }
.rj-avatar.ring { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ink); }
.rj-avatar.kind { background: var(--bg-4); color: var(--fg-2); font-weight: 600; }
.rj-avatar-stack { display: inline-flex; align-items: center; }
.rj-avatar.stacked { margin-left: -8px; box-shadow: 0 0 0 2px var(--bg-1); }
.rj-avatar-stack .rj-avatar:first-child { margin-left: 0; }
.rj-avatar.more { background: var(--bg-4); color: var(--fg-2); font: 600 calc(var(--s) * .36)/1 var(--mono); }
/* 空位（虚线圈）：padding 归零，抵消通用空态 .empty 的 36px 20px——两者共享类名 */
.rj-avatar.empty { background: transparent; box-shadow: none; border: 1.5px dashed var(--line-3); color: var(--fg-4); padding: 0; font: 500 calc(var(--s) * .4)/1 var(--sans); }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: 60px;
  display: flex; align-items: center; gap: 16px; padding: 0 clamp(14px, 2.5vw, 28px);
  background: rgba(10,11,15,.78); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.topbar .spacer { flex: 1; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: .01em; color: var(--fg); white-space: nowrap; }
.brand-glyph { width: 22px; height: 22px; border-radius: 6px; flex: none; position: relative;
  background: conic-gradient(from 210deg, var(--ember), var(--ember-2) 40%, #5a1a12 75%, var(--ember));
  box-shadow: 0 0 18px -2px rgba(255,106,61,.8); }
.brand-glyph::after { content: ""; position: absolute; inset: 6px; border-radius: 3px; background: var(--bg); opacity: .85; }
.topbar nav { display: flex; gap: 2px; margin-left: 6px; }
.topbar nav a { padding: 7px 11px; border-radius: 8px; font: 500 14px/1 var(--sans); color: var(--fg-2); transition: background .2s, color .2s; }
.topbar nav a:hover { color: var(--fg); background: var(--bg-3); }
.topbar nav a.active { color: var(--fg); background: var(--bg-3); }
.icon-btn { position: relative; width: 36px; height: 36px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--fg-2);
  display: inline-grid; place-items: center; cursor: pointer; transition: background .2s, color .2s; }
.icon-btn:hover { background: var(--bg-3); color: var(--fg); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .badge { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
  background: var(--ember); color: #fff; font: 700 10px/16px var(--mono); text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.user-chip { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px 0 4px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--fg); font: 500 13.5px/1 var(--sans); transition: background .2s, border-color .2s; }
.user-chip:hover { background: var(--bg-3); border-color: var(--line-2); }
.balance-pill { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--fg-2);
  font: 500 12.5px/1 var(--mono); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: background .2s, color .2s; }
.balance-pill:hover { background: var(--bg-3); color: var(--fg); }
.balance-pill b { color: var(--fg); font-weight: 600; }

/* 手机底栏 */
.tabbar { display: none; }
@media (max-width: 760px) {
  .sec-head { flex-wrap: wrap; align-items: flex-start; }
  .sec-head .seg { width: 100%; overflow-x: auto; }
  .topbar nav { display: none; }
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr);
    background: rgba(10,11,15,.9); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-top: 1px solid var(--line);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0 4px; border-radius: 10px; color: var(--fg-3); font: 500 11px/1 var(--sans); }
  .tabbar a svg { width: 20px; height: 20px; }
  .tabbar a.active { color: var(--ember); }
  body.has-tabbar { padding-bottom: 72px; }
}

/* ---------- 弹窗 / 抽屉 / toast ---------- */
.modal-mask { position: fixed; inset: 0; z-index: 60; display: none; place-items: center; padding: 16px;
  background: rgba(5,6,9,.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal-mask.open { display: grid; }
.modal { position: relative; width: min(540px, 100%); max-height: 88vh; overflow-y: auto;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-xl); padding: 26px 28px 24px;
  box-shadow: var(--shadow-pop); animation: popIn .55s var(--spring-soft) both; }
.modal .eyebrow { margin-bottom: 8px; }
.modal h3 { font-size: var(--t-lg); margin-bottom: 6px; }
.modal .modal-lede { color: var(--fg-3); font-size: var(--t-sm); line-height: 1.65; margin-bottom: 4px; }
.modal label { display: block; font: 500 12.5px/1 var(--sans); color: var(--fg-3); margin: 16px 0 7px; }
.modal .actions { margin-top: 24px; display: flex; justify-content: flex-end; gap: 10px; }
.modal-x { position: absolute; right: 12px; top: 12px; width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; color: var(--fg-3);
  font-size: 20px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.modal-x:hover { background: var(--bg-3); color: var(--fg); }
dialog.rj { border: 1px solid var(--line-2); border-radius: var(--r-xl); background: var(--bg-2); color: var(--fg); padding: 0;
  width: min(560px, calc(100vw - 32px)); max-height: 88vh; box-shadow: var(--shadow-pop); }
dialog.rj[open] { animation: popIn .55s var(--spring-soft) both; }
dialog.rj::backdrop { background: rgba(5,6,9,.72); backdrop-filter: blur(6px); }
dialog.rj .modal-x { z-index: 2; }
.json-input { font-family: var(--mono); font-size: 12.5px; min-height: 170px; }

.drawer-scrim { position: fixed; inset: 0; z-index: 40; background: rgba(5,6,9,.5); border: 0; display: none; padding: 0; cursor: default; }
.drawer-scrim.open { display: block; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 41; width: min(400px, 92vw); background: var(--bg-1); border-left: 1px solid var(--line-2);
  box-shadow: var(--shadow-pop); transform: translateX(104%); transition: transform .55s var(--spring-soft); display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer > header { display: flex; align-items: center; gap: 10px; padding: 16px 16px 14px; border-bottom: 1px solid var(--line); }
.drawer > header b { font-size: var(--t-base); font-weight: 700; flex: 1; }
.drawer > footer { padding: 12px 16px; border-top: 1px solid var(--line); color: var(--fg-4); font-size: var(--t-xs); }
.drawer-body { flex: 1; overflow-y: auto; padding: 10px 12px; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(12px); z-index: 99;
  padding: 11px 18px; border-radius: 12px; background: var(--bg-3); border: 1px solid var(--line-2); color: var(--fg);
  font: 500 14px/1.3 var(--sans); box-shadow: var(--shadow-pop); opacity: 0; pointer-events: none; max-width: min(520px, 90vw); text-align: center;
  transition: opacity .25s, transform .45s var(--spring-soft); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: rgba(255,77,109,.5); color: #ffb4c2; background: #2a141a; }

/* ---------- 图标（game-icons mask，随 currentColor 上色） ---------- */
.gi { display: inline-block; width: 18px; height: 18px; flex: none; vertical-align: -3px;
  -webkit-mask: center / contain no-repeat; mask: center / contain no-repeat; background: currentColor; }
.ic { vertical-align: -3px; flex: none; }

/* ---------- 空态 / 骨架 ---------- */
/* 吉祥物：*_body.png 不含五官，眼睛是独立图层（落地页 landing.js 做的是同一件事），
   只贴 body 会得到一张空脸。--ex/--ey/--ew 是眼睛相对 body 盒子的中心与宽度。 */
.crew-char { position: relative; display: block; }
.crew-char > img { display: block; width: 100%; height: auto; }
.crew-char > .eyes { position: absolute; left: var(--ex); top: var(--ey); width: var(--ew); transform: translate(-50%, -50%); }

.empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 36px 20px; color: var(--fg-3); }
.empty > img, .empty > .crew-char { width: 110px; height: auto; filter: drop-shadow(0 12px 24px rgba(0,0,0,.6)); margin-bottom: 4px; }
.empty h3 { color: var(--fg); font-size: var(--t-md); }
.empty p { font-size: var(--t-sm); max-width: 38ch; line-height: 1.6; }
.empty .actions { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; justify-content: center; }
.skel { background: linear-gradient(90deg, var(--bg-2) 20%, var(--bg-3) 50%, var(--bg-2) 80%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: 8px; }
.page-loading { display: grid; gap: 12px; padding: 40px clamp(16px, 3vw, 32px); width: min(var(--w), 100%); margin: 0 auto; }
.page-loading .skel { height: 18px; } .page-loading .skel.big { height: 120px; border-radius: var(--r-lg); }

/* ---------- 动效 ---------- */
@keyframes pulse { 50% { opacity: .35; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes riseIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; transform: scale(.94) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,106,61,0); } 50% { box-shadow: 0 0 0 6px rgba(255,106,61,.12); } }
@keyframes drift { from { transform: translate3d(-2%, 0, 0) scale(1.04); } to { transform: translate3d(2%, -1%, 0) scale(1.08); } }
.rise { animation: riseIn .7s var(--spring-soft) both; }
.pop { animation: popIn .6s var(--spring-soft) both; }
.stagger > * { animation: riseIn .7s var(--spring-soft) both; }
.stagger > *:nth-child(1) { animation-delay: 0ms; } .stagger > *:nth-child(2) { animation-delay: 45ms; } .stagger > *:nth-child(3) { animation-delay: 90ms; }
.stagger > *:nth-child(4) { animation-delay: 135ms; } .stagger > *:nth-child(5) { animation-delay: 180ms; } .stagger > *:nth-child(6) { animation-delay: 225ms; }
.stagger > *:nth-child(7) { animation-delay: 270ms; } .stagger > *:nth-child(8) { animation-delay: 315ms; } .stagger > *:nth-child(9) { animation-delay: 360ms; }
.stagger > *:nth-child(10) { animation-delay: 405ms; } .stagger > *:nth-child(11) { animation-delay: 450ms; } .stagger > *:nth-child(n+12) { animation-delay: 480ms; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- 滚动条 ---------- */
* { scrollbar-width: thin; scrollbar-color: var(--bg-5) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--bg-5); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------- 通用行 ---------- */
.list-row { display: flex; align-items: center; gap: 10px; padding: 9px 6px; border-radius: 10px; font-size: var(--t-sm); transition: background .2s; }
.list-row:hover { background: var(--bg-2); }
.list-row b { font-weight: 600; color: var(--fg); }
.list-row .where { color: var(--fg-3); font-size: var(--t-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.list-row .acts { margin-left: auto; display: flex; gap: 4px; flex: none; }
.list-row .acts button { border: 0; background: transparent; color: var(--fg-3); cursor: pointer; font: 500 12px/1 var(--sans); padding: 5px 8px; border-radius: 6px; }
.list-row .acts button:hover { background: var(--bg-3); color: var(--fg); }
.list-row .acts button.quiet { color: var(--fg-4); }
.list-row .acts button.hot { color: var(--ember); }
.name-link { cursor: pointer; }
.name-link:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--fg-4); }
.rj-avatar.taken { background: var(--bg-5); box-shadow: 0 0 0 2px var(--bg-1); }
