:root {
  --bg: #0d0f14;
  --panel: rgba(23, 26, 33, .72);
  --panel-solid: #171a21;
  --panel2: #1d212b;
  --text: #eef0f5;
  --muted: #9aa0b0;
  --faint: #6b7183;
  --accent: #feb201;
  --accent2: #3fd0c9;
  --pick: #3fd0c9;
  --maybe: #feb201;
  --skip: #ff6b81;
  --line: rgba(255, 255, 255, .08);
  --line2: rgba(255, 255, 255, .14);
  --radius: 18px;
  --shadow: 0 20px 60px rgba(0, 0, 0, .45);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
.topic-layout { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 18px; align-items: start; }
.topic-side { position: sticky; top: 74px; }
.topic-side .accounts { grid-template-columns: 1fr; }
.cal-day { aspect-ratio: auto; height: 34px; font-size: 12px; }
.topic-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: sticky; bottom: 0; margin-top: 16px; padding: 10px 0 2px; background: linear-gradient(180deg, transparent, rgba(18,20,26,.96) 30%); }
.topic-nav button { min-width: 96px; }
.topic-nav span { color: var(--muted); font-size: 12.5px; }
.cal-more { width: 100%; margin-top: 8px; }
.trend-summary { margin-top: 14px; }
.chart-label { margin: 14px 0 8px; color: var(--muted); font-size: 12px; letter-spacing: .08em; }
.heat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.heat { text-align: left; padding: 10px 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); }
.heat.active { border-color: var(--accent); }
.heat-meter { display: flex; align-items: flex-end; height: 64px; margin: 8px 0 6px; }
.heat-meter i { display: block; width: 100%; border-radius: 8px 8px 4px 4px; }
.heat b { font-size: 20px; line-height: 1.1; }
.heat small, .heat > span { color: var(--muted); font-size: 12px; }
.topic-legend { display: flex; gap: 12px; margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.topic-legend i { display: inline-block; width: 8px; height: 8px; margin-right: 4px; border-radius: 50%; }
.topic-line { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px; align-items: center; margin: 7px 0; font-size: 12px; }
.topic-tracks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.topic-tracks u { display: block; height: 8px; border-radius: 99px; background: rgba(255,255,255,.06); overflow: hidden; }
.topic-tracks i { display: block; height: 100%; border-radius: 99px; }
.bench-video { width: 100%; max-height: 68vh; border-radius: 14px; background: #000; margin: 12px 0; }
.trend-keywords { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.trend-keywords button { border: 1px solid var(--line2); border-radius: 999px; padding: 7px 12px; color: var(--muted); font-size: 13px; background: rgba(255,255,255,.03); }
.trend-keywords button.active { color: #1a1403; background: var(--accent); border-color: transparent; font-weight: 700; }
.trend-keywords button small { margin-left: 6px; opacity: .72; font-weight: 500; }
.bench-accounts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin-bottom: 16px; }
.bench-account { text-align: left; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.03); }
.bench-account.active { border-color: var(--accent); }
.bench-account b { display: block; font-size: 14px; }
.bench-account span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.trend-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.trend-tabs button { border: 1px solid var(--line2); border-radius: 999px; padding: 6px 12px; color: var(--muted); font-size: 13px; }
.trend-tabs button.active { color: #1a1403; background: var(--accent); border-color: transparent; }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.matrix { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.matrix th, .matrix td { border-bottom: 1px solid var(--line); padding: 7px 6px; text-align: right; white-space: nowrap; }
.matrix th:first-child, .matrix td:first-child { text-align: left; white-space: normal; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- background ---------- */
.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .32; }
.orb-a { width: 520px; height: 520px; background: radial-gradient(circle, var(--accent), transparent 68%); top: -160px; right: -120px; }
.orb-b { width: 560px; height: 560px; background: radial-gradient(circle, var(--accent2), transparent 68%); bottom: -220px; left: -180px; }
.orb-c { width: 340px; height: 340px; background: radial-gradient(circle, #7c6cff, transparent 70%); top: 40%; left: 55%; opacity: .14; }
.grid-lines {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 10%, transparent 70%);
  opacity: .5;
}
.glass {
  background: var(--panel);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--line);
}

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: 10px; }
.logo {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #ffd76a); color: #0d0f14; font-weight: 900; font-size: 18px;
  box-shadow: 0 6px 20px rgba(254, 178, 1, .35);
}
.brand-name { font-weight: 800; font-size: 15px; letter-spacing: .5px; line-height: 1.2; white-space: nowrap; }
.brand-sub { font-size: 11.5px; color: var(--muted); letter-spacing: 2px; white-space: nowrap; max-width: 168px; overflow: hidden; text-overflow: ellipsis; }
.brand-lg .logo { width: 48px; height: 48px; font-size: 24px; border-radius: 14px; }
.brand-lg .brand-name { font-size: 20px; }

/* ---------- auth ---------- */
.auth { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 24px 18px; }
.auth-card { width: min(420px, 100%); border-radius: 26px; padding: 34px 28px 26px; box-shadow: var(--shadow); }
.auth-lead { color: var(--muted); margin: 14px 0 22px; font-size: 14px; }
.seg { position: relative; display: grid; grid-template-columns: 1fr 1fr; background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 20px; }
.seg-btn { position: relative; z-index: 1; padding: 9px 0; font-weight: 600; color: var(--muted); transition: color .25s; }
.seg-btn.active { color: #0d0f14; }
.seg-ink { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 9px; background: var(--accent); box-shadow: 0 4px 14px rgba(254,178,1,.35); }
.field { position: relative; display: block; margin-bottom: 14px; }
.field input {
  width: 100%; padding: 22px 14px 8px; border-radius: 12px; border: 1px solid var(--line2);
  background: rgba(0,0,0,.25); outline: none; transition: border-color .2s, box-shadow .2s;
}
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(254,178,1,.12); }
.field span { position: absolute; left: 15px; top: 15px; color: var(--muted); font-size: 14px; pointer-events: none; transition: all .2s; }
.field input:focus + span, .field input:not(:placeholder-shown) + span { top: 6px; font-size: 11px; color: var(--accent); }
.auth[data-mode="login"] .reg-only { display: none; }
.form-error { min-height: 20px; color: var(--skip); font-size: 13px; margin: 2px 0 8px; }
.btn-primary {
  position: relative; overflow: hidden; width: 100%; padding: 13px; border-radius: 12px; font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #ffcf4a); color: #0d0f14; box-shadow: 0 10px 26px rgba(254,178,1,.3);
  transition: scale .15s;
}
.btn-primary:active { scale: .98; }
.btn-primary[disabled] { opacity: .7; }
.shine { position: absolute; top: 0; left: -60%; width: 40%; height: 100%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.6), transparent); transform: skewX(-20deg); animation: shine 3.2s ease-in-out infinite; }
@keyframes shine { 0%, 60% { left: -60%; } 100% { left: 130%; } }
.auth-wechat { margin-top: 16px; font-size: 13px; color: var(--muted); text-align: center; line-height: 1.7; }
.auth-wechat b { color: var(--text); letter-spacing: 1px; font-size: 16px; }
.guest-entry {
  display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 14px;
  padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line2); background: rgba(255,255,255,.04);
  color: var(--text); font-size: 16px; font-weight: 700; text-decoration: none;
}
.guest-entry svg { width: 28px; height: 28px; stroke: var(--accent); fill: none; stroke-width: 1.8; }
.guest-entry[hidden] { display: none; }

