:root {
  --paper: #f1eee7;
  --paper-2: #e9e5dc;
  --panel: #fffdf8;
  --panel-2: #faf7f0;
  --ink: #171716;
  --ink-2: #3f3d38;
  --muted: #77736b;
  --muted-2: #9a958b;
  --line: #e4dfd3;
  --line-strong: #d5cfc0;
  --yellow: #ffd400;
  --yellow-soft: #fff3b0;
  --red: #d92d20;
  --red-soft: #fef3f2;
  --orange: #b54708;
  --orange-soft: #fffaeb;
  --green: #067647;
  --green-soft: #ecfdf3;
  --blue: #175cd3;
  --blue-soft: #eff8ff;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 18px 50px rgba(30, 26, 15, 0.07);
  --shadow-soft: 0 8px 24px rgba(30, 26, 15, 0.05);
  --font: "Inter", "SF Pro Display", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(23, 23, 22, 0.035) 0.7px, transparent 0.7px);
  background-size: 5px 5px;
  z-index: 0;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { max-width: 100%; display: block; }
code { font-family: var(--mono); font-size: 0.92em; background: var(--paper-2); padding: 2px 6px; border-radius: 6px; }

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-sm { width: 14px; height: 14px; }
.icon-muted { color: var(--muted-2); }

.app { position: relative; z-index: 1; display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar-backdrop { display: none; }
@media (max-width: 780px) {
  .sidebar-backdrop.is-open { display: block; position: fixed; inset: 0; z-index: 70; background: rgba(17, 17, 16, 0.34); backdrop-filter: blur(2px); }
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 26px 20px 20px;
  border-right: 1px solid var(--line);
  background: rgba(246, 243, 236, 0.88);
  backdrop-filter: blur(12px);
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 4px 26px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 13px;
  display: grid; place-items: center;
  background: var(--ink); color: var(--yellow);
  font-size: 21px; font-weight: 800;
  box-shadow: 0 7px 0 rgba(23, 23, 22, 0.08);
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.15; }
.brand-copy strong { font-size: 16px; letter-spacing: 0.02em; }
.brand-copy span { margin-top: 5px; font-size: 8px; letter-spacing: 0.19em; color: var(--muted); font-weight: 700; }

.nav { display: flex; flex-direction: column; gap: 5px; }
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  padding: 11px 12px;
  border: 0; border-radius: 12px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13px; font-weight: 600;
  text-align: left;
  transition: background 0.18s, color 0.18s, transform 0.18s;
}
.nav-item .icon { color: var(--muted); transition: color 0.18s; }
.nav-item i { margin-left: auto; font-style: normal; font-size: 9px; letter-spacing: 0.08em; color: var(--muted-2); font-family: var(--mono); }
.nav-item:hover { background: rgba(255, 253, 248, 0.78); transform: translateX(2px); }
.nav-item.is-active { background: var(--ink); color: #fff; box-shadow: 0 10px 22px rgba(23, 23, 22, 0.16); }
.nav-item.is-active .icon { color: var(--yellow); }
.nav-item.is-active i { color: rgba(255, 255, 255, 0.44); }
.nav-badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  display: grid; place-items: center;
  background: var(--red); color: #fff; border-radius: 99px;
  font-size: 10px; font-weight: 800;
}
.nav-item.is-active .nav-badge { background: var(--yellow); color: var(--ink); }

.sidebar-spacer { flex: 1; min-height: 26px; }
.source-card {
  padding: 15px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
}
.source-top { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; letter-spacing: 0.12em; font-weight: 700; }
.source-card strong { display: block; margin: 9px 0 5px; font-size: 13px; }
.source-card p { margin: 0 0 11px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.source-card a { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); font-size: 11px; font-weight: 700; text-decoration: none; }
.source-card a:hover { text-decoration: underline; }
.operator { display: flex; align-items: center; gap: 9px; margin-top: 14px; padding: 4px; }
.operator-avatar { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--yellow-soft); color: var(--ink); font-weight: 800; font-size: 12px; }
.operator div:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }
.operator strong { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.operator span { color: var(--muted); font-size: 9px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-left: auto; box-shadow: 0 0 0 4px rgba(6, 118, 71, 0.1); }

/* ---------- Main / Topbar ---------- */
.main { min-width: 0; padding: 0 32px; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px;
  min-height: 90px; padding: 18px 0 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(241, 238, 231, 0.88);
  backdrop-filter: blur(14px);
}
.mobile-menu { display: none; border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 8px; }
.topbar-title { min-width: 0; }
.breadcrumb { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; letter-spacing: 0.04em; font-weight: 600; }
.breadcrumb-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--yellow); border: 1px solid rgba(23, 23, 22, 0.2); }
.slash { color: var(--line-strong); }
.topbar h1 { margin: 5px 0 0; font-size: 24px; line-height: 1.15; letter-spacing: -0.035em; }
.topbar-actions { display: flex; align-items: center; gap: 13px; margin-left: auto; }
.live-status { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid rgba(6, 118, 71, 0.18); border-radius: 99px; background: var(--green-soft); color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: 0.03em; white-space: nowrap; }
.live-status.is-paused { color: var(--orange); background: var(--orange-soft); border-color: rgba(181, 71, 8, 0.18); }
.live-status.is-error { color: var(--red); background: var(--red-soft); border-color: rgba(217, 45, 32, 0.18); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(6, 118, 71, 0.11); animation: pulse 2.4s infinite; }
.live-status.is-paused .live-dot, .live-status.is-error .live-dot { animation: none; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.55; transform: scale(0.86); } }
.sync-meta { color: var(--muted); font-size: 10px; white-space: nowrap; }
.sync-meta b { color: var(--ink-2); font-family: var(--mono); font-size: 10px; font-weight: 600; margin-left: 3px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 0 14px;
  border: 1px solid transparent; border-radius: 10px;
  background: transparent; color: var(--ink);
  font-size: 12px; font-weight: 700; line-height: 1;
  text-decoration: none; white-space: nowrap;
  transition: transform 0.16s, background 0.16s, border-color 0.16s, box-shadow 0.16s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: wait; transform: none; }
