/* ═══════════════════════════════════════════════════════════
   《我有病》H5 设计系统
   移动端优先 · 深色临床风 · 病历质感
   ═══════════════════════════════════════════════════════════ */

:root {
  /* 底色 */
  --bg:        #080b0f;
  --bg-2:      #0d1218;
  --panel:     #121820;
  --panel-2:   #18212c;
  --line:      #1f2b37;
  --line-2:    #2a3948;

  /* 文字 */
  --text:      #dbe6f0;
  --text-2:    #9db0c2;
  --dim:       #66788a;
  --dim-2:     #47586a;

  /* 品牌与语义色 */
  --brand:     #3ddc97;   /* 医疗绿 */
  --brand-dk:  #1f9d6b;
  --danger:    #ff5c5c;   /* 规则红 */
  --warn:      #ffb020;   /* 警示黄 */
  --psych:     #b57bff;   /* 精神病紫 */
  --info:      #57b3ff;   /* 情报蓝 */
  --pol:       #8247e5;   /* Polygon 紫 */

  --radius:    14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow:    0 10px 30px rgba(0,0,0,.45);

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC",
               "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body { padding-bottom: var(--safe-b); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }
button { font-family: inherit; }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.dim  { color: var(--dim); }
.text-2 { color: var(--text-2); }
.hide { display: none !important; }
.center { text-align: center; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }

/* ── 应用骨架 ─────────────────────────────────────────── */
.app { max-width: 720px; margin: 0 auto; min-height: 100vh; }
.app-main { padding: 14px 14px 96px; }

/* ── 顶部导航 ─────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  padding-top: calc(10px + var(--safe-t));
  background: rgba(8,11,15,.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  letter-spacing: 2px;
  font-size: 17px;
}
.nav-logo .mark {
  width: 26px; height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--info));
  display: grid; place-items: center;
  font-size: 13px; color: #05100b; font-weight: 900;
}
.nav-spacer { flex: 1; }
.nav-actions { display: flex; align-items: center; gap: 8px; }

.nav-lang {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  color: var(--dim);
  background: var(--panel);
}

/* 移动端底部 Tab 栏 */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  display: flex;
  background: rgba(10,14,19,.96);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
}
.tabbar .tab {
  flex: 1;
  padding: 9px 0 8px;
  text-align: center;
  font-size: 11px;
  color: var(--dim);
  letter-spacing: .5px;
}
.tabbar .tab .ico { display: block; font-size: 19px; line-height: 1.2; }
.tabbar .tab.on { color: var(--brand); }

/* ── 模块（全站统一结构） ─────────────────────────────── */
.module {
  margin-bottom: 22px;
  scroll-margin-top: 70px;
}
.module-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-left: 11px;
  border-left: 3px solid var(--brand);
}
.module-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 1px;
}
.module-sub {
  font-size: 12.5px;
  color: var(--dim);
  margin-top: 3px;
}
.module-head-r { flex: none; font-size: 13px; }
.module-body { }

.module.m-danger .module-head { border-left-color: var(--danger); }
.module.m-warn   .module-head { border-left-color: var(--warn); }
.module.m-psych  .module-head { border-left-color: var(--psych); }
.module.m-info   .module-head { border-left-color: var(--info); }
.module.m-plain  .module-head { border-left-color: var(--line-2); }