/* ---------- app shell ---------- */
.app { position: relative; z-index: 1; min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px clamp(16px, 4vw, 40px); border-width: 0 0 1px; border-radius: 0;
}
.tabs { position: relative; display: flex; gap: 4px; background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 14px; padding: 4px; }
.tab { position: relative; z-index: 1; display: flex; align-items: center; gap: 7px; padding: 8px 16px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 14px; transition: color .25s; white-space: nowrap; }
.tab svg { width: 18px; height: 18px; }
.tab.active { color: #0d0f14; }
.tab-ink { position: absolute; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 10px; background: var(--accent); box-shadow: 0 4px 16px rgba(254,178,1,.35); }
.user { position: relative; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; border: 1px solid var(--line2); font-size: 13.5px; max-width: 180px; }
.user-chip span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 30px; height: 30px; border-radius: 50%; overflow: hidden; flex: none; display: grid; place-items: center; background: #2a2416; color: var(--accent); font-weight: 800; }
.avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 150px; border-radius: 14px; padding: 6px; box-shadow: var(--shadow); }
.menu button { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 9px; font-size: 14px; }
.menu button:hover { background: rgba(255,255,255,.06); }
body:not(.is-admin) .admin-only { display: none !important; }

.stage { max-width: 1180px; margin: 0 auto; padding: 28px clamp(16px, 4vw, 40px) 60px; }
.view { display: none; }
.view.active { display: block; }
.view-head { margin-bottom: 22px; }
.view-head h1 { font-size: clamp(24px, 4vw, 34px); font-weight: 800; letter-spacing: .5px; }
.view-head p { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* ---------- accounts ---------- */
.accounts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-bottom: 18px; }
.account {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 14px; padding: 16px; text-align: left;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); transition: border-color .25s, translate .2s;
}
.account::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 15% 50%, rgba(254,178,1,.16), transparent 60%); opacity: 0; transition: opacity .3s; }
.account.active { border-color: rgba(254,178,1,.6); }
.account.active::after { opacity: 1; }
.account:hover { translate: 0 -2px; }
.account img, .account .ph { width: 56px; height: 56px; border-radius: 16px; object-fit: cover; object-position: top; flex: none; background: var(--panel2); display: grid; place-items: center; font-weight: 800; font-size: 20px; color: var(--accent); }
.account-info { flex: 1; min-width: 0; position: relative; z-index: 1; }
.account-name { font-weight: 700; font-size: 15px; }
.account-meta { font-size: 12.5px; color: var(--muted); }
.ring { position: relative; z-index: 1; width: 58px; height: 58px; flex: none; }
.ring svg { width: 58px; height: 58px; transform: rotate(-90deg); }
.ring circle { stroke-width: 5; fill: none; }
.ring .track { stroke: rgba(255,255,255,.08); }
.ring .bar { stroke: var(--accent2); stroke-linecap: round; }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.account-all .ph { color: var(--accent2); }

