/* 琥珀快讯 · 版式参考 alphaheartbeat.cn（左导航 / 主栏快讯流 / 右侧栏），浅色与深色两套主题 */
:root {
  --orange: #ff6b2b;
  --orange-2: #e05520;
  --orange-soft: rgba(255, 107, 43, .10);
  --orange-line: rgba(255, 107, 43, .35);
  --blue: #1e90d4;
  --red: #ff3d5a;
  --green: #00b26b;
  --gold: #ffb800;
  --level-s: #ff3d5a;
  --level-a: #ff6b2b;
  --level-b: #1e90d4;
  --level-c: #6b7c93;
  --up: #e8364f;        /* 红涨 */
  --down: #0fa968;      /* 绿跌 */
  --bg: #f4f5f7;
  --panel: #ffffff;
  --panel-2: #f7f8fa;
  --line: #e8eaef;
  --line-2: #f0f1f4;
  --text: #141821;
  --text-2: #3b4250;
  --muted: #7a8394;
  --chip: #f1f2f5;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04);
  --mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --body: -apple-system, BlinkMacSystemFont, "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --nav-w: 238px;
  --side-w: 344px;
  --top-h: 76px;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #070b12;
  --panel: #0c121b;
  --panel-2: #101722;
  --line: #1b2433;
  --line-2: #141c28;
  --text: #e8ebf1;
  --text-2: #c3c9d4;
  --muted: #7d889b;
  --chip: #151d29;
  --orange-soft: rgba(255, 107, 43, .14);
  --shadow: none;
  --level-c: #61738c;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text); font: 14px/1.6 var(--body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; border-radius: 6px; }
.icon { flex: none; display: block; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- 外框 ---------- */
.app { display: grid; grid-template-columns: var(--nav-w) 1fr; min-height: 100vh; }
.nav {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--panel); border-right: 1px solid var(--line); padding: 22px 12px 18px;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 12px 26px; }
.brand strong { display: block; font-size: 22px; letter-spacing: 1px; line-height: 1.1; }
.brand small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.nav-list { display: flex; flex-direction: column; gap: 6px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-radius: 10px;
  font-size: 15.5px; font-weight: 600; color: var(--text-2); border: 0; background: none; text-align: left; width: 100%;
}
.nav-item:hover { background: var(--panel-2); }
.nav-item.active { color: var(--orange); background: var(--orange-soft); }
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--orange);
}
.nav-sep { height: 1px; background: var(--line); margin: 18px 8px; }
.nav-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.nav-foot a { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 10px; color: var(--text-2); font-size: 14px; }
.nav-foot a:hover { background: var(--panel-2); }
.nav-foot a .icon:last-child { margin-left: auto; color: var(--muted); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--top-h); display: flex; align-items: center; gap: 12px;
  padding: 0 28px; background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar h2 { margin: 0; font-size: 18px; font-weight: 700; }
.topbar .spacer { flex: 1; }
.live { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(0, 178, 107, .5); animation: ping 2s infinite; }
.live.off i { background: var(--muted); animation: none; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(0, 178, 107, .45); } 80%, 100% { box-shadow: 0 0 0 7px rgba(0, 178, 107, 0); } }
.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel); font-size: 13.5px; font-weight: 600; white-space: nowrap;
}
.btn:hover { border-color: var(--orange-line); }
.btn.on { color: var(--orange); border-color: var(--orange); background: var(--orange-soft); }
.btn.round { width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: 50%; }
.btn.primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn.primary:hover { background: var(--orange-2); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }

.body { display: grid; grid-template-columns: minmax(0, 1fr) var(--side-w); gap: 24px; padding: 24px 28px 60px; align-items: start; }
.body.no-side { grid-template-columns: minmax(0, 1fr); }
.side { position: sticky; top: calc(var(--top-h) + 24px); display: flex; flex-direction: column; gap: 16px; max-height: calc(100vh - var(--top-h) - 48px); overflow: auto; scrollbar-width: thin; }
.no-side .side { display: none; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.panel { padding: 18px 18px 16px; }
.panel-h { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.panel-h h3 { margin: 0; font-size: 16px; font-weight: 700; }
.panel-h small { color: var(--muted); font-size: 12px; }
.panel-h .x { margin-left: auto; }
.panel-close { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; }
.panel-close strong { font-size: 15px; }
.panel-close small { display: block; color: var(--muted); font-size: 12px; }

/* ---------- 首屏 hero ---------- */
.hero { position: relative; overflow: hidden; }
.hero-in { position: relative; padding: 26px 26px 20px; }
.hero h1 { position: relative; margin: 0 0 18px; font-size: 32px; line-height: 1.25; font-weight: 800; letter-spacing: .5px; }
.hero h1 em { font-style: normal; color: var(--orange); }
.hero p.lead { position: relative; margin: 0 0 18px; color: var(--text-2); font-size: 14.5px; max-width: 620px; }
.hero .notice { position: relative; margin: 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--text-2); font-size: 12.5px; max-width: 760px; }
.hero .notice b { font-family: var(--mono); letter-spacing: 1px; margin-right: 6px; font-weight: 700; }
.hero-art { position: absolute; right: -60px; top: -70px; width: 400px; height: 260px; opacity: .45; pointer-events: none; color: var(--muted); }
[data-theme="dark"] .hero-art { opacity: .35; }
.metrics { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); background: var(--panel); border-radius: 0 0 14px 14px; }
.metric { padding: 12px 16px 14px; border-right: 1px solid var(--line); background: none; border-top: 0; border-bottom: 0; border-left: 0; text-align: left; }
.metric:last-child { border-right: 0; }
.metric:hover { background: var(--panel-2); }
.metric small { display: block; color: var(--muted); font-size: 12px; }
.metric strong { display: block; font-size: 21px; font-weight: 800; font-family: var(--mono); letter-spacing: -.5px; }
.metric span { font-size: 12.5px; font-family: var(--mono); }

