/* ============================================================
   牙刷弹幕库 — stylesheet
   Dark-first, emerald-green accent, glass panels.
   ============================================================ */

:root {
  --topbar-h: 72px;
  --bg: #090c13;
  --bg-2: #0d1220;
  --panel: rgba(17, 22, 34, 0.78);
  --panel-solid: #111623;
  --panel-2: rgba(255, 255, 255, 0.035);
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.15);
  --text: #e9edf6;
  --text-2: #c6cdda;
  --muted: #8b94a8;
  --faint: #5f6779;
  --pink: #34d399;
  --pink-2: #6ee7b7;
  --pink-dim: rgba(52, 211, 153, 0.13);
  --pink-line: rgba(52, 211, 153, 0.42);
  --mint: #2dd4bf;
  --gold: #ffc857;
  --violet: #b9a3ff;
  --shadow: 0 22px 50px rgba(0, 0, 0, 0.34);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.22);
  --mark-bg: rgba(52, 211, 153, 0.3);
  --mark-fg: #fff;
  --radius: 14px;
  --mono: "JetBrains Mono", "Cascadia Mono", "Consolas", ui-monospace, monospace;
  --sans: "Inter", "HarmonyOS Sans SC", "MiSans", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

html[data-theme="light"] {
  --bg: #f3f5fa;
  --bg-2: #e9edf6;
  --panel: rgba(255, 255, 255, 0.84);
  --panel-solid: #ffffff;
  --panel-2: rgba(15, 23, 42, 0.035);
  --line: rgba(15, 23, 42, 0.09);
  --line-strong: rgba(15, 23, 42, 0.18);
  --text: #141a26;
  --text-2: #333d4f;
  --muted: #687083;
  --faint: #98a0b1;
  --pink: #059669;
  --pink-2: #047857;
  --pink-dim: rgba(5, 150, 105, 0.1);
  --pink-line: rgba(5, 150, 105, 0.35);
  --mint: #0f9d8a;
  --gold: #b47a00;
  --violet: #7554d6;
  --shadow: 0 20px 44px rgba(36, 46, 74, 0.1);
  --shadow-sm: 0 8px 20px rgba(36, 46, 74, 0.08);
  --mark-bg: #d1fae5;
  --mark-fg: #065f46;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scrollbar-color: rgba(140, 150, 170, 0.35) transparent; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 520px at 12% -8%, rgba(52, 211, 153, 0.13), transparent 62%),
    radial-gradient(900px 480px at 92% 2%, rgba(88, 140, 255, 0.1), transparent 58%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 62%);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 62%);
  pointer-events: none;
  z-index: 0;
}
html[data-theme="light"] body::before { background-image: radial-gradient(rgba(15, 23, 42, 0.06) 1px, transparent 1px); }

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
::selection { background: rgba(52, 211, 153, 0.35); }

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

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(140, 150, 170, 0.28); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(140, 150, 170, 0.5); background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

.app { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }

/* ---------------- topbar ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 22px;
  background: rgba(9, 12, 19, 0.78);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
html[data-theme="light"] .topbar { background: rgba(255, 255, 255, 0.76); }

.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; flex: 0 0 auto; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  font-size: 19px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #34d399 0%, #10b981 46%, #0f766e 120%);
  box-shadow: 0 8px 22px rgba(52, 211, 153, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  letter-spacing: -0.04em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.18; }
.brand-text b { font-size: 15px; font-weight: 700; letter-spacing: 0.01em; }
.brand-text small { font-size: 10.5px; color: var(--muted); margin-top: 2px; letter-spacing: 0.02em; }

.global-search {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}
.global-search:hover { border-color: var(--line-strong); }
.global-search:focus-within {
  border-color: var(--pink-line);
  box-shadow: 0 0 0 4px var(--pink-dim);
  background: var(--panel-solid);
}
.gs-icon { color: var(--muted); flex: 0 0 auto; }
.global-search input {
  flex: 1; min-width: 0; width: 0;
  border: 0; outline: 0; background: transparent;
  font-size: 13px; letter-spacing: 0.01em;
}
.global-search input::placeholder { color: var(--faint); }
.global-search input::-webkit-search-cancel-button { display: none; }
.global-search kbd {
  font-family: var(--mono); font-size: 10px; color: var(--faint);
  border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 5px; padding: 1px 5px; line-height: 1.4;
}
.gs-clear {
  display: grid; place-items: center;
  width: 22px; height: 22px; border-radius: 6px;
  border: 0; background: var(--panel-2); color: var(--muted);
}
.gs-clear:hover { color: var(--text); background: rgba(52, 211, 153, 0.16); }

.gs-modes {
  display: flex; flex: 0 0 auto; gap: 2px;
  padding: 2px; border-radius: 8px;
  background: var(--panel-2);
}
.gs-modes button {
  height: 25px; padding: 0 8px;
  border: 0; border-radius: 6px;
  background: transparent; color: var(--faint);
  font-size: 10.5px; font-weight: 500; letter-spacing: 0.02em;
  transition: 0.14s;
}
.gs-modes button:hover { color: var(--text-2); }
.gs-modes button.on { background: var(--pink-dim); color: var(--pink-2); font-weight: 650; }
.gs-sep { flex: 0 0 auto; width: 1px; height: 18px; background: var(--line); }

.top-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.icon-btn {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 9px;
  border: 1px solid transparent; background: transparent; color: var(--muted);
  transition: 0.15s;
}
.icon-btn:hover { color: var(--text); background: var(--panel-2); border-color: var(--line); }
.ico-sun { display: none; }
html[data-theme="light"] .ico-sun { display: block; }
html[data-theme="light"] .ico-moon { display: none; }
.menu-btn { display: none; }

/* ---------------- layout ---------------- */

.layout { display: flex; flex: 1; min-height: 0; }

.sidebar {
  position: sticky;
  top: var(--topbar-h);
  flex: 0 0 318px;
  width: 318px;
  height: calc(100vh - var(--topbar-h));
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.022), transparent 260px);
  z-index: 30;
}

