﻿/* ========== 主题变量 ========== */
:root {
  --radius: 20px;
  --font: "HarmonyOS Sans SC", "PingFang SC", "MiSans", "Microsoft YaHei UI", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ice: #3d8bfd;
  --ice-2: #6cc4ff;
  --fire: #ff7a3d;
  --fire-2: #ffb547;
  --ok: #22b07d;
  --danger: #e5484d;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light dark;
}
[data-theme="light"] {
  --bg-1: #dfeefe; --bg-2: #efe6ff; --bg-3: #fff0e3;
  --text: #13203b; --muted: #5d6a85;
  --glass: rgba(255, 255, 255, .62); --glass-2: rgba(255, 255, 255, .85);
  --line: rgba(19, 32, 59, .09); --shadow: 0 10px 30px -12px rgba(40, 70, 130, .28);
  --card: #ffffff; --card-back: #f6f8ff; --chip: rgba(255, 255, 255, .7);
  --snow: 255, 255, 255;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg-1: #0b1226; --bg-2: #1a1442; --bg-3: #2b1531;
  --text: #e8edf8; --muted: #9aa6c2;
  --glass: rgba(22, 28, 56, .55); --glass-2: rgba(28, 35, 68, .9);
  --line: rgba(255, 255, 255, .08); --shadow: 0 14px 40px -14px rgba(0, 0, 0, .7);
  --card: #161d3a; --card-back: #1b2347; --chip: rgba(255, 255, 255, .06);
  --snow: 200, 220, 255;
  color-scheme: dark;
}

/* ========== 基础 ========== */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; font-family: var(--font); color: var(--text); line-height: 1.6;
  background:
    radial-gradient(1200px 600px at 100% -10%, color-mix(in srgb, var(--fire) 22%, transparent), transparent 60%),
    radial-gradient(900px 600px at -10% 30%, color-mix(in srgb, var(--ice) 25%, transparent), transparent 60%),
    linear-gradient(160deg, var(--bg-1), var(--bg-2) 55%, var(--bg-3));
  background-attachment: fixed;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
  transition: color .3s;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ice); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.ic { width: 1.2em; height: 1.2em; flex: none; vertical-align: -.22em; }
.muted { color: var(--muted); margin: .2rem 0 .8rem; }
.small { font-size: .85rem; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 99; background: var(--glass-2); padding: 8px 12px; border-radius: 10px; }
.skip:focus { left: 8px; }
#snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.glass {
  background: var(--glass); border: 1px solid var(--line); box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
}

/* ========== 顶栏 ========== */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px;
  padding: calc(10px + env(safe-area-inset-top)) clamp(14px, 4vw, 32px) 10px;
  background: color-mix(in srgb, var(--bg-1) 55%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.brand img { border-radius: 10px; box-shadow: 0 4px 14px -4px rgba(61, 139, 253, .6); }
.brand span { display: flex; flex-direction: column; line-height: 1.15; }
.brand small { color: var(--muted); font-size: .72rem; }
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--chip); border: 1px solid var(--line); }
.tabs a { text-decoration: none; padding: 6px 16px; border-radius: 999px; font-size: .92rem; color: var(--muted); transition: .2s; }
.tabs a.on { background: var(--glass-2); color: var(--text); box-shadow: 0 2px 8px -2px rgba(0, 0, 0, .15); }
.top-actions { display: flex; gap: 6px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--chip); transition: .2s var(--ease);
}
.icon-btn:hover { background: var(--glass-2); transform: translateY(-1px); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.lg { width: 52px; height: 52px; border-radius: 50%; }
.icon-btn .ic { width: 20px; height: 20px; }

.bottom-tabs { display: none; }
@media (max-width: 720px) {
  .tabs { display: none; }
  .bottom-tabs {
    display: flex; position: fixed; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 30;
    justify-content: space-around; padding: 6px; border-radius: 22px;
    background: var(--glass-2); border: 1px solid var(--line); box-shadow: var(--shadow);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  }
  .bottom-tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px; font-size: .72rem; text-decoration: none; color: var(--muted); border-radius: 16px; }
  .bottom-tabs a .ic { width: 22px; height: 22px; }
  .bottom-tabs a.on { color: var(--ice); background: color-mix(in srgb, var(--ice) 12%, transparent); }
}