/* ---------- 筛选条 ---------- */
.filters { padding: 18px 16px 0; }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.filter-row + .filter-row { margin-top: 12px; }
.search { flex: 1 1 320px; position: relative; }
.search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input {
  width: 100%; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2);
  padding: 0 40px 0 40px; outline: none;
}
.search input:focus { border-color: var(--orange); background: var(--panel); }
.search kbd { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font: 11px var(--mono); color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab { height: 42px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); font-weight: 700; font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; }
.tab:hover { border-color: var(--orange-line); }
.tab.on { background: var(--orange); border-color: var(--orange); color: #fff; }
.tab .icon { color: var(--gold); }
.tab.on .icon { color: #fff; }
.field { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.field select {
  height: 36px; min-width: 104px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); padding: 0 10px; font-weight: 600; color: var(--text);
}
.drop { position: relative; }
.drop > summary { list-style: none; }
.drop > summary::-webkit-details-marker { display: none; }
.drop-panel {
  position: absolute; z-index: 30; top: 42px; left: 0; width: 360px; max-height: 360px; overflow: auto; padding: 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, .14);
}
.drop-panel h4 { margin: 4px 0 8px; font-size: 12px; color: var(--muted); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.toggle input { accent-color: var(--orange); }
.filter-row .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.statusbar {
  margin: 14px 0 0; padding: 10px 14px; background: var(--panel-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; color: var(--text-2);
}
.statusbar b { color: var(--orange); font-weight: 700; margin-right: 6px; }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px 0; }
.active-filters .chip { background: var(--orange-soft); color: var(--orange); }

/* ---------- 快讯条目 ---------- */
.feed { padding: 4px 16px 8px; }
.item {
  display: grid; grid-template-columns: 76px minmax(0, 1fr) 36px; gap: 4px 6px; padding: 20px 0 18px;
  border-bottom: 1px solid var(--line-2); cursor: pointer;
}
.item:last-child { border-bottom: 0; }
.item.fresh { animation: fresh 3s ease-out; }
@keyframes fresh { from { background: var(--orange-soft); } to { background: transparent; } }
.item time { font-family: var(--mono); line-height: 1.25; }
.item time b { display: block; font-size: 15.5px; font-weight: 700; color: var(--text); }
.item time small { font-size: 11.5px; color: var(--muted); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 12.5px; margin-bottom: 6px; }
.src { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--text-2); }
.src::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.lv-S .src::before { background: var(--level-s); }
.lv-A .src::before { background: var(--level-a); }
.lv-B .src::before { background: var(--level-b); }
.badge { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 4px; font-size: 11.5px; font-weight: 800; line-height: 1; }
.badge.S { color: var(--level-s); background: color-mix(in srgb, var(--level-s) 13%, transparent); }
.badge.A { color: var(--level-a); background: color-mix(in srgb, var(--level-a) 13%, transparent); }
.badge.B { color: var(--level-b); background: color-mix(in srgb, var(--level-b) 13%, transparent); }
.badge.C { color: var(--level-c); background: color-mix(in srgb, var(--level-c) 15%, transparent); }
.badge.bull { color: var(--up); background: color-mix(in srgb, var(--up) 12%, transparent); }
.badge.bear { color: var(--down); background: color-mix(in srgb, var(--down) 13%, transparent); }
.badge.neutral, .badge.unsure { color: var(--muted); background: var(--chip); }
.tagx { font-weight: 700; color: var(--orange); }
.tagx.multi { color: var(--blue); }
.tagx.official { color: var(--gold); }
.tagx.type { color: var(--muted); font-weight: 600; }
.title { margin: 0; font-size: 16px; line-height: 1.65; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.lv-S .title { color: var(--level-s); font-weight: 800; }
.lv-A .title { font-weight: 800; }
.wiim .title { font-weight: 600; }
.ai { margin: 6px 0 0; font-size: 14px; line-height: 1.7; color: var(--text-2); overflow-wrap: anywhere; }
.ai b { color: var(--orange); font-weight: 700; margin-right: 4px; }
.item .chips { margin-top: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 9px; border-radius: 6px; border: 0;
  background: var(--chip); color: var(--text-2); font-size: 12px; font-weight: 600; white-space: nowrap;
}
.chip:hover { color: var(--orange); }
.chip .code { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.chip.seg { background: transparent; border: 1px dashed var(--line); }
.chip.on { background: var(--orange); color: #fff; }
.chip.on .code { color: rgba(255, 255, 255, .8); }
.chip .icon { width: 12px; height: 12px; }
.share { width: 34px; height: 34px; border-radius: 50%; border: 0; background: none; color: var(--muted); display: grid; place-items: center; }
.share:hover { background: var(--panel-2); color: var(--orange); }

/* 展开详情 */
.detail { grid-column: 2 / 3; margin-top: 12px; padding: 14px 16px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); cursor: default; font-size: 13px; }
.detail h5 { margin: 12px 0 6px; font-size: 12.5px; color: var(--muted); font-weight: 700; letter-spacing: .5px; }
.detail h5:first-child { margin-top: 0; }
.detail .reasons { display: flex; flex-wrap: wrap; gap: 6px; }
.detail .reasons span { padding: 2px 8px; border-radius: 5px; background: var(--chip); font-size: 12px; }
.ev { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding: 8px 0; border-top: 1px dashed var(--line); }
.ev:first-of-type { border-top: 0; }
.ev .tier { font-size: 11px; padding: 1px 6px; border-radius: 4px; background: var(--chip); color: var(--muted); align-self: start; margin-top: 2px; white-space: nowrap; }
.ev .tier.primary { background: color-mix(in srgb, var(--gold) 18%, transparent); color: #b07f00; }
[data-theme="dark"] .ev .tier.primary { color: var(--gold); }
.ev a { color: var(--text); font-weight: 600; }
.ev a:hover { color: var(--orange); }
.ev p { margin: 2px 0 0; color: var(--text-2); grid-column: 2; }
.ev .when { grid-column: 2; font-size: 11.5px; color: var(--muted); }
table.mini { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.mini th, table.mini td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.mini th { color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; }
table.mini td { white-space: nowrap; }
table.mini td.path { white-space: normal; min-width: 260px; }
table.mini td.num, table.mini th.num { text-align: right; font-family: var(--mono); white-space: nowrap; }
.links { display: flex; flex-direction: column; gap: 4px; }
.links a { color: var(--blue); overflow-wrap: anywhere; }
.links a:hover { text-decoration: underline; }
.open-link { display: inline-flex; align-items: center; gap: 4px; color: var(--blue); font-weight: 600; }

.more { display: flex; justify-content: center; padding: 18px 0 8px; }
.empty, .error, .loading { padding: 48px 16px; text-align: center; color: var(--muted); }
.error { color: var(--red); }
.loading::after { content: ""; display: inline-block; width: 14px; height: 14px; margin-left: 8px; vertical-align: -2px; border: 2px solid var(--line); border-top-color: var(--orange); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--chip), var(--panel-2), var(--chip)); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- 侧栏 ---------- */
.watch-add { display: flex; gap: 8px; margin-bottom: 10px; }
.watch-add input { flex: 1; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); padding: 0 10px; outline: none; text-transform: uppercase; }
.watch-add input:focus { border-color: var(--orange); }
.rows { display: flex; flex-direction: column; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 8px; border: 0; background: none; text-align: left; width: 100%; }
.row:hover { background: var(--panel-2); }
.row .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.row .nm .code { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-left: 6px; font-weight: 500; }
.row .cnt { font-family: var(--mono); font-size: 12.5px; color: var(--text-2); }
.row .cnt b { color: var(--orange); }
.row .rm { width: 22px; height: 22px; border: 0; background: none; color: var(--muted); border-radius: 50%; display: grid; place-items: center; }
.row .rm:hover { background: var(--chip); color: var(--red); }
.balance { display: flex; width: 64px; height: 6px; border-radius: 3px; overflow: hidden; background: var(--chip); }
.balance i { display: block; height: 100%; }
.balance .b { background: var(--up); }
.balance .r { background: var(--down); }
.levels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.lvbox { border-radius: 10px; padding: 10px 8px; text-align: center; background: var(--panel-2); border: 1px solid var(--line); }
.lvbox b { display: block; font-size: 20px; font-family: var(--mono); line-height: 1.2; }
.lvbox small { font-size: 12px; color: var(--muted); }
.lvbox.S b { color: var(--level-s); } .lvbox.A b { color: var(--level-a); } .lvbox.B b { color: var(--level-b); } .lvbox.C b { color: var(--level-c); }
.senti { margin-top: 12px; }
.senti-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--chip); margin: 6px 0; }
.senti-bar i { display: block; }
.senti-legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.legend dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 10px; font-size: 12.5px; color: var(--text-2); }
.legend dt { align-self: start; }
.legend dd { margin: 0; }
.side-note { font-size: 12.5px; color: var(--text-2); margin: 0; }
.side-note a { color: var(--orange); font-weight: 600; }

