:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-2: #f0f0ed;
  --text: #17181a;
  --text-2: #55585e;
  --text-3: #8a8d93;
  --border: #e6e6e2;
  --accent: #2f5bea;
  --major: #d9362b;
  --major-bg: #fdf0ee;
  --major-border: #f4cfca;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
  --c-china: #d9362b;
  --c-world: #2f5bea;
  --c-business: #b7791f;
  --c-tech: #7c4dde;
  --c-other: #2c8a6a;
  --radius: 14px;
  --maxw: 720px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111214; --surface: #1a1b1e; --surface-2: #232428; --text: #ececee; --text-2: #b0b2b8;
    --text-3: #7d8087; --border: #2a2c30; --accent: #7c9cff; --major: #ff6b5e; --major-bg: #2a1a19;
    --major-border: #4a2723; --shadow: none;
    --c-china: #ff6b5e; --c-world: #7c9cff; --c-business: #e0a94a; --c-tech: #b394ff; --c-other: #5cc59e;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111214; --surface: #1a1b1e; --surface-2: #232428; --text: #ececee; --text-2: #b0b2b8;
  --text-3: #7d8087; --border: #2a2c30; --accent: #7c9cff; --major: #ff6b5e; --major-bg: #2a1a19;
  --major-border: #4a2723; --shadow: none;
  --c-china: #ff6b5e; --c-world: #7c9cff; --c-business: #e0a94a; --c-tech: #b394ff; --c-other: #5cc59e;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans CJK SC", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top);
}
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 10px 16px 4px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 19px; letter-spacing: .5px; }
.top-actions { display: flex; align-items: center; gap: 6px; min-width: 0; }
.status { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #3bb36b; margin-right: 6px; vertical-align: 1px; }
.status.warn::before { background: #e0a94a; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: var(--text-2);
  display: grid; place-items: center; cursor: pointer; flex: none;
}
.icon-btn:hover { background: var(--surface-2); }

.tabs {
  max-width: var(--maxw); margin: 0 auto; padding: 4px 12px 8px;
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs.hidden { display: none; }
.tab {
  flex: none; border: 0; background: transparent; color: var(--text-2); cursor: pointer;
  padding: 6px 14px; border-radius: 999px; font-size: 15px;
}
.tab:hover { background: var(--surface-2); }
.tab.active { background: var(--text); color: var(--bg); font-weight: 600; }

/* ---------- 内容 ---------- */
.view { max-width: var(--maxw); margin: 0 auto; padding: 12px 16px 24px; outline: none; }
.section-title {
  font-size: 13px; font-weight: 600; color: var(--text-3); letter-spacing: 1px;
  margin: 18px 4px 8px; display: flex; align-items: center; gap: 8px;
}
.section-title .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--major); box-shadow: 0 0 0 4px var(--major-bg); }

.card {
  display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 10px; box-shadow: var(--shadow); transition: transform .12s ease, border-color .12s;
}
.card:hover { border-color: color-mix(in srgb, var(--text-3) 50%, var(--border)); }
.card:active { transform: scale(.99); }
.card.major { background: var(--major-bg); border-color: var(--major-border); padding: 16px 18px; }
.card h2 { font-size: 17px; line-height: 1.45; margin: 0 0 6px; font-weight: 650; }
.card.major h2 { font-size: 19px; }
.card p { margin: 0; color: var(--text-2); font-size: 14.5px; line-height: 1.65; }
.card .clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card.major .clamp { -webkit-line-clamp: 4; }

.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 10px; font-size: 12.5px; color: var(--text-3); }
.badge { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 12px; }
.badge.major { color: #fff; background: var(--major); padding: 1px 8px; border-radius: 6px; }
.cat::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: currentColor; display: inline-block; margin-right: 5px; vertical-align: 2px; }
.cat-china { color: var(--c-china); } .cat-world { color: var(--c-world); } .cat-business { color: var(--c-business); }
.cat-tech { color: var(--c-tech); } .cat-other { color: var(--c-other); }
.imp { display: inline-flex; gap: 2px; }
.imp i { width: 4px; height: 10px; border-radius: 1px; background: var(--border); display: inline-block; }
.imp i.on { background: var(--text-3); }
.major .imp i.on { background: var(--major); }