/* ── 卡片 ─────────────────────────────────────────────── */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.card + .card { margin-top: 12px; }
.card-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-desc { font-size: 13px; color: var(--dim); line-height: 1.7; }
.card.accent-brand   { border-color: #1e6b4c; background: linear-gradient(180deg, #0e2a20, var(--panel)); }
.card.accent-danger  { border-color: #6b2020; background: linear-gradient(180deg, #2a1010, var(--panel)); }
.card.accent-warn    { border-color: #6b5216; background: linear-gradient(180deg, #2a2210, var(--panel)); }
.card.accent-psych   { border-color: #4b2f70; background: linear-gradient(180deg, #1e1430, var(--panel)); }
.card.accent-info    { border-color: #23506b; background: linear-gradient(180deg, #10222f, var(--panel)); }

/* 卡片网格 */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 400px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
}

/* ── 按钮 ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .08s ease, filter .15s ease, border-color .15s ease;
  line-height: 1.2;
}
.btn:active { transform: scale(.975); }
.btn:disabled, .btn.disabled { opacity: .38; cursor: not-allowed; }
.btn-block { display: flex; width: 100%; }
.btn-lg { padding: 15px 20px; font-size: 16px; border-radius: var(--radius); }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 8px; }

.btn-primary {
  background: linear-gradient(100deg, var(--brand-dk), var(--brand));
  border-color: var(--brand);
  color: #04140d;
  font-weight: 800;
}
.btn-danger   { background: linear-gradient(100deg, #a02b2b, var(--danger)); border-color: var(--danger); color: #fff; }
.btn-psych    { background: linear-gradient(100deg, #6b3fb0, var(--psych)); border-color: var(--psych); color: #fff; }
.btn-info     { background: linear-gradient(100deg, #2b6fa0, var(--info)); border-color: var(--info); color: #fff; }
.btn-ghost    { background: transparent; border-color: var(--line-2); color: var(--text-2); }
.btn-pol      { background: linear-gradient(100deg, #5b2fae, var(--pol)); border-color: var(--pol); color: #fff; }

.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

/* ── 标签 / 徽章 ──────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
}
.pill-brand  { color: var(--brand);  border-color: #1e6b4c; background: #0e2a20; }
.pill-danger { color: var(--danger); border-color: #6b2020; background: #2a1010; }
.pill-warn   { color: var(--warn);   border-color: #6b5216; background: #2a2210; }
.pill-psych  { color: var(--psych);  border-color: #4b2f70; background: #1e1430; }
.pill-info   { color: var(--info);   border-color: #23506b; background: #10222f; }
.pill-mono   { font-family: ui-monospace, monospace; }

/* ── 表单 ─────────────────────────────────────────────── */
.field { display: block; margin-bottom: 14px; }
.field > label {
  display: block;
  font-size: 12.5px;
  color: var(--dim);
  margin-bottom: 6px;
  letter-spacing: .5px;
}
.input, .select, .textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s ease;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); }
.input::placeholder, .textarea::placeholder { color: var(--dim-2); }
.textarea { min-height: 88px; resize: vertical; line-height: 1.6; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%),
          linear-gradient(135deg, var(--dim) 50%, transparent 50%);
          background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
          background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }

.checkline {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 10px;
}
.checkline input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--brand); flex: none; }

.form-hint { font-size: 12px; color: var(--dim); margin-top: 6px; line-height: 1.6; }
.form-error { font-size: 13px; color: var(--danger); min-height: 18px; }

/* ── 选项（问卷 / 行动选择） ──────────────────────────── */
.opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 9px;
  cursor: pointer;
  transition: all .13s ease;
  font-size: 14.5px;
}
.opt:active { transform: scale(.985); }
.opt .opt-key {
  flex: none;
  width: 23px; height: 23px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  font-size: 12px;
  font-family: ui-monospace, monospace;
  color: var(--dim);
}
.opt.on { border-color: var(--brand); background: #0e2419; }
.opt.on .opt-key { background: var(--brand); border-color: var(--brand); color: #04140d; font-weight: 800; }
.opt.danger { border-color: var(--danger); background: #2a1010; }
.opt.danger .opt-key { background: var(--danger); border-color: var(--danger); color: #fff; }

/* ── 图片占位符 ───────────────────────────────────────── */
.ph {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 120px;
  padding: 20px 16px;
  text-align: center;
  border: 1.5px dashed var(--line-2);
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.014) 0 10px, transparent 10px 20px),
    var(--bg-2);
  overflow: hidden;
}
.ph-badge {
  position: absolute;
  top: 9px; left: 9px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--warn);
  color: #221703;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .5px;
}
.ph-title { font-size: 14px; font-weight: 800; color: var(--text-2); letter-spacing: .5px; }
.ph-size  { font-size: 11px; font-family: ui-monospace, monospace; color: var(--info); }
.ph-desc  { font-size: 12px; color: var(--dim); max-width: 92%; line-height: 1.65; }
.ph.tall { min-height: 210px; }
.ph.hero { min-height: 260px; }

/* ── 美术图（位次有图时替代占位符） ───────────────────────
   视图里写的是 img_art()，有图出 <img>、没图出 .ph 占位符，
   两者共用同一套 class 名（hero / mt-16 …），所以这里只要
   保证 .art 在同样的版式位置下尺寸行为一致即可。 */
.art {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-2);
}
/* 占位符用 min-height 撑高度，真图交给 aspect-ratio，别互相打架 */
.art.hero { min-height: 0; }
/* 图还没加载出来时先占住比例，避免页面跳动 */
.art[style*="aspect-ratio"] { min-height: 0; }

