/* Hiliand Token Plan — 现代化 SaaS 设计系统（响应式 + 明暗主题） */

:root {
  --bg: #f5f6fa;
  --bg-soft: #eceef5;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #94a3b8;
  --border: #e4e7f0;
  --primary: #4f46e5;
  --primary-2: #4338ca;
  --primary-soft: #eef2ff;
  --success: #16a34a;
  --success-soft: #e9f9ef;
  --warn: #d97706;
  --warn-soft: #fef3e2;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 10px 30px -12px rgba(15, 23, 42, .10);
  --shadow-lg: 0 24px 60px -18px rgba(15, 23, 42, .22);
  --font: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sidebar-w: 248px;
}

[data-theme="dark"] {
  --bg: #0b1020;
  --bg-soft: #10162a;
  --surface: #131a2e;
  --surface-2: #1a2340;
  --text: #e7ecf7;
  --text-2: #b6c2da;
  --muted: #7c89a8;
  --border: #24304f;
  --primary: #6366f1;
  --primary-2: #818cf8;
  --primary-soft: #1e2749;
  --success: #34d399;
  --success-soft: #12291f;
  --warn: #fbbf24;
  --warn-soft: #2c2410;
  --danger: #f87171;
  --danger-soft: #2c1618;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -12px rgba(0, 0, 0, .5);
  --shadow-lg: 0 28px 70px -18px rgba(0, 0, 0, .65);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; overscroll-behavior-y: none; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0; }
button { font-family: inherit; }
::selection { background: var(--primary); color: #fff; }

/* 滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ================= 布局 ================= */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 40;
  overflow-y: auto;
  transition: transform .25s ease;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 6px 10px 18px;
}
.brand-logo {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed 55%, #06b6d4);
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 17px;
  box-shadow: 0 8px 18px -6px rgba(79, 70, 229, .5);
}
.brand-name { font-weight: 750; font-size: 15.5px; }
.brand-sub { font-size: 11px; color: var(--muted); margin-top: -2px; }

.nav-section { margin-top: 14px; padding: 0 10px; font-size: 11px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500; cursor: pointer;
  border: none; background: none; width: 100%; text-align: left; font-size: 14px;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--bg-soft); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 650; }
.nav-item .nav-ico { width: 19px; text-align: center; opacity: .9; }

.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex; flex-direction: column;
  min-width: 0;
}
.topbar {
  height: 62px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px; border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 30;
}
.topbar-title { font-size: 17px; font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.balance-pill {
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, var(--primary-soft), var(--surface-2));
  border: 1px solid var(--border);
  padding: 7px 15px; border-radius: 999px; font-weight: 650;
}
.balance-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 25%, transparent); }
.balance-pill .num { color: var(--primary); font-variant-numeric: tabular-nums; }

.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  color: #fff; display: grid; place-items: center; font-weight: 700; cursor: pointer;
}
.icon-btn {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); cursor: pointer; display: grid; place-items: center; font-size: 15px;
}
.icon-btn:hover { background: var(--bg-soft); }

.content { padding: 26px; max-width: 1240px; width: 100%; margin: 0 auto; }

/* 移动端 */
.menu-btn { display: none; }
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-btn { display: grid; }
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .balance-pill .label { display: none; }
}