.more-btn, .btn {
  display: block; width: 100%; padding: 12px; margin-top: 8px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 14px;
}
.btn.inline { display: inline-block; width: auto; padding: 8px 16px; margin: 0; }
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }
.more-btn:hover, .btn:hover { border-color: var(--text-3); }

.empty, .notice { text-align: center; color: var(--text-3); padding: 48px 16px; font-size: 14.5px; }
.notice { text-align: left; padding: 14px 16px; background: var(--surface-2); border-radius: 12px; margin-bottom: 12px; color: var(--text-2); }

/* ---------- 详情 ---------- */
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-size: 14px; padding: 6px 0; cursor: pointer; background: none; border: 0; }
.detail h1 { font-size: 24px; line-height: 1.4; margin: 10px 0 8px; }
.detail .meta { margin: 0 0 18px; }
.detail .summary { font-size: 17px; line-height: 1.8; margin: 0 0 16px; }
.why { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 10px; padding: 12px 14px; margin: 0 0 22px; }
.why b { display: block; font-size: 13px; color: var(--accent); margin-bottom: 2px; }
.why span { color: var(--text-2); font-size: 15px; }
.sources { list-style: none; padding: 0; margin: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.sources li + li { border-top: 1px solid var(--border); }
.sources a { display: block; padding: 12px 14px; }
.sources a:hover { background: var(--surface-2); }
.sources .s-title { font-size: 15px; line-height: 1.5; }
.sources .s-meta { font-size: 12.5px; color: var(--text-3); margin-top: 3px; }
.disclaimer { font-size: 12px; color: var(--text-3); margin-top: 16px; }

/* ---------- 简报 ---------- */
.brief-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 8px 4px 4px; }
.brief-head h1 { font-size: 24px; margin: 0; }
.brief-head select { background: var(--surface); color: var(--text-2); border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px; font: inherit; font-size: 13px; }
.overview { font-size: 16.5px; line-height: 1.8; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin: 12px 0 16px; }
.brief-list { list-style: none; padding: 0; margin: 0; counter-reset: b; }
.brief-list li { counter-increment: b; }
.brief-list a { display: grid; grid-template-columns: 34px 1fr; gap: 4px; padding: 14px 4px; border-bottom: 1px solid var(--border); }
.brief-list a::before { content: counter(b); font-size: 20px; font-weight: 700; color: var(--text-3); line-height: 1.3; }
.brief-list h3 { margin: 0 0 4px; font-size: 16.5px; line-height: 1.45; }
.brief-list p { margin: 0; color: var(--text-2); font-size: 15px; line-height: 1.7; }
.brief-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; font-size: 12.5px; color: var(--text-3); gap: 12px; }

/* ---------- 底部导航 ---------- */
.bottombar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: center; gap: 0;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom);
}
.bottombar a { flex: 1; max-width: 200px; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 0 6px; font-size: 11.5px; color: var(--text-3); }
.bottombar a.active { color: var(--text); font-weight: 600; }