.side-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 15px 18px 12px;
  border-bottom: 1px solid var(--line);
}
.side-close { display: none; position: absolute; top: 8px; right: 8px; z-index: 2; background: var(--panel-2); }
.side-close:hover { background: var(--pink-dim); color: var(--pink-2); }
.side-stat b { display: block; font-size: 19px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.side-stat span { font-size: 10px; color: var(--muted); letter-spacing: 0.05em; }

.side-controls { padding: 11px 14px 9px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--line); }
.chip-row { display: flex; flex-wrap: wrap; gap: 5px; }
.side-row { display: flex; gap: 6px; }
.mini-input, .mini-select {
  height: 31px; min-width: 0;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel-2); color: var(--text-2);
  font-size: 11.5px; padding: 0 9px; outline: 0;
  transition: 0.15s;
}
.mini-input { flex: 1; }
.mini-input::placeholder { color: var(--faint); }
.mini-input:focus, .mini-select:focus { border-color: var(--pink-line); background: var(--panel-solid); }
.mini-select { padding-right: 24px; cursor: pointer; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 13px) 13px, calc(100% - 9px) 13px;
  background-size: 4px 4px, 4px 4px; background-repeat: no-repeat;
}
html[data-theme="dark"] .mini-select option { background: #141a28; color: #e9edf6; }

.chip {
  appearance: none;
  display: inline-flex; align-items: center; gap: 5px;
  height: 25px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--muted);
  font-size: 11px; letter-spacing: 0.02em; white-space: nowrap;
  transition: 0.15s;
}
.chip:hover { color: var(--text-2); border-color: var(--line-strong); }
.chip.on { color: var(--pink-2); border-color: var(--pink-line); background: var(--pink-dim); }
html[data-theme="light"] .chip.on { color: var(--pink-2); }
.chip-row .chip .cnt { font-family: var(--mono); font-size: 9.5px; opacity: 0.62; }

.side-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 8px 9px 18px; overscroll-behavior: contain; }

.side-user {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, var(--pink-dim), transparent 88%);
}
.side-user .avatar { width: 26px; height: 26px; border-radius: 7px; font-size: 10px; }
.side-user .su-main { flex: 1; min-width: 0; }
.side-user .su-main b { display: block; font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .su-main em { display: block; margin-top: 1px; font-style: normal; font-size: 9px; color: var(--muted); font-family: var(--mono); letter-spacing: 0.02em; }
.side-user .su-clear {
  flex: 0 0 auto; display: grid; place-items: center;
  width: 22px; height: 22px; padding: 0;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--panel-2); color: var(--muted); font-size: 14px; line-height: 1;
}
.side-user .su-clear:hover { color: var(--pink-2); border-color: var(--pink-line); background: var(--pink-dim); }

.stream {
  display: block; width: 100%; text-align: left;
  padding: 9px 11px 8px;
  margin: 0 0 2px;
  border: 1px solid transparent; border-radius: 10px;
  background: transparent; color: inherit;
  transition: background 0.14s, border-color 0.14s;
}
.stream:hover { background: var(--panel-2); }
.stream.on {
  background: linear-gradient(95deg, var(--pink-dim), rgba(52, 211, 153, 0.02) 82%);
  border-color: rgba(52, 211, 153, 0.22);
}
.stream .st-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 10.5px; color: var(--muted); }
.stream .st-date { display: inline-flex; gap: 5px; align-items: center; font-family: var(--mono); letter-spacing: 0.02em; }
.stream .st-date i { font-style: normal; color: var(--faint); font-family: var(--sans); }
.stream .st-count { font-family: var(--mono); font-size: 10px; color: var(--faint); }
.stream .st-count.ta { color: var(--pink-2); }
.stream.on .st-count { color: var(--pink-2); }
.stream .st-title {
  margin: 3px 0 3px;
  font-size: 13px; font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.stream .st-meta { display: flex; gap: 7px; flex-wrap: wrap; font-size: 10px; color: var(--faint); }
#sSub .alt-title { color: var(--pink-2); cursor: help; }
.stream .spark { display: flex; align-items: flex-end; gap: 1.5px; height: 15px; margin-top: 6px; opacity: 0.8; }
.stream .spark i { flex: 1; min-height: 1px; border-radius: 1px; background: rgba(52, 211, 153, 0.22); }
.stream.on .spark i { background: rgba(52, 211, 153, 0.5); }
.stream.empty-rec { opacity: 0.62; }

.month-head {
  width: 100%; display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  margin: 3px 0 1px; padding: 6px 10px;
  border: 0; border-radius: 7px; background: transparent;
  color: var(--muted); font-family: var(--sans); font-size: 10px;
  text-align: left; cursor: pointer; position: sticky; top: 0; z-index: 3;
  backdrop-filter: blur(12px); background: color-mix(in srgb, var(--bg) 88%, transparent);
}
.month-head:hover { color: var(--pink-2); background: var(--panel-2); }
.month-head b { font-weight: 650; color: var(--text-2); }
.month-head .mh-arrow { display: inline-block; font-size: 9px; color: var(--faint); transition: transform 0.15s; }
.month-head.collapsed .mh-arrow { transform: rotate(-90deg); }
.month-head .mh-count { margin-left: auto; font-family: var(--mono); font-size: 9px; color: var(--faint); }
.month-head .mh-money { flex-basis: 100%; padding-left: 16px; font-family: var(--mono); font-size: 9px; color: var(--faint); opacity: 0.85; }
.month-head.collapsed { opacity: 0.85; }
.stream.live-now {
  border-color: rgba(52, 211, 153, 0.38);
  background: linear-gradient(95deg, rgba(52, 211, 153, 0.13), rgba(52, 211, 153, 0.02) 82%);
}
.stream.live-now .st-live.now { animation: live-dot 1.4s ease-in-out infinite; }
.st-live {
  display: inline-block; font-family: var(--sans); font-style: normal;
  font-size: 9px; font-weight: 700; line-height: 1;
  padding: 3px 5px; border-radius: 4px; letter-spacing: 0;
}
.st-live.now { color: #fff; background: var(--pink); }
.st-live.over { color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); }
@keyframes live-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
.live-flag {
  display: inline-flex; align-items: center;
  font-size: 10px; font-weight: 700; color: var(--muted);
  padding: 2px 6px; border-radius: 4px; margin-right: 4px;
  background: var(--panel-2); border: 1px solid var(--line);
}
.live-flag.on { color: #fff; background: var(--pink); border-color: var(--pink); }

.side-foot { padding: 9px 16px 12px; border-top: 1px solid var(--line); font-size: 9.5px; color: var(--faint); line-height: 1.6; }
.sidebar-backdrop { display: none; }
.side-none { padding: 24px 12px; text-align: center; font-size: 11px; color: var(--faint); }

/* ---------------- main ---------------- */

.main { flex: 1; min-width: 0; padding: 24px 30px 70px; overflow: hidden; }
.view { max-width: 1460px; margin: 0 auto; }

.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.vh-left { min-width: 0; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.13em; color: var(--pink); margin-bottom: 4px; }
.view-head h2 { margin: 0; font-size: 26px; line-height: 1.2; font-weight: 700; letter-spacing: -0.025em; }
.sub { margin-top: 7px; font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.sub .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); display: inline-block; }
.sub b { color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.vh-actions { display: flex; gap: 8px; flex: 0 0 auto; padding-bottom: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 35px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel); color: var(--text-2);
  font-size: 12px; font-weight: 500; letter-spacing: 0.01em;
  transition: 0.15s; white-space: nowrap;
}
.btn:hover { border-color: var(--line-strong); color: var(--text); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary {
  border-color: transparent; color: #fff;
  background: linear-gradient(135deg, #34d399, #10b981 60%, #0f766e);
  box-shadow: 0 8px 22px rgba(52, 211, 153, 0.28);
}
.btn.primary:hover { box-shadow: 0 10px 26px rgba(52, 211, 153, 0.38); }
.btn.tiny { height: 29px; padding: 0 10px; font-size: 11px; border-radius: 7px; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

/* kpis */

.kpis {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); box-shadow: var(--shadow-sm);
  overflow: hidden; margin-bottom: 15px;
}
.kpi { padding: 12px 17px; border-right: 1px solid var(--line); min-width: 0; }
.kpi:last-child { border-right: 0; }
.kpi b { display: block; font-size: 20px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.25; white-space: nowrap; }
.kpi b em { font-style: normal; font-size: 11.5px; font-weight: 500; color: var(--muted); margin-left: 5px; letter-spacing: 0; }
.kpi span { display: block; margin-top: 2px; font-size: 10px; color: var(--muted); letter-spacing: 0.06em; }

/* cards */

.card {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-head h3 { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.03em; color: var(--text-2); }
.card-head .hint, .hint { font-size: 10px; color: var(--faint); font-weight: 400; letter-spacing: 0.02em; }
.ch-left { display: flex; align-items: baseline; gap: 9px; min-width: 0; }
.ch-left .hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* timeline */

.timeline-card { padding: 13px 16px 8px; margin-bottom: 15px; }
.tl-right { display: flex; align-items: center; gap: 12px; }
.tl-legend { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; color: var(--faint); white-space: nowrap; }
.tl-legend i { width: 7px; height: 7px; border-radius: 2px; display: inline-block; }
.dot-base { background: rgba(52, 211, 153, 0.3); }
.dot-filter { background: var(--pink); }
.tl-legend.is-filtered { opacity: 0; transition: opacity 0.2s; }
.timeline-card.has-filter .tl-legend.is-filtered { opacity: 1; }

.timeline-wrap { position: relative; padding-top: 5px; }
#timeline { display: block; width: 100%; height: 138px; touch-action: none; cursor: crosshair; }
.tl-empty {
  position: absolute; inset: 12px 0 26px;
  display: grid; place-items: center;
  font-size: 12px; color: var(--faint);
  border: 1px dashed var(--line); border-radius: 9px;
  background: rgba(0, 0, 0, 0.08);
}
.tl-hint { margin-top: 1px; text-align: right; font-size: 9.5px; color: var(--faint); opacity: 0.8; letter-spacing: 0.02em; }
.tl-tip {
  position: absolute; z-index: 5; pointer-events: none;
  min-width: 130px; max-width: 300px;
  transform: translate(-50%, 0);
  padding: 7px 10px 8px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: rgba(10, 14, 23, 0.96);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  font-size: 11px; color: var(--text-2);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
html[data-theme="light"] .tl-tip { background: rgba(255, 255, 255, 0.98); color: var(--text-2); }
.tl-tip b { display: block; color: var(--text); font-weight: 600; font-size: 11.5px; margin-bottom: 2px; font-variant-numeric: tabular-nums; }
.tl-tip .tt-count { color: var(--pink-2); font-weight: 600; }
.tl-tip .tt-sample { display: block; margin-top: 4px; color: var(--muted); font-size: 10.5px; line-height: 1.45; max-height: 32px; overflow: hidden; }

/* results */

.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 288px; gap: 15px; align-items: start; }
.results-panel {
  min-width: 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); box-shadow: var(--shadow-sm);
  overflow: hidden;
  overflow: clip; /* "clip" (not "hidden") keeps position:sticky working */
}
/* Search / filter / pager stay visible while the list scrolls. */
.list-sticky {
  position: sticky; top: var(--topbar-h); z-index: 30;
  background: var(--panel-solid);
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
}
.toolbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 7px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
}
.tb-search {
  flex: 1 1 190px; min-width: 150px;
  display: flex; align-items: center; gap: 7px;
  height: 31px; padding: 0 9px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel-2); color: var(--muted);
  transition: 0.15s;
}
.tb-search:focus-within { border-color: var(--pink-line); background: var(--panel-solid); box-shadow: 0 0 0 3px var(--pink-dim); }
.tb-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 11.5px; }
.tb-search input::placeholder { color: var(--faint); }
.tb-search input::-webkit-search-cancel-button { display: none; }
.mini-clear { display: grid; place-items: center; width: 18px; height: 18px; border: 0; border-radius: 5px; background: transparent; color: var(--faint); padding: 0; }
.mini-clear:hover { color: var(--text); background: var(--panel-2); }