/* ================= 组件 ================= */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.card + .card { margin-top: 18px; }
.card-title { font-size: 15.5px; font-weight: 700; margin-bottom: 4px; }
.card-desc { color: var(--muted); font-size: 13px; margin-bottom: 16px; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1024px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.stat-card { padding: 18px 20px; }
.stat-label { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.stat-value { font-size: 25px; font-weight: 750; margin-top: 5px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-sub { color: var(--text-2); font-size: 12px; margin-top: 3px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer;
  font-size: 14px; font-weight: 600; transition: all .15s;
  background: var(--bg-soft); color: var(--text);
  white-space: nowrap;
}
.btn:hover { filter: brightness(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 8px 18px -8px rgba(79, 70, 229, .55); }
.btn-primary:hover { background: var(--primary-2); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn.busy { position: relative; color: transparent !important; }
.btn.busy::after {
  content: ""; position: absolute; width: 16px; height: 16px;
  border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn-ghost.busy::after, .btn.busy::after { border-color: color-mix(in srgb, currentColor 30%, transparent); border-top-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }

.label { display: block; font-size: 12.5px; font-weight: 650; color: var(--text-2); margin-bottom: 6px; }
.input {
  width: 100%; padding: 10px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font-size: 14px; font-family: inherit; outline: none; transition: border .15s, box-shadow .15s;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.textarea { resize: vertical; min-height: 96px; line-height: 1.65; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.field { margin-bottom: 15px; }
.field-help { font-size: 12px; color: var(--muted); margin-top: 5px; }
.field-inline { display: flex; align-items: center; gap: 10px; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--primary); }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 650;
}
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--primary-soft); color: var(--primary); }
.badge-muted { background: var(--bg-soft); color: var(--muted); }

.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; padding: 11px 14px; background: var(--surface-2);
  color: var(--muted); font-size: 12px; font-weight: 650; white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--surface-2); }
.col-actions { text-align: right; white-space: nowrap; }
.col-actions .btn { margin-left: 6px; }
.empty { padding: 42px 20px; text-align: center; color: var(--muted); }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(9, 12, 24, .5);
  backdrop-filter: blur(3px); display: grid; place-items: center;
  z-index: 100; opacity: 0; transition: opacity .22s; padding: 18px;
}
.modal-backdrop.show { opacity: 1; }
.modal {
  width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto;
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); transform: translateY(14px) scale(.98); transition: transform .22s;
}
.modal-backdrop.show .modal { transform: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 0; }
.modal-head h3 { font-size: 16.5px; }
.modal-x { border: none; background: none; color: var(--muted); font-size: 16px; cursor: pointer; }
.modal-body { padding: 18px 22px; }
.modal-body p { color: var(--text-2); }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 22px 20px; }

/* Toast */
#toast-root { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 16px; box-shadow: var(--shadow-lg); font-size: 13.5px; font-weight: 550;
  opacity: 0; transform: translateX(20px); transition: all .3s; max-width: 380px;
}
.toast.show { opacity: 1; transform: none; }
.toast-icon { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; color: #fff; flex-shrink: 0; }
.toast-success .toast-icon { background: var(--success); }
.toast-error .toast-icon { background: var(--danger); }
.toast-info .toast-icon { background: var(--primary); }

/* 顶部进度条 */
#top-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 100%;
  background: linear-gradient(90deg, var(--primary), #06b6d4);
  transform-origin: left; z-index: 300;
  animation: prog 1.4s ease-in-out infinite;
}
#top-progress.done { animation: none; opacity: 0; transition: opacity .3s; }
@keyframes prog {
  0% { transform: scaleX(0); }
  50% { transform: scaleX(.7); }
  100% { transform: scaleX(.92); }
}

/* ================= 应用介绍引导页 ================= */
.landing { min-height: 100vh; background:
    radial-gradient(1100px 560px at 10% -10%, rgba(99, 102, 241, .16), transparent 60%),
    radial-gradient(900px 520px at 95% 110%, rgba(6, 182, 212, .13), transparent 55%),
    var(--bg); }
.landing-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 6vw; position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
}
.hero { text-align: center; padding: 84px 6vw 56px; max-width: 1080px; margin: 0 auto; }
.hero-badge {
  display: inline-block; padding: 6px 16px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary);
  font-size: 12.5px; font-weight: 650; border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
}
.hero-title { font-size: clamp(32px, 5.2vw, 54px); line-height: 1.18; margin: 22px 0 18px; letter-spacing: -.03em; }
.hero-sub { color: var(--text-2); font-size: clamp(15px, 2vw, 17.5px); line-height: 1.9; }
.hero-actions { display: flex; gap: 14px; justify-content: center; margin: 30px 0 44px; flex-wrap: wrap; }
.btn-lg { padding: 13px 28px; font-size: 15.5px; border-radius: 12px; }
.hero-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  max-width: 900px; margin: 0 auto;
}
.hero-stats > div {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 14px; box-shadow: var(--shadow);
}
.hero-stats b { display: block; font-size: 15px; }
.hero-stats span { color: var(--muted); font-size: 12px; }
@media (max-width: 800px) { .hero-stats { grid-template-columns: repeat(2, 1fr); } }

