/* ============ 塔罗 · 神秘学主题 ============ */
:root {
  --bg0: #0a0812; --bg1: #14102a; --bg2: #1d1840;
  --gold: #d9b96c; --gold-dim: #9c8450; --gold-glow: rgba(217, 185, 108, .35);
  --ink: #e9e4f5; --ink-dim: #a89fc4; --ink-faint: #6f679a;
  --card-bg: linear-gradient(160deg, #221c48, #171233 55%, #241a52);
  --face-bg: linear-gradient(170deg, #f7f1df, #e8dfc2 60%, #efe6cd);
  --face-ink: #3a2e55;
  --rose: #b0709c; --ok: #7fc9a8; --warn: #d98f6c;
  --radius: 14px;
  --serif: Georgia, 'Times New Roman', 'Songti SC', 'SimSun', 'Noto Serif CJK SC', 'Hiragino Mincho ProN', serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { overscroll-behavior-y: contain; }
button, .chip, .spread-opt, .tback, .slot, .hist-list li { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
body.modal-open { overflow: hidden; }
body {
  font-family: var(--serif);
  background: radial-gradient(ellipse 120% 80% at 50% -10%, var(--bg2), var(--bg1) 45%, var(--bg0) 100%);
  color: var(--ink); min-height: 100vh; overflow-x: hidden;
}
#stars { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.wrap { position: relative; z-index: 1; max-width: 1060px; margin: 0 auto; padding: 18px 16px 80px; }

/* ---------- 顶栏 ---------- */
header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 4px 16px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand .sigil { width: 46px; height: 46px; filter: drop-shadow(0 0 12px var(--gold-glow)); }
.brand h1 { font-size: 22px; letter-spacing: 2px; color: var(--gold); font-weight: 600; }
.brand small { display: block; color: var(--ink-faint); font-size: 11px; letter-spacing: 4px; margin-top: 2px; }
.langs { display: flex; gap: 6px; }
.langs button {
  background: transparent; border: 1px solid var(--ink-faint); color: var(--ink-dim);
  border-radius: 20px; padding: 4px 13px; cursor: pointer; font: inherit; font-size: 13px; transition: .2s;
}
.langs button.on { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 10px var(--gold-glow); }

/* ---------- 导航 ---------- */
nav {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px;
  border-bottom: 1px solid rgba(217,185,108,.15); padding-bottom: 0;
  scrollbar-width: none; -ms-overflow-style: none;
}
nav::-webkit-scrollbar { display: none; }
nav button {
  background: transparent; border: none; color: var(--ink-dim); font: inherit; font-size: 15px;
  padding: 10px 16px; cursor: pointer; border-bottom: 2px solid transparent; transition: .2s; letter-spacing: 1px; white-space: nowrap; flex: none;
}
nav button:active { opacity: .6; }
nav button:hover { color: var(--ink); }
nav button.on { color: var(--gold); border-bottom-color: var(--gold); }

/* ---------- 卡片与面板 ---------- */
.panel {
  background: rgba(20, 15, 45, .72); border: 1px solid rgba(217,185,108,.18);
  border-radius: var(--radius); padding: 22px; backdrop-filter: blur(6px);
  box-shadow: 0 8px 40px rgba(0,0,0,.35);
}
.panel + .panel { margin-top: 18px; }
.panel h2 { color: var(--gold); font-size: 18px; font-weight: 600; letter-spacing: 2px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.panel h2::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(217,185,108,.4), transparent); }
.hint { color: var(--ink-faint); font-size: 13px; line-height: 1.7; }

/* ---------- 表单 ---------- */
label.fld { display: block; font-size: 13px; color: var(--ink-dim); margin: 14px 0 6px; letter-spacing: 1px; }
select, input[type=text], textarea {
  width: 100%; background: rgba(10, 8, 20, .7); border: 1px solid rgba(217,185,108,.25);
  color: var(--ink); font: inherit; font-size: 15px; border-radius: 10px; padding: 10px 14px; outline: none; transition: .2s;
}
select:focus, input:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(217,185,108,.15); }
textarea { resize: vertical; min-height: 64px; }

/* 牌阵选择 */
.spread-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.spread-opt {
  border: 1px solid rgba(217,185,108,.22); border-radius: 12px; padding: 12px; cursor: pointer; transition: .2s;
  background: rgba(10,8,20,.5);
}
.spread-opt:hover { border-color: var(--gold-dim); transform: translateY(-2px); }
.spread-opt.on { border-color: var(--gold); box-shadow: 0 0 16px var(--gold-glow); background: rgba(217,185,108,.06); }
.spread-opt .nm { color: var(--gold); font-size: 14.5px; font-weight: 600; }
.spread-opt .ct { color: var(--ink-faint); font-size: 12px; margin-top: 3px; }
.spread-opt .ds { color: var(--ink-dim); font-size: 12px; margin-top: 6px; line-height: 1.5; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid rgba(217,185,108,.25); border-radius: 20px; padding: 6px 16px; cursor: pointer;
  color: var(--ink-dim); font: inherit; font-size: 14px; background: transparent; transition: .2s;
}
.chip.on { border-color: var(--gold); color: var(--gold); background: rgba(217,185,108,.08); }

.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  background: linear-gradient(160deg, #d9b96c, #b3924a); color: #241a05; border: none; border-radius: 12px;
  font: inherit; font-size: 16px; font-weight: 700; letter-spacing: 3px; padding: 13px 34px; cursor: pointer;
  box-shadow: 0 4px 24px var(--gold-glow); transition: .2s; margin-top: 18px;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 30px var(--gold-glow); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.ghost { background: transparent; color: var(--gold); border: 1px solid var(--gold-dim); box-shadow: none; font-weight: 400; }
.btn.ghost:hover { border-color: var(--gold); }
.btn.sm { padding: 7px 16px; font-size: 13px; letter-spacing: 1px; margin-top: 0; }

/* ---------- 塔罗牌通用 ---------- */
.tcard { perspective: 1000px; width: 118px; height: 186px; flex: none; }
.tcard .inner {
  position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .8s cubic-bezier(.4,.1,.2,1);
}
.tcard.flip .inner { transform: rotateY(180deg); }
.tface { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 10px; overflow: hidden; }
.tback {
  background:
    radial-gradient(circle at 50% 42%, rgba(217,185,108,.28), transparent 58%),
    repeating-linear-gradient(45deg, rgba(217,185,108,.07) 0 2px, transparent 2px 7px),
    linear-gradient(160deg, #2a2255, #171233 55%, #2d2260);
  border: 2px solid var(--gold-dim); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.tback .emblem { width: 62%; opacity: .9; filter: drop-shadow(0 0 8px var(--gold-glow)); }
.tback::after { content: ''; position: absolute; inset: 6px; border: 1px solid rgba(217,185,108,.35); border-radius: 6px; }
.tfront {
  transform: rotateY(180deg); background: var(--face-bg); color: var(--face-ink);
  border: 1px solid #b9a97e; display: flex; flex-direction: column; align-items: center; padding: 8px 6px;
}
.tfront .num { font-size: 13px; letter-spacing: 2px; color: #7a6a3c; font-weight: 700; }
.tfront .art { flex: 1; width: 100%; display: flex; align-items: center; justify-content: center; padding: 4px 0; }
.tfront .art svg { width: 74%; height: 74%; }
.tfront .art.hebrew { font-size: 44px; color: #5a4a8a; text-shadow: 0 1px 2px rgba(90,74,138,.3); font-weight: 700; }
.tfront .nm { font-size: 11.5px; font-weight: 700; text-align: center; line-height: 1.35; letter-spacing: .5px; }
.tfront.rev-mark { filter: none; }
.tcard.revealed .tfront::after { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 3px transparent; }

/* 逆位视觉：牌面上下镜像 */
.tcard.reversed .tfront { transform: rotateY(180deg) rotate(180deg); }

/* 手选牌扇面（旋转量走 --r 变量，避免与选中态 transform 冲突） */
.fan { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; padding: 14px 0 6px; }
.fan .tcard { width: 62px; height: 100px; transition: transform .22s, filter .22s; transform: rotate(var(--r, 0deg)); }
.fan .tcard .tback { border-width: 1px; border-radius: 6px; }
.fan .tcard .tback .emblem { width: 70%; }
.fan .tcard:hover { transform: translateY(-8px) scale(1.06) rotate(var(--r, 0deg)); filter: brightness(1.25); z-index: 2; }
.fan .tcard.picked { transform: translateY(-16px) scale(1.1) rotate(var(--r, 0deg)); filter: brightness(1.35) drop-shadow(0 0 10px var(--gold-glow)); border-radius: 6px; }
.fan .tcard.picked .tback { border-color: var(--gold); }
.fan-note { text-align: center; color: var(--gold); font-size: 14px; margin: 10px 0 2px; letter-spacing: 1px; }

/* 底部悬浮选牌进度条（手选模式） */
.pick-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(0deg, rgba(10, 8, 22, .97), rgba(10, 8, 22, .88) 80%, transparent);
  transform: translateY(110%); transition: transform .3s ease;
}
.pick-bar.show { transform: translateY(0); }
.pick-bar .dots { display: flex; gap: 6px; flex: 1; }
.pick-bar .dots i {
  width: 12px; height: 12px; border-radius: 50%;
  border: 1.5px solid var(--gold-dim); transition: .2s;
}
.pick-bar .dots i.on { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 8px var(--gold-glow); }
.pick-bar .cnt { font-size: 13px; color: var(--ink-dim); min-width: 40px; text-align: center; }
.pick-bar .btn { margin: 0; padding: 10px 22px; font-size: 14px; letter-spacing: 2px; }
.pick-bar .clr {
  background: none; border: 1px solid var(--ink-faint); color: var(--ink-dim);
  border-radius: 10px; padding: 9px 12px; font: inherit; font-size: 13px; cursor: pointer;
}

/* ---------- 牌阵结果 ---------- */
.spread-layout { display: flex; flex-wrap: wrap; gap: 22px 26px; justify-content: center; padding: 14px 0 4px; }
.slot { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 128px; cursor: pointer; }
.slot .pos { font-size: 12.5px; color: var(--gold-dim); letter-spacing: 1px; text-align: center; min-height: 18px; transition: .2s; }
.slot:hover .pos { color: var(--gold); }
.slot .tcard { width: 122px; height: 192px; }
.slot:hover .tcard { filter: drop-shadow(0 0 14px var(--gold-glow)); }
.slot.sel .pos { color: var(--gold); text-shadow: 0 0 8px var(--gold-glow); }
.slot.sel .tcard { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 10px; }

/* 详情卡 */
.card-detail { border-top: 1px dashed rgba(217,185,108,.25); margin-top: 16px; padding-top: 16px; }
.card-detail h3 { color: var(--gold); font-size: 17px; letter-spacing: 1px; }
.card-detail .kw { display: flex; gap: 7px; flex-wrap: wrap; margin: 10px 0; }
.card-detail .kw span { border: 1px solid rgba(176,112,156,.5); color: #d8a8c8; border-radius: 16px; padding: 2px 12px; font-size: 12.5px; }
.card-detail p { color: var(--ink); line-height: 1.85; font-size: 14.5px; margin: 9px 0; }
.card-detail .dom { color: var(--rose); }
.card-detail h4 { color: var(--ink-dim); font-size: 13px; letter-spacing: 2px; margin: 14px 0 4px; }
.card-detail ul { list-style: none; }
.card-detail ul li { color: var(--ink-dim); font-size: 13.5px; line-height: 1.8; padding-left: 16px; position: relative; }
.card-detail ul li::before { content: '✦'; position: absolute; left: 0; color: var(--gold-dim); font-size: 10px; }
.meta-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.meta-row span { background: rgba(217,185,108,.08); border: 1px solid rgba(217,185,108,.2); color: var(--gold-dim); font-size: 12px; border-radius: 8px; padding: 3px 10px; }

/* ---------- 分析区 ---------- */
.analysis { margin-top: 6px; }
.an-item { margin: 15px 0; }
.an-item .lbl { color: var(--ink-dim); font-size: 13px; letter-spacing: 2px; margin-bottom: 7px; }
.an-item .txt { color: var(--ink); font-size: 14.5px; line-height: 1.85; }
.elbars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.elbar .en { font-size: 12px; color: var(--ink-dim); display: flex; justify-content: space-between; margin-bottom: 4px; }
.elbar .bar { height: 7px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; }
.elbar .bar i { display: block; height: 100%; border-radius: 4px; transition: width .8s ease; }
.elbar.f_火 i { background: linear-gradient(90deg, #c25b4a, #e8926f); }
.elbar.f_水 i { background: linear-gradient(90deg, #4a7fc2, #6fb3e8); }
.elbar.f_风 i { background: linear-gradient(90deg, #9c8fd2, #c3b7ee); }
.elbar.f_土 i { background: linear-gradient(90deg, #7a9c5a, #a8cc84); }
.dignity-list li { margin: 6px 0; color: var(--ink); font-size: 14px; line-height: 1.7; list-style: none; }
.dignity-list li b { color: var(--gold-dim); font-weight: 400; }
.flow-arrow { font-size: 15px; color: var(--gold); letter-spacing: 1px; }
.soul-badge {
  display: inline-flex; align-items: center; gap: 10px; border: 1px solid var(--gold-dim); border-radius: 12px;
  padding: 8px 16px; background: rgba(217,185,108,.06); margin-top: 4px;
}
.soul-badge .n { font-size: 26px; color: var(--gold); font-weight: 700; }
.soul-badge .t { font-size: 13px; color: var(--ink-dim); line-height: 1.5; }
.summary-box {
  border: 1px solid rgba(217,185,108,.3); background: linear-gradient(160deg, rgba(217,185,108,.08), rgba(217,185,108,.02));
  border-radius: 12px; padding: 16px 18px; font-size: 15px; line-height: 1.95; color: var(--ink);
}
.proof { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; color: var(--ink-faint); margin-top: 16px; line-height: 1.7; word-break: break-all; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }

/* ---------- 每日 ---------- */
.daily-wrap { display: flex; gap: 26px; align-items: flex-start; flex-wrap: wrap; }
.daily-card-zone { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.daily-date { color: var(--gold-dim); letter-spacing: 3px; font-size: 15px; }
.daily-info { flex: 1; min-width: 280px; }

/* ---------- 百科 ---------- */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filter-bar input { width: 200px; flex: 1; min-width: 140px; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 14px; }
.lib-item { cursor: pointer; transition: transform .2s; }
.lib-item:hover { transform: translateY(-4px); }
.lib-item .tcard { width: 100%; height: auto; aspect-ratio: 118/186; }
.lib-item .cap { text-align: center; font-size: 12px; color: var(--ink-dim); margin-top: 6px; line-height: 1.4; }
.lib-item .cap b { color: var(--ink); font-weight: 600; display: block; font-size: 12.5px; }

/* 模态 */
.modal-mask { position: fixed; inset: 0; background: rgba(6,4,14,.82); backdrop-filter: blur(4px); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal {
  background: linear-gradient(165deg, #1c1640, #120e28); border: 1px solid rgba(217,185,108,.35); border-radius: 16px;
  max-width: 680px; width: 100%; max-height: 88vh; overflow-y: auto; padding: 26px; position: relative;
}
.modal .close { position: absolute; top: 12px; right: 14px; background: none; border: none; color: var(--ink-faint); font-size: 22px; cursor: pointer; }
.modal .close:hover { color: var(--gold); }

/* ---------- 历史/统计 ---------- */
.hist-list { list-style: none; }
.hist-list li {
  border: 1px solid rgba(217,185,108,.15); border-radius: 12px; padding: 14px 16px; margin: 10px 0; cursor: pointer;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; transition: .2s; background: rgba(10,8,20,.45);
}
.hist-list li:hover { border-color: var(--gold-dim); transform: translateX(4px); }
.hist-list .dt { color: var(--ink-faint); font-size: 12px; font-family: ui-monospace, monospace; min-width: 132px; }
.hist-list .qq { color: var(--ink); font-size: 14.5px; flex: 1; min-width: 150px; }
.hist-list .qq small { display: block; color: var(--gold-dim); font-size: 12px; margin-bottom: 2px; }
.hist-list .mini { display: flex; gap: 4px; }
.hist-list .mini em { font-style: normal; font-size: 11px; border: 1px solid rgba(217,185,108,.25); border-radius: 6px; padding: 2px 6px; color: var(--ink-dim); }
.hist-list .mini em.r { color: #d98f6c; border-color: rgba(217,143,108,.4); }
.stat-row { display: flex; align-items: center; gap: 12px; margin: 8px 0; }
.stat-row .sn { width: 150px; font-size: 13.5px; color: var(--ink-dim); text-align: right; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-row .sb { flex: 1; height: 16px; background: rgba(255,255,255,.07); border-radius: 8px; overflow: hidden; }
.stat-row .sb i { display: block; height: 100%; background: linear-gradient(90deg, #8a6fd2, var(--gold)); border-radius: 8px; transition: width .7s; }
.stat-row .sv { width: 44px; font-size: 13px; color: var(--gold); font-family: ui-monospace, monospace; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { border: 1px solid rgba(217,185,108,.2); border-radius: 12px; padding: 14px; text-align: center; background: rgba(217,185,108,.04); }
.kpi .v { font-size: 26px; color: var(--gold); font-weight: 700; }
.kpi .k { font-size: 12px; color: var(--ink-faint); margin-top: 4px; letter-spacing: 1px; }

/* ---------- 方法论 ---------- */
.method h3 { color: var(--gold); font-size: 16px; margin: 20px 0 8px; letter-spacing: 1px; }
.method p, .method li { color: var(--ink-dim); line-height: 1.9; font-size: 14.5px; }
.method ul, .method ol { padding-left: 22px; margin: 6px 0; }
.method b { color: var(--ink); font-weight: 600; }
.method .quote { border-left: 3px solid var(--gold-dim); padding: 4px 16px; margin: 12px 0; color: var(--ink); font-style: italic; background: rgba(217,185,108,.04); border-radius: 0 8px 8px 0; }
.method table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 13.5px; }
.method th, .method td { border: 1px solid rgba(217,185,108,.2); padding: 7px 10px; text-align: left; color: var(--ink-dim); }
.method th { color: var(--gold-dim); font-weight: 600; }

/* ---------- 杂项 ---------- */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: rgba(30,24,64,.95); border: 1px solid var(--gold); color: var(--gold); border-radius: 12px;
  padding: 11px 26px; font-size: 14px; z-index: 99; transition: .3s; pointer-events: none; letter-spacing: 1px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.loading { text-align: center; color: var(--ink-faint); padding: 40px; letter-spacing: 4px; }
.loading::after { content: '✦ ✧ ✦'; display: block; margin-top: 10px; color: var(--gold-dim); animation: twinkle 1.2s infinite; }
@keyframes twinkle { 50% { opacity: .3; } }
.empty { text-align: center; color: var(--ink-faint); padding: 40px 0; line-height: 2; }
footer { text-align: center; color: var(--ink-faint); font-size: 12px; padding: 30px 0 10px; line-height: 1.8; }

/* ---------- 移动端优化 ---------- */
@media (max-width: 640px) {
  .wrap { padding: 12px 12px calc(60px + env(safe-area-inset-bottom, 0px)); }
  .brand h1 { font-size: 18px; }
  .brand .sigil { width: 38px; height: 38px; }

  /* 导航：单行横向滑动 */
  nav { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 14px; scroll-snap-type: x proximity; }
  nav button { padding: 9px 13px; font-size: 14px; }

  /* iOS 聚焦不缩放 */
  select, input[type=text], textarea { font-size: 16px; }

  /* 触摸目标加大 */
  .chip { padding: 8px 18px; min-height: 38px; }
  .spread-opt { padding: 12px 11px; }
  .spread-opt:active { transform: scale(.97); }
  .spread-opt .ds { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

  /* 牌阵结果：紧凑网格（凯尔特十张不再一牌一行） */
  .spread-layout { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 12px 8px; justify-content: center; }
  .slot { width: 100%; }
  .slot .pos { font-size: 10.5px; min-height: 15px; letter-spacing: 0; }
  .slot .tcard { width: 100%; height: auto; aspect-ratio: 118 / 186; }
  .slot:active .tcard { filter: brightness(1.2); }

  /* 扇面：网格更易点选，去随机旋转 */
  .fan { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px 8px; padding-bottom: 90px; }
  .fan .tcard { width: 100%; height: auto; aspect-ratio: 118 / 186; transform: none; }
  .fan .tcard:hover { transform: none; }
  .fan .tcard.picked { transform: translateY(-6px) scale(1.05); }
  .fan .tcard:active { filter: brightness(1.3); }

  /* 元素条 / 统计 */
  .elbars { grid-template-columns: repeat(2, 1fr); }
  .stat-row .sn { width: 96px; font-size: 12.5px; }
  .panel { padding: 15px 13px; border-radius: 12px; }
  .panel h2 { font-size: 16px; }

  /* 每日：堆叠居中，牌更大 */
  .daily-wrap { flex-direction: column; align-items: center; }
  .daily-card-zone { width: 100%; }
  .daily-info { width: 100%; }

  /* 操作按钮全宽更易点 */
  .actions { gap: 9px; }
  .actions .btn { flex: 1; padding: 11px 8px; font-size: 13.5px; }
  .btn:active { transform: scale(.97); }

  /* 模态：贴边更近、底部安全区 */
  .modal-mask { padding: 10px; align-items: flex-end; }
  .modal { max-height: 92vh; padding: 20px 16px calc(24px + env(safe-area-inset-bottom, 0px)); border-radius: 18px 18px 12px 12px; }
  .modal .close { width: 44px; height: 44px; top: 4px; right: 4px; font-size: 20px; }

  .hist-list li { padding: 12px 12px; gap: 8px; }
  .hist-list .dt { min-width: 100px; font-size: 11px; }
  .hist-list .mini em { font-size: 10px; padding: 1px 5px; }

  .toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); font-size: 13px; padding: 10px 20px; max-width: 86vw; }

  .card-detail p { font-size: 14px; }
  .an-item .txt { font-size: 14px; }
  .method p, .method li { font-size: 14px; }
  .lib-grid { gap: 10px; }
  .proof { font-size: 10.5px; }
}