.toolbar .chips { display: flex; gap: 4px; flex-wrap: wrap; }
.toolbar .chip { height: 29px; padding: 0 9px; font-size: 10.5px; }
.toolbar .chip .cnt { font-family: var(--mono); font-size: 9.5px; opacity: 0.65; }
.toolbar .mini-select { height: 29px; max-width: 132px; font-size: 10.5px; }
.tb-count { margin-left: auto; font-size: 10.5px; color: var(--faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tb-count b { color: var(--text-2); font-weight: 600; font-size: 11.5px; }

.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 11px; border-bottom: 1px solid transparent; }
.filter-chips:not(:empty) { padding: 8px 11px; border-bottom-color: var(--line); }
.fchip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 7px 0 8px;
  border: 1px solid var(--pink-line); border-radius: 6px;
  background: var(--pink-dim); color: var(--pink-2);
  font-size: 10.5px; max-width: 320px;
}
.fchip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fchip button { display: grid; place-items: center; width: 14px; height: 14px; border: 0; border-radius: 4px; background: transparent; color: inherit; padding: 0; opacity: 0.75; }
.fchip button:hover { opacity: 1; background: rgba(52, 211, 153, 0.18); }
.fchip.clear-all { border-color: var(--line); background: transparent; color: var(--muted); padding-right: 8px; }
.fchip.clear-all:hover { color: var(--text); border-color: var(--line-strong); }
.fchip.profile-link { border-color: var(--line); background: transparent; color: var(--muted); padding-right: 8px; }
.fchip.profile-link:hover { color: var(--pink-2); border-color: var(--pink-line); background: var(--pink-dim); }

.result-list { min-height: 120px; }

.row {
  position: relative;
  display: grid;
  grid-template-columns: 96px 140px minmax(0, 1fr) 54px;
  gap: 10px;
  align-items: start;
  padding: 9px 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  transition: background 0.12s;
}
html[data-theme="light"] .row { border-bottom-color: rgba(15, 23, 42, 0.055); }
.row:last-child { border-bottom: 0; }
.row:hover { background: rgba(255, 255, 255, 0.028); }
html[data-theme="light"] .row:hover { background: rgba(15, 23, 42, 0.026); }
.row-link { cursor: pointer; }
.row.flash { animation: flash 2.4s ease-out; }
@keyframes flash {
  0% { background: rgba(52, 211, 153, 0.28); }
  100% { background: transparent; }
}