.landing-section { padding: 64px 6vw; max-width: 1180px; margin: 0 auto; }
.landing-section-title { font-size: clamp(24px, 3.4vw, 32px); font-weight: 780; text-align: center; letter-spacing: -.02em; }
.landing-section-sub { text-align: center; color: var(--muted); margin: 10px 0 36px; }
.landing-soft { max-width: none; background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.landing-soft .steps-row { max-width: 1180px; margin: 0 auto; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 1024px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .feature-grid { grid-template-columns: 1fr; } }
.feature-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.feature-ico {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary); margin-bottom: 14px;
}
.feature-title { font-size: 16px; font-weight: 720; margin-bottom: 8px; }
.feature-desc { color: var(--text-2); font-size: 13.5px; line-height: 1.85; }

.steps-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 900px) { .steps-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .steps-row { grid-template-columns: 1fr; } }
.step-card { text-align: center; padding: 22px 16px; background: var(--bg-soft); border-radius: var(--radius); }
.step-card .step-num {
  width: 38px; height: 38px; border-radius: 50%; margin: 0 auto 12px;
  background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 750;
}
.step-card .step-title { font-weight: 700; margin-bottom: 6px; }
.step-card .step-desc { color: var(--muted); font-size: 12.5px; }

.cta-box {
  text-align: center; background: linear-gradient(135deg, var(--primary), #7c3aed 60%, #06b6d4);
  border-radius: 22px; padding: 56px 28px; color: #fff;
  box-shadow: 0 30px 70px -22px rgba(79, 70, 229, .55);
}
.cta-box h2 { font-size: clamp(22px, 3vw, 30px); margin-bottom: 12px; }
.cta-box p { opacity: .92; margin-bottom: 26px; }
.cta-box .btn-ghost { border-color: rgba(255, 255, 255, .55); color: #fff; background: rgba(255, 255, 255, .12); }
.cta-box .btn-ghost:hover { background: rgba(255, 255, 255, .22); }
.cta-box .btn-primary { background: #fff; color: var(--primary); box-shadow: none; }

.landing-footer {
  text-align: center; color: var(--muted); font-size: 12.5px;
  padding: 30px 6vw 40px; border-top: 1px solid var(--border);
}

/* ================= 认证页 ================= */
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 22px;
  background:
    radial-gradient(1000px 520px at 12% -8%, rgba(99, 102, 241, .16), transparent 60%),
    radial-gradient(900px 500px at 95% 110%, rgba(6, 182, 212, .14), transparent 55%),
    var(--bg);
}
.auth-card { width: 100%; max-width: 420px; padding: 32px 30px; }
.auth-title { font-size: 22px; font-weight: 750; }
.auth-sub { color: var(--muted); font-size: 13.5px; margin: 6px 0 22px; }
.auth-tabs { display: flex; background: var(--bg-soft); border-radius: var(--radius-sm); padding: 4px; margin-bottom: 22px; }
.auth-tab {
  flex: 1; padding: 8px; text-align: center; border-radius: 7px; cursor: pointer;
  font-weight: 600; color: var(--text-2); font-size: 13.5px; border: none; background: none;
}
.auth-tab.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }
.auth-note { margin-top: 16px; font-size: 12.5px; color: var(--muted); text-align: center; }

/* ================= 对话页 ================= */
.chat-shell { display: flex; flex-direction: column; height: calc(100vh - 62px); }
.chat-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 26px; border-bottom: 1px solid var(--border); background: var(--surface);
}
.chat-scroll { flex: 1; overflow-y: auto; padding: 22px 26px; overscroll-behavior: contain; }
.chat-inner { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.msg { display: flex; gap: 12px; }
.msg-avatar {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff;
}
.msg-user .msg-avatar { background: linear-gradient(135deg, #6366f1, #06b6d4); }
.msg-assistant .msg-avatar { background: linear-gradient(135deg, #059669, #10b981); }
.msg-body { flex: 1; min-width: 0; }
.msg-name { font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.msg-text {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 13px 16px; white-space: pre-wrap; word-break: break-word; line-height: 1.75;
}
.msg-user .msg-text { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 22%, transparent); }
.msg-text.msg-error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); color: var(--danger); }
.msg-meta { font-size: 11.5px; color: var(--muted); margin-top: 5px; display: flex; gap: 14px; }
.cursor-blink { display: inline-block; width: 8px; height: 15px; background: var(--primary); vertical-align: text-bottom; margin-left: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.chat-input-area {
  border-top: 1px solid var(--border); background: var(--surface);
  padding: 14px 26px 18px;
}
.chat-input-inner { max-width: 860px; margin: 0 auto; display: flex; gap: 10px; align-items: flex-end; }
.chat-textarea {
  flex: 1; min-height: 52px; max-height: 180px; resize: none;
  padding: 13px 15px; border-radius: 13px;
}
.chat-empty {
  text-align: center; color: var(--muted); padding: 70px 20px;
}
.chat-empty .big { font-size: 42px; margin-bottom: 10px; }

/* ================= 套餐卡片 ================= */
.plan-card {
  position: relative; display: flex; flex-direction: column; gap: 12px;
  padding: 24px; overflow: hidden;
}
.plan-card.hot { border-color: color-mix(in srgb, var(--primary) 45%, transparent); }
.plan-flag {
  position: absolute; top: 14px; right: -32px; transform: rotate(38deg);
  background: var(--primary); color: #fff; font-size: 11px; font-weight: 700;
  padding: 4px 38px;
}
.plan-name { font-size: 16px; font-weight: 700; }
.plan-credits { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.plan-credits small { font-size: 13px; color: var(--muted); font-weight: 600; margin-left: 4px; }
.plan-price { font-size: 17px; font-weight: 700; color: var(--primary); }
.plan-desc { color: var(--muted); font-size: 13px; min-height: 38px; }

/* ================= 步骤指引 ================= */
.steps { display: flex; flex-direction: column; gap: 0; margin-bottom: 20px; }
.step { display: flex; gap: 14px; }
.step-num {
  width: 30px; height: 30px; border-radius: 50%; background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; font-weight: 750; font-size: 13px; flex-shrink: 0;
}
.step-body { padding-bottom: 18px; flex: 1; }
.step-title { font-weight: 700; font-size: 14px; }
.step-desc { color: var(--text-2); font-size: 13px; margin-top: 3px; }
.step-line { width: 2px; background: var(--border); margin: 4px 0 4px 14px; flex: 1; min-height: 12px; }
.code-inline {
  font-family: var(--mono); background: var(--bg-soft); border: 1px solid var(--border);
  padding: 1px 7px; border-radius: 6px; font-size: 12.5px;
}
.formula-box {
  background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
  border-radius: var(--radius-sm); padding: 14px 16px; font-size: 13.5px;
}
.formula-box code { font-family: var(--mono); color: var(--primary); font-weight: 650; }

.test-result { margin-top: 14px; border-radius: var(--radius-sm); padding: 14px 16px; font-size: 13.5px; }
.test-result.ok { background: var(--success-soft); color: var(--success); }
.test-result.err { background: var(--danger-soft); color: var(--danger); }
.test-result ul { margin: 8px 0 0; padding-left: 20px; }

/* 简易柱状图 */
.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar { width: 100%; max-width: 34px; border-radius: 5px 5px 0 0; background: linear-gradient(180deg, var(--primary), color-mix(in srgb, var(--primary) 55%, transparent)); min-height: 2px; }
.bar-label { font-size: 10px; color: var(--muted); white-space: nowrap; }

/* 页面标题 */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.page-title { font-size: 21px; font-weight: 750; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }

/* 居中加载 */
.loading { display: grid; place-items: center; min-height: 60vh; color: var(--muted); }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--primary);
  animation: spin .8s linear infinite; margin-bottom: 12px;
}
