/* ==========================================================================
   舆情视频监测 · 样式表
   结构：① 变量与基础 ② 登录 ③ 顶栏/横幅 ④ 卡片与表单 ⑤ 列表 ⑥ 统计与走势
        ⑦ 底部导航 ⑧ 弹窗与提醒 ⑨ 手机适配 ⑩ 桌面/宽屏美化
   ========================================================================== */

/* ---------------------------- ① 变量与基础 ---------------------------- */
:root {
  --bg: #f4f6fb;
  --bg-soft: #eef2f9;
  --card: #ffffff;
  --text: #111827;
  --text-2: #374151;
  --muted: #6b7688;
  --line: #e8ecf4;
  --line-strong: #dbe2ee;

  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eef4ff;
  --primary-ring: rgba(37, 99, 235, .18);

  --danger: #e5484d;
  --danger-bg: #fdecec;
  --ok: #0f8a5f;
  --ok-ink: #0b6e4f;      /* 绿字用于正文时用这个，白底对比度 ≥ 4.5:1 */
  --ok-bg: #e7f8f0;
  --warn: #b45309;
  --warn-bg: #fdf5e6;
  --pending: #5b6472;
  --pending-bg: #eef1f6;

  --r-lg: 18px;
  --r-md: 13px;
  --r-sm: 9px;

  --shadow-xs: 0 1px 2px rgba(17, 24, 39, .05);
  --shadow-sm: 0 2px 10px rgba(17, 24, 39, .05), 0 1px 2px rgba(17, 24, 39, .04);
  --shadow-md: 0 10px 30px rgba(17, 24, 39, .08), 0 2px 6px rgba(17, 24, 39, .04);
  --shadow-lg: 0 24px 60px rgba(17, 24, 39, .12);
  --shadow: var(--shadow-sm);

  --holo: linear-gradient(135deg, #3b82f6 0%, #6366f1 55%, #8b5cf6 100%);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* 关键：.login-wrap 等自定义 display 会盖掉浏览器默认的 [hidden]{display:none}，
   导致 JS 里 el.hidden = true 看似生效、页面上却还显示着（登录后进不去就栽在这里）。 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -.005em;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: var(--primary); }

:focus-visible { outline: 2px solid var(--primary-ring); outline-offset: 2px; }

/* ---------------------------- ② 登录 ---------------------------- */
.login-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 18px calc(24px + env(safe-area-inset-bottom));
  background:
    radial-gradient(900px 520px at 15% -10%, #e0ebff 0%, rgba(224, 235, 255, 0) 60%),
    radial-gradient(760px 480px at 90% 10%, #eae4ff 0%, rgba(234, 228, 255, 0) 55%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 392px;
  background: var(--card);
  border-radius: 22px;
  padding: 30px 24px 22px;
  border: 1px solid #eef1f8;
  box-shadow: var(--shadow-lg);
}

.login-card .logo {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: var(--holo);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: 1px;
  margin-bottom: 16px;
  box-shadow: 0 8px 20px rgba(79, 70, 229, .28);
}

.login-card h1 { font-size: 21px; margin: 0 0 6px; letter-spacing: -.02em; }
.login-card .sub { color: var(--muted); font-size: 13px; margin: 0 0 22px; }
.login-card label {
  display: block; font-size: 12.5px; color: var(--muted);
  margin-bottom: 14px; font-weight: 500;
}
.login-card input {
  display: block; width: 100%; margin-top: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fbfcfe;
  font-size: 16px;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.login-card input:focus {
  outline: none; border-color: var(--primary); background: #fff;
  box-shadow: 0 0 0 4px var(--primary-ring);
}

/* ---------------------------- ③ 顶栏 / 横幅 ---------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top));
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-weight: 650; font-size: 15px;
  display: flex; align-items: center; gap: 9px;
  flex: 0 0 auto; white-space: nowrap;
  letter-spacing: -.01em;
}
.brand .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, .16);
  transition: background .25s, box-shadow .25s;
}
/* 实时提醒连接状态：绿=在线，黄=重连中，灰=已断开（靠轮询兜底） */
.brand .dot.warn { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245, 158, 11, .18); }
.brand .dot.bad  { background: #9aa4b2; box-shadow: 0 0 0 4px rgba(154, 164, 178, .18); }

.linkbar {
  position: sticky; top: 0; z-index: 30;
  margin: 0; padding: 7px 14px;
  font-size: 12.5px; line-height: 1.45;
  background: var(--warn-bg); color: var(--warn);
  border-bottom: 1px solid rgba(180, 83, 9, .18);
  text-align: center;
}
.linkbar.bad { background: var(--danger-bg); color: var(--danger); border-bottom-color: rgba(229, 72, 77, .2); }

/* 快手 Cookie 提示条：只有管理员能看到，且只在「没填 / 已失效」时出现 */
.cookiebar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 0; padding: 7px 14px;
  font-size: 12.5px; line-height: 1.45;
  background: var(--danger-bg); color: var(--danger);
  border-bottom: 1px solid rgba(229, 72, 77, .2);
}
.cookiebar button { flex: 0 0 auto; }

/* 快手 Cookie 卡片 */
.ck-badge {
  display: inline-block; margin-left: 6px; padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; vertical-align: middle;
  background: #eef2f7; color: #64748b;
}
.ck-badge.on   { background: var(--ok-bg); color: var(--ok); }
.ck-badge.warn { background: var(--warn-bg); color: var(--warn); }
.ck-badge.bad  { background: var(--danger-bg); color: var(--danger); }
.ck-badge.off  { background: #eef2f7; color: #64748b; }
#cookieInput {
  width: 100%; font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12px; line-height: 1.55; min-height: 76px;
}
#cookieCard .row.space { align-items: center; }
#cookieCard .row.space span.row { gap: 8px; }

.userbox {
  display: flex; align-items: center; gap: 8px; position: relative;
  flex: 0 1 auto; min-width: 0; white-space: nowrap;
}
.userbox button { flex: 0 0 auto; white-space: nowrap; }
.who {
  font-size: 13px; color: var(--muted);
  flex: 0 1 auto; min-width: 0; max-width: 32vw;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 屏幕很窄时（iPhone 竖屏）：用户名优先让位，避免标题和按钮折行 */
@media (max-width: 430px) {
  .brand { font-size: 14px; }
  .who { max-width: 22vw; }
  .topbar { gap: 8px; }
}

/* ===== 提醒开关（PC 上做得更像一个可点的小开关，而不是灰按钮） ===== */
.notify-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #f5f8fd; color: var(--primary);
  font-size: 12.5px; font-weight: 600; line-height: 1;
  white-space: nowrap; cursor: pointer;
  transition: background .18s, border-color .18s, color .18s, box-shadow .18s, transform .1s;
}
.notify-btn:hover { background: #eaf1ff; border-color: #c9dcff; box-shadow: 0 3px 10px rgba(37, 99, 235, .14); }
.notify-btn:active { transform: translateY(1px); }
.notify-btn .nb-ico { display: inline-flex; align-items: center; }
.notify-btn .nb-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #c3cbd8; transition: background .2s, box-shadow .2s;
}
.notify-btn[data-state="on"] { background: #ecfdf3; border-color: #b7ebcb; color: #0f7b53; }
.notify-btn[data-state="on"]:hover { background: #ddfbe9; border-color: #93e0b6; }
.notify-btn[data-state="on"] .nb-dot { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }
.notify-btn[data-state="warn"] { background: #fff8ed; border-color: #fce3bd; color: #b45309; }
.notify-btn[data-state="warn"]:hover { background: #fef0d9; border-color: #f8d29b; }
.notify-btn[data-state="warn"] .nb-dot { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .2); }
.notify-btn.pulse { animation: nbPulse .45s ease; }
@keyframes nbPulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .5); }
  100% { box-shadow: 0 0 0 12px rgba(34, 197, 94, 0); }
}

/* ---------------------------- ④ 卡片与表单 ---------------------------- */
main { padding: 14px 14px calc(84px + env(safe-area-inset-bottom)); max-width: 980px; margin: 0 auto; }

.card {
  background: var(--card);
  border: 1px solid #eff2f8;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  padding: 16px;
  margin-bottom: 14px;
}
.card h2 {
  font-size: 15px; margin: 0 0 12px; font-weight: 650;
  letter-spacing: -.01em;
}

textarea, input, select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: #fbfcfe;
  font-size: 15px;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
textarea { resize: vertical; min-height: 92px; line-height: 1.6; }
textarea:focus, input:focus, select:focus {
  outline: none; border-color: var(--primary); background: #fff;
  box-shadow: 0 0 0 4px var(--primary-ring);
}

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.row.space { justify-content: space-between; }
.row > input, .row > select { flex: 1 1 150px; width: auto; }

.primary {
  background: var(--primary); color: #fff;
  padding: 11px 18px; border-radius: var(--r-md); font-weight: 600;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .22);
  transition: background .16s, box-shadow .16s, transform .1s;
}
.primary:hover { background: var(--primary-dark); box-shadow: 0 6px 18px rgba(37, 99, 235, .28); }
.primary:active { transform: translateY(1px); }
.primary.block { width: 100%; margin-top: 4px; padding: 13px; border-radius: var(--r-md); font-size: 16px; }

.ghost {
  background: #f4f7fc; color: var(--primary);
  padding: 9px 14px; border-radius: 10px; font-weight: 500;
  border: 1px solid var(--line-strong);
  transition: background .16s, border-color .16s;
}
.ghost:hover { background: #eaf1ff; border-color: #c9dcff; }
.ghost.small { padding: 6px 11px; font-size: 12px; border-radius: 9px; }
.ghost:active { background: #e2ebfb; }

.hint { color: var(--muted); font-size: 12px; margin: 8px 0 0; }
.msg { font-size: 13px; margin: 10px 0 0; min-height: 18px; color: var(--ok); }
.msg.err { color: var(--danger); }
.err { color: var(--danger); font-size: 13px; min-height: 18px; margin: 10px 0 0; }
.bootinfo { font-size: 12px; margin: 6px 0 0; text-align: center; color: var(--muted); }
.bootinfo.ok { color: var(--ok-ink); }
.bootinfo.bad { color: var(--danger); }

/* ---------------------------- ⑤ 筛选与列表 ---------------------------- */
.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  padding: 7px 14px; border-radius: 999px;
  background: #f2f5fb; color: var(--muted);
  font-size: 13px; border: 1px solid transparent;
  white-space: nowrap;
  transition: background .16s, color .16s, border-color .16s;
}
.chip:hover { background: #e9eefa; color: var(--text-2); }
.chip.active { background: var(--primary-soft); color: var(--primary); border-color: #c9dcff; font-weight: 600; }
.search { margin-top: 10px; }

.list { display: grid; gap: 10px; }
@media (min-width: 760px) { .list { grid-template-columns: 1fr 1fr; } }

.item {
  border: 1px solid var(--line);
  border-left: 3px solid var(--pending);
  border-radius: var(--r-md);
  padding: 12px 14px;
  background: #fff;
  transition: box-shadow .18s, transform .18s, border-color .18s;
}
.item:hover { box-shadow: var(--shadow-sm); border-color: var(--line-strong); }
.item.s-deleted { border-left-color: var(--danger); background: linear-gradient(180deg, #fff8f8, #fff 60%); }
.item.s-alive { border-left-color: var(--ok); }
.item.s-error { border-left-color: #e0a12a; }

.item-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.plat {
  font-size: 12px; color: var(--muted); background: #f2f5fb;
  padding: 2px 8px; border-radius: 6px;
}
.plat.status-line { display: inline-flex; align-items: center; gap: 4px; background: none; padding: 0; }
.badge {
  font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px;
  background: var(--pending-bg); color: var(--pending);
}
.badge.deleted { background: var(--danger-bg); color: var(--danger); }
.badge.alive { background: var(--ok-bg); color: var(--ok); }
.badge.error { background: var(--warn-bg); color: var(--warn); }
.item .title { font-size: 14px; font-weight: 500; word-break: break-all; margin-bottom: 4px; }
.item .title a { color: var(--text); text-decoration: none; }
.item .title a:hover { color: var(--primary); text-decoration: underline; }
.item .meta { font-size: 12px; color: var(--muted); word-break: break-all; }
.item .evidence {
  font-size: 12px; color: var(--warn); background: var(--warn-bg);
  padding: 6px 9px; border-radius: 8px; margin-top: 8px; word-break: break-all;
}
.item .actions { display: flex; gap: 14px; margin-top: 9px; font-size: 12.5px; }
.item .actions button, .item .actions a {
  color: var(--primary); text-decoration: none; padding: 0;
  border-radius: 6px; transition: color .16s;
}
.item .actions button:hover, .item .actions a:hover { color: var(--primary-dark); text-decoration: underline; }
.item .actions button.danger { color: var(--danger); }
.empty { color: var(--muted); font-size: 13px; text-align: center; padding: 18px 0; }

/* ---------------------------- ⑥ 统计与走势 ---------------------------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) {
  .stats { grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); }
}
.stat {
  background: #f8fafd; border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 14px 10px; text-align: center;
}
.stat b { display: block; font-size: 24px; line-height: 1.2; letter-spacing: -.02em; }
.stat span { font-size: 12px; color: var(--muted); }
.stat.deleted b { color: var(--danger); }
.stat.alive b { color: var(--ok); }
.stat.error b { color: var(--warn); }
.stat.pending-review b { color: #a05a00; }

.chart-grid { display: grid; gap: 14px; }
.chart-grid > .card { margin-bottom: 0; }
@media (min-width: 900px) {
  .chart-grid { grid-template-columns: minmax(0, 1.5fr) minmax(286px, .8fr); align-items: stretch; }
  .chart-grid > .card { height: 100%; }
}
.chart-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-bottom: 10px;
}
.chart-head h2 { margin: 0; }
.range { display: flex; gap: 6px; background: #f2f5fb; padding: 3px; border-radius: 999px; }
.range .chip { padding: 5px 13px; font-size: 12.5px; background: transparent; }
.range .chip.active { background: #fff; box-shadow: var(--shadow-xs); }

/* 图例：点一下只显示某一条线 */
.trend-legend {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 6px; font-size: 12.5px; color: var(--muted);
}
.trend-legend .lg {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 3px 9px 3px 6px; border-radius: 999px;
  transition: background .15s, opacity .15s;
}
.trend-legend .lg:hover { background: #f2f6ff; }
.trend-legend .lg.off { opacity: .36; text-decoration: line-through; }
.trend-legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.trend-legend .lg-tip { margin-left: auto; font-size: 11.5px; color: #a6b2c6; }

/* 折线图 */
.trend { position: relative; width: 100%; }
.trend svg { display: block; width: 100%; height: auto; overflow: visible; }
.trend .grid { stroke: #eef2f9; stroke-width: 1; stroke-dasharray: 3 5; }
.trend .axis { fill: #98a6bb; font-size: 11px; font-variant-numeric: tabular-nums; }
.trend .axis.y { fill: #aab6c8; }
.trend .area { pointer-events: none; }
.trend .line { fill: none; stroke-linejoin: round; stroke-linecap: round; animation: lineIn .7s ease-out both; }
.trend .l-total { stroke: #111827; stroke-width: 2.6; }
.trend .l-alive { stroke: #16a34a; stroke-width: 2.2; }
.trend .l-deleted { stroke: #dc2626; stroke-width: 2.2; }
.trend .dot { opacity: .26; transition: opacity .18s; pointer-events: none; }
.trend:hover .dot { opacity: .78; }
.trend .d-total { fill: #111827; }
.trend .d-alive { fill: #16a34a; }
.trend .d-deleted { fill: #dc2626; }
.trend .hover-line { stroke: #c3cfe3; stroke-width: 1; stroke-dasharray: 4 4; pointer-events: none; }
.trend .hover-dot { stroke: #fff; stroke-width: 2.2; pointer-events: none; }
.trend .hit { cursor: crosshair; }

/* 悬停浮层 */
.chart-hover {
  position: absolute; z-index: 6; pointer-events: none;
  transform: translate(-50%, 0);
  background: rgba(15, 23, 42, .94); color: #fff;
  border-radius: 12px; padding: 8px 11px; font-size: 12px; line-height: 1.5;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .26);
  display: flex; flex-direction: column; gap: 2px; min-width: 104px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.chart-hover b { font-size: 11.5px; font-weight: 600; opacity: .7; letter-spacing: .02em; }
.chart-hover .k { display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.chart-hover .k i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
@keyframes lineIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* 状态占比（甜甜圈） */
.pie { display: flex; justify-content: center; padding: 4px 0 2px; }
.pie svg { width: min(206px, 60vw); height: auto; }
.pie .slice { transition: filter .18s; }
.pie .slice.hot { filter: drop-shadow(0 6px 14px rgba(15, 23, 42, .22)); }
.pie .pie-total { font-size: 30px; font-weight: 800; fill: #0f172a; letter-spacing: -.02em; }
.pie .pie-sub { font-size: 11px; fill: #98a6bb; }
.pie-legend { display: grid; gap: 3px; margin-top: 8px; }
.pie-legend .row {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; padding: 7px 10px; border-radius: 10px;
  transition: background .15s;
}
.pie-legend .row:hover, .pie-legend .row.hot { background: #f4f7fd; }
.pie-legend .row i { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 auto; }
.pie-legend .lb { color: var(--text-2); }
.pie-legend .num { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; }
.pie-legend .pct { min-width: 44px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* 导航外层：手机上空着（不影响底部固定导航），桌面上做成一条粘顶的横带 */
.navwrap { display: contents; }

/* ---------------------------- ⑦ 底部导航 ---------------------------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 0 7px; font-size: 11px; color: var(--muted);
  transition: color .16s;
}
.tab i { font-style: normal; font-size: 17px; line-height: 1; }
.tab.active { color: var(--primary); font-weight: 600; }

/* ---------------------------- ⑧ 弹窗与提醒 ---------------------------- */
/* 提醒说明：居中弹窗（原来是顶栏里的小气泡，会被横幅盖住、长文案溢出，也不好点） */
.tip-modal {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
}
.tip-modal[hidden] { display: none !important; }
.tip-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .5); }
.tip-card {
  position: relative;
  width: min(460px, 100%);
  max-height: min(78vh, 620px);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 20px 20px 16px;
  border-radius: 18px;
  background: #1f2937; color: #e8eef8;
  box-shadow: 0 24px 60px rgba(2, 6, 23, .45);
  animation: tipIn .16s ease;
}
.tip-card h3 { margin: 0 34px 10px 0; font-size: 15.5px; color: #fff; letter-spacing: -.01em; }
.nt-body { font-size: 14px; line-height: 1.78; overflow-wrap: anywhere; word-break: break-word; }
.nt-body b { color: #fff; font-weight: 700; }
.nt-body code {
  background: rgba(255, 255, 255, .15); border-radius: 5px;
  padding: 1px 6px; font-size: 12.5px; overflow-wrap: anywhere;
}
.nt-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.nt-btn {
  border: 1px solid transparent; border-radius: 10px;
  padding: 9px 16px; font-size: 14px; cursor: pointer;
  font-family: inherit; transition: background .16s, border-color .16s;
}
.nt-btn.primary { background: #3b82f6; color: #fff; }
.nt-btn.primary:hover { background: #2f6fe0; }
.nt-btn.ghost { background: rgba(255, 255, 255, .12); color: #e8eef8; border-color: rgba(255, 255, 255, .2); }
.nt-btn.ghost:hover { background: rgba(255, 255, 255, .2); }
.tip-card .nt-x {
  position: absolute; top: 8px; right: 8px;
  background: none; border: 0; color: #b6c2d2; font-size: 15px;
  cursor: pointer; padding: 6px; line-height: 1;
}
.tip-card .nt-x:hover { color: #fff; }
@keyframes tipIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 删除提醒横幅 */
.toasts {
  position: fixed; z-index: 100;
  top: calc(12px + env(safe-area-inset-top));
  left: 50%; transform: translateX(-50%);
  width: min(94vw, 460px);
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: linear-gradient(135deg, #ef4444, #c81e2b);
  color: #fff;
  border-radius: 15px;
  padding: 13px 15px;
  box-shadow: 0 14px 34px rgba(200, 30, 43, .34);
  animation: toastIn .28s cubic-bezier(.2, .9, .3, 1.2);
  display: flex; gap: 10px; align-items: flex-start;
}
.toast.hide { animation: toastOut .25s ease forwards; }
.toast .ico { font-size: 18px; line-height: 1.2; }
.toast .body { flex: 1; min-width: 0; }
.toast .t { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.toast .m { font-size: 13px; opacity: .95; word-break: break-all; }
.toast .x { color: #fff; opacity: .8; font-size: 16px; padding: 0 2px; line-height: 1; }
/* 删除横幅上的「再响一次」：万一提示音被系统/浏览器拦住，点它一定能听见 */
.toast .replay {
  margin-top: 8px; padding: 5px 10px;
  background: rgba(255, 255, 255, .18); color: #fff;
  border: 1px solid rgba(255, 255, 255, .3); border-radius: 8px;
  font-size: 12.5px; cursor: pointer; font-family: inherit;
  transition: background .16s;
}
.toast .replay:hover { background: rgba(255, 255, 255, .3); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px) scale(.97); } }

/* ---------------------------- ⑨ 手机细节 ---------------------------- */
@media (max-width: 560px) {
  .cookiebar { flex-wrap: wrap; text-align: center; }
}

/* ---------------------------- ⑩ 桌面 / 宽屏美化 ---------------------------- */
/* 880px 起：导航从底部挪到顶部做成胶囊标签栏，内容居中、留白舒展 */
@media (min-width: 880px) {
  body {
    background:
      radial-gradient(1100px 420px at 50% -220px, #e6eeff 0%, rgba(230, 238, 255, 0) 70%),
      var(--bg);
  }

  #appView { display: flex; flex-direction: column; min-height: 100vh; }

  .topbar {
    order: 0;
    height: 64px;
    padding: 0 max(24px, calc((100% - 1120px) / 2));
    gap: 16px;
    background: rgba(255, 255, 255, .8);
    border-bottom: 1px solid rgba(232, 236, 244, .9);
  }
  .brand { font-size: 16px; font-weight: 700; gap: 10px; }
  .brand::before {
    content: "";
    width: 26px; height: 26px; border-radius: 8px;
    background: var(--holo);
    box-shadow: 0 4px 12px rgba(79, 70, 229, .28);
  }
  .brand .dot { width: 7px; height: 7px; }
  .who { max-width: 240px; font-size: 13px; }

  /* 顶部胶囊标签栏：外层做一条粘顶横带，滚动时标签一直可用且不会与卡片叠在一起 */
  .navwrap {
    order: 1;
    display: block;
    position: sticky; top: 64px; z-index: 18;
    padding: 14px 24px 12px;
    background: rgba(244, 246, 251, .92);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid rgba(232, 236, 244, .85);
  }
  .tabbar {
    position: static; left: auto; right: auto; bottom: auto; top: auto;
    width: max-content; max-width: 100%;
    margin: 0 auto;
    padding: 5px;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, .95);
    box-shadow: var(--shadow-sm);
  }
  .tab {
    flex: 0 0 auto;
    flex-direction: row; gap: 7px;
    padding: 9px 18px;
    font-size: 14px; font-weight: 550;
    border-radius: 11px; color: var(--muted);
    transition: background .16s, color .16s, box-shadow .16s;
  }
  .tab i { font-size: 14px; opacity: .75; }
  .tab:hover { background: #f2f5fb; color: var(--text-2); }
  .tab.active {
    background: #fff; color: var(--primary);
    box-shadow: 0 2px 8px rgba(17, 24, 39, .1), inset 0 0 0 1px rgba(37, 99, 235, .12);
  }
  .tab.active i { opacity: 1; }

  main {
    order: 2;
    width: 100%; max-width: 1120px;
    margin: 0 auto;
    padding: 18px 24px 56px;
  }

  .card {
    padding: 20px 22px;
    margin-bottom: 16px;
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
  }
  .card h2 { font-size: 16px; margin-bottom: 14px; }

  /* 提交面板：输入区更大、按钮靠右 */
  #panel-submit { max-width: 940px; margin-inline: auto; }
  #panel-submit textarea { min-height: 116px; font-size: 15px; }
  #panel-submit .row { margin-top: 12px; }
  #panel-submit .primary { padding: 12px 26px; }

  /* 卡片标题前加一道细色条，层级更清楚 */
  .card h2 { display: flex; align-items: center; gap: 9px; }
  .card h2::before {
    content: "";
    width: 3px; height: 14px; border-radius: 2px;
    background: var(--primary); opacity: .8;
    flex: 0 0 auto;
  }

  /* 列表两列，卡片更透气 */
  .list { grid-template-columns: 1fr 1fr; gap: 12px; }
  .item { padding: 14px 16px; border-radius: 14px; }
  .item:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
  .item .title { font-size: 14.5px; }

  /* 统计卡片：更像 KPI 仪表盘 */
  .stats { gap: 12px; }
  .stat {
    position: relative;
    background: linear-gradient(180deg, #fbfcff, #f7f9fd);
    border-radius: 14px;
    padding: 18px 12px 16px;
    text-align: left;
    overflow: hidden;
    transition: box-shadow .18s, transform .18s;
  }
  .stat::before {
    content: ""; position: absolute; left: 0; top: 14px; bottom: 14px;
    width: 3px; border-radius: 3px; background: var(--line-strong);
  }
  .stat span { display: block; margin-top: 4px; font-size: 12.5px; }
  .stat b { font-size: 30px; }
  .stat.deleted::before { background: var(--danger); }
  .stat.alive::before { background: var(--ok); }
  .stat.error::before { background: #e0a12a; }
.stat.pending-review::before { background: #e0a12a; }
  .stat:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }

  /* 走势图卡片 */
  .trend-legend { gap: 20px; font-size: 13px; }
  .trend { padding: 4px 2px 0; }

  /* 管理页：卡片双列排布 */
  #panel-admin {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
  }
  #panel-admin .card { margin-bottom: 0; height: 100%; }
  #panel-admin #cookieCard { grid-column: 1 / -1; }

  /* 提醒说明弹窗在桌面也居中一点更耐看 */
  .tip-card { width: min(480px, 100%); padding: 22px 22px 18px; }

  /* 删除横幅落在右上角，不挡内容 */
  .toasts { left: auto; right: 28px; top: 84px; transform: none; width: 400px; }
}

/* 1280px 起：再放宽一档，长链接不至于挤成两行 */
@media (min-width: 1280px) {
  .topbar { padding-inline: max(32px, calc((100% - 1240px) / 2)); }
  main { max-width: 1240px; }
  .list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat b { font-size: 32px; }
}

/* 打印/筛选器滚动条细节 */
.filters { scrollbar-width: none; }

/* 桌面滚动条：细一点、浅一点，别抢视线 */
@media (min-width: 880px) {
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb {
    background: #d4dcea; background-clip: content-box;
    border: 3px solid transparent; border-radius: 999px;
  }
  ::-webkit-scrollbar-thumb:hover { background: #c0cadd; background-clip: content-box; }
}

/* ---------- 归档：已删除的卡片可以从「全部」里收起来 ---------- */
.item.archived { background: linear-gradient(180deg, #fbfcfe, #fff 60%); border-left-color: #c9d3e4; }
.item.archived .title { opacity: .72; }
.plat.archived-tag {
  background: #eef1f7; color: #5b6785; border: 1px solid #dde4ef;
  font-weight: 600; letter-spacing: .02em;
}
.plat.pending-review {
  background: #fff6e6; color: #a05a00; border: 1px solid #f3ddb5;
  font-weight: 600; letter-spacing: .02em;
}
.stat.archived::before { background: #94a3b8; }
.stat.archived b { color: #5b6785; }

/* 全局小提示（归档、重检等操作的反馈） */
.toast.mini { padding: 10px 12px; }
.toast.mini .m { font-size: 13px; }

/* 短信卡片：复选框别被 .row > input 的 flex 撑开；发送记录单列显示 */
.row > input[type="checkbox"] { flex: 0 0 auto; width: auto; }
#smsCard label.row { gap: 8px; }
#smsList { grid-template-columns: 1fr; }
#smsList .item { border-left-color: var(--primary); }
#smsList .item .ihead { align-items: baseline; }

/* ===================== 年月选择条 ===================== */
.monthbar {
  background: rgba(255, 255, 255, .82);
  border-bottom: 1px solid var(--line);
}
.mb-inner {
  max-width: 1240px; margin: 0 auto; padding: 8px 16px;
  display: flex; align-items: center; gap: 8px;
}
.mb-label { flex: 0 0 auto; font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.mb-arrow {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px;
  border: 1px solid var(--line-strong); background: #fff; color: var(--text-2);
  font-size: 15px; line-height: 1; cursor: pointer; padding: 0;
}
.mb-arrow:hover { border-color: var(--primary); color: var(--primary); }
.mb-arrow:disabled { opacity: .38; cursor: default; border-color: var(--line); color: var(--muted); }
.mb-scroll {
  flex: 1 1 auto; display: flex; gap: 6px; overflow-x: auto;
  scrollbar-width: none; padding: 2px; min-width: 0;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 10px, #000 calc(100% - 10px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 10px, #000 calc(100% - 10px), transparent 100%);
}
.mb-scroll::-webkit-scrollbar { display: none; }
.mb-chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: #fff; color: var(--text-2); font-size: 13px; cursor: pointer;
  white-space: nowrap; transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.mb-chip:hover { border-color: var(--primary); color: var(--primary); }
.mb-chip.active {
  background: var(--primary); border-color: var(--primary); color: #fff;
  box-shadow: 0 4px 12px var(--primary-ring);
}
.mb-chip b {
  font-weight: 600; font-size: 11px; padding: 1px 5px; border-radius: 999px;
  background: var(--bg-soft); color: var(--muted);
}
.mb-chip.active b { background: rgba(255, 255, 255, .26); color: #fff; }
.mb-chip i { font-style: normal; font-size: 10px; padding: 1px 5px; border-radius: 999px; }
.mb-chip .mb-now { background: var(--ok-bg); color: var(--ok); }
.mb-chip .mb-hist { background: var(--pending-bg); color: var(--pending); }
.mb-chip.active .mb-now, .mb-chip.active .mb-hist { background: rgba(255, 255, 255, .22); color: #fff; }
@media (max-width: 640px) {
  .mb-inner { padding: 6px 10px; gap: 6px; }
  .mb-label { display: none; }
  .mb-chip { font-size: 12px; padding: 5px 9px; }
}

/* 卡片标题里的年月 */
.card-sub { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 6px; }

/* 历史舆情标签 */
.plat.history-tag { background: var(--pending-bg); color: var(--pending); }

/* 失效提醒卡片（提交页） */
.nt-card .card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nt-card .msg { min-height: 0; }
.nt-dim { color: var(--muted); font-size: 12px; }
.nt-list { margin: 10px 0 0; padding-left: 18px; max-height: 42vh; overflow-y: auto; }
.nt-list li { margin: 0 0 8px; font-size: 13px; line-height: 1.5; }
.nt-list li b { color: var(--primary); font-weight: 600; }

/* 提交页的「失效提醒」卡片：做成可操作的第一步，视觉上稍微提亮 */
#notifyCard {
  background: linear-gradient(135deg, #ffffff 0%, #f5f9ff 100%);
  border-left: 3px solid var(--primary);
}
#notifyCard h2 { color: #1f2937; }
#notifyCard .hint b { color: #1d4ed8; }
#notifyCard .row.space { margin-top: 12px; }
#notifyCard #enableNotifyBtn:disabled { opacity: .65; cursor: default; }