.c-time { font-family: var(--mono); line-height: 1.25; padding-top: 1px; }
.c-time b { display: block; font-size: 12px; font-weight: 500; color: var(--text-2); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.c-time em { display: block; margin-top: 2px; font-style: normal; font-size: 9.5px; color: var(--faint); letter-spacing: 0.01em; white-space: nowrap; }

.c-user { display: flex; align-items: center; gap: 6px; min-width: 0; padding-top: 1px; }
.avatar {
  position: relative;
  flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 9px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, hsl(var(--h, 340) 62% 56%), hsl(calc(var(--h, 340) + 36) 62% 42%));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  overflow: hidden; user-select: none;
}
.avatar-initial { position: relative; z-index: 0; line-height: 1; }
.avatar-img {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%; object-fit: cover;
  border-radius: inherit; background: #1a1f2c;
}
.avatar-xs { width: 18px; height: 18px; font-size: 8px; border-radius: 5px; }
.uname {
  min-width: 0; padding: 0; border: 0; background: transparent;
  color: var(--muted); font-size: 11px; text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-bottom: 1px dashed transparent;
}
button.uname:hover { color: var(--pink-2); border-bottom-color: var(--pink-line); }
.c-user.user-profile-link { cursor: pointer; }
.c-user.user-profile-link:hover .uname { color: var(--pink-2); border-bottom-color: var(--pink-line); }

.c-text { font-size: 13px; line-height: 1.55; color: var(--text); word-break: break-word; overflow-wrap: anywhere; padding-top: 0.5px; }
.c-text mark { background: var(--mark-bg); color: var(--mark-fg); border-radius: 3px; padding: 0 1.5px; }
.c-text .src {
  display: inline-block; margin-right: 7px; padding: 0 5px;
  border-radius: 4px; background: var(--panel-2);
  font-size: 9.5px; color: var(--muted); vertical-align: 1.5px;
  white-space: nowrap; max-width: 210px; overflow: hidden; text-overflow: ellipsis;
}
.badge {
  display: inline-block; margin-left: 6px; padding: 0 5px;
  border: 1px solid transparent; border-radius: 4px;
  font-size: 9px; font-weight: 600; line-height: 15px;
  vertical-align: 1.5px; letter-spacing: 0.02em;
}
.badge.sc { color: var(--gold); background: rgba(255, 200, 87, 0.1); border-color: rgba(255, 200, 87, 0.24); }
.badge.guard { color: var(--violet); background: rgba(167, 139, 250, 0.12); border-color: rgba(167, 139, 250, 0.25); }
.badge.gift { color: #ff9f6e; background: rgba(255, 159, 110, 0.12); border-color: rgba(255, 159, 110, 0.26); }
.badge.mode { color: var(--muted); background: var(--panel-2); border-color: var(--line); font-weight: 500; }

.c-actions {
  display: flex; align-items: flex-start; justify-content: flex-end;
  gap: 3px; padding-top: 1px; min-width: 0;
}
.copy-btn {
  display: grid; place-items: center;
  width: 26px; height: 26px; margin-top: 0;
  border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: var(--faint);
  opacity: 0; transition: 0.13s;
}
.row:hover .copy-btn, .copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover { color: var(--pink-2); background: var(--pink-dim); border-color: var(--pink-line); }
.copy-btn.copied { color: var(--mint); border-color: rgba(94, 234, 212, 0.4); }

.replay-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; margin-left: 0; border-radius: 4px;
  border: 1px solid transparent; vertical-align: 0;
  text-decoration: none; color: var(--pink-2); background: var(--pink-dim);
  transition: 0.13s; flex: 0 0 auto;
}
.replay-btn.on:hover { color: #fff; background: var(--pink); }
.replay-btn.off { color: var(--faint); background: transparent; border-color: var(--line); opacity: 0.38; cursor: help; }
.replay-btn.off:hover { opacity: 0.66; }
.replay-head.off { opacity: 0.45; cursor: default; }
#sReplayHint { display: inline-flex; align-items: center; gap: 5px; }
.replay-refresh {
  border: 0; background: none; color: var(--pink-2);
  font-size: 10px; cursor: pointer; padding: 0; text-decoration: underline;
}
.replay-list { display: flex; flex-direction: column; gap: 6px; padding: 4px 0 2px; }
.replay-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel-2); color: inherit; text-decoration: none;
}
.replay-item:hover { border-color: var(--pink-line); background: var(--pink-dim); }
.rp-play { color: var(--pink-2); font-size: 9px; }
.rp-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.rp-main b { font-size: 11px; color: var(--text); }
.rp-main em { font-style: normal; font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 9px; color: var(--faint); }
.rp-meta i { font-style: normal; }
.rp-meta i.on { color: var(--mint); }
.rp-meta i.off { color: var(--faint); }
.replay-empty { padding: 8px 3px; font-size: 11px; color: var(--text-2); }
.replay-tip { padding: 4px 2px 0; font-size: 9.5px; color: var(--faint); line-height: 1.5; }

.empty {
  padding: 54px 22px; text-align: center; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 7px;
}
.empty .e-ico {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--panel-2); border: 1px solid var(--line);
  color: var(--faint); margin-bottom: 3px;
}
.empty b { font-size: 13px; color: var(--text-2); font-weight: 600; }
.empty span { font-size: 11.5px; color: var(--faint); max-width: 380px; line-height: 1.7; }
.empty .btn { margin-top: 6px; }
.sugs { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 4px; }
.sug {
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel-2); color: var(--text-2);
  font-size: 11px; padding: 3px 11px; transition: 0.13s;
}
.sug:hover { color: var(--pink-2); border-color: var(--pink-line); background: var(--pink-dim); }