/* ---------- 其他页面 ---------- */
.page-h { padding: 22px 24px; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px; }
.page-h h1 { margin: 0; font-size: 26px; font-weight: 800; }
.page-h p { margin: 4px 0 0; color: var(--text-2); }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 16px; }
.seg-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; text-align: left; border: 1px solid var(--line); }
.seg-card:hover { border-color: var(--orange-line); }
.seg-card h3 { margin: 0; font-size: 16px; }
.seg-card .code { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.seg-card .nums { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-2); font-family: var(--mono); }
.seg-card .nums b { color: var(--text); font-size: 15px; }
.tk-head { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; padding: 22px 24px; }
.tk-head h1 { margin: 0; font-size: 28px; font-weight: 800; }
.tk-head h1 .code { font-family: var(--mono); font-size: 18px; color: var(--muted); margin-left: 10px; font-weight: 600; }
.tk-head .px b { font-family: var(--mono); font-size: 26px; }
.tk-head .chg { display: flex; gap: 14px; font-family: var(--mono); font-size: 13px; }
.spark { width: 100%; height: 150px; display: block; }
.spark .area { fill: var(--orange-soft); }
.spark .line { fill: none; stroke: var(--orange); stroke-width: 2; }
.spark text { fill: var(--muted); font: 11px var(--mono); }
.wiim-list { display: flex; flex-direction: column; }
.wiim-row { display: grid; grid-template-columns: 70px 1fr; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.wiim-row:last-child { border-bottom: 0; }
.wiim-row time { font-family: var(--mono); color: var(--muted); font-size: 12.5px; }
.wiim-row p { margin: 0; }
.section { margin-top: 16px; }
.section > .panel-h { padding: 18px 18px 0; }
.uni-group { padding: 6px 18px 14px; }
.uni-group h4 { margin: 10px 0 8px; font-size: 13px; color: var(--muted); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--panel-2); }
table.data td.num { font-family: var(--mono); text-align: right; white-space: nowrap; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill.ok { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.pill.warn { color: #c98a00; background: color-mix(in srgb, var(--gold) 18%, transparent); }
.pill.bad { color: var(--red); background: color-mix(in srgb, var(--red) 13%, transparent); }
.stack { display: flex; height: 14px; border-radius: 3px; overflow: hidden; min-width: 2px; }
.stack i { display: block; height: 100%; }
.stack .S { background: var(--level-s); } .stack .A { background: var(--level-a); } .stack .B { background: var(--level-b); } .stack .C { background: var(--level-c); opacity: .6; }
.wrap-x { overflow-x: auto; }

#toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; transition: .2s; z-index: 100;
  background: var(--text); color: var(--panel); padding: 10px 18px; border-radius: 10px; font-size: 13px; font-weight: 600; pointer-events: none;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.to-top { position: fixed; right: 24px; bottom: 24px; z-index: 40; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); box-shadow: 0 6px 18px rgba(0,0,0,.12); display: none; font-weight: 700; }
.to-top.show { display: grid; place-items: center; }

/* 登录页 */
.login { min-height: 100vh; display: grid; place-items: center; }
.login form { width: 320px; display: flex; flex-direction: column; gap: 10px; padding: 28px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.login input { height: 40px; border-radius: 8px; border: 1px solid var(--line); padding: 0 10px; }
.login button { height: 40px; border-radius: 8px; border: 0; background: var(--orange); color: #fff; font-weight: 700; }
.login .error { color: var(--red); margin: 0; }

/* ---------- 窄屏 ---------- */
@media (max-width: 1280px) {
  :root { --side-w: 300px; }
  .hero h1 { font-size: 27px; }
}
@media (max-width: 1080px) {
  .body { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; max-height: none; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .nav { position: static; height: auto; flex-direction: row; align-items: center; padding: 10px; overflow-x: auto; }
  .brand { padding: 0 10px 0 0; }
  .brand small, .nav-sep, .nav-foot { display: none; }
  .nav-list { flex-direction: row; }
  .nav-item { padding: 8px 12px; font-size: 14px; }
  .nav-item.active::before { display: none; }
  .topbar { padding: 0 14px; }
  .body { padding: 14px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .item { grid-template-columns: 58px minmax(0, 1fr) 32px; }
  .hero-art { display: none; }
}