/* ── 付款二维码（订单创建后由 ticket.js 实时生成） ──────── */
.qr-box {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--bg-2);
}
.qr-img {
  flex: 0 0 148px;
  width: 148px;
  height: 148px;
  padding: 8px;
  border-radius: var(--radius-sm);
  /* 必须是白底黑点：暗色底白点的二维码，不少钱包镜头会扫不出来 */
  background: #fff;
}
.qr-img svg { display: block; width: 100%; height: 100%; }
.qr-side { flex: 1; min-width: 0; }
.qr-amount {
  font-size: 18px;
  font-weight: 800;
  color: var(--brand);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.qr-chain {
  margin-top: 3px;
  font-size: 11px;
  color: var(--info);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.qr-tip { margin-top: 8px; font-size: 12px; color: var(--dim); line-height: 1.6; }

@media (max-width: 420px) {
  .qr-box { flex-direction: column; align-items: stretch; }
  .qr-img { align-self: center; }
}

/* ── 数据展示 ─────────────────────────────────────────── */
.stat-row { display: flex; gap: 10px; }
.stat {
  flex: 1;
  min-width: 0;
  padding: 11px 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  text-align: center;
}
.stat .k { font-size: 11px; color: var(--dim); letter-spacing: .5px; }
.stat .v {
  font-size: 20px;
  font-weight: 800;
  font-family: ui-monospace, monospace;
  margin-top: 2px;
  white-space: nowrap;
}
.stat .v.brand  { color: var(--brand); }
.stat .v.danger { color: var(--danger); }
.stat .v.warn   { color: var(--warn); }
.stat .v.psych  { color: var(--psych); }
.stat .v.info   { color: var(--info); }

/* 进度条 */
.bar {
  height: 7px;
  background: #0a0f14;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 9px;
}
.bar > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width .45s ease;
  background: linear-gradient(90deg, var(--brand), var(--info));
}
.bar.danger > i { background: linear-gradient(90deg, var(--warn), var(--danger)); }
.bar.psych  > i { background: linear-gradient(90deg, var(--info), var(--psych)); }

/* ── 列表 ─────────────────────────────────────────────── */
.list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid #161e27;
  font-size: 14px;
}
.list li:last-child { border-bottom: none; }
.list .li-main { flex: 1; min-width: 0; }
.list .li-name { font-weight: 600; }
.list .li-sub  { font-size: 12px; color: var(--dim); margin-top: 2px; }
.list .li-right { flex: none; font-family: ui-monospace, monospace; font-weight: 700; }

