:root {
  color-scheme: light;
  --ink: #15201c;
  --muted: #66726d;
  --line: #dbe3df;
  --line-strong: #bdcac4;
  --surface: #ffffff;
  --surface-muted: #f3f6f4;
  --canvas: #e9eeeb;
  --accent: #0b6e4f;
  --accent-strong: #084f3a;
  --green: #237a57;
  --yellow: #9c6a08;
  --orange: #c25419;
  --red: #b4232d;
  --radius: 12px;
  --shadow: 0 18px 50px rgba(28, 48, 39, .08);
  font-family: "Segoe UI Variable", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--canvas); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--canvas); }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid rgba(11, 110, 79, .26); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 16px; top: -60px; z-index: 50; padding: 10px 14px; color: #fff; background: var(--accent-strong); border-radius: 8px; }
.skip-link:focus { top: 12px; }
.topbar { position: sticky; top: 0; z-index: 20; height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 max(24px, calc((100vw - 1480px) / 2)); color: #f7fbf9; background: #0d1613; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand-block { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid #4b665b; border-radius: 10px; color: #9ce3c6; background: #18251f; font-weight: 800; }
.brand-name { font-size: 15px; font-weight: 750; letter-spacing: .01em; }
.brand-scope { margin-top: 2px; color: #9eada6; font-size: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.collector-state { display: flex; align-items: center; gap: 8px; color: #b7c5be; font-size: 12px; }
.collector-state span { width: 8px; height: 8px; border-radius: 50%; background: #7e8d86; }
.collector-state.ok span { background: #55c894; box-shadow: 0 0 0 4px rgba(85,200,148,.12); }
.collector-state.stale span { background: #f1a15f; box-shadow: 0 0 0 4px rgba(241,161,95,.12); }
.collector-state.bad span { background: #ef6b73; box-shadow: 0 0 0 4px rgba(239,107,115,.12); }
.button { min-height: 38px; padding: 8px 14px; border: 1px solid transparent; border-radius: 8px; font-weight: 650; transition: transform .12s ease, background .12s ease; }
.button:active, .copy-button:active, .status-button:active { transform: translateY(1px); }
.button-secondary { color: #eef6f2; border-color: #405249; background: #1b2822; }
.button-secondary:hover { background: #26372f; }
.shell { width: min(1480px, calc(100% - 48px)); margin: 0 auto; padding: 30px 0 48px; }
.overview { margin-bottom: 20px; }
.overview-heading, .stream-heading, .panel-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.section-label { margin: 0 0 6px; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .06em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(26px, 3vw, 40px); line-height: 1.08; letter-spacing: -.035em; }
h2 { margin-bottom: 0; font-size: 20px; letter-spacing: -.02em; }
.update-copy { display: grid; justify-items: end; gap: 3px; color: var(--muted); font-size: 12px; }
.update-copy span { color: var(--ink); font-weight: 700; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; overflow: hidden; margin-top: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--line); box-shadow: var(--shadow); }
.metric { min-height: 116px; padding: 20px; background: var(--surface); }
.metric-label { color: var(--muted); font-size: 12px; font-weight: 650; }
.metric-value { margin-top: 10px; font-variant-numeric: tabular-nums; font-size: 32px; font-weight: 780; letter-spacing: -.04em; }
.metric-note { margin-top: 5px; color: var(--muted); font-size: 12px; }
.metric.danger .metric-value { color: var(--red); }
.metric.warning .metric-value { color: var(--orange); }
.workspace { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 20px; align-items: start; }
.event-rail, .stream-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.event-rail { position: sticky; top: 92px; overflow: hidden; }
.panel-heading, .stream-heading { padding: 20px; border-bottom: 1px solid var(--line); }
.count-badge { min-width: 28px; padding: 5px 8px; text-align: center; color: var(--accent-strong); background: #e2f1eb; border-radius: 999px; font-size: 12px; font-weight: 800; }
.trend { height: 96px; display: flex; align-items: end; gap: 4px; padding: 20px 20px 14px; border-bottom: 1px solid var(--line); }
.trend-column { position: relative; flex: 1; min-width: 3px; height: 100%; display: flex; align-items: end; background: #edf1ef; border-radius: 3px 3px 0 0; overflow: hidden; }
.trend-column i { width: 100%; display: block; background: var(--accent); border-radius: 3px 3px 0 0; }
.trend-column.risky i { background: var(--red); }
.trend-empty { align-self: center; width: 100%; color: var(--muted); text-align: center; font-size: 12px; }
.event-list { max-height: calc(100dvh - 290px); overflow: auto; }
.event-item { width: 100%; display: block; padding: 16px 20px; text-align: left; color: inherit; border: 0; border-bottom: 1px solid var(--line); background: transparent; }
.event-item:hover { background: var(--surface-muted); }
.event-item:last-child { border-bottom: 0; }
.event-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.risk-label { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 800; }
.risk-red { color: #941f29; background: #fde7e9; }
.risk-orange { color: #9a3f12; background: #ffeadf; }
.risk-yellow { color: #7d5608; background: #fff3cf; }
.risk-green { color: #1e694c; background: #def2e9; }
.event-score { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.event-title { margin-top: 10px; font-size: 14px; font-weight: 720; line-height: 1.45; }
.event-meta { margin-top: 8px; color: var(--muted); font-size: 11px; }
.stream-panel { min-width: 0; overflow: hidden; }
.result-count { color: var(--muted); font-size: 12px; }
.filters { display: grid; grid-template-columns: minmax(220px, 1fr) repeat(3, auto); gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); background: #fafcfb; }
.filters input, .filters select { width: 100%; height: 40px; color: var(--ink); border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); }
.filters input { padding: 0 12px; }
.filters select { min-width: 112px; padding: 0 30px 0 10px; }
.post-stream { min-height: 420px; }
.post-card { padding: 22px 24px; border-bottom: 1px solid var(--line); background: var(--surface); }
.post-card:last-child { border-bottom: 0; }
.post-card:target, .post-card.highlight { animation: highlight 1.5s ease; }
@keyframes highlight { 0%, 45% { background: #fff9df; } 100% { background: var(--surface); } }
.post-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.author { min-width: 0; display: flex; align-items: center; gap: 10px; }
.avatar { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; color: #eaf7f1; background: #254b3d; border-radius: 9px; font-weight: 800; }
.author-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 750; }
.author-meta { margin-top: 3px; color: var(--muted); font-size: 12px; }
.post-risk { display: flex; align-items: center; gap: 8px; }
.risk-score { font-size: 12px; color: var(--muted); }
.event-link { margin: 16px 0 10px; color: var(--accent-strong); font-size: 12px; font-weight: 750; }
.post-text { margin: 0; color: #1e2925; font-size: 16px; line-height: 1.68; white-space: pre-wrap; overflow-wrap: anywhere; }
.reason-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.reason { padding: 4px 8px; color: #6f4732; background: #f7eee8; border-radius: 6px; font-size: 11px; }
.post-stats { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.post-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid #edf1ef; }
.copy-button, .status-button, .source-link { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; padding: 7px 10px; color: #34433d; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); font-size: 12px; font-weight: 680; text-decoration: none; }
.copy-button:hover, .status-button:hover, .source-link:hover { border-color: #8fa39a; background: var(--surface-muted); }
.source-link { color: #fff; border-color: var(--accent); background: var(--accent); }
.source-link:hover { color: #fff; background: var(--accent-strong); }
.action-spacer { flex: 1; }
.status-button.active { color: var(--accent-strong); border-color: #9ccbb8; background: #e5f4ed; }
.notice { margin: 16px 20px 0; padding: 14px; border-radius: 8px; }
.error-notice { color: #7f2028; background: #fdebed; }
.error-notice span { display: block; margin-top: 4px; font-size: 12px; }
.error-notice button { margin-top: 10px; color: #7f2028; border: 0; background: transparent; font-weight: 750; text-decoration: underline; }
.empty-state { padding: 80px 24px; text-align: center; }
.empty-state strong { font-size: 18px; }
.empty-state p { max-width: 420px; margin: 10px auto 0; color: var(--muted); line-height: 1.6; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 40; max-width: min(360px, calc(100vw - 40px)); padding: 12px 16px; color: #fff; background: #10201a; border-radius: 9px; box-shadow: 0 16px 44px rgba(0,0,0,.2); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .18s ease, transform .18s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.loading-block { position: relative; overflow: hidden; min-height: 88px; background: #edf1ef; }
.loading-block::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.75), transparent); animation: loading 1.3s infinite; }
.event-skeleton { margin: 16px 20px; min-height: 96px; border-radius: 8px; }
@keyframes loading { to { transform: translateX(100%); } }

@media (max-width: 980px) {
  .workspace { grid-template-columns: 1fr; }
  .event-rail { position: static; }
  .event-list { max-height: 320px; }
  .filters { grid-template-columns: 1fr 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  .topbar { height: 64px; padding: 0 14px; }
  .brand-scope, .collector-state b { display: none; }
  .button { min-height: 36px; padding-inline: 10px; }
  .shell { width: calc(100% - 24px); padding-top: 20px; }
  .overview-heading { align-items: flex-start; }
  .update-copy span { display: none; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric { min-height: 96px; padding: 15px; }
  .metric-value { font-size: 27px; }
  .filters { grid-template-columns: 1fr 1fr; padding: 12px; }
  .search-field { grid-column: 1 / -1; }
  .filters label:last-child { grid-column: 1 / -1; }
  .panel-heading, .stream-heading { padding: 16px; }
  .post-card { padding: 18px 16px; }
  .post-header { align-items: flex-start; }
  .post-risk { display: grid; justify-items: end; gap: 4px; }
  .post-text { font-size: 15px; }
  .post-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .copy-button, .status-button, .source-link { width: 100%; min-height: 40px; }
  .action-spacer { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