.btn-ghost { background: rgba(255, 253, 248, 0.72); border-color: var(--line); }
.btn-ghost:hover { background: var(--panel); border-color: var(--line-strong); }
.btn-dark { background: var(--ink); color: #fff; box-shadow: 0 8px 20px rgba(23, 23, 22, 0.15); }
.btn-dark:hover { background: #2c2b28; }
.btn-yellow { background: var(--yellow); color: var(--ink); box-shadow: 0 8px 0 rgba(0, 0, 0, 0.16); }
.btn-yellow:hover { background: #ffe23a; }
.btn-outline-light { border-color: rgba(255, 255, 255, 0.22); color: #fff; background: rgba(255, 255, 255, 0.04); }
.btn-outline-light:hover { background: rgba(255, 255, 255, 0.1); }
.btn-soft { background: var(--paper-2); border-color: transparent; color: var(--ink-2); }
.btn-soft:hover { background: #e2ddd1; }
.btn-block { width: 100%; }
.btn.is-loading .icon { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Views ---------- */
.views { padding: 24px 0 26px; }
.view { display: none; animation: viewIn 0.35s ease both; }
.view.is-active { display: block; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.view-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 4px 0 22px; }
.view-heading h2 { margin: 6px 0 5px; font-size: 31px; letter-spacing: -0.045em; line-height: 1.1; }
.view-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.view-heading-actions { display: flex; align-items: center; gap: 9px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 286px;
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 20px;
  overflow: hidden;
  padding: 34px 38px;
  border-radius: 26px;
  background: #141412;
  color: #fff;
  box-shadow: 0 24px 50px rgba(23, 23, 22, 0.17);
}
.hero-grid-bg {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(90deg, #000, transparent 72%);
  pointer-events: none;
}
.hero::after { content: ""; position: absolute; width: 380px; height: 380px; right: -120px; top: -140px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 212, 0, 0.18), transparent 66%); pointer-events: none; }
.hero-copy { position: relative; z-index: 2; align-self: center; }
.hero-kicker { display: flex; align-items: center; gap: 8px; color: rgba(255, 255, 255, 0.5); font-family: var(--mono); font-size: 9px; letter-spacing: 0.18em; font-weight: 700; }
.hero-kicker span { width: 16px; height: 1px; background: var(--yellow); }
.hero h2 { margin: 16px 0 13px; font-size: clamp(38px, 4.2vw, 58px); line-height: 0.98; letter-spacing: -0.055em; font-weight: 800; }
.hero h2 em { font-style: normal; color: var(--yellow); }
.hero p { max-width: 480px; margin: 0; color: rgba(255, 255, 255, 0.58); font-size: 12px; line-height: 1.85; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 24px; }
.hero-actions .btn { min-height: 42px; padding: 0 16px; }
.hero-actions .btn-yellow .icon { transition: transform 0.2s; }
.hero-actions .btn-yellow:hover .icon { transform: translate(2px, -2px); }

.hero-orbit { position: relative; min-height: 220px; display: grid; place-items: center; z-index: 2; }
.orbit { position: absolute; border: 1px solid rgba(255, 255, 255, 0.09); border-radius: 50%; }
.orbit-a { width: 190px; height: 190px; }
.orbit-b { width: 270px; height: 270px; border-style: dashed; animation: orbitSpin 40s linear infinite; }
.orbit-c { width: 350px; height: 350px; opacity: 0.5; }
@keyframes orbitSpin { to { transform: rotate(360deg); } }
.hero-circle { position: relative; width: 138px; height: 138px; border-radius: 50%; padding: 8px; background: rgba(255, 255, 255, 0.08); }
.hero-circle img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.2); }
.hero-circle-ring { position: absolute; inset: -9px; border: 1px solid rgba(255, 212, 0, 0.45); border-radius: 50%; }
.hero-circle-ring::before { content: ""; position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); top: 6px; right: 18px; box-shadow: 0 0 16px rgba(255, 212, 0, 0.8); }
.orbit-chip {
  position: absolute; display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 10px; border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px; background: rgba(25, 25, 22, 0.84); backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.78); font-size: 9px; font-weight: 700; white-space: nowrap;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
}
.chip-a { top: 5px; left: 2%; }
.chip-b { right: 0; top: 30%; }
.chip-c { bottom: 3px; left: 12%; }
.pulse-bars { display: flex; align-items: flex-end; gap: 2px; height: 10px; }
.pulse-bars i { width: 2px; background: var(--yellow); border-radius: 2px; animation: barPulse 1.1s ease-in-out infinite; }
.pulse-bars i:nth-child(1) { height: 4px; }
.pulse-bars i:nth-child(2) { height: 9px; animation-delay: 0.15s; }
.pulse-bars i:nth-child(3) { height: 6px; animation-delay: 0.3s; }
@keyframes barPulse { 0%, 100% { transform: scaleY(0.6); } 50% { transform: scaleY(1); } }

/* ---------- KPI ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.kpi-card {
  position: relative; overflow: hidden;
  padding: 18px 18px 15px;
  border: 1px solid var(--line); border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s, box-shadow 0.2s;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi-card--risk { background: linear-gradient(150deg, #fffdf8, #fff5f3); }
.kpi-head { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; font-weight: 600; }
.kpi-icon { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; }
.kpi-icon .icon { width: 15px; height: 15px; }
.kpi-icon.yellow { background: var(--yellow-soft); color: #7a6400; }
.kpi-icon.red { background: var(--red-soft); color: var(--red); }
.kpi-icon.blue { background: var(--blue-soft); color: var(--blue); }
.kpi-icon.green { background: var(--green-soft); color: var(--green); }
.kpi-value { display: flex; align-items: baseline; gap: 5px; margin: 8px 0 5px; }
.kpi-value b { font-size: 38px; line-height: 1; letter-spacing: -0.055em; font-weight: 800; font-variant-numeric: tabular-nums; }
.kpi-value span { color: var(--muted); font-size: 11px; }
.kpi-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 17px; color: var(--muted); font-size: 9px; }
.kpi-foot b { color: var(--ink-2); font-weight: 700; }
.kpi-link { display: inline-flex; align-items: center; gap: 1px; color: var(--ink); font-weight: 700; cursor: pointer; }
.kpi-link:hover { text-decoration: underline; }
.trend-tag { font-style: normal; padding: 3px 6px; border-radius: 5px; background: var(--red-soft); color: var(--red); font-size: 8px; font-weight: 800; }
.trend-tag.is-calm { background: var(--green-soft); color: var(--green); }
.signal-dots { display: flex; gap: 3px; align-items: flex-end; }
.signal-dots i { width: 3px; border-radius: 3px; background: var(--line-strong); }
.signal-dots i:nth-child(1) { height: 5px; } .signal-dots i:nth-child(2) { height: 8px; } .signal-dots i:nth-child(3) { height: 11px; } .signal-dots i:nth-child(4) { height: 14px; }
.signal-dots i.on { background: var(--blue); }
.mini-bars { display: flex; align-items: flex-end; gap: 2px; height: 16px; width: 52px; justify-content: flex-end; }
.mini-bars i { width: 4px; border-radius: 2px; background: var(--yellow); min-height: 2px; }

/* ---------- Insight strip ---------- */
.insight-strip {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px; overflow: hidden;
  margin: 0 0 14px; background: var(--line);
  border: 1px solid var(--line); border-radius: 14px;
}
.insight-strip > div { display: flex; flex-direction: column; gap: 2px; padding: 11px 14px; background: var(--panel); }
.insight-strip span { color: var(--muted); font-size: 8px; }
.insight-strip b { font-size: 17px; line-height: 1.2; letter-spacing: -0.03em; }
.insight-strip small { color: var(--muted-2); font-size: 7px; }

/* ---------- Heatmap ---------- */
.heatmap-panel { margin-top: 12px; padding: 20px 22px; }
.heatmap { margin-top: 16px; overflow-x: auto; padding-bottom: 2px; }
.heatmap-row { display: grid; grid-template-columns: 50px repeat(24, minmax(14px, 1fr)); gap: 3px; min-width: 620px; margin-bottom: 3px; align-items: center; }
.heatmap-row > i { height: 13px; border-radius: 3px; background: var(--paper-2); transition: transform 0.12s; }
.heatmap-row > i:hover { transform: scale(1.18); outline: 1px solid var(--ink); }
.heatmap-head > i { height: auto; color: var(--muted-2); font-style: normal; font-size: 7px; text-align: center; background: transparent; }
.heatmap-head > i:hover { transform: none; outline: 0; }
.heatmap-day { display: flex; flex-direction: column; gap: 1px; color: var(--ink-2); font-family: var(--mono); font-size: 8px; }
.heatmap-day small { color: var(--muted-2); font-size: 7px; }
.heat-0 { background: #f0ece3 !important; }
.heat-1 { background: #fff0a8 !important; }
.heat-2 { background: #ffe276 !important; }
.heat-3 { background: #f5c518 !important; }
.heat-4 { background: #a87900 !important; }
.heatmap-legend { display: flex; align-items: center; gap: 3px; color: var(--muted-2); font-size: 8px; }
.heatmap-legend i { width: 11px; height: 11px; border-radius: 2px; }

/* ---------- Dashboard grid ---------- */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr); gap: 12px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.trend-panel { min-height: 350px; padding: 20px 22px 14px; grid-column: 1; }
.risk-panel { grid-column: 2; padding: 20px; }
.feed-panel { grid-column: 1; padding: 20px 22px 8px; }
.side-column { grid-column: 2; display: flex; flex-direction: column; gap: 12px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.panel-kicker { display: block; color: var(--muted-2); font-family: var(--mono); font-size: 8px; font-weight: 700; letter-spacing: 0.16em; }
.panel-head h3 { margin: 4px 0 0; font-size: 16px; letter-spacing: -0.02em; }
.panel-note { color: var(--muted); font-size: 9px; }
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--paper-2); border-radius: 8px; }
.segmented button { border: 0; border-radius: 6px; padding: 5px 9px; background: transparent; color: var(--muted); font-size: 9px; font-weight: 700; }
.segmented button.is-active { background: var(--panel); color: var(--ink); box-shadow: 0 2px 5px rgba(23, 23, 22, 0.07); }

.trend-summary { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 22px 0 4px; }
.sentiment-score > span { display: block; color: var(--muted); font-size: 9px; }
.sentiment-score > div { display: flex; align-items: baseline; gap: 8px; margin-top: 2px; }
.sentiment-score b { font-size: 31px; letter-spacing: -0.05em; line-height: 1; }
.sentiment-score em { font-style: normal; padding: 3px 7px; border-radius: 5px; background: var(--green-soft); color: var(--green); font-size: 8px; font-weight: 800; }
.sentiment-score em.is-warn { background: var(--orange-soft); color: var(--orange); }
.sentiment-score em.is-bad { background: var(--red-soft); color: var(--red); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 11px; color: var(--muted); font-size: 8px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 4px; }
.chart-legend i { display: inline-block; }
.legend-area { width: 13px; height: 6px; border-radius: 2px; background: rgba(23, 23, 22, 0.12); }
.legend-line { width: 13px; height: 2px; background: var(--red); }
.legend-bar { width: 5px; height: 9px; border-radius: 2px; background: var(--yellow); }
.chart-wrap { position: relative; height: 208px; margin-top: 4px; }
#trendChart { width: 100%; height: 100%; display: block; }
.chart-tooltip {
  position: absolute; z-index: 5; min-width: 115px;
  padding: 8px 10px; border-radius: 8px; background: #111; color: #fff;
  font-size: 9px; line-height: 1.7; pointer-events: none;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
}
.chart-tooltip b { color: var(--yellow); }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted-2); font-size: 11px; }

.donut-wrap { position: relative; width: 158px; height: 158px; margin: 16px auto 4px; }
.donut { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut-track { fill: none; stroke: var(--paper-2); stroke-width: 11; }
.donut-seg { fill: none; stroke-width: 11; stroke-linecap: butt; transition: stroke-dasharray 0.7s ease; }
.donut-high { stroke: var(--red); }
.donut-medium { stroke: #f79009; }
.donut-low { stroke: #d0d5dd; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-center b { font-size: 34px; line-height: 1; letter-spacing: -0.05em; }
.donut-center span { color: var(--muted); font-size: 9px; margin-top: 3px; }
.risk-legend { display: flex; flex-direction: column; gap: 7px; margin: 4px 0 15px; }
.risk-legend-row { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; }
.risk-legend-row i { width: 7px; height: 7px; border-radius: 3px; }
.risk-legend-row b { margin-left: auto; color: var(--ink); font-size: 11px; }
.topic-block { border-top: 1px solid var(--line); padding-top: 12px; }
.topic-title { display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; margin-bottom: 9px; }
.topic-title span:first-child { color: var(--ink-2); font-weight: 700; }
.topic-bars { display: flex; flex-direction: column; gap: 7px; }
.topic-row { display: grid; grid-template-columns: 55px 1fr 20px; align-items: center; gap: 7px; font-size: 9px; color: var(--muted); }
.topic-track { height: 5px; border-radius: 4px; background: var(--paper-2); overflow: hidden; }
.topic-fill { height: 100%; border-radius: 4px; background: var(--ink); transition: width 0.5s; }
.topic-row b { text-align: right; color: var(--ink-2); font-size: 9px; }

/* ---------- Feed ---------- */
.feed-panel-head { align-items: center; }
.text-link { display: inline-flex; align-items: center; gap: 2px; border: 0; background: transparent; color: var(--muted); font-size: 10px; font-weight: 700; padding: 4px; }
.text-link:hover { color: var(--ink); }
.feed-tabs { display: flex; flex-wrap: wrap; gap: 5px; margin: 14px 0 2px; }
.feed-tabs button { border: 1px solid transparent; border-radius: 7px; padding: 5px 9px; background: transparent; color: var(--muted); font-size: 9px; font-weight: 700; }
.feed-tabs button:hover { background: var(--paper-2); color: var(--ink-2); }
.feed-tabs button.is-active { background: var(--ink); color: #fff; }
.feed-list { display: flex; flex-direction: column; }
.feed-item {
  position: relative;
  display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.16s;
}
.feed-item:first-child { border-top: 0; }
.feed-item:hover { background: rgba(250, 247, 240, 0.55); }
.feed-item.is-new::before { content: ""; position: absolute; left: -22px; top: 22px; width: 4px; height: 22px; border-radius: 0 4px 4px 0; background: var(--yellow); }
.feed-avatar { width: 38px; height: 38px; border-radius: 11px; overflow: hidden; background: var(--paper-2); display: grid; place-items: center; color: var(--ink-2); font-weight: 800; font-size: 13px; border: 1px solid var(--line); }
.feed-avatar img { width: 100%; height: 100%; object-fit: cover; }
.feed-main { min-width: 0; }
.feed-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 5px; }
.feed-author { color: var(--ink); font-size: 11px; font-weight: 700; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-time { color: var(--muted-2); font-size: 9px; }
.feed-tag { padding: 2px 5px; border-radius: 4px; background: var(--paper-2); color: var(--muted); font-size: 8px; font-weight: 600; }
.tag-high { background: var(--red-soft); color: var(--red); }
.tag-medium { background: var(--orange-soft); color: var(--orange); }
.tag-low { background: var(--green-soft); color: var(--green); }
.tag-demo { background: #fff7d6; color: #7a6400; }
.tag-board { background: #f4f3ff; color: #6941c6; }
.tag-cluster { background: #eef4ff; color: #175cd3; }
.tag-review { background: #f4f3ff; color: #6941c6; }
.tag-overdue { background: #fef3f2; color: #d92d20; }
mark.kw { background: var(--yellow-soft); color: var(--ink); border-radius: 3px; padding: 0 2px; box-shadow: inset 0 -1px 0 rgba(168, 121, 0, 0.28); }
.feed-keywords { display: inline-flex; gap: 3px; align-items: center; }
.feed-keywords i { font-style: normal; padding: 1px 4px; border-radius: 3px; background: var(--yellow-soft); color: #7a6400; font-size: 7px; font-weight: 700; }
.feed-content { margin: 0; color: var(--ink-2); font-size: 12px; line-height: 1.75; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.feed-media { display: flex; gap: 5px; margin-top: 8px; }
.media-thumb { width: 56px; height: 56px; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: var(--paper-2); overflow: hidden; }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.18s; }
.media-thumb:hover img { transform: scale(1.05); }
.feed-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 8px; color: var(--muted-2); font-size: 8px; }
.feed-foot span { display: inline-flex; align-items: center; gap: 3px; }
.feed-foot .icon { width: 12px; height: 12px; }
.heat-meter { display: inline-flex; align-items: center; gap: 3px; margin-left: auto; }
.heat-track { width: 42px; height: 4px; border-radius: 3px; background: var(--paper-2); overflow: hidden; }
.heat-fill { height: 100%; border-radius: 3px; background: var(--yellow); }
.feed-actions { display: flex; gap: 4px; opacity: 0; transition: opacity 0.16s; }
.feed-item:hover .feed-actions { opacity: 1; }
@media (hover: none) { .feed-actions { opacity: 1; } }
.mini-btn { border: 1px solid var(--line); background: var(--panel); border-radius: 5px; padding: 3px 6px; color: var(--muted); font-size: 8px; font-weight: 700; }
.mini-btn:hover { border-color: var(--ink); color: var(--ink); }
.mini-btn.is-done { background: var(--green-soft); color: var(--green); border-color: transparent; }
.feed-skeleton { display: grid; grid-template-columns: 38px 1fr; gap: 12px; padding: 17px 0; border-top: 1px solid var(--line); }
.feed-skeleton > i { width: 38px; height: 38px; border-radius: 11px; background: var(--paper-2); }
.feed-skeleton div { display: flex; flex-direction: column; gap: 7px; }
.feed-skeleton b, .feed-skeleton span { display: block; height: 9px; border-radius: 5px; background: linear-gradient(90deg, var(--paper-2), #f6f2e9, var(--paper-2)); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.feed-skeleton b { width: 30%; }
.feed-skeleton span:nth-child(2) { width: 88%; height: 11px; }
.feed-skeleton span:nth-child(3) { width: 62%; height: 11px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Side widgets ---------- */
.hotrank-panel { padding: 18px; }
.hotrank-list { display: flex; flex-direction: column; margin-top: 10px; }
.hotrank-item { display: flex; align-items: flex-start; gap: 8px; padding: 7px 0; border: 0; border-top: 1px solid var(--line); background: transparent; text-align: left; }
.hotrank-item:first-child { border-top: 0; }
.hotrank-item:hover .hotrank-main p { color: var(--ink); }
.hotrank-num { width: 18px; height: 18px; border-radius: 5px; display: grid; place-items: center; flex: none; background: var(--paper-2); color: var(--muted); font-family: var(--mono); font-size: 8px; }
.hotrank-num.is-top { background: var(--yellow); color: var(--ink); }
.hotrank-main { min-width: 0; }
.hotrank-main p { margin: 0; color: var(--ink-2); font-size: 9px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hotrank-main > div { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 3px; color: var(--muted-2); font-size: 7px; }
.hotrank-main .feed-tag { font-size: 7px; padding: 1px 4px; }
.hotrank-empty { padding: 24px 0; text-align: center; color: var(--muted); font-size: 9px; }
.share-image-wrap { padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper-2); min-height: 120px; display: grid; place-items: center; }
.share-image-wrap img { width: 100%; max-height: 380px; object-fit: contain; border-radius: 8px; display: block; }
.share-image-loading { color: var(--muted); font-size: 10px; padding: 38px 0; }
.hotwords-panel { padding: 18px; }
.word-cloud { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; min-height: 75px; align-content: flex-start; }
.word-chip { display: inline-flex; align-items: baseline; gap: 3px; border: 1px solid var(--line); border-radius: 7px; padding: 4px 7px; background: var(--panel-2); color: var(--ink-2); font-weight: 700; transition: transform 0.16s, border-color 0.16s; }
.word-chip:hover { transform: translateY(-1px); border-color: var(--ink); }
.word-chip small { color: var(--muted-2); font-size: 7px; font-weight: 500; }
.hotwords-foot { color: var(--muted-2); font-size: 8px; margin-top: 12px; }
.channels-panel { padding: 18px; }
.channel-live { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 8px; font-weight: 700; }
.channel-live.is-on { color: var(--green); }
.channel-row { display: flex; align-items: center; gap: 9px; padding: 11px 0; border-top: 1px solid var(--line); margin-top: 4px; }
.channel-row:first-of-type { border-top: 0; }
.channel-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); }
.channel-icon.green { background: var(--green-soft); color: var(--green); }
.channel-icon .icon { width: 15px; height: 15px; }
.channel-copy { display: flex; flex-direction: column; min-width: 0; }
.channel-copy strong { font-size: 10px; }
.channel-copy span { color: var(--muted); font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel-state { margin-left: auto; padding: 2px 5px; border-radius: 4px; background: var(--paper-2); color: var(--muted); font-family: var(--mono); font-size: 7px; font-weight: 700; }
.channel-state.is-on { background: var(--green-soft); color: var(--green); }
.channel-last { padding: 8px 0 11px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.advice-panel { display: flex; gap: 11px; padding: 15px 16px; background: #171716; color: #fff; border-color: #171716; }
.advice-icon { width: 31px; height: 31px; border-radius: 9px; background: rgba(255, 212, 0, 0.16); color: var(--yellow); display: grid; place-items: center; flex: none; }
.advice-panel .panel-kicker { color: rgba(255, 255, 255, 0.36); }
.advice-panel h3 { margin: 3px 0 4px; font-size: 12px; }
.advice-panel p { margin: 0; color: rgba(255, 255, 255, 0.55); font-size: 9px; line-height: 1.65; }

/* ---------- Full feed view ---------- */
.feed-panel--full { padding: 18px 24px 20px; }
.feed-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.feed-toolbar .feed-tabs { margin: 0; flex: 1; }
.search-box { display: flex; align-items: center; gap: 6px; min-width: 260px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); color: var(--muted); }
.search-box .icon { width: 14px; height: 14px; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 10px; }
.search-box input::placeholder { color: var(--muted-2); }
.feed-list--full .feed-item { padding: 20px 0; grid-template-columns: 42px minmax(0, 1fr); }
.feed-list--full .feed-avatar { width: 42px; height: 42px; border-radius: 12px; }
.feed-list--full .feed-content { -webkit-line-clamp: 4; font-size: 12.5px; }
.feed-list--full .feed-actions { opacity: 1; }
.feed-empty { padding: 60px 0; text-align: center; color: var(--muted); font-size: 12px; }
.load-more-wrap { display: flex; justify-content: center; padding: 14px 0 4px; border-top: 1px solid var(--line); }

/* ---------- Alerts view ---------- */
.alert-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; overflow: hidden; margin-bottom: 12px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; }
.alert-stats > div { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; background: var(--panel); }
.alert-stats span { color: var(--muted); font-size: 9px; }
.alert-stats b { font-size: 23px; line-height: 1.1; letter-spacing: -0.04em; }
.alerts-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr); gap: 12px; }
.alerts-grid > .panel { padding: 20px 22px; }
.alert-log { display: flex; flex-direction: column; margin-top: 8px; }
.alert-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: flex-start; padding: 13px 0; border-top: 1px solid var(--line); }
.alert-row:first-child { border-top: 0; }
.alert-row-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--green-soft); color: var(--green); }
.alert-row-icon.is-fail { background: var(--red-soft); color: var(--red); }
.alert-row-icon .icon { width: 14px; height: 14px; }
.alert-row-main { min-width: 0; }
.alert-row-main strong { display: block; font-size: 10px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert-row-main p { margin: 2px 0 0; color: var(--muted); font-size: 8px; }
.alert-row-time { color: var(--muted-2); font-size: 8px; white-space: nowrap; }
.alert-retry { align-self: center; white-space: nowrap; }
.driver-list { display: flex; flex-direction: column; gap: 5px; margin-top: 9px; }
.driver-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.driver-item span { color: var(--ink); font-size: 9px; font-weight: 700; }
.driver-item small { color: var(--muted); font-size: 8px; }
.disposition-form { display: flex; flex-direction: column; gap: 9px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.disposition-form .field { gap: 4px; }
.disposition-form .field input, .disposition-form .field textarea { background: var(--panel); }
.alert-empty { padding: 40px 0; text-align: center; color: var(--muted); font-size: 11px; }
.rules-summary { display: flex; flex-direction: column; gap: 8px; margin-top: 15px; }
.rule-item { display: flex; align-items: flex-start; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.rule-item .icon { width: 14px; height: 14px; color: var(--green); margin-top: 1px; }
.rule-item div { display: flex; flex-direction: column; gap: 2px; }
.rule-item strong { font-size: 9px; }
.rule-item span { color: var(--muted); font-size: 8px; line-height: 1.55; }
.rule-actions { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.rule-actions p { margin: 8px 0 0; color: var(--muted-2); font-size: 8px; line-height: 1.55; }

/* ---------- Lexicon ---------- */
.lexicon-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; overflow: hidden; margin-bottom: 12px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; }
.lexicon-stats > div { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; background: var(--panel); }
.lexicon-stats span { color: var(--muted); font-size: 8px; }
.lexicon-stats b { font-size: 23px; line-height: 1.1; letter-spacing: -0.04em; }
.lexicon-stats small { color: var(--muted-2); font-size: 7px; }
.lexicon-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 12px; align-items: start; }
.lexicon-cats { padding: 14px 10px; position: sticky; top: 110px; }
.lexicon-cat-head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 9px; color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: 0.04em; }
.lexicon-cat-head b { color: var(--ink-2); font-family: var(--mono); font-size: 8px; }
.lexicon-cat-foot { padding: 10px 8px 2px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 7px; line-height: 1.6; }
.lex-cat { width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px; border: 0; border-radius: 8px; background: transparent; text-align: left; }
.lex-cat:hover { background: var(--panel-2); }
.lex-cat.is-active { background: var(--ink); color: #fff; }
.lex-cat.is-off { opacity: 0.58; }
.lex-dot { width: 7px; height: 7px; border-radius: 3px; flex: none; }
.lex-cat > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.lex-cat strong { font-size: 9px; }
.lex-cat span { color: var(--muted); font-size: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lex-cat.is-active span { color: rgba(255, 255, 255, 0.5); }
.lex-count { margin-left: auto; color: var(--muted); font-family: var(--mono); font-size: 7px; }
.lex-cat.is-active .lex-count { color: var(--yellow); }
.lex-cat-toggle { margin-left: auto; padding: 1px 4px; border-radius: 3px; background: var(--green-soft); color: var(--green); font-family: var(--mono); font-size: 7px; font-style: normal; }
.lex-cat.is-off .lex-cat-toggle { background: var(--paper-2); color: var(--muted); }
.lex-cat.is-active .lex-cat-toggle { background: var(--yellow); color: var(--ink); }
.lexicon-main { padding: 18px 20px; min-width: 0; }
.lexicon-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lexicon-title { display: flex; align-items: baseline; gap: 8px; }
.lexicon-title h3 { margin: 0; font-size: 15px; }
.lexicon-title span { color: var(--muted); font-size: 8px; }
.lexicon-toolbar .search-box { min-width: 210px; }
.lexicon-toolbar-sub { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 9px 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.lexicon-words { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.lex-word { display: flex; align-items: center; gap: 7px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); transition: border-color 0.15s, background 0.15s; cursor: pointer; }
.lex-word:hover { border-color: var(--ink); }
.lex-word.is-off { background: var(--panel-2); opacity: 0.58; }
.lex-word.is-custom { border-style: dashed; background: #fffdf4; }
.lex-word-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.lex-word-main strong { font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lex-word-main span { color: var(--muted); font-size: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lex-hit { margin-left: auto; color: var(--muted-2); font-family: var(--mono); font-size: 7px; white-space: nowrap; }
.lex-state { color: var(--green); font-family: var(--mono); font-size: 7px; }
.lex-word.is-off .lex-state { color: var(--muted-2); }
.lex-delete { width: 16px; height: 16px; border: 0; border-radius: 4px; background: var(--red-soft); color: var(--red); font-size: 12px; line-height: 1; padding: 0; }
.lexicon-empty { grid-column: 1 / -1; padding: 40px 0; text-align: center; color: var(--muted); font-size: 10px; }
.modal-card { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(480px, calc(100% - 30px)); max-height: calc(100vh - 40px); overflow-y: auto; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24); animation: viewIn 0.22s ease both; }
.modal-card-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-card-head h3 { margin: 4px 0 0; font-size: 17px; }
.modal-form { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px 20px; }
.modal-form .field-row { margin-top: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 7px; padding-top: 6px; }

/* ---------- Settings ---------- */
.save-state { color: var(--muted); font-size: 10px; }
.save-state.is-dirty { color: var(--orange); font-weight: 700; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-bottom: 20px; }
.settings-card { padding: 20px 22px; }
.settings-card--wide { grid-column: 1 / -1; }
.settings-card-head { display: flex; align-items: flex-start; gap: 11px; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.settings-num { width: 25px; height: 25px; border-radius: 7px; display: grid; place-items: center; background: var(--ink); color: var(--yellow); font-family: var(--mono); font-size: 8px; font-weight: 700; flex: none; }
.settings-card-head h3 { margin: 1px 0 3px; font-size: 14px; }
.settings-card-head p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.6; }
.settings-card-head .switch-row { margin-left: auto; padding: 0; border: 0; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.switch-row:last-child { border-bottom: 0; }
.switch-row > span { display: flex; flex-direction: column; gap: 2px; }
.switch-row strong { font-size: 10px; }
.switch-row small { color: var(--muted); font-size: 8px; }
.switch-row--inline { padding: 0; border: 0; }
.switch-row--inline strong { font-size: 9px; }
.switch { appearance: none; width: 34px; height: 20px; border-radius: 99px; background: var(--line-strong); position: relative; cursor: pointer; transition: background 0.18s; flex: none; }
.switch::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #fff; top: 2px; left: 2px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16); transition: transform 0.18s; }
.switch:checked { background: var(--ink); }
.switch:checked::after { transform: translateX(14px); background: var(--yellow); }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.field-row--3 { grid-template-columns: 1.4fr 0.6fr 0.9fr; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { color: var(--muted); font-size: 8px; font-weight: 700; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.field > span small { color: var(--muted-2); font-weight: 400; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 34px; padding: 7px 9px;
  border: 1px solid var(--line); border-radius: 7px;
  background: var(--panel-2); color: var(--ink); font-size: 10px;
  outline: 0; transition: border-color 0.16s, box-shadow 0.16s;
}
.field textarea { resize: vertical; line-height: 1.7; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(23, 23, 22, 0.06); }
.field input::placeholder, .field textarea::placeholder { color: var(--muted-2); }
.range-field { margin-top: 16px; }
.range-field span b { color: var(--ink); font-family: var(--mono); }
.range-field input[type="range"] { padding: 0; height: 5px; min-height: 5px; accent-color: var(--ink); background: var(--paper-2); border: 0; }
.range-field small { color: var(--muted-2); font-size: 8px; }
.preset-row { display: flex; flex-wrap: wrap; gap: 5px; margin: 12px 0 2px; }
.chip { border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; background: var(--panel); color: var(--muted); font-size: 8px; font-weight: 700; }
.chip:hover, .chip.is-active { border-color: var(--ink); color: var(--ink); background: var(--yellow-soft); }
.settings-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.inline-note { color: var(--muted-2); font-size: 8px; }
.wechat-guide { margin-top: 12px; padding: 11px 13px; border-left: 2px solid var(--yellow); background: var(--panel-2); border-radius: 0 8px 8px 0; }
.wechat-guide strong { font-size: 9px; }
.wechat-guide p { margin: 3px 0 0; color: var(--muted); font-size: 8px; line-height: 1.65; }

/* ---------- Footer ---------- */
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 17px 0 24px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 8px; }

/* ---------- Toasts / Modal ---------- */
.toast-stack { position: fixed; right: 22px; bottom: 22px; z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 8px; max-width: 360px; padding: 11px 13px; border-radius: 10px; background: #171716; color: #fff; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22); font-size: 10px; line-height: 1.6; animation: toastIn 0.24s ease both; pointer-events: auto; }
.toast.is-success { background: #0d3d2a; }
.toast.is-error { background: #4a1511; }
.toast .icon { width: 14px; height: 14px; margin-top: 1px; color: var(--yellow); }
.toast.is-success .icon { color: #6ce9a6; }
.toast.is-error .icon { color: #fda29b; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.modal-root { position: fixed; inset: 0; z-index: 90; display: none; }
.modal-root.is-open { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(17, 17, 16, 0.44); backdrop-filter: blur(4px); }
.post-drawer { position: absolute; right: 0; top: 0; bottom: 0; width: min(540px, 100%); overflow-y: auto; background: var(--panel); box-shadow: -20px 0 60px rgba(0, 0, 0, 0.16); animation: drawerIn 0.26s ease both; }
@keyframes drawerIn { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(255, 253, 248, 0.94); backdrop-filter: blur(10px); z-index: 2; }
.drawer-head span { color: var(--muted); font-size: 9px; font-family: var(--mono); letter-spacing: 0.12em; }
.icon-btn { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); display: grid; place-items: center; }
.icon-btn:hover { background: var(--paper-2); }
.drawer-body { padding: 22px; }
.drawer-author { display: flex; align-items: center; gap: 10px; }
.drawer-author .feed-avatar { width: 42px; height: 42px; border-radius: 12px; }
.drawer-author div:nth-child(2) { display: flex; flex-direction: column; }
.drawer-author strong { font-size: 12px; }
.drawer-author span { color: var(--muted); font-size: 9px; }
.drawer-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 15px 0 12px; }
.drawer-content { margin: 0; white-space: pre-wrap; color: var(--ink); font-size: 14px; line-height: 1.9; }
.drawer-media { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 14px; }
.drawer-media-item { padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-2); }
.drawer-media-item img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: transform 0.18s; }
.drawer-media-item:hover img { transform: scale(1.03); }
.lightbox { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(860px, calc(100% - 30px)); max-height: calc(100vh - 40px); padding: 12px; border-radius: 18px; background: #111; box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 140px); object-fit: contain; border-radius: 10px; }
.lightbox-close { position: absolute; right: 14px; top: 14px; background: rgba(255, 255, 255, 0.9); border-color: transparent; }
.lightbox-open { flex: none; }
.drawer-section { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.drawer-section h4 { margin: 0 0 9px; font-size: 10px; }
.reason-list { display: flex; flex-direction: column; gap: 6px; }
.reason-item { display: flex; align-items: flex-start; gap: 7px; padding: 8px 10px; border-radius: 7px; background: var(--panel-2); color: var(--muted); font-size: 9px; line-height: 1.6; }
.reason-item .icon { width: 13px; height: 13px; color: var(--orange); margin-top: 1px; }
.drawer-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--line); }
.drawer-metrics div { padding: 10px; background: var(--panel); display: flex; flex-direction: column; gap: 2px; }
.drawer-metrics span { color: var(--muted); font-size: 8px; }
.drawer-metrics b { font-size: 15px; }
.drawer-actions { display: flex; gap: 7px; margin-top: 18px; flex-wrap: wrap; }
.drawer-actions .btn { flex: 1; min-width: 120px; }
.source-comment-list { display: flex; flex-direction: column; gap: 7px; max-height: 340px; overflow-y: auto; }
.source-comment { padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
.source-comment-head { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.source-comment-head strong { font-size: 9px; }
.source-comment-head span { color: var(--muted-2); font-size: 7px; }
.source-comment p { margin: 4px 0 0; color: var(--ink-2); font-size: 10px; line-height: 1.65; white-space: pre-wrap; }
.source-reply { margin-top: 6px; padding: 6px 8px; border-radius: 6px; background: var(--panel); color: var(--muted); font-size: 9px; line-height: 1.55; }
.source-reply b { color: var(--ink-2); }
.comment-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.comment-item { display: flex; gap: 8px; padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.comment-avatar { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: var(--yellow-soft); color: #7a6400; font-size: 9px; font-weight: 800; flex: none; }
.comment-item > div:last-child { min-width: 0; }
.comment-meta { display: flex; align-items: baseline; gap: 7px; }
.comment-meta strong { font-size: 9px; }
.comment-meta span { color: var(--muted-2); font-size: 7px; }
.comment-item p { margin: 3px 0 0; color: var(--ink-2); font-size: 10px; line-height: 1.6; white-space: pre-wrap; }
.comment-empty { padding: 12px; border: 1px dashed var(--line); border-radius: 9px; color: var(--muted); font-size: 9px; line-height: 1.6; }
.comment-form { display: flex; flex-direction: column; gap: 7px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); }
.comment-form-head { display: flex; align-items: center; gap: 7px; }
.comment-form-head input { width: 130px; min-height: 27px; padding: 4px 7px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); font-size: 9px; }
.comment-form-head span { color: var(--muted); font-size: 8px; }
.comment-form textarea { width: 100%; padding: 7px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); font-size: 10px; resize: vertical; outline: 0; }
.comment-form textarea:focus { border-color: var(--ink); }
.share-card { width: min(560px, calc(100% - 30px)); }
.share-post-preview { padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.share-post-preview p { margin: 6px 0 0; color: var(--ink-2); font-size: 11px; line-height: 1.7; max-height: 90px; overflow: auto; }
.share-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.share-action { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); text-align: left; }
.share-action:hover { border-color: var(--ink); background: var(--panel-2); }
.share-action .icon { width: 15px; height: 15px; color: var(--ink); margin-bottom: 2px; }
.share-action span { font-size: 10px; font-weight: 700; }
.share-action small { color: var(--muted); font-size: 7px; }

/* ---------- Responsive ---------- */
@media (max-width: 1240px) {
  .alert-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: minmax(0, 1.35fr) minmax(250px, 0.65fr); }
  .hero { padding: 30px; }
  .hero h2 { font-size: 46px; }
  .topbar-actions .sync-meta { display: none; }
}
@media (max-width: 1050px) {
  .app { grid-template-columns: 210px minmax(0, 1fr); }
  .sidebar { padding-left: 14px; padding-right: 14px; }
  .main { padding: 0 22px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
  .trend-panel, .risk-panel, .feed-panel, .side-column { grid-column: 1; }
  .side-column { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-orbit { display: none; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-card--wide { grid-column: 1; }
  .alerts-grid { grid-template-columns: 1fr; }
  .lexicon-layout { grid-template-columns: 1fr; }
  .lexicon-cats { position: static; }
  .lexicon-words { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .insight-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 780px) {
  .app { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 248px; z-index: 80; transform: translateX(-100%); transition: transform 0.24s ease; box-shadow: 20px 0 50px rgba(0, 0, 0, 0.12); }
  .sidebar.is-open { transform: none; }
  .main { padding: 0 15px; overflow-x: hidden; }
  .mobile-menu { display: grid; place-items: center; }
  .topbar { min-height: 76px; gap: 10px; }
  .topbar-title { flex: 1; min-width: 0; overflow: hidden; }
  .topbar h1 { font-size: 19px; white-space: nowrap; }
  .breadcrumb { display: none; }
  .topbar-actions { flex: none; gap: 7px; }
  .topbar-actions .live-status, .topbar-actions .btn-ghost span { display: none; }
  .topbar-actions .btn { min-width: 38px; padding: 0 9px; }
  .topbar-actions .btn span { display: none; }
  .hero { padding: 24px 21px; border-radius: 20px; }
  .hero-copy { min-width: 0; }
  .hero h2 { font-size: 39px; }
  .hero p { font-size: 11px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
  .kpi-grid { gap: 8px; }
  .kpi-card { padding: 14px; min-width: 0; }
  .kpi-foot { flex-wrap: wrap; }
  .panel { min-width: 0; }
  .kpi-value b { font-size: 32px; }
  .trend-panel, .risk-panel, .feed-panel { padding: 16px; }
  .chart-wrap { height: 180px; }
  .side-column { grid-template-columns: 1fr; }
  .view-heading { flex-direction: column; align-items: flex-start; gap: 12px; }
  .view-heading h2 { font-size: 26px; }
  .view-heading-actions { width: 100%; }
  .view-heading-actions .btn { flex: 1; }
  .feed-toolbar { flex-direction: column; align-items: stretch; }
  .search-box { min-width: 0; }
  .feed-list--full .feed-item { grid-template-columns: 36px minmax(0, 1fr); }
  .feed-list--full .feed-avatar { width: 36px; height: 36px; }
  .alert-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lexicon-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lexicon-words { grid-template-columns: 1fr; }
  .lexicon-toolbar { flex-direction: column; align-items: stretch; }
  .lexicon-toolbar .search-box { min-width: 0; }
  .lexicon-toolbar-sub { align-items: flex-start; flex-direction: column; gap: 4px; }
  .insight-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .heatmap-panel { padding: 16px; }
  .field-row, .field-row--3 { grid-template-columns: 1fr; }
  .share-buttons { grid-template-columns: 1fr; }
  .settings-card { padding: 16px; }
  .settings-card-head { flex-wrap: wrap; }
  .settings-card-head .switch-row { margin-left: 36px; width: calc(100% - 36px); }
  .footer { flex-direction: column; gap: 4px; }
  .toast-stack { left: 14px; right: 14px; bottom: 14px; align-items: stretch; }
  .toast { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ============================================================
   正式版视觉：校园舆情监测中心
   面向校领导汇报场景，降低装饰性，突出数据与处置状态。
   ============================================================ */
:root {
  --paper: #f1f4f7;
  --paper-2: #e8edf2;
  --panel: #ffffff;
  --panel-2: #f7f9fb;
  --ink: #12243a;
  --ink-2: #34475d;
  --muted: #66788b;
  --muted-2: #8d9aaa;
  --line: #dce3ea;
  --line-strong: #c7d1dc;
  --yellow: #c8a45c;
  --yellow-soft: #f7f0e0;
  --red: #b42318;
  --red-soft: #fdf1f0;
  --orange: #a15c14;
  --orange-soft: #fdf6ec;
  --green: #1d6b4f;
  --green-soft: #eef7f3;
  --blue: #174a7e;
  --blue-soft: #edf3f9;
  --radius: 10px;
  --radius-sm: 8px;
  --shadow: 0 12px 30px rgba(16, 38, 64, 0.07);
  --shadow-soft: 0 2px 7px rgba(16, 38, 64, 0.045);
}
body { background: var(--paper); font-size: 13px; }
body::before { display: none; }
.app { grid-template-columns: 236px minmax(0, 1fr); }
.main { padding: 0 28px; }

/* Sidebar */
.sidebar { background: #0d2238; border-right: 0; padding: 22px 16px 18px; }
.brand { padding-bottom: 22px; }
.brand-mark { width: 38px; height: 38px; border-radius: 9px; background: var(--yellow); color: #0d2238; box-shadow: none; }
.brand-copy strong { color: #fff; font-size: 15px; letter-spacing: 0.02em; }
.brand-copy span { color: rgba(255,255,255,.4); font-size: 7px; letter-spacing: .16em; }
.nav { gap: 3px; }
.nav-item { color: rgba(255,255,255,.66); border-radius: 6px; padding: 10px 11px; font-size: 12px; }
.nav-item .icon { color: rgba(255,255,255,.5); }
.nav-item i { color: rgba(255,255,255,.28); }
.nav-item:hover { background: rgba(255,255,255,.07); transform: none; }
.nav-item.is-active { background: #173a5c; color: #fff; box-shadow: none; border-left: 2px solid var(--yellow); border-radius: 0 6px 6px 0; }
.nav-item.is-active .icon { color: var(--yellow); }
.nav-item.is-active i { color: rgba(255,255,255,.45); }
.nav-badge { background: var(--red); }
.source-card { background: rgba(255,255,255,.055); border-color: rgba(255,255,255,.1); border-radius: 8px; box-shadow: none; }
.source-top { color: rgba(255,255,255,.44); }
.source-card strong { color: #fff; font-size: 12px; }
.source-card p { color: rgba(255,255,255,.44); }
.source-card a { color: rgba(255,255,255,.7); }
.operator { color: #fff; }
.operator-avatar { background: rgba(200,164,92,.2); color: var(--yellow); border-radius: 7px; }
.operator strong { color: rgba(255,255,255,.8); }
.operator span { color: rgba(255,255,255,.36); }
.status-dot { background: #4ade80; }

/* Topbar */
.topbar { min-height: 78px; padding: 14px 0 12px; background: rgba(241,244,247,.94); }
.breadcrumb { font-size: 9px; letter-spacing: .03em; }
.breadcrumb-dot { background: var(--yellow); border-color: var(--yellow); }
.topbar h1 { font-size: 21px; letter-spacing: -.02em; font-weight: 700; }
.live-status { border-radius: 4px; background: var(--green-soft); font-size: 9px; padding: 6px 9px; }
.btn { border-radius: 5px; min-height: 36px; font-size: 11px; }
.btn-ghost { background: #fff; }
.btn-dark { background: #12395d; box-shadow: none; }
.btn-dark:hover { background: #174a7e; }
.btn-yellow, .btn-gold { background: var(--yellow); color: #0d2238; box-shadow: none; }
.btn-gold:hover { background: #d6b56f; }

/* Formal command header */
.command-hero {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(360px, .75fr);
  gap: 26px; align-items: stretch;
  padding: 28px 32px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0d2238 0%, #12395d 100%);
  color: #fff;
  box-shadow: 0 14px 32px rgba(13,34,56,.14);
  margin-bottom: 14px;
}
.command-copy { align-self: center; }
.command-kicker { color: var(--yellow); font-size: 10px; letter-spacing: .16em; font-weight: 700; }
.command-copy h2 { margin: 12px 0 10px; font-size: 36px; line-height: 1.15; letter-spacing: -.03em; font-weight: 700; }
.command-copy p { max-width: 660px; margin: 0; color: rgba(255,255,255,.68); font-size: 12px; line-height: 1.9; }
.command-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.command-actions .btn { min-height: 38px; padding: 0 14px; }
.command-actions .btn-outline-light { border-color: rgba(255,255,255,.28); color: #fff; }
.command-side { display: flex; flex-direction: column; justify-content: space-between; gap: 16px; padding: 18px 20px; background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.12); border-radius: 9px; }
.command-source { display: flex; align-items: center; gap: 10px; }
.command-logo { width: 42px; height: 42px; border-radius: 8px; display: grid; place-items: center; background: var(--yellow); color: #0d2238; font-size: 20px; font-weight: 800; }
.command-source > div:nth-child(2) { display: flex; flex-direction: column; gap: 2px; }
.command-source strong { font-size: 12px; }
.command-source span { color: rgba(255,255,255,.42); font-size: 8px; }
.command-badge { margin-left: auto; padding: 3px 6px; border: 1px solid rgba(74,222,128,.35); border-radius: 3px; color: #86efac; font-size: 8px; }
.command-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: rgba(255,255,255,.12); border-radius: 6px; overflow: hidden; }
.command-metrics > div { display: flex; flex-direction: column; gap: 4px; padding: 12px 10px; background: rgba(13,34,56,.55); }
.command-metrics span { color: rgba(255,255,255,.45); font-size: 8px; }
.command-metrics b { color: #fff; font-size: 22px; line-height: 1.1; letter-spacing: -.03em; }
.command-note { display: flex; align-items: center; gap: 6px; color: rgba(255,255,255,.48); font-size: 8px; }
.command-note .live-dot { color: #4ade80; }

/* Cards and metrics */
.kpi-grid { gap: 10px; margin: 12px 0; }
.kpi-card { border-radius: 9px; border-color: var(--line); box-shadow: var(--shadow-soft); padding: 16px 18px; }
.kpi-card--risk { background: #fff; border-top: 2px solid var(--red); }
.kpi-card:hover { transform: none; box-shadow: var(--shadow-soft); }
.kpi-head { font-size: 10px; color: var(--muted); }
.kpi-icon { border-radius: 6px; width: 26px; height: 26px; }
.kpi-value b { font-size: 34px; color: var(--ink); }
.kpi-value span { font-size: 10px; }
.kpi-foot { font-size: 8px; }
.trend-tag { border-radius: 3px; font-size: 7px; }
.insight-strip { border-radius: 8px; margin-bottom: 12px; }
.insight-strip > div { padding: 10px 14px; }
.insight-strip b { font-size: 16px; }
.panel { border-radius: 9px; border-color: var(--line); box-shadow: var(--shadow-soft); }
.trend-panel, .risk-panel, .feed-panel { padding: 18px 20px; }
.panel-kicker { color: #97a4b2; font-size: 7px; letter-spacing: .14em; }
.panel-head h3 { font-size: 15px; font-weight: 700; }
.feed-tabs button { border-radius: 4px; font-size: 9px; }
.feed-tabs button.is-active { background: #12395d; }
.feed-item { padding: 14px 0; border-color: #e7ecf1; }
.feed-item:hover { background: #f8fafc; }
.feed-item.is-new::before { background: var(--yellow); }
.feed-avatar { border-radius: 7px; border-color: var(--line); }
.feed-content { font-size: 12px; color: var(--ink-2); line-height: 1.7; }
.feed-tag { border-radius: 3px; background: #f1f4f7; color: #5d6d7e; font-size: 7px; }
.tag-high { background: var(--red-soft); color: var(--red); }
.tag-medium { background: var(--orange-soft); color: var(--orange); }
.tag-low { background: var(--green-soft); color: var(--green); }
.tag-board { background: #edf3f9; color: #174a7e; }
.tag-cluster { background: #edf3f9; color: #174a7e; }
.tag-review { background: #f4f1e8; color: #745a20; }
.tag-demo { background: #f7f0e0; color: #745a20; }
mark.kw { background: #f7f0e0; color: #5f4718; box-shadow: inset 0 -1px 0 rgba(160,120,30,.3); }
.feed-actions { opacity: 1; }
.mini-btn { border-radius: 3px; background: #fff; }
.heatmap-panel { border-radius: 9px; }
.heat-1 { background: #f5eedf !important; }
.heat-2 { background: #ead9b7 !important; }
.heat-3 { background: #d8bc82 !important; }
.heat-4 { background: #9b742c !important; }
.donut-high { stroke: var(--red); }
.donut-medium { stroke: #c58a3c; }
.donut-low { stroke: #d5dce4; }
.sentiment-score em { border-radius: 3px; }
.word-chip { border-radius: 4px; background: #fff; }
.hotrank-panel, .hotwords-panel, .channels-panel { border-radius: 9px; }
.advice-panel { background: #0d2238; border-color: #0d2238; border-radius: 9px; }
.advice-icon { background: rgba(200,164,92,.18); color: var(--yellow); }
.footer { border-color: var(--line); font-size: 7px; }
.modal-card, .post-drawer { border-radius: 9px 0 0 9px; }
.modal-card { border-radius: 9px; }
.icon-btn { border-radius: 5px; }

/* Mobile */
@media (max-width: 1050px) {
  .app { grid-template-columns: 210px minmax(0, 1fr); }
  .command-hero { grid-template-columns: 1fr; }
  .command-copy h2 { font-size: 31px; }
}
@media (max-width: 780px) {
  .app { display: block; }
  .main { padding: 0 14px; }
  .topbar { min-height: 68px; }
  .topbar h1 { font-size: 18px; }
  .command-hero { padding: 20px; gap: 16px; }
  .command-copy h2 { font-size: 27px; }
  .command-copy p { font-size: 11px; }
  .command-actions { flex-direction: column; }
  .command-actions .btn { width: 100%; }
  .command-side { padding: 14px; }
  .command-metrics b { font-size: 19px; }
  .kpi-card { border-radius: 7px; }
  .panel { border-radius: 7px; }
  .sidebar { background: #0d2238; }
}

/* Fix overview grid stretching: prevent tall side column from creating blank feed panel */
.dash-grid { align-items: start; }
.trend-panel, .risk-panel, .feed-panel, .side-column { align-self: start; }
.side-column { height: auto; }
.hotrank-panel--wide { margin-top: 12px; }
.hotrank-panel--wide .hotrank-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 26px; }
.hotrank-panel--wide .hotrank-item { min-width: 0; }
@media (max-width: 780px) {
  .hotrank-panel--wide .hotrank-list { grid-template-columns: 1fr; }
}

/* Frontend access control */
.auth-card { width: min(400px, calc(100% - 30px)); }
.auth-card .modal-form { gap: 14px; }
.auth-error { margin: 0; padding: 9px 11px; border: 1px solid rgba(180, 35, 24, 0.18); border-radius: 6px; background: var(--red-soft); color: var(--red); font-size: 11px; }
#logoutBtn { color: var(--ink-2); }
#logoutBtn:hover { border-color: var(--line-strong); background: var(--paper-2); }
@media (max-width: 780px) {
  .auth-card { width: calc(100% - 24px); }
}

/* Fixed share preview and mobile form sizing */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overflow-x: hidden; }
.share-image-wrap img { width: auto; max-width: 100%; max-height: 360px; object-fit: contain; margin: 0 auto; }
@media (max-width: 780px) {
  input, select, textarea { font-size: 16px !important; }
  .field input, .field select, .field textarea { min-height: 42px; }
  .share-card { width: calc(100% - 20px); }
  .share-image-wrap img { max-height: 300px; }
  .modal-card { max-height: calc(100dvh - 24px); }
}

/* Mobile sidebar: avoid Safari stale backdrop blur / gray overlay */
.sidebar-backdrop.is-open { background: rgba(13, 34, 56, 0.34); backdrop-filter: none; -webkit-backdrop-filter: none; }
@media (max-width: 780px) {
  .sidebar { backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* Modal centering: previous viewIn animation cleared translate(-50%,-50%) */
@keyframes modalInCentered {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 8px)); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}
.modal-card { animation: modalInCentered 0.22s ease both; }
body { touch-action: manipulation; }

/* Static first image for WeChat link preview crawler */
.wechat-share-image { position: absolute; left: -10000px; top: 0; width: 1200px; height: 630px; opacity: 0.01; pointer-events: none; }