.list-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 7px 12px; padding: 9px 12px; border-top: 1px solid var(--line); font-size: 10px; color: var(--faint); text-align: left; font-variant-numeric: tabular-nums; }
.list-foot:empty { display: none; }
.list-foot b { color: var(--muted); font-weight: 500; }
.list-foot-text { white-space: nowrap; }
.list-top { display: flex; justify-content: flex-end; padding: 6px 12px 2px; }
.list-top:empty { display: none; }
.list-top .pager { margin-left: 0; }
.pager { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.page-btn {
  padding: 4px 7px; border: 1px solid var(--line); border-radius: 5px;
  background: var(--panel-2); color: var(--text-2);
  font-family: var(--sans); font-size: 10px; line-height: 1.2; cursor: pointer;
}
.page-btn:hover:not(:disabled) { color: var(--pink-2); border-color: var(--pink-line); background: var(--pink-dim); }
.page-btn:disabled { opacity: 0.32; cursor: default; }
.page-now { padding: 0 4px; color: var(--muted); white-space: nowrap; }
.page-now b { color: var(--text-2); }

/* insights */

.insights { display: flex; flex-direction: column; gap: 13px; }
.insights .card { padding: 13px 14px 10px; }
.insights .card-head { margin-bottom: 7px; }

.rank-list { display: flex; flex-direction: column; }
.rank {
  display: grid; grid-template-columns: 14px 18px minmax(0, 1fr) auto;
  gap: 7px; align-items: center;
  padding: 5px 3px; border: 0; background: transparent; color: inherit;
  border-radius: 6px; text-align: left;
}
button.rank:hover { background: var(--panel-2); }
.rank .n { font-family: var(--mono); font-size: 9px; color: var(--faint); text-align: right; }
.rank .nm { min-width: 0; }
.rank .nm .name { display: block; font-size: 11px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank .track { display: block; height: 2px; margin-top: 3px; background: rgba(255, 255, 255, 0.06); border-radius: 2px; overflow: hidden; }
.rank .track i { display: block; height: 100%; border-radius: 2px; background: linear-gradient(90deg, var(--pink), #a7f3d0); opacity: 0.85; }
.rank .c { font-family: var(--mono); font-size: 9.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.rank.on .name { color: var(--pink-2); }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel-2); color: var(--text-2);
  padding: 2px 9px; line-height: 1.55; cursor: pointer;
  transition: 0.13s;
}
.tag:hover { color: var(--pink-2); border-color: var(--pink-line); background: var(--pink-dim); }
.tag.static { cursor: default; }
.tag.static:hover { color: var(--text-2); border-color: var(--line); background: var(--panel-2); }
.tag .tc { font-family: var(--mono); font-size: 8.5px; color: var(--faint); margin-left: 3px; }
.tag:nth-child(3n) { color: var(--pink-2); }

/* user lookup / profile */

.back-profile { margin-bottom: 7px; }
.back-profile button {
  display: inline-flex; align-items: center; gap: 5px;
  height: 27px; padding: 0 11px;
  border: 1px solid var(--pink-line); border-radius: 7px;
  background: var(--pink-dim); color: var(--pink-2);
  font-size: 11px; font-weight: 600; transition: 0.14s;
}
.back-profile button:hover { color: #fff; background: var(--pink); border-color: var(--pink); }
html[data-theme="light"] .back-profile button:hover { color: #fff; }

.profile-title { display: flex; align-items: center; gap: 11px; }
.profile-title > span:nth-child(2) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar-lg { width: 38px; height: 38px; border-radius: 11px; font-size: 15px; flex: 0 0 auto; }
.then-name {
  display: inline-block; margin-right: 6px; padding: 0 5px;
  border: 1px solid var(--line); border-radius: 4px;
  background: var(--panel-2); color: var(--muted);
  font-size: 9.5px; line-height: 16px; vertical-align: 1px;
  white-space: nowrap;
}
.uc-alias { display: block; margin-top: 2px; font-size: 9.5px; color: var(--faint); font-style: normal; }
a.btn { text-decoration: none; }
.profile-title .uid-chip {
  font-family: var(--mono); font-size: 10px; font-weight: 400;
  color: var(--muted); border: 1px solid var(--line);
  border-radius: 5px; padding: 1px 6px; letter-spacing: 0;
}

.profile-kv {
  display: grid; grid-template-columns: auto minmax(0, 1fr);
  gap: 5px 10px; font-size: 11px; line-height: 1.5;
}
.profile-kv span:nth-child(odd) { color: var(--faint); white-space: nowrap; }
.profile-kv span:nth-child(even) { color: var(--text-2); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }

.ustream-list { display: flex; flex-direction: column; gap: 1px; }
.ustream {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px; align-items: center;
  padding: 6px; border: 0; border-radius: 6px;
  background: transparent; color: inherit; text-align: left;
}
.ustream:hover { background: var(--panel-2); }
.ustream b { display: block; font-size: 11px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ustream em { display: block; margin-top: 1px; font-style: normal; font-size: 9.5px; color: var(--faint); font-family: var(--mono); }
.ustream .c { font-family: var(--mono); font-size: 9.5px; color: var(--faint); }

.user-candidates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ucard {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 15px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel); color: inherit; text-align: left;
  transition: 0.15s;
}
.ucard:hover { border-color: var(--pink-line); background: linear-gradient(95deg, var(--pink-dim), transparent 75%); transform: translateY(-1px); }
.ucard .uc-main { flex: 1; min-width: 0; }
.ucard b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ucard em { display: block; margin-top: 2px; font-style: normal; font-size: 10px; color: var(--muted); font-family: var(--mono); }
.ucard .uc-last { font-size: 9.5px; color: var(--faint); white-space: nowrap; }
.ucard .arrow { color: var(--faint); flex: 0 0 auto; }

.row-profile { grid-template-columns: 96px minmax(0, 1fr) 28px; }

.group-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 13px 5px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent);
  font-size: 10px; color: var(--muted);
}
html[data-theme="light"] .group-head { background: linear-gradient(180deg, rgba(15, 23, 42, 0.025), transparent); }
.group-head b { min-width: 0; font-weight: 600; font-size: 10.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.group-head span { flex: 0 0 auto; font-family: var(--mono); font-size: 9px; color: var(--faint); }

.pgroup { border-bottom: 1px solid var(--line); }
.pgroup:last-child { border-bottom: 0; }
.pgroup-head {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 9px 13px 8px; border: 0; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent);
  color: inherit; text-align: left; cursor: pointer; font-family: inherit;
}
html[data-theme="light"] .pgroup-head { background: linear-gradient(180deg, rgba(15, 23, 42, 0.04), transparent); }
.pgroup-head:hover { background: var(--pink-dim); }
.pg-arrow { width: 10px; flex: 0 0 auto; color: var(--pink-2); font-size: 10px; }
.pg-name { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.pg-name b { font-size: 10.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-name em { font-style: normal; font-size: 9px; color: var(--faint); }
.pg-state { flex: 0 0 auto; font-family: var(--mono); font-size: 9px; color: var(--faint); }
.pgroup.collapsed .pgroup-head { border-bottom-color: transparent; }
.pgroup.collapsed .pg-arrow { color: var(--faint); }
.pgroup-actions { display: flex; align-items: center; gap: 7px; padding: 8px 13px 10px; flex-wrap: wrap; }
.pgroup-actions .btn { height: 24px; font-size: 10px; }
.pgroup-actions .btn.ghost { border-color: var(--line); background: transparent; color: var(--muted); }
.pgroup-actions .btn.ghost:hover { color: var(--text); border-color: var(--line-strong); }

/* footer */.foot { max-width: 1460px; margin: 28px auto 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 10px; color: var(--faint); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* toast */

.toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 120;
  transform: translate(-50%, 12px);
  padding: 9px 16px;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: rgba(12, 17, 27, 0.94); color: var(--text);
  font-size: 12px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  opacity: 0; pointer-events: none; transition: 0.22s;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  max-width: min(90vw, 480px); text-align: center;
}
html[data-theme="light"] .toast { background: rgba(255, 255, 255, 0.96); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* modal */

.modal {
  position: fixed; inset: 0; z-index: 110;
  display: grid; place-items: center;
  padding: 22px;
  background: rgba(4, 7, 13, 0.62);
  -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px);
}
.modal-card {
  position: relative; width: 580px; max-width: 100%; max-height: 84vh; overflow: auto;
  padding: 24px 26px 22px;
  border: 1px solid var(--line-strong); border-radius: 18px;
  background: var(--panel-solid); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.modal-card h3 { margin: 0 0 12px; font-size: 18px; letter-spacing: -0.01em; }
.modal-close { position: absolute; top: 14px; right: 14px; }
.modal-body { font-size: 12.5px; line-height: 1.85; color: var(--text-2); }
.modal-body p { margin: 0 0 10px; }
.modal-body b { color: var(--text); }
.modal-body .kv { display: grid; grid-template-columns: 100px 1fr; gap: 2px 12px; margin: 12px 0 16px; font-size: 11.5px; }
.modal-body .kv span:nth-child(odd) { color: var(--faint); }
.modal-body .kv span:nth-child(even) { font-variant-numeric: tabular-nums; }
.modal-body kbd {
  font-family: var(--mono); font-size: 10px; padding: 1px 5px;
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px;
  background: var(--panel-2); color: var(--text-2);
}
.modal-body .note { border-left: 2px solid var(--pink); padding: 2px 0 2px 10px; color: var(--muted); font-size: 11px; margin: 12px 0; }

/* responsive */

@media (max-width: 1320px) {
  .content-grid { grid-template-columns: minmax(0, 1fr) 266px; }
  .main { padding: 22px 24px 64px; }
}

@media (max-width: 1160px) {
  .content-grid { grid-template-columns: minmax(0, 1fr); }
  .insights { display: grid; grid-template-columns: 1fr 1fr; }
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .kpi:nth-child(3) { border-right: 0; }
  .kpi:nth-child(n + 4) { border-top: 1px solid var(--line); }
  .user-candidates { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  .menu-btn { display: grid; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    height: 100vh; height: 100dvh;
    width: min(308px, 86vw); flex-basis: min(308px, 86vw);
    background: var(--panel-solid);
    transform: translateX(-102%);
    transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 30px 0 60px rgba(0, 0, 0, 0.35);
    z-index: 95;
  }
  .sidebar.open { transform: none; }
  body.sidebar-open { overflow: hidden; }
  .side-close { display: grid; }
  .side-stats { padding-right: 48px; }
  .sidebar-backdrop {
    display: block; position: fixed; inset: 0; z-index: 90;
    background: rgba(4, 7, 13, 0.5);
    opacity: 0; pointer-events: none; transition: opacity 0.2s;
  }
  .sidebar-backdrop.show { opacity: 1; pointer-events: auto; }
  .brand-text small { display: none; }
  .global-search { margin: 0; }
  .view-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .vh-actions { padding-bottom: 0; }
}

@media (max-width: 700px) {
  :root { --topbar-h: 62px; }
  .topbar { gap: 9px; padding: 0 12px; }
  .brand-text { display: none; }
  .global-search { height: 38px; }
  .global-search kbd { display: none; }
  .main { padding: 16px 14px 60px; }
  .view-head h2 { font-size: 21px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi { padding: 10px 13px; }
  .kpi:nth-child(2n) { border-right: 0; }
  .kpi:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .kpi:nth-child(3) { border-right: 1px solid var(--line); }
  .kpi:last-child { grid-column: 1 / -1; border-right: 0; display: flex; align-items: baseline; gap: 8px; }
  .kpi:last-child span { margin-top: 0; }
  .insights { grid-template-columns: 1fr; }
  .row { grid-template-columns: 84px minmax(0, 1fr) 54px; padding: 8px 10px; gap: 4px 8px; }
  .c-user { grid-column: 2; grid-row: 1; padding-top: 0; }
  .c-text { grid-column: 2; grid-row: 2; }
  .c-time { grid-row: 1 / span 2; }
  .c-actions { grid-column: 3; grid-row: 1 / span 2; padding-top: 0; }
  .copy-btn { opacity: 0.6; width: 25px; height: 25px; }
  .replay-btn { width: 19px; height: 19px; }
  .row-profile { grid-template-columns: 84px minmax(0, 1fr) 54px; }
  .row-profile .c-text { grid-row: 1; }
  .row-profile .c-time { grid-row: 1; }
  .row-profile .c-actions { grid-row: 1; }
  .group-head { padding: 8px 10px 4px; }
  .pgroup-head { padding: 8px 10px 7px; gap: 7px; }
  .pgroup-actions { padding: 7px 10px 9px; }
  .gs-modes button { padding: 0 6px; font-size: 10px; }
  .avatar-lg { width: 32px; height: 32px; font-size: 13px; border-radius: 9px; }
  .user-candidates { grid-template-columns: 1fr; }
  .profile-title { gap: 8px; }
  .toolbar { gap: 6px; }
  .tb-count { width: 100%; margin-left: 0; }
  .tl-legend { display: none; }
  .view-head .btn span { display: none; }
}

/* ---------------- top navigation / home / account ---------------- */

.top-nav { display: flex; align-items: center; gap: 3px; flex: 0 0 auto; }
.nav-btn {
  border: 1px solid transparent; background: transparent; color: var(--muted);
  border-radius: 8px; padding: 7px 12px; font-family: var(--sans);
  font-size: 12px; font-weight: 600; line-height: 1; cursor: pointer;
  transition: 0.14s; white-space: nowrap;
}
.nav-btn:hover { color: var(--text); background: var(--panel-2); }
.nav-btn.on { color: var(--pink-2); background: var(--pink-dim); border-color: var(--pink-line); }
.top-actions { margin-left: auto; }

.page-search-wrap { margin: 0 0 15px; }
.page-search.global-search { max-width: none; width: 100%; margin: 0; height: 46px; }
body.nav-home .sidebar, body.nav-account .sidebar,
body.nav-home .sidebar-backdrop, body.nav-account .sidebar-backdrop { display: none; }
body.nav-home .menu-btn, body.nav-account .menu-btn { display: none !important; }
body.nav-home .main, body.nav-account .main { max-width: none; }

.home-view { max-width: 1460px; }
.home-hero {
  position: relative; display: flex; align-items: stretch; justify-content: space-between;
  gap: 30px; padding: 34px 36px; margin-bottom: 16px; overflow: hidden;
  border: 1px solid var(--line); border-radius: 20px;
  background:
    radial-gradient(820px 380px at 85% -30%, rgba(52, 211, 153, 0.16), transparent 68%),
    linear-gradient(120deg, var(--panel-solid), var(--panel));
  box-shadow: var(--shadow-sm);
}
.home-copy { max-width: 720px; position: relative; z-index: 2; }
.home-copy h1 { margin: 8px 0 12px; font-size: clamp(34px, 4.2vw, 58px); line-height: 1.08; letter-spacing: -0.045em; }
.home-copy p { margin: 0; max-width: 620px; color: var(--muted); font-size: 13px; line-height: 1.85; }
.home-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 21px; }
.home-art { position: relative; width: 330px; flex: 0 0 auto; min-height: 230px; }
.home-orb {
  position: absolute; width: 250px; height: 250px; right: 12px; top: 4px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(110, 231, 183, 0.55), rgba(16, 185, 129, 0.09) 45%, transparent 72%);
  filter: blur(1px);
}
.home-card-stack { position: absolute; inset: 20px 0 0 22px; }
.hc {
  position: absolute; min-width: 190px; padding: 10px 13px; border-radius: 12px;
  background: rgba(17, 22, 35, 0.88); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-sm); backdrop-filter: blur(14px);
}
html[data-theme="light"] .hc { background: rgba(255,255,255,.92); }
.hc span { display: block; font-size: 9px; color: var(--faint); margin-bottom: 4px; }
.hc b { font-size: 12px; font-weight: 600; }
.hc1 { top: 10px; right: 12px; transform: rotate(4deg); opacity: .7; }
.hc2 { top: 74px; right: 40px; transform: rotate(-3deg); opacity: .88; }
.hc3 { top: 144px; right: 4px; transform: rotate(2deg); }

.home-art.home-dm-stage {
  width: 540px; min-height: 300px; padding: 13px 14px 11px;
  display: flex; flex-direction: column; gap: 8px; overflow: hidden;
  border: 1px solid var(--line-strong); border-radius: 14px;
  background:
    radial-gradient(360px 200px at 80% -20%, rgba(52, 211, 153, 0.22), transparent 70%),
    rgba(8, 12, 20, 0.72);
  box-shadow: var(--shadow-sm);
}
html[data-theme="light"] .home-art.home-dm-stage { background: rgba(255,255,255,.82); }
.home-dm-stage .home-orb { width: 270px; height: 270px; right: -20px; top: -80px; opacity: .75; pointer-events: none; }
.dm-stage-head { display: flex; align-items: center; gap: 7px; position: relative; z-index: 2; min-height: 16px; }
.dm-stage-head b { font-size: 11px; font-weight: 650; color: var(--text-2); }
.dm-stage-head .hint { margin-left: auto; font-size: 9px; color: var(--faint); max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-stage-head .live-dot { width: 7px; height: 7px; box-shadow: 0 0 0 3px var(--pink-dim); }
.dm-screen {
  position: relative; flex: 1; min-height: 225px; overflow: hidden; border-radius: 9px;
  border: 1px solid var(--line); background: rgba(3, 7, 13, 0.52);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 5%, #000 95%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 5%, #000 95%, transparent 100%);
}
html[data-theme="light"] .dm-screen { background: rgba(241, 245, 249, .72); }
.dm-flight {
  position: absolute; left: 100%; top: 0; z-index: 1;
  white-space: nowrap; padding: 3px 8px; border-radius: 999px;
  color: #e6edf8; font-size: 12px; line-height: 1.2;
  background: rgba(13, 20, 33, .7); border: 1px solid rgba(255, 255, 255, .08);
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
  animation: dm-fly var(--dur, 9s) linear forwards;
  will-change: transform;
}
html[data-theme="light"] .dm-flight { color: #26364a; background: rgba(255,255,255,.86); border-color: rgba(15,23,42,.09); text-shadow: none; }
.dm-flight.sc { color: #f7d774; border-color: rgba(247, 215, 116, .4); }
.dm-flight.guard { color: #c4b5fd; border-color: rgba(196, 181, 253, .4); }
.dm-flight.gift { color: #ffb08a; border-color: rgba(255, 176, 138, .38); }
.dm-flight.dm-jump { cursor: pointer; }
.dm-flight.dm-jump:hover { animation-play-state: paused; color: #fff; border-color: var(--pink-line); background: var(--pink-dim); }
.dm-stage-foot { position: relative; z-index: 2; font-family: var(--mono); font-size: 9px; color: var(--faint); display: flex; justify-content: space-between; gap: 8px; }
@keyframes dm-fly {
  from { transform: translateX(0); }
  to { transform: translateX(calc(-1 * var(--travel, 900px))); }
}
@media (max-width: 1120px) {
  .home-art.home-dm-stage { width: 410px; min-height: 280px; }
  .dm-screen { min-height: 200px; }
}
@media (max-width: 900px) {
  .home-hero { flex-direction: column; }
  .home-art.home-dm-stage { display: flex; width: 100%; min-height: 220px; }
  .dm-screen { min-height: 150px; }
}
@media (max-width: 700px) {
  .home-art.home-dm-stage { min-height: 200px; padding: 11px 11px 9px; }
  .dm-screen { min-height: 135px; }
  .dm-stage-head .hint { max-width: 160px; }
}

.home-stats {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); margin-bottom: 16px; overflow: hidden;
}
.home-stat { padding: 15px 18px; border-right: 1px solid var(--line); }
.home-stat:last-child { border-right: 0; }
.home-stat b { display: block; font-size: 23px; font-weight: 650; letter-spacing: -0.03em; }
.home-stat span { display: block; margin-top: 3px; font-size: 10px; color: var(--muted); }

.home-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 15px; align-items: start; }
.home-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 15px 15px 13px; box-shadow: var(--shadow-sm); }
.home-panel .card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.home-panel .card-head h3 { margin: 0; font-size: 13px; }
.home-changelog {
  margin-top: 15px; padding: 15px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); box-shadow: var(--shadow-sm);
}
.home-changelog .card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.home-changelog .card-head h3 { margin: 0; font-size: 13px; }
.changelog-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.changelog-list li { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 10px; font-size: 12px; line-height: 1.6; }
.changelog-list time { padding-top: 1px; font-family: var(--mono); font-size: 10px; color: var(--faint); white-space: nowrap; }
.changelog-list b { display: block; font-weight: 600; color: var(--text-2); }
.changelog-list span { color: var(--muted); }
@media (max-width: 700px) {
  .changelog-list li { grid-template-columns: 1fr; gap: 2px; }
}
.home-recent { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.home-session {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  text-align: left; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel-2); color: inherit; padding: 10px 11px; cursor: pointer;
  transition: 0.14s;
}
.home-session:hover { border-color: var(--pink-line); background: var(--pink-dim); transform: translateY(-1px); }
.home-session.is-live { border-color: var(--pink-line); background: linear-gradient(120deg, var(--pink-dim), transparent 80%); }
.hs-date { font-family: var(--mono); font-size: 9.5px; color: var(--faint); }
.hs-date i { font-style: normal; font-family: var(--sans); }
.hs-live { color: var(--pink-2); font-size: 9px; margin-left: 4px; }
.hs-title { font-size: 12px; font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hs-meta { font-size: 9.5px; color: var(--muted); }
.home-features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.home-feature { text-align: left; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); color: inherit; padding: 11px 12px; cursor: pointer; transition: 0.14s; }
.home-feature:hover { border-color: var(--pink-line); background: var(--pink-dim); }
.home-feature b { display: block; font-size: 12px; margin-bottom: 4px; }
.home-feature span { display: block; font-size: 10px; color: var(--muted); line-height: 1.5; }
.home-live-slot { margin-top: 10px; }
.home-live-card {
  display: flex; align-items: center; gap: 10px; padding: 10px 11px;
  border: 1px solid var(--pink-line); border-radius: 10px; background: var(--pink-dim);
}
.home-live-card div { flex: 1; min-width: 0; }
.home-live-card b { display: block; font-size: 12px; }
.home-live-card em { display: block; font-style: normal; font-size: 10px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 0 4px var(--pink-dim); animation: live-pulse 1.3s ease-in-out infinite; flex: 0 0 auto; }

.account-view { max-width: 1180px; }
.account-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.account-card { padding: 20px; }
.account-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: var(--pink-2); background: var(--pink-dim); border: 1px solid var(--pink-line); font-size: 14px; margin-bottom: 12px; }
.account-gate { max-width: 460px; }
.account-login { padding: 22px; }
.account-login h3 { margin: 0 0 8px; font-size: 16px; }
.account-login p { margin: 0 0 16px; color: var(--muted); font-size: 11.5px; line-height: 1.7; }
.account-field { display: flex; flex-direction: column; gap: 6px; font-size: 10.5px; color: var(--muted); margin-bottom: 12px; }
.account-field input {
  border: 1px solid var(--line); border-radius: 9px; background: var(--panel-solid);
  color: var(--text); padding: 9px 11px; font-size: 13px; outline: none;
}
.account-field input:focus { border-color: var(--pink-line); box-shadow: 0 0 0 3px var(--pink-dim); }
.account-err { margin-bottom: 12px; color: #f87171; background: rgba(248, 113, 113, 0.1); border: 1px solid rgba(248, 113, 113, 0.3); border-radius: 8px; padding: 8px 10px; font-size: 11px; }
.account-login .btn { width: 100%; }
.account-status { margin-top: 14px; padding: 16px; }
.account-actions { display: flex; gap: 8px; margin-top: 12px; }
.account-card h3 { margin: 0 0 8px; font-size: 15px; }
.account-card p { margin: 0 0 15px; color: var(--muted); font-size: 11.5px; line-height: 1.8; }
.account-card code { font-family: var(--mono); font-size: 10px; color: var(--pink-2); background: var(--pink-dim); padding: 1px 4px; border-radius: 4px; }

.income-total { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 2px 1px 10px; border-bottom: 1px solid var(--line); }
.income-total span { font-size: 10px; color: var(--muted); }
.income-total b { font-size: 23px; font-weight: 700; letter-spacing: -0.03em; color: var(--pink-2); font-variant-numeric: tabular-nums; }
.income-rows { display: flex; flex-direction: column; gap: 7px; padding-top: 9px; }
.income-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 7px; font-size: 10px; }
.ir-label { color: var(--muted); }
.ir-bar { height: 5px; border-radius: 3px; background: var(--panel-2); overflow: hidden; }
.ir-bar i { display: block; height: 100%; border-radius: 3px; background: var(--pink); }
.income-row.sc .ir-bar i { background: var(--gold); }
.income-row.guard .ir-bar i { background: var(--violet); }
.income-row.gift .ir-bar i { background: #ff9f6e; }
.income-row b { color: var(--text-2); font-family: var(--mono); font-size: 10px; font-weight: 500; text-align: right; }
.income-note { margin: 9px 0 0; color: var(--faint); font-size: 9px; line-height: 1.6; }

@media (max-width: 1120px) {
  .home-art { width: 250px; }
  .hc { min-width: 160px; }
  .home-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .account-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .home-hero { padding: 24px 22px; }
  .home-art { display: none; }
  .home-grid { grid-template-columns: 1fr; }
  .home-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-stat:nth-child(3) { border-right: 0; }
  .home-stat:nth-child(n + 4) { border-top: 1px solid var(--line); }
  .account-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .brand-text { display: none; }
  .topbar { gap: 8px; padding: 0 10px; }
  .top-nav { gap: 1px; }
  .nav-btn { padding: 7px 7px; font-size: 11px; }
  .top-actions { gap: 2px; }
  .top-actions .icon-btn { width: 32px; height: 32px; }
  .home-copy h1 { font-size: 31px; }
  .home-recent { grid-template-columns: 1fr; }
  .home-features { grid-template-columns: 1fr; }
  .home-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-stat { border-right: 1px solid var(--line); }
  .home-stat:nth-child(2n) { border-right: 0; }
  .home-stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .home-copy p { font-size: 12px; }
  .page-search.global-search { height: 42px; }
}

@media (max-width: 960px) {
  /* On phones/tablets show income, replay and ranking above the long danmaku list. */
  #streamView .content-grid,
  #userView .content-grid { display: flex; flex-direction: column; }
  #streamView .insights,
  #userView .insights { order: -1; }
}

@media (max-width: 700px) {
  /* Key insight cards become a swipeable strip instead of a 900px-tall stack. */
  #streamView .insights,
  #userView .insights {
    display: flex; flex-direction: row; align-items: flex-start; gap: 10px;
    overflow-x: auto; padding-bottom: 6px;
    width: 100%; max-width: 100%; min-width: 0;
    scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
  }
  #streamView .insights > .card,
  #userView .insights > .card {
    flex: 0 0 86vw; scroll-snap-align: start;
  }
}

@media (max-width: 360px) {
  .brand { display: none; }
  .topbar { gap: 6px; padding: 0 8px; }
  .nav-btn { padding: 6px 5px; font-size: 10.5px; }
  .top-actions { gap: 2px; }
  .top-actions .icon-btn { width: 30px; height: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