/* ---------- toolbar ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line2); color: var(--muted); font-size: 13px; white-space: nowrap; transition: all .2s; }
.chip.active { background: var(--text); color: #0d0f14; border-color: var(--text); font-weight: 600; }
.chip .n { opacity: .6; margin-left: 4px; font-variant-numeric: tabular-nums; }
.search { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line2); background: rgba(0,0,0,.2); min-width: 220px; flex: 0 1 300px; }
.search svg { color: var(--muted); width: 18px; height: 18px; }
.search input { background: none; border: 0; outline: none; width: 100%; font-size: 14px; }

/* ---------- topic cards ---------- */
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line); cursor: pointer; overflow: hidden;
  transition: border-color .25s, box-shadow .25s;
}
.card:hover { border-color: var(--line2); box-shadow: 0 14px 40px rgba(0,0,0,.35); }
.card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: transparent; transition: background .3s; }
.card[data-mark="pick"]::before { background: var(--pick); }
.card[data-mark="maybe"]::before { background: var(--maybe); }
.card[data-mark="skip"]::before { background: var(--skip); }
.card[data-mark="skip"] .card-title, .card[data-mark="skip"] .card-hook { opacity: .5; }
.card-top { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--accent); font-weight: 700; }
.badge { padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid var(--line); font-size: 11.5px; white-space: nowrap; }
.badge.pf { color: var(--accent2); border-color: rgba(63,208,201,.3); }
.card-top .spacer { flex: 1; }
.card-title { font-size: 16px; font-weight: 700; line-height: 1.45; }
.card-hook { font-size: 13.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-note { font-size: 12.5px; color: var(--accent); background: rgba(254,178,1,.08); border-radius: 8px; padding: 6px 10px; }
.marks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: auto; padding-top: 4px; }
.mark-btn {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 5px; padding: 8px 0; border-radius: 10px;
  border: 1px solid var(--line2); font-size: 13px; font-weight: 600; color: var(--muted); transition: background .2s, color .2s, border-color .2s;
}
.mark-btn svg { width: 16px; height: 16px; stroke-width: 2.4; }
.mark-btn[data-status="pick"]:hover, .mark-btn[data-status="pick"].on { color: #0d0f14; background: var(--pick); border-color: var(--pick); }
.mark-btn[data-status="maybe"]:hover, .mark-btn[data-status="maybe"].on { color: #0d0f14; background: var(--maybe); border-color: var(--maybe); }
.mark-btn[data-status="skip"]:hover, .mark-btn[data-status="skip"].on { color: #0d0f14; background: var(--skip); border-color: var(--skip); }
.counts { display: flex; gap: 10px; font-size: 12px; color: var(--muted); }
.counts i { font-style: normal; }
.counts .pick { color: var(--pick); } .counts .maybe { color: var(--maybe); } .counts .skip { color: var(--skip); }
.del-btn { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--faint); opacity: 0; transition: opacity .2s, background .2s, color .2s; z-index: 2; }
.del-btn svg { width: 16px; height: 16px; }
.card:hover .del-btn, .kb-card:hover .del-btn, .mat:hover .del-btn { opacity: 1; }
.del-btn:hover { background: rgba(255,107,129,.15); color: var(--skip); }
@media (hover: none) { .del-btn { opacity: 1; } }
.burst { position: fixed; z-index: 90; width: 6px; height: 6px; border-radius: 50%; pointer-events: none; }
.empty { text-align: center; color: var(--muted); padding: 60px 0; }

/* ---------- knowledge ---------- */
.kb-block { margin-bottom: 22px; }
.kb-block header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.kb-block h2 { font-size: 16px; white-space: nowrap; }
.kb-block header p { color: var(--muted); font-size: 12.5px; }
.kb-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kb-block.people { container-type: inline-size; }
.kb-block.people .kb-grid { grid-template-columns: 1fr; gap: 8px; }
.kb-card { position: relative; display: flex; gap: 12px; align-items: center; min-height: 72px; padding: 12px 14px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); cursor: pointer; }
.kb-card:hover { border-color: var(--line2); }
.kb-card.person { flex-direction: row; align-items: center; padding: 10px 14px; min-height: 68px; }
.kb-card.person > div { min-width: 0; }
.kb-card img, .kb-card.person img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; object-position: center; flex: none; aspect-ratio: auto; }
.kb-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: rgba(63,208,201,.1); color: var(--accent2); }
.kb-icon svg { width: 18px; height: 18px; }
.kb-card h3 { font-size: 14px; margin: 0 0 4px; line-height: 1.35; }
.kb-card.person h3 { font-size: 14px; margin: 0 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-card.person p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; -webkit-line-clamp: unset; }
.kb-card p { font-size: 12.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@container (min-width: 980px) {
  .kb-block.people .kb-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
  .kb-card.person { flex-direction: column; align-items: center; text-align: center; padding: 16px 12px 14px; }
  .kb-card.person img { width: 72px; height: 72px; }
  .kb-card.person h3, .kb-card.person p { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}
.kb-note { width: 100%; text-align: left; margin-top: 4px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.checks { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.check input { accent-color: #3fd0c9; width: 16px; height: 16px; }
@media (max-width: 900px) {
  .kb-grid { grid-template-columns: 1fr 1fr; }
  .kb-block header { flex-direction: column; gap: 2px; }
}
.kb-cat { font-size: 11.5px; color: var(--accent); font-weight: 700; letter-spacing: 1px; }

/* ---------- materials ---------- */
.mat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mat { position: relative; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); overflow: hidden; cursor: pointer; transition: border-color .25s, translate .2s; }
.mat:hover { border-color: var(--line2); translate: 0 -3px; }
.mat-cover { position: relative; aspect-ratio: 3 / 4; background: var(--panel2); overflow: hidden; }
.mat-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.mat:hover .mat-cover img { transform: scale(1.05); }
.mat-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(13,15,20,.85)); }
.play { position: absolute; z-index: 1; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; display: grid; place-items: center; background: rgba(13,15,20,.55); border: 1px solid rgba(255,255,255,.25); backdrop-filter: blur(6px); }
.play svg { fill: #fff; stroke: none; width: 22px; height: 22px; margin-left: 3px; }
.mat-body { padding: 10px 12px 12px; }
.mat-body h3 { font-size: 13.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mat-check { position: absolute; z-index: 3; top: 8px; left: 8px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: rgba(13,15,20,.55); }
.mat-check input { width: 16px; height: 16px; accent-color: #feb201; }
.mat.on { outline: 2px solid var(--accent); }
.mat-batch { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.03); }
.mat-batch label { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.mat-batch .btn-danger { padding: 7px 12px; }
.mat-body p { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* ---------- sheet ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(5,6,9,.55); backdrop-filter: blur(4px); }
.sheet {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(620px, 100%); border-radius: 26px 0 0 26px;
  background: rgba(20, 23, 30, .92); box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.sheet-grip { display: none; }
.sheet-close { position: absolute; top: 16px; right: 16px; z-index: 2; }
.icon-btn { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; border: 1px solid var(--line2); background: rgba(255,255,255,.04); }
.sheet-body { overflow-y: auto; padding: 30px 30px calc(30px + var(--safe-b)); flex: 1; overscroll-behavior: contain; }
.sheet-body h2 { font-size: 22px; line-height: 1.4; margin: 10px 46px 12px 0; }
.sheet-body .meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); }
.hook { margin: 6px 0 18px; padding: 12px 16px; border-radius: 12px; background: rgba(254,178,1,.08); border: 1px solid rgba(254,178,1,.2); color: #ffd56b; font-weight: 600; }
.script { white-space: pre-wrap; font-size: 15.5px; line-height: 1.95; color: #dfe2ea; }
.script p { margin-bottom: 4px; }
.section-label { font-size: 12px; color: var(--muted); letter-spacing: 1.5px; margin: 22px 0 8px; font-weight: 700; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-size: 12.5px; color: var(--accent2); background: rgba(63,208,201,.08); border-radius: 999px; padding: 3px 10px; }
.shoot { font-size: 13.5px; color: var(--muted); background: rgba(255,255,255,.03); border: 1px dashed var(--line2); border-radius: 12px; padding: 10px 14px; }
.sheet .marks { margin-top: 22px; }
.sheet .mark-btn { padding: 12px 0; font-size: 14px; }
.note { width: 100%; min-height: 84px; resize: vertical; border-radius: 12px; border: 1px solid var(--line2); background: rgba(0,0,0,.25); padding: 12px 14px; outline: none; font-size: 14px; }
.note:focus { border-color: var(--accent); }
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.btn-ghost, .btn-danger, .btn-solid {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 11px; font-size: 13.5px; font-weight: 600;
  border: 1px solid var(--line2); transition: background .2s, border-color .2s; text-decoration: none; color: var(--text);
}
.btn-ghost:hover { background: rgba(255,255,255,.06); }
.btn-solid { background: var(--accent); color: #0d0f14; border-color: var(--accent); }
.btn-solid[disabled] { opacity: .4; cursor: not-allowed; }
.btn-danger { background: rgba(255,107,129,.12); border-color: rgba(255,107,129,.4); color: var(--skip); }
.btn-ghost svg, .btn-solid svg, .btn-danger svg { width: 16px; height: 16px; }
.doc h3 { font-size: 16px; margin: 20px 0 8px; color: var(--accent); }
.doc p { color: #dfe2ea; margin: 6px 0; }
.doc ul, .doc ol { padding-left: 20px; color: #dfe2ea; }
.doc li { margin: 4px 0; }
.doc blockquote { border-left: 3px solid var(--accent2); padding: 4px 12px; color: var(--muted); margin: 8px 0; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.doc-hero { width: 100%; max-height: 300px; object-fit: cover; object-position: top; border-radius: 16px; margin: 4px 0 8px; }
.doc-portrait { width: 100%; height: auto; max-height: none; object-fit: contain; background: #0d0f14; border-radius: 16px; margin: 4px 0 8px; }
.player { width: 100%; max-height: 62vh; border-radius: 16px; background: #000; margin-top: 8px; }
.caption { white-space: pre-wrap; font-size: 14px; background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: #dfe2ea; }
.files { display: grid; gap: 8px; }
.file { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.02); color: var(--text); text-decoration: none; font-size: 13.5px; transition: border-color .2s; }
.file:hover { border-color: var(--accent2); }
.file span { flex: 1; }
.file svg { color: var(--accent2); }

/* admin */
.admin-grid { display: grid; gap: 10px; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { padding: 14px; border-radius: 14px; background: rgba(255,255,255,.03); border: 1px solid var(--line); }
.stat b { display: block; font-size: 24px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; }
.table td:not(.wrap) { white-space: nowrap; }
.table td.wrap { min-width: 160px; }
.table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.pill { font-size: 11.5px; padding: 1px 8px; border-radius: 999px; font-weight: 700; color: #0d0f14; white-space: nowrap; }
.pill.pick { background: var(--pick); } .pill.maybe { background: var(--maybe); } .pill.skip { background: var(--skip); }
.linkish { color: var(--accent2); text-align: left; font-size: inherit; }
.linkish:hover { text-decoration: underline; }
.sync-msg { font-size: 13px; color: var(--muted); }

/* confirm + toast */
.confirm-wrap { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; background: rgba(5,6,9,.62); padding: 20px; }
.confirm-wrap .btn-danger { background: var(--skip); color: #fff; border-color: var(--skip); }
.confirm { width: min(380px, 100%); border-radius: 20px; padding: 22px; box-shadow: var(--shadow); background: rgba(23,26,33,.95); }
.confirm p { font-size: 15px; margin-bottom: 18px; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }
.toast {
  position: fixed; z-index: 100; left: 50%; bottom: calc(28px + var(--safe-b)); transform: translate(-50%, 140%);
  padding: 11px 18px; border-radius: 12px; background: rgba(238,240,245,.96); color: #0d0f14; font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; max-width: calc(100vw - 32px);
}

.skeleton { border-radius: var(--radius); height: 170px; background: linear-gradient(100deg, rgba(255,255,255,.03) 30%, rgba(255,255,255,.07) 50%, rgba(255,255,255,.03) 70%); background-size: 200% 100%; animation: sk 1.3s linear infinite; border: 1px solid var(--line); }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  /* backdrop-filter 会让 fixed 的底部栏以顶栏为定位基准 */
  .topbar { padding: 10px 16px; backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(13,15,20,.94); }
  .brand-sub { display: none; }
  .brand-name { font-size: 13px; white-space: nowrap; }
  .tabs {
    position: fixed; left: 12px; right: 12px; bottom: calc(10px + var(--safe-b)); z-index: 30; justify-content: space-around;
    background: rgba(20,23,30,.88); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-radius: 20px; padding: 6px;
    box-shadow: 0 12px 40px rgba(0,0,0,.5);
  }
  .tab { flex: 1; flex-direction: column; gap: 2px; padding: 6px 0; font-size: 10px; justify-content: center; }
  .ent-switch { max-width: 120px; }
  .tab svg { width: 20px; height: 20px; }
  .tab-ink { border-radius: 14px; }
  .stage { padding: 20px 14px calc(110px + var(--safe-b)); }
  .topic-grid, .kb-grid { grid-template-columns: 1fr; }
  .mat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .mat-body { padding: 10px 12px 12px; }
  .mat-body h3 { font-size: 13.5px; }
  .search { flex: 1 1 100%; min-width: 0; }
  .topic-layout { grid-template-columns: 1fr; }
  .chart-grid { grid-template-columns: 1fr; }
  .topic-line { grid-template-columns: 72px minmax(0, 1fr); }
  .heat { padding: 8px; }
  .heat b { font-size: 16px; }
  .heat-meter { height: 48px; }
  .topic-side { position: static; }
  .accounts { grid-template-columns: 1fr; gap: 10px; }
  .account { padding: 12px; gap: 12px; }
  .account img, .account .ph { width: 48px; height: 48px; border-radius: 14px; }
  .account-name { font-size: 14px; }
  .ring, .ring svg { width: 48px; height: 48px; }
  .sheet { top: auto; left: 0; width: 100%; height: 92vh; border-radius: 24px 24px 0 0; }
  .sheet-grip { display: block; width: 42px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.2); margin: 10px auto 0; }
  .sheet-body { padding: 18px 18px calc(24px + var(--safe-b)); }
  .sheet-body h2 { font-size: 19px; }
  .sheet-close { top: 12px; right: 12px; }
  .stat-row { grid-template-columns: repeat(3, 1fr); }
  .user-chip { max-width: 120px; }
}

.ent-switch { max-width: 180px; padding: 8px 10px; font-size: 13px; }

.cal { padding: 14px; border-radius: var(--radius); margin-bottom: 16px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head b { font-size: 15px; }
.cal-nav { width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--line); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow, .cal-day { text-align: center; font-size: 12px; }
.cal-dow { color: var(--faint); padding-bottom: 4px; }
.cal-day { position: relative; height: 34px; border-radius: 10px; color: var(--faint); }
.cal-day.in { color: var(--text); }
.cal-day.has { background: rgba(255,255,255,.05); }
.cal-day.on { background: var(--accent); color: #0d0f14; font-weight: 800; }
.cal-day.today:not(.on) { box-shadow: inset 0 0 0 1px var(--accent2); }
.cal-day i { position: absolute; left: 50%; bottom: 4px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent2); }
.cal-day.on i { background: #0d0f14; }

.submit-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 0 14px; padding: 12px 14px; border-radius: 16px;
}
.submit-bar b { font-size: 14px; }
.submit-bar span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.submit-bar .btn-solid { width: auto; white-space: nowrap; }

.mat-group { margin: 8px 0 26px; }
.mat-group h2 { font-size: 15px; margin: 0 0 12px; color: var(--accent); }
.mat-sub { margin-bottom: 16px; }
.mat-sub h3 { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 8px; }
#mat-accounts { margin-bottom: 16px; }
.mat-thumbstrip { display: flex; gap: 8px; overflow-x: auto; margin: 12px 0; }
.mat-thumbstrip img, .doc-hero { cursor: zoom-in; }
.mat-thumbstrip img { width: 92px; height: 122px; object-fit: cover; border-radius: 12px; background: #000; flex: none; }
.lightbox { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; }
.lightbox[hidden] { display: none !important; }
.lb-backdrop { position: absolute; inset: 0; border: 0; background: rgba(5,6,9,.88); cursor: zoom-out; }
.lb-close { position: absolute; top: 16px; right: 16px; z-index: 2; }
.lb-nav { position: absolute; top: 50%; z-index: 2; width: 44px; height: 44px; margin-top: -22px; border: 0; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; cursor: pointer; }
.lb-nav svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lb-nav.prev { left: 12px; }
.lb-nav.next { right: 12px; }
.lightbox img { position: relative; z-index: 1; max-width: min(920px, 86vw); max-height: 86vh; object-fit: contain; border-radius: 12px; background: #000; }
.lb-count { position: absolute; left: 0; right: 0; bottom: 18px; z-index: 2; text-align: center; color: #fff; font-size: 13px; }
.cos-tag { color: var(--accent2); font-size: 11px; margin-left: 6px; }

.trend-weeks { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 14px; }
.plat-row, .bar-list { display: grid; gap: 10px; margin-bottom: 16px; }
.plat-row { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.plat { padding: 14px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.plat b { font-size: 22px; }
.plat span, .hit-meta { color: var(--muted); font-size: 12px; }
.bar { display: grid; grid-template-columns: 120px 1fr 36px; gap: 8px; align-items: center; font-size: 12.5px; }
.bar u { display: block; height: 8px; border-radius: 99px; background: rgba(255,255,255,.06); overflow: hidden; }
.bar u i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent2), var(--accent)); }
.hit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.hit { border-radius: 16px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); cursor: pointer; text-align: left; }
.hit img, .hit .ph { width: 100%; aspect-ratio: 3/4; object-fit: cover; background: #151820; display: grid; place-items: center; color: var(--faint); }
.hit div { padding: 10px 12px 12px; }
.hit h3 { font-size: 13.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-bottom: 18px; }
.admin-card { padding: 16px; border-radius: var(--radius); }
.admin-card h3 { margin-bottom: 10px; font-size: 15px; }
.admin-card .field { margin-bottom: 8px; }
.admin-card .btn-solid { width: 100%; }
.plain { display: grid; gap: 6px; margin-bottom: 8px; font-size: 12.5px; color: var(--muted); }
.plain select, .ent-switch {
  color-scheme: light;
  padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line2);
  background: #1c1f27; color: #f4f5f7; font-size: 14px;
}
.plain select option, .ent-switch option { background: #fff; color: #16181d; }

@media (max-width: 760px) {
  .bar { grid-template-columns: 88px 1fr 32px; }
  .hit-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .shine, .skeleton { animation: none; }
  * { transition-duration: .01ms !important; }
}