/* 排行榜前三名 */
.rank-top { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; align-items: end; }
.rank-top .rt {
  padding: 12px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-2);
  text-align: center;
}
.rank-top .rt .medal { font-size: 22px; }
.rank-top .rt .nm { font-size: 13px; font-weight: 700; margin-top: 4px; }
.rank-top .rt .sc { font-size: 12px; font-family: ui-monospace, monospace; color: var(--dim); }
.rank-top .rt.p1 { border-color: var(--warn); background: linear-gradient(180deg, #2a2210, var(--bg-2)); padding-top: 18px; }
.rank-top .rt.p2 { border-color: #6b7a86; }
.rank-top .rt.p3 { border-color: #7a5230; }

/* ── 日志 / 频道 ──────────────────────────────────────── */
.feed {
  max-height: 260px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.feed li {
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-2);
  border-bottom: 1px solid #151d26;
  word-break: break-word;
}
.feed li:last-child { border-bottom: none; }
.feed li.f-day    { color: var(--text); font-weight: 700; letter-spacing: .5px; }
.feed li.f-rule   { color: var(--info); }
.feed li.f-warn   { color: var(--warn); }
.feed li.f-good   { color: var(--brand); }
.feed li.f-bad    { color: var(--danger); }
.feed li.f-system { color: var(--psych); }
.feed .cname { color: var(--info); font-weight: 600; margin-right: 6px; }

.chat-row { display: flex; gap: 8px; margin-top: 10px; }
.chat-row .input { flex: 1; padding: 10px 12px; font-size: 15px; }

/* ── 12 格街区画板 ────────────────────────────────────── */
.board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.board .cell {
  position: relative;
  aspect-ratio: 1 / .82;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .14s ease;
  overflow: hidden;
}
.board .cell:active { transform: scale(.96); }
.board .cell .c-ico  { font-size: 20px; line-height: 1; }
.board .cell .c-name { font-size: 12.5px; font-weight: 600; }
.board .cell .c-hint { font-size: 10px; color: var(--dim-2); }
.board .cell.sel {
  border-color: var(--brand);
  background: #0e2419;
  box-shadow: 0 0 0 1px var(--brand) inset;
}
.board .cell.forbidden {
  border-color: var(--danger);
  background: repeating-linear-gradient(45deg, #2a1010 0 8px, #1e0c0c 8px 16px);
}
.board .cell.forbidden .c-name { color: #ffb3b3; }
.board .cell.forbidden::after {
  content: "禁止";
  position: absolute;
  top: 5px; right: 5px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
}
.board .cell .c-people {
  position: absolute;
  bottom: 4px; left: 0; right: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2px;
}
.board .cell .c-people span {
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  font-size: 9px;
  display: grid; place-items: center;
  color: var(--text-2);
}

/* ── 阶段条 ───────────────────────────────────────────── */
.phasebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 14px;
}
.phasebar .pb-round { font-size: 13px; font-weight: 700; }
.phasebar .pb-phase {
  flex: 1;
  font-size: 13px;
  color: var(--text-2);
}
.phasebar .pb-timer {
  font-family: ui-monospace, monospace;
  font-weight: 800;
  color: var(--warn);
  font-size: 15px;
}

.steps { display: flex; gap: 6px; margin-bottom: 14px; }
.steps .st {
  flex: 1;
  text-align: center;
  font-size: 10.5px;
  padding: 5px 2px;
  border-radius: 7px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--dim-2);
}
.steps .st.on { background: #0e2419; border-color: var(--brand); color: var(--brand); font-weight: 700; }
.steps .st.done { color: var(--dim); border-color: var(--line-2); }

/* ── 横幅提示 ─────────────────────────────────────────── */
.banner {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 14px;
  line-height: 1.6;
}
.banner.b-info   { background: #10222f; border: 1px solid #23506b; color: #bcdcff; }
.banner.b-good   { background: #0e2419; border: 1px solid #1e6b4c; color: #a9f0cf; }
.banner.b-warn   { background: #2a2210; border: 1px solid #6b5216; color: #ffdfab; }
.banner.b-danger { background: #2a1010; border: 1px solid #6b2020; color: #ffc2c2; }

/* ── 病情 / 身份卡 ────────────────────────────────────── */
.idcard {
  position: relative;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
}
.idcard::after {
  content: "仅本人可见";
  position: absolute;
  top: 14px; right: -26px;
  padding: 3px 28px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  transform: rotate(38deg);
  letter-spacing: 1px;
}
.idcard .ic-role { font-size: 22px; font-weight: 900; letter-spacing: 2px; }
.idcard .ic-role.r-arbiter { color: var(--info); }
.idcard .ic-role.r-sick    { color: var(--psych); }
.idcard .ic-role.r-healthy { color: var(--brand); }
.idcard .ic-school { font-size: 12.5px; color: var(--dim); margin-top: 4px; }

/* ── 折叠 ─────────────────────────────────────────────── */
.fold-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
}
.fold-arrow {
  flex: none;
  color: var(--dim);
  font-size: 13px;
  transition: transform .18s ease;
}
.fold-head.open .fold-arrow { transform: rotate(180deg); }
.fold-body { margin-top: 12px; }

/* ── 可选中卡片（档位 / 商品 / 目标） ─────────────────── */
.card.sel {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand) inset;
  background: linear-gradient(180deg, #0e2419, var(--panel));
}
.card.tap { cursor: pointer; transition: transform .1s ease, border-color .15s ease; }
.card.tap:active { transform: scale(.985); }

/* ── 座位表（候诊室） ─────────────────────────────────── */
.seats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.seat {
  position: relative;
  padding: 10px 4px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line-2);
  background: var(--bg-2);
  text-align: center;
  font-size: 11px;
  color: var(--dim-2);
  min-height: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.seat .s-no { font-family: ui-monospace, monospace; font-size: 10px; }
.seat .s-ico { font-size: 17px; line-height: 1.1; }
.seat .s-name { font-size: 11px; font-weight: 600; color: var(--text-2); word-break: break-all; }
.seat.filled { border-style: solid; border-color: var(--line); }
.seat.me     { border-color: var(--brand); background: #0e2419; }
.seat.ai     { border-color: #4b2f70; background: #1e1430; }
.seat.jailed { border-color: var(--danger); background: #2a1010; }
.seat .s-tag {
  position: absolute;
  top: 3px; right: 3px;
  font-size: 9px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  color: var(--dim);
}
.seat.ai .s-tag { background: var(--psych); border-color: var(--psych); color: #fff; }

/* ── 病区 / 医师行 ────────────────────────────────────── */
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid #161e27; font-size: 13.5px; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--dim); flex: none; }
.kv .v { text-align: right; font-weight: 600; word-break: break-all; }

/* ── 弹层 ─────────────────────────────────────────────── */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,.68);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.modal {
  width: 100%;
  max-width: 720px;
  max-height: 86vh;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-bottom: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 20px 18px calc(24px + var(--safe-b));
  animation: sheetUp .22s ease-out;
}
@keyframes sheetUp { from { transform: translateY(28px); opacity: .4; } to { transform: none; opacity: 1; } }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.modal-title { font-size: 17px; font-weight: 800; }
.modal-close {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--dim);
  cursor: pointer;
  font-size: 15px;
}

/* ── Toast ────────────────────────────────────────────── */
.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: calc(84px + var(--safe-b));
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: calc(100% - 32px);
  max-width: 420px;
  pointer-events: none;
}
.toast {
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow);
  animation: toastIn .2s ease-out;
}
.toast.t-good   { background: #0e2419; border-color: var(--brand); color: #a9f0cf; }
.toast.t-bad    { background: #2a1010; border-color: var(--danger); color: #ffc2c2; }
.toast.t-warn   { background: #2a2210; border-color: var(--warn); color: #ffdfab; }
.toast.t-info   { background: #10222f; border-color: var(--info); color: #bcdcff; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ── 页脚 ─────────────────────────────────────────────── */
.footer {
  margin-top: 30px;
  padding: 22px 16px 30px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--dim);
  line-height: 1.9;
}
.footer .ft-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 14px; }
.footer .ft-links a { color: var(--text-2); }
.footer .ft-warn {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: #1a1410;
  border: 1px solid #4a3a1a;
  color: #d8c49a;
  font-size: 11.5px;
}
.footer .ft-org { margin-top: 12px; color: var(--dim-2); font-size: 11px; }

/* ── 骨架屏 ───────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--panel) 25%, var(--panel-2) 37%, var(--panel) 63%);
  background-size: 400% 100%;
  animation: sk 1.4s ease infinite;
  border-radius: 8px;
  height: 16px;
}
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }


/* ═══════════════════════════════════════════════════════════
   后台管理（/admin/*）
   只在后台布局里引用，不影响游戏端
   ═══════════════════════════════════════════════════════════ */
.adm-nav { display:flex; gap:6px; overflow-x:auto; padding:10px 0; border-bottom:1px solid var(--line,#1b2430); margin-bottom:14px; }
.adm-nav a { flex:0 0 auto; padding:6px 12px; border-radius:999px; font-size:13px; color:var(--dim,#78899a); text-decoration:none; border:1px solid transparent; }
.adm-nav a.on { color:#fff; background:rgba(120,120,255,.14); border-color:rgba(120,120,255,.5); }

.adm-wrap { overflow-x:auto; -webkit-overflow-scrolling:touch; margin:0 -4px; }
.adm-table { width:100%; border-collapse:collapse; font-size:13px; min-width:640px; }
.adm-table th, .adm-table td { padding:9px 10px; text-align:left; border-bottom:1px solid var(--line,#1b2430); white-space:nowrap; vertical-align:top; }
.adm-table th { color:var(--dim,#78899a); font-weight:600; font-size:12px; letter-spacing:.02em; }
.adm-table tbody tr:hover { background:rgba(255,255,255,.02); }
.adm-table td.wrap { white-space:normal; min-width:200px; }
.adm-table .num { text-align:right; font-variant-numeric:tabular-nums; }

.adm-filters { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.adm-filters .input, .adm-filters .select { flex:1 1 140px; min-width:120px; }

.adm-pager { display:flex; gap:8px; align-items:center; justify-content:center; margin-top:14px; font-size:13px; }
.adm-pager a, .adm-pager span { padding:6px 12px; border-radius:8px; border:1px solid var(--line,#1b2430); text-decoration:none; color:inherit; }
.adm-pager .off { opacity:.35; }

.adm-kv { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:10px; }
.adm-kv .kv-item { padding:10px 12px; border:1px solid var(--line,#1b2430); border-radius:10px; }
.adm-kv .kv-k { font-size:12px; color:var(--dim,#78899a); }
.adm-kv .kv-v { font-size:15px; font-weight:700; margin-top:2px; word-break:break-all; }

.adm-inline { display:flex; gap:6px; align-items:center; }
.adm-inline .input { width:110px; }
.adm-code { font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:12px; word-break:break-all; }