/* ========== 布局 ========== */
main { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 18px clamp(14px, 4vw, 32px) 40px; }
.view { animation: fadeUp .45s var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } }

.hero { display: flex; align-items: center; gap: 20px; padding: 22px clamp(18px, 4vw, 32px); border-radius: 26px; position: relative; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--fire-2) 45%, transparent), transparent 70%); pointer-events: none;
}
.hero-text { flex: 1; min-width: 0; }
.hero h1 {
  margin: 0 0 4px; font-size: clamp(1.4rem, 3.6vw, 2.1rem); letter-spacing: .02em;
  background: linear-gradient(90deg, var(--ice), #8b6cff 50%, var(--fire)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { margin: 0 0 14px; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--chip); font-size: .92rem; transition: .2s var(--ease); white-space: nowrap;
}
.btn:hover { background: var(--glass-2); transform: translateY(-1px); }
.btn:active { transform: scale(.97); }
.btn.primary { border: 0; color: #fff; background: linear-gradient(135deg, var(--ice), #7a5cff); box-shadow: 0 8px 20px -8px rgba(61, 139, 253, .8); }
.btn.on { color: var(--fire); border-color: color-mix(in srgb, var(--fire) 40%, transparent); }
.btn.on-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.btn.danger { color: var(--danger); }

.ring { position: relative; width: 112px; height: 112px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring .track { stroke: var(--line); }
.ring .bar { stroke: url(#ringGrad); stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset .8s var(--ease); }
.ring-text { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.ring-text b { font-size: 1.7rem; }
.ring-text small { color: var(--muted); font-size: .72rem; }
@media (max-width: 520px) { .ring { width: 86px; height: 86px; } .ring-text b { font-size: 1.3rem; } }

.toolbar { display: flex; gap: 10px; margin: 18px 0 10px; }
.search { flex: 1; display: flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 14px; height: 46px; }
.search input { flex: 1; border: 0; background: none; outline: none; min-width: 0; height: 100%; }
.search-ic { color: var(--muted); display: grid; }
.seg { display: flex; padding: 4px; border-radius: 14px; gap: 2px; }
.seg button { border: 0; background: none; width: 42px; border-radius: 10px; color: var(--muted); display: grid; place-items: center; }
.seg button.on { background: var(--glass-2); color: var(--text); box-shadow: 0 2px 6px -2px rgba(0, 0, 0, .2); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; scroll-snap-type: x proximity; }
.chips::-webkit-scrollbar { display: none; }
.chips button {
  flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--chip); font-size: .9rem; transition: .2s; scroll-snap-align: start;
}
.chips button .n { font-size: .72rem; color: var(--muted); }
.chips button.on { color: #fff; border-color: transparent; background: linear-gradient(135deg, hsl(var(--h, 215) 80% 55%), hsl(calc(var(--h, 215) + 30) 80% 58%)); }
.chips button.on .n { color: rgba(255, 255, 255, .8); }
.chips.small button { padding: 4px 12px; font-size: .82rem; }
.chips.small button.on { background: var(--text); color: var(--bg-1); }

/* ========== 卡片 ========== */
.card { perspective: 1400px; height: 100%; -webkit-tap-highlight-color: transparent; }
.card-inner { position: relative; height: 100%; transform-style: preserve-3d; transition: transform .7s var(--ease); }
.card.flipped .card-inner { transform: rotateY(180deg); }
.face {
  position: absolute; inset: 0; border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.face.back { transform: rotateY(180deg); background: var(--card-back); padding: 18px; }
.cover {
  position: relative; height: 42%; min-height: 128px; flex: none; color: #fff; overflow: hidden;
  background:
    radial-gradient(circle at 80% 20%, hsla(var(--h), 100%, 85%, .55), transparent 45%),
    linear-gradient(135deg, hsl(var(--h) 75% 52%), hsl(calc(var(--h) + 40) 70% 42%));
}
.cover .art { position: absolute; right: -14px; bottom: -22px; width: 58%; opacity: .95; }
.cover .art .ic { width: 100%; height: auto; stroke-width: 1.1; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .25)); }
.cover .flakes { position: absolute; inset: 0; opacity: .35; }
.cover .cat-tag {
  position: absolute; left: 14px; top: 14px; display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px; font-size: .75rem; background: rgba(255, 255, 255, .22); backdrop-filter: blur(6px);
}
.badges { position: absolute; right: 12px; top: 12px; display: flex; gap: 6px; }
.badge { font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #fff; color: hsl(var(--h) 70% 40%); }
.badge.new { background: linear-gradient(135deg, var(--fire), var(--fire-2)); color: #fff; }
.badge.read { background: rgba(255, 255, 255, .25); color: #fff; display: inline-flex; align-items: center; gap: 2px; }
.badge.read .ic { width: 12px; height: 12px; }
.c-body { flex: 1; display: flex; flex-direction: column; padding: 14px 16px 12px; min-height: 0; }
.c-body h3 { margin: 0 0 6px; font-size: 1.08rem; line-height: 1.35; }
.c-body p { margin: 0; color: var(--muted); font-size: .88rem; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.c-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding-top: 10px; font-size: .78rem; color: var(--muted); }
.c-foot .stars { color: var(--fire-2); letter-spacing: 1px; }
.c-foot .sp { flex: 1; }
.fav-btn { border: 0; background: none; padding: 4px; color: var(--muted); display: grid; border-radius: 8px; }
.fav-btn .ic { width: 20px; height: 20px; }
.fav-btn.on { color: var(--fire-2); }
.fav-btn.on .ic { fill: currentColor; }
.fav-btn.pop { animation: pop .4s var(--ease); }
@keyframes pop { 50% { transform: scale(1.35); } }

.back h4 { margin: 0 0 4px; display: flex; align-items: center; gap: 6px; font-size: .95rem; color: hsl(var(--h) 70% 55%); }
.back .b-title { font-size: .8rem; color: var(--muted); margin-bottom: 10px; }
.back ol { margin: 0; padding: 0; list-style: none; counter-reset: t; display: flex; flex-direction: column; gap: 8px; overflow: auto; }
.back li { counter-increment: t; display: flex; gap: 10px; font-size: .92rem; align-items: flex-start; }
.back li::before {
  content: counter(t); flex: none; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; font-size: .75rem; font-weight: 700;
  color: #fff; background: linear-gradient(135deg, hsl(var(--h) 75% 55%), hsl(calc(var(--h) + 40) 70% 48%));
}
.back .tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.back .tags span { font-size: .72rem; padding: 2px 8px; border-radius: 6px; background: var(--chip); border: 1px solid var(--line); color: var(--muted); }
.back .b-actions { margin-top: auto; display: flex; gap: 8px; }
.back .b-actions .btn { flex: 1; justify-content: center; padding: 8px 10px; }

/* 网格 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; margin-top: 8px; }
.grid .card { height: 344px; animation: fadeUp .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 30ms); }
.grid .card:hover .face.front { transform: translateY(-4px); box-shadow: 0 20px 40px -18px rgba(40, 70, 130, .5); }
.grid .face { transition: transform .3s var(--ease), box-shadow .3s; }
.card.is-read .face.front .c-body h3 { color: var(--muted); }

/* 卡组 */
.deck { display: flex; flex-direction: column; align-items: center; margin-top: 10px; }
.deck-stage { position: relative; width: min(370px, 88vw); height: min(500px, 60dvh); min-height: 430px; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.deck-stage .card { position: absolute; inset: 0; transition: transform .45s var(--ease), opacity .45s; will-change: transform; }
.deck-stage .card.dragging { transition: none; }
.deck-stage .cover { height: 46%; }
.deck-stage .c-body h3 { font-size: 1.25rem; }
.deck-stage .c-body p { -webkit-line-clamp: 5; line-clamp: 5; font-size: .95rem; }
.deck-nav { display: flex; align-items: center; gap: 20px; margin-top: 22px; }
.deck-meta { display: flex; flex-direction: column; align-items: center; min-width: 120px; }
.deck-meta small { color: var(--muted); font-size: .75rem; }
.swipe-hint { position: absolute; top: 40%; font-size: .9rem; font-weight: 700; padding: 6px 12px; border-radius: 10px; color: #fff; opacity: 0; pointer-events: none; }

.empty { text-align: center; padding: 40px; border-radius: var(--radius); margin-top: 16px; }

/* ========== 面板（工具 / 我的） ========== */
#view-tools, #view-me { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); align-items: start; }
.panel { border-radius: 24px; padding: 20px clamp(16px, 3vw, 24px); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 6px 10px; flex-wrap: wrap; }
.panel h2 { margin: 0; font-size: 1.12rem; }
.pill { font-size: .78rem; padding: 3px 10px; border-radius: 999px; background: var(--chip); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.progress { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin-bottom: 12px; }
.progress i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--ice), var(--ok)); transition: width .5s var(--ease); }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.checklist label { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--chip); border: 1px solid var(--line); cursor: pointer; transition: .2s; }
.checklist input { appearance: none; width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--muted); display: grid; place-items: center; flex: none; margin: 0; transition: .2s; }
.checklist input:checked { background: var(--ok); border-color: var(--ok); }
.checklist input:checked::after { content: ""; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px); }
.checklist input:checked + span { text-decoration: line-through; color: var(--muted); }

.field { display: flex; flex-direction: column; gap: 6px; font-size: .88rem; color: var(--muted); margin-bottom: 10px; }
.field input { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--chip); font-size: 1.05rem; color: var(--text); }
.sliders { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 14px; }
.slider { display: grid; grid-template-columns: 52px 1fr 48px; align-items: center; gap: 10px; font-size: .9rem; }
.slider input { accent-color: var(--c); width: 100%; }
.slider b { text-align: right; font-variant-numeric: tabular-nums; }
.ratio-out { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ratio-out div { padding: 12px; border-radius: 14px; text-align: center; background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); }
.ratio-out small { display: block; color: var(--muted); font-size: .78rem; }
.ratio-out b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.ratio-out .warn { grid-column: 1 / -1; font-size: .82rem; color: var(--danger); background: none; border: 0; padding: 0; }
.counter svg { width: 100%; max-width: 360px; display: block; margin: 0 auto; }
.counter text { fill: var(--text); font-family: var(--font); }

.cat-stats { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.cat-stat { display: grid; grid-template-columns: 24px 80px 1fr 46px; align-items: center; gap: 8px; font-size: .88rem; }
.cat-stat .ic { color: hsl(var(--h) 70% 55%); }
.cat-stat .progress { margin: 0; }
.cat-stat .progress i { background: linear-gradient(90deg, hsl(var(--h) 75% 55%), hsl(calc(var(--h) + 40) 70% 55%)); }
.cat-stat small { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.mini-list { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 6px; }
.mini-list a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--chip); border: 1px solid var(--line); text-decoration: none; transition: .2s; }
.mini-list a:hover { background: var(--glass-2); }
.mini-list .dot { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff; flex: none; background: linear-gradient(135deg, hsl(var(--h) 75% 55%), hsl(calc(var(--h) + 40) 70% 45%)); }
.mini-list .dot .ic { width: 16px; height: 16px; }
.mini-list span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-list small { color: var(--muted); }
.mini-list .none { color: var(--muted); font-size: .9rem; padding: 6px 2px; }
.switch { display: flex; align-items: center; gap: 12px; margin: 8px 0 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch span { width: 44px; height: 26px; border-radius: 99px; background: var(--line); position: relative; transition: .25s; flex: none; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); transition: .25s var(--ease); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--ice); outline-offset: 2px; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 8px; }

/* ========== 全文弹层 ========== */
.sheet {
  padding: 0; border: 0; color: var(--text); background: transparent;
  width: min(760px, 100%); max-width: 100%; max-height: 100dvh; margin: auto;
}
.sheet::backdrop { background: rgba(6, 10, 25, .45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.sheet[open] { animation: sheetIn .45s var(--ease); }
.sheet[open]::backdrop { animation: fade .3s; }
@keyframes sheetIn { from { opacity: 0; transform: translateY(40px) scale(.98); } }
@keyframes fade { from { opacity: 0; } }
.sheet-inner { display: flex; flex-direction: column; max-height: min(88dvh, 900px); background: var(--card); border-radius: 26px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); }
.sheet-head { position: relative; flex: none; }
.sheet-cover { height: 150px; }
.sheet-cover.cover { height: 150px; }
.sheet-cover .art { width: 150px; right: 80px; bottom: -34px; }
.close { position: absolute; right: 14px; top: 14px; background: rgba(255, 255, 255, .25); color: #fff; border-color: rgba(255, 255, 255, .3); backdrop-filter: blur(6px); }
.sheet-body { overflow-y: auto; padding: 18px clamp(18px, 4vw, 32px) 24px; overscroll-behavior: contain; }
.sheet-body h2 { margin: 6px 0 6px; font-size: 1.45rem; line-height: 1.3; }
.lead { color: var(--muted); margin: 0 0 14px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: .78rem; color: var(--muted); }
.meta span { padding: 2px 9px; border-radius: 99px; background: var(--chip); border: 1px solid var(--line); }
.prose h3 { font-size: 1.05rem; margin: 22px 0 8px; padding-left: 10px; border-left: 4px solid hsl(var(--h) 75% 55%); }
.prose p { margin: 8px 0; }
.prose ul { padding-left: 1.2em; margin: 8px 0; }
.prose li { margin: 4px 0; }
.prose li::marker { color: hsl(var(--h) 75% 55%); }
.prose .callout { margin: 14px 0; padding: 12px 14px; border-radius: 14px; font-size: .92rem; background: color-mix(in srgb, var(--fire-2) 14%, transparent); border: 1px solid color-mix(in srgb, var(--fire-2) 35%, transparent); display: flex; gap: 10px; }
.prose .callout .ic { color: var(--fire); margin-top: 2px; }
.table-wrap { overflow-x: auto; margin: 10px 0; border-radius: 14px; border: 1px solid var(--line); }
.prose table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.prose th, .prose td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { background: color-mix(in srgb, hsl(var(--h) 70% 55%) 12%, transparent); white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; }
.sheet-foot { flex: none; display: flex; gap: 8px; align-items: center; justify-content: center; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--card-back); }
.sheet-foot .btn { flex: 1; justify-content: center; max-width: 160px; }
@media (max-width: 720px) {
  .sheet { margin: auto 0 0; width: 100%; }
  .sheet-inner { border-radius: 26px 26px 0 0; max-height: 94dvh; }
  .sheet[open] { animation-name: sheetUp; }
  @keyframes sheetUp { from { transform: translateY(100%); } }
}

/* ========== 提示 ========== */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 100; transform: translate(-50%, 20px);
  padding: 10px 18px; border-radius: 14px; background: var(--text); color: var(--bg-1); font-size: .9rem;
  opacity: 0; pointer-events: none; transition: .3s var(--ease); box-shadow: var(--shadow); white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 721px) { .toast { bottom: 28px; } body { padding-bottom: 0; } }

/* 主题切换的圆形扩散 */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