.skeleton { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); height: 96px; margin-bottom: 10px; position: relative; overflow: hidden; }
.skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, var(--surface-2), transparent); animation: sh 1.2s infinite; }
@keyframes sh { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.login { max-width: 340px; margin: 18vh auto 0; text-align: center; }
.login input { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; margin: 16px 0 8px; }
.login .err { color: var(--major); font-size: 13px; min-height: 20px; }

@media (min-width: 860px) {
  .card h2 { font-size: 18px; }
  .card.major h2 { font-size: 21px; }
  .detail h1 { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- AI 解读 ---------- */
.tldr {
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: 12px; padding: 14px 16px; margin: 4px 0 22px; font-size: 17px; line-height: 1.7; font-weight: 500;
}
.tldr b { display: block; font-size: 12.5px; color: var(--accent); letter-spacing: 1px; margin-bottom: 2px; font-weight: 600; }
.a-sec { margin: 0 0 26px; }
.a-sec h3 { font-size: 17.5px; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.a-ico { font-size: 16px; width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; flex: none; }
.a-sec p { margin: 0 0 12px; font-size: 16.5px; line-height: 1.85; }
.ref {
  display: inline-block; min-width: 17px; height: 17px; padding: 0 4px; margin: 0 1px; border-radius: 5px;
  background: var(--surface-2); color: var(--text-3); font-size: 11px; line-height: 17px; text-align: center;
  vertical-align: 2px; font-weight: 600;
}
.ref:hover { background: var(--accent); color: #fff; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
.timeline li { position: relative; padding: 0 0 14px 22px; border-left: 2px solid var(--border); }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.timeline li:last-child::before { background: var(--accent); }
.timeline time { display: block; font-size: 13px; color: var(--accent); font-weight: 600; margin-bottom: 2px; }
.timeline div { font-size: 15.5px; line-height: 1.7; }
.players { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.players li { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; }
.players b { display: block; font-size: 15.5px; }
.players span { font-size: 14.5px; color: var(--text-2); line-height: 1.6; }
.outlook { display: grid; gap: 10px; }
.scn { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.scn-head { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 4px; }
.scn-head b { font-size: 15.5px; line-height: 1.5; }
.scn p { margin: 0; font-size: 14.5px; line-height: 1.7; color: var(--text-2); }
.lk { flex: none; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; margin-top: 1px; }
.lk-hi { background: color-mix(in srgb, var(--major) 14%, transparent); color: var(--major); }
.lk-mid { background: color-mix(in srgb, var(--c-business) 16%, transparent); color: var(--c-business); }
.lk-lo { background: var(--surface-2); color: var(--text-3); }
.hint { font-size: 12.5px !important; color: var(--text-3); margin: 8px 0 0 !important; }
.watch { margin: 0; padding-left: 20px; }
.watch li { font-size: 15.5px; line-height: 1.7; margin-bottom: 6px; }
.unclear { background: color-mix(in srgb, var(--c-business) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c-business) 30%, var(--border)); border-radius: 12px; padding: 12px 16px; margin: 0 0 22px; }
.unclear b { display: block; font-size: 14px; margin-bottom: 4px; }
.unclear p { margin: 0; font-size: 15px; line-height: 1.75; color: var(--text-2); }
.a-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 12.5px; color: var(--text-3); border-top: 1px solid var(--border); padding-top: 12px; margin-top: 8px; }
.link-btn { background: none; border: 0; color: var(--accent); cursor: pointer; font-size: 13px; padding: 4px 0; white-space: nowrap; }
.refs .s-title { display: flex; gap: 8px; }
.ref-n { flex: none; min-width: 20px; height: 20px; border-radius: 6px; background: var(--surface-2); color: var(--text-3); font-size: 12px; font-weight: 600; display: grid; place-items: center; margin-top: 2px; }
.all-src { margin-top: 14px; }
.all-src summary { cursor: pointer; color: var(--text-2); font-size: 14px; padding: 8px 2px; }
.a-loading { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; margin: 4px 0 18px; }
.a-loading b { display: block; font-size: 15.5px; }
.a-loading span { font-size: 13.5px; color: var(--text-3); }
.pulse { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); opacity: .85; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(.7); opacity: .45; } 50% { transform: scale(1); opacity: .9; } }
.line-sk { height: 14px; border-radius: 6px; background: var(--surface-2); margin: 12px 0; }
.line-sk:nth-child(3n) { width: 70%; } .line-sk:nth-child(3n+1) { width: 92%; }
.updating { font-size: 13px; color: var(--accent); margin-bottom: 10px; }
