/* ============================================================
   栖影 · TailHome Cinema
   A private, tailnet-only screening room.
   ============================================================ */

:root {
  --bg: #080b10;
  --bg-deep: #06080b;
  --bg-soft: #0c1016;
  --panel: #0f141b;
  --panel-2: #131922;
  --panel-3: #18202a;
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f2ede3;
  --text-soft: #c3bcaf;
  --muted: #8b94a0;
  --faint: #5d6673;
  --gold: #e8b86d;
  --gold-bright: #f7d49a;
  --gold-dim: rgba(232, 184, 109, 0.12);
  --gold-line: rgba(232, 184, 109, 0.28);
  --mint: #7ad8c2;
  --mint-dim: rgba(122, 216, 194, 0.12);
  --coral: #e88b74;
  --danger: #ef817b;
  --danger-dim: rgba(239, 129, 123, 0.12);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --sidebar: 248px;
  --topbar: 72px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
  --shadow-soft: 0 12px 40px rgba(0, 0, 0, 0.28);
  --font-sans: "SF Pro SC", "PingFang SC", "Microsoft YaHei", "Noto Sans SC",
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-latin: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --font-mono: "SFMono-Regular", "Cascadia Code", "Consolas", monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

:root[data-accent="mint"] {
  --gold: #7ad8c2;
  --gold-bright: #b3f0e2;
  --gold-dim: rgba(122, 216, 194, 0.12);
  --gold-line: rgba(122, 216, 194, 0.3);
  --coral: #e8b86d;
}

:root[data-accent="rose"] {
  --gold: #e9a18b;
  --gold-bright: #f8cbbd;
  --gold-dim: rgba(233, 161, 139, 0.12);
  --gold-line: rgba(233, 161, 139, 0.3);
  --coral: #e8b86d;
}

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

html {
  background: var(--bg);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(1100px 700px at 82% -12%, rgba(232, 184, 109, 0.055), transparent 62%),
    radial-gradient(900px 620px at -10% 26%, rgba(122, 216, 194, 0.035), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.no-scroll { overflow: hidden; }

::selection {
  background: rgba(232, 184, 109, 0.28);
  color: #fff;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border: 3px solid transparent;
  background-clip: padding-box;
  border-radius: 20px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); background-clip: padding-box; }

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img, video { display: block; max-width: 100%; }
svg { display: block; width: 18px; height: 18px; flex: none; }

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 999;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--gold);
  color: #12100b;
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform 0.2s;
}
.skip-link:focus { transform: translateY(0); }

.noscript {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bg);
  z-index: 1000;
  font-size: 18px;
}

/* ---------- boot ---------- */
.boot-screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.boot-mark { width: 58px; height: 58px; color: var(--gold); opacity: 0.9; animation: boot-turn 8s linear infinite; }
.boot-mark svg { width: 100%; height: 100%; }
.boot-word { font-size: 22px; letter-spacing: 0.42em; margin-left: 0.42em; color: var(--text-soft); }
.boot-line { width: 120px; height: 1px; background: var(--line); overflow: hidden; }
.boot-line span {
  display: block;
  width: 40%;
  height: 100%;
  background: var(--gold);
  animation: boot-line 1.2s var(--ease) infinite;
}
@keyframes boot-turn { to { transform: rotate(360deg); } }
@keyframes boot-line {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(320%); }
}

/* ---------- buttons & basics ---------- */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  --btn-line: var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--btn-line);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: transform 0.18s var(--ease), background 0.18s, border-color 0.18s, color 0.18s, opacity 0.18s;
}
.btn:hover { border-color: rgba(255, 255, 255, 0.26); background: rgba(255, 255, 255, 0.04); }
.btn:active { transform: scale(0.975); }
.btn:disabled { opacity: 0.45; pointer-events: none; }
.btn svg { width: 17px; height: 17px; flex: none; }

.btn-primary {
  --btn-bg: linear-gradient(135deg, var(--gold-bright), var(--gold));
  --btn-fg: #16120a;
  --btn-line: transparent;
  box-shadow: 0 8px 24px rgba(232, 184, 109, 0.16);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #ffe1ae, var(--gold-bright));
  border-color: transparent;
  box-shadow: 0 12px 30px rgba(232, 184, 109, 0.24);
}
.btn-ghost { --btn-bg: rgba(255, 255, 255, 0.035); }
.btn-danger { --btn-fg: #ffd7d3; --btn-line: rgba(239, 129, 123, 0.35); --btn-bg: var(--danger-dim); }
.btn-danger:hover { background: rgba(239, 129, 123, 0.2); border-color: rgba(239, 129, 123, 0.55); }
.btn-quiet { border-color: transparent; color: var(--muted); padding: 0 10px; }
.btn-quiet:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.btn-lg { min-height: 48px; padding: 0 22px; font-size: 14.5px; }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 12.5px; }
.btn-icon { width: 40px; min-height: 40px; padding: 0; border-radius: 50%; }
.btn-icon.btn-sm { width: 32px; min-height: 32px; }

.icon-btn {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  transition: 0.18s;
}
.icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); border-color: var(--line); }
.icon-btn svg { width: 18px; height: 18px; }

.spinner {
  width: 17px;
  height: 17px;
  border: 2px solid rgba(0, 0, 0, 0.25);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
.btn-ghost .spinner, .btn-danger .spinner { border-color: rgba(255, 255, 255, 0.18); border-top-color: currentColor; }
.spinner.lg { width: 28px; height: 28px; border-width: 2.5px; }
@keyframes spin { to { transform: rotate(360deg); } }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}
.eyebrow.no-rule::before { display: none; }

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--font-mono); }
.serif { font-family: var(--font-latin); }
.gold { color: var(--gold); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.pill svg { width: 12px; height: 12px; }
.pill.gold { color: var(--gold); border-color: var(--gold-line); background: var(--gold-dim); }
.pill.mint { color: var(--mint); border-color: rgba(122, 216, 194, 0.3); background: var(--mint-dim); }
.pill.danger { color: var(--danger); border-color: rgba(239, 129, 123, 0.3); background: var(--danger-dim); }

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(122, 216, 194, 0.12);
}
.dot.live { background: var(--mint); color: var(--mint); animation: pulse-dot 2.4s infinite; }
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(122, 216, 194, 0.1); }
  50% { box-shadow: 0 0 0 6px rgba(122, 216, 194, 0.02); }
}

/* ---------- auth ---------- */
.auth {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(430px, 0.88fr);
  background: var(--bg-deep);
}

.auth-visual {
  position: relative;
  overflow: hidden;
  padding: clamp(30px, 4.4vw, 64px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(900px 600px at 90% 10%, rgba(232, 184, 109, 0.11), transparent 60%),
    radial-gradient(800px 760px at 4% 90%, rgba(122, 216, 194, 0.06), transparent 60%),
    linear-gradient(160deg, #10141b 0%, #090c11 70%);
  isolation: isolate;
}

.auth-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 60% 40%, #000 20%, transparent 72%);
}
.auth-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.12;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

.auth-brand { position: relative; z-index: 3; display: flex; align-items: center; gap: 12px; }
.auth-brand .mark { width: 36px; height: 36px; color: var(--gold); }
.auth-brand .word { font-size: 17px; letter-spacing: 0.3em; font-weight: 700; }
.auth-brand .sub {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--faint);
  margin-top: 2px;
}

.auth-claim { position: relative; z-index: 3; max-width: 620px; margin-top: auto; padding: 12vh 0 4vh; }
.auth-claim::before {
  content: "";
  position: absolute;
  inset: -40px -120px -24px -60px;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse at 26% 56%, rgba(7, 10, 15, 0.96) 0%, rgba(7, 10, 15, 0.84) 42%, rgba(7, 10, 15, 0) 76%);
}
.auth-claim .eyebrow { margin-bottom: 24px; }
.auth-claim h1 {
  margin: 0;
  font-size: clamp(40px, 4.8vw, 72px);
  line-height: 1.06;
  letter-spacing: -0.035em;
  font-weight: 700;
  text-wrap: balance;
}
.auth-claim h1 .thin {
  color: var(--text-soft);
  font-weight: 300;
}
.auth-claim h1 .gold { color: var(--gold); }
.auth-claim p {
  margin: 26px 0 0;
  max-width: 440px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.9;
}
.auth-specs {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.auth-spec { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11.5px; letter-spacing: 0.04em; }
.auth-spec svg { width: 14px; height: 14px; color: var(--gold); }

.auth-posters {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, transparent 38%, #000 58%);
  mask-image: linear-gradient(90deg, transparent 0, transparent 38%, #000 58%);
}
.poster {
  position: absolute;
  width: clamp(170px, 17vw, 250px);
  aspect-ratio: 2 / 3;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  opacity: 0.85;
}
.poster::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.12), transparent 35%),
    radial-gradient(circle at 65% 24%, rgba(255, 255, 255, 0.32), transparent 12%),
    linear-gradient(160deg, var(--p1), var(--p2) 58%, #07090d);
}
.poster::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, rgba(4, 6, 9, 0.78), transparent 42%),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.12) 0 1px, transparent 1px 3px);
}
.poster .poster-label {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 13px;
  z-index: 2;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.68);
  font-family: var(--font-mono);
}
.poster .poster-title {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 30px;
  z-index: 2;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
}
.poster .poster-num {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
}
.poster.p1 { --p1: #3c2b20; --p2: #8c5f36; top: 12%; right: 9%; transform: rotate(7deg); animation: float-a 12s ease-in-out infinite; }
.poster.p2 { --p1: #1c2e2c; --p2: #3d6e65; top: 38%; right: 32%; transform: rotate(-6deg); opacity: 0.55; animation: float-b 15s ease-in-out infinite; display: none; }
.poster.p3 { --p1: #2b1c1d; --p2: #7a4a45; top: 55%; right: -4%; transform: rotate(12deg); opacity: 0.4; animation: float-a 18s ease-in-out infinite reverse; }
@keyframes float-a { 0%, 100% { translate: 0 0; } 50% { translate: 0 -14px; } }
@keyframes float-b { 0%, 100% { translate: 0 0; } 50% { translate: 8px 15px; } }

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 4vw, 64px);
  background:
    radial-gradient(600px 400px at 100% 0%, rgba(232, 184, 109, 0.05), transparent 60%),
    var(--bg-soft);
}
.auth-card { width: 100%; max-width: 400px; margin: 0 auto; }
.auth-card .auth-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 16px;
}
.auth-card h2 { margin: 0; font-size: 32px; letter-spacing: -0.025em; font-weight: 700; }
.auth-card .auth-lead { margin: 10px 0 30px; color: var(--muted); font-size: 13.5px; line-height: 1.8; }

.auth-form { display: flex; flex-direction: column; gap: 16px; }
.field { position: relative; display: flex; flex-direction: column; }
.field > label {
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.06em;
  margin-bottom: 7px;
  font-weight: 600;
}
.input, .textarea, .select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.028);
  color: var(--text);
  padding: 12px 14px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--gold-line);
  background: rgba(255, 255, 255, 0.045);
  box-shadow: 0 0 0 3px rgba(232, 184, 109, 0.08);
}
.input { height: 48px; }
.textarea { min-height: 120px; resize: vertical; line-height: 1.7; }
.select {
  height: 40px;
  padding: 0 34px 0 12px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b94a0' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.field-hint { font-size: 11px; color: var(--faint); margin-top: 6px; line-height: 1.6; }
.field-error { font-size: 12px; color: var(--danger); margin-top: 6px; }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 46px; }
.input-action {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
}
.form-error {
  display: none;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(239, 129, 123, 0.26);
  background: var(--danger-dim);
  color: #ffc2be;
  font-size: 12.5px;
  line-height: 1.6;
}
.form-error.visible { display: flex; }
.form-error svg { width: 15px; height: 15px; flex: none; margin-top: 1px; }
.auth-form .btn { width: 100%; margin-top: 4px; }
.auth-foot { display: flex; justify-content: space-between; gap: 16px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 11px; color: var(--faint); }
.auth-foot .mono { letter-spacing: 0.08em; }
.auth-note {
  margin-top: 24px;
  padding: 12px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  display: flex;
  gap: 10px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.65;
}
.auth-note svg { width: 15px; height: 15px; flex: none; margin-top: 1px; color: var(--gold); }
.auth-mobile-brand { display: none; }

/* ---------- shell ---------- */
.shell { min-height: 100dvh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  padding: 24px 16px 18px;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(400px 300px at 0% 0%, rgba(232, 184, 109, 0.04), transparent 70%),
    rgba(8, 11, 16, 0.92);
  backdrop-filter: blur(18px);
}
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 4px 10px 28px; }
.sidebar-brand .mark { width: 34px; height: 34px; color: var(--gold); flex: none; }
.sidebar-brand .word { font-size: 17px; font-weight: 700; letter-spacing: 0.28em; line-height: 1.1; }
.sidebar-brand .sub {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.18em;
  color: var(--faint);
  margin-top: 3px;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-group { margin-top: 18px; }
.nav-label {
  padding: 0 12px;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--faint);
  text-transform: uppercase;
}
.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  height: 42px;
  padding: 0 12px;
  border-radius: 11px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  transition: 0.18s;
}
.nav-link svg { width: 18px; height: 18px; flex: none; opacity: 0.85; }
.nav-link:hover { color: var(--text); background: rgba(255, 255, 255, 0.045); }
.nav-link.active {
  color: var(--text);
  background: linear-gradient(100deg, rgba(232, 184, 109, 0.12), rgba(232, 184, 109, 0.02));
  border: 1px solid rgba(232, 184, 109, 0.12);
}
.nav-link.active::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 11px;
  bottom: 11px;
  width: 2px;
  border-radius: 2px;
  background: var(--gold);
  box-shadow: 0 0 12px var(--gold);
}
.nav-link.active svg { color: var(--gold); opacity: 1; }
.nav-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--gold);
  color: #16120a;
  font-size: 10px;
  font-weight: 800;
}
.nav-badge:empty { display: none; }

.sidebar-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.storage-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.022);
}
.storage-card .row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.storage-card .label { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.16em; color: var(--faint); }
.storage-card .value { font-size: 12px; color: var(--text-soft); font-weight: 600; }
.storage-bar { height: 3px; border-radius: 4px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.storage-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--gold-bright)); transition: width 0.6s var(--ease); }
.storage-card .hint { margin-top: 9px; color: var(--faint); font-size: 10px; }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: 0.18s;
  cursor: pointer;
}
.sidebar-user:hover { background: rgba(255, 255, 255, 0.04); border-color: var(--line); }
.avatar {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent, #f0b86e);
  color: #12100b;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.avatar.lg { width: 54px; height: 54px; font-size: 19px; }
.avatar.sm { width: 26px; height: 26px; font-size: 10px; }
.sidebar-user .who { min-width: 0; flex: 1; }
.sidebar-user .name { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user .role { font-size: 10px; color: var(--faint); margin-top: 1px; }
.sidebar-user .more { color: var(--faint); }
.sidebar-user .more svg { width: 16px; height: 16px; }
.tailnet-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
}
.tailnet-chip .dot { color: var(--mint); }

.shell-main { margin-left: var(--sidebar); min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar);
  padding: 0 clamp(20px, 3vw, 40px);
  display: flex;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 11, 16, 0.78);
  backdrop-filter: blur(20px) saturate(1.2);
}
.topbar-context { min-width: 0; flex: none; display: flex; align-items: center; gap: 13px; }
.topbar-context .ctx-rule { width: 1px; height: 20px; background: var(--line-strong); }
.topbar-context .ctx-label { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.18em; color: var(--faint); }
.topbar-context .ctx-title { font-size: 13px; font-weight: 600; color: var(--text-soft); }

.searchbar {
  margin-left: auto;
  position: relative;
  width: min(360px, 34vw);
}
.searchbar svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--faint); pointer-events: none; }
.searchbar input {
  width: 100%;
  height: 38px;
  padding: 0 48px 0 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 12.5px;
  outline: none;
  transition: 0.18s;
}
.searchbar input:focus { border-color: var(--gold-line); background: rgba(255, 255, 255, 0.05); width: 100%; }
.searchbar kbd {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 10px;
  background: rgba(0, 0, 0, 0.18);
}
.top-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.top-avatar { width: 36px; height: 36px; padding: 0; border: 1px solid var(--line-strong); border-radius: 50%; background: transparent; }
.top-avatar .avatar { width: 32px; height: 32px; border: none; }

.view { max-width: 1580px; margin: 0 auto; padding: clamp(24px, 3.2vw, 42px) clamp(20px, 3vw, 40px) 90px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.page-head .titles { min-width: 0; }
.page-head h1 { margin: 9px 0 0; font-size: clamp(28px, 3vw, 40px); line-height: 1.12; letter-spacing: -0.035em; font-weight: 700; }
.page-head p { margin: 9px 0 0; color: var(--muted); font-size: 13px; }
.page-head .actions { display: flex; align-items: center; gap: 10px; flex: none; }

.mobile-brand { display: none; }

/* ---------- home ---------- */
.hero {
  position: relative;
  min-height: clamp(420px, 56vh, 560px);
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0d1218;
  isolation: isolate;
}
.hero-bg { position: absolute; inset: 0; z-index: -2; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.015); filter: saturate(0.92) brightness(0.78); }
.hero-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(6, 8, 12, 0.97) 0%, rgba(6, 8, 12, 0.82) 36%, rgba(6, 8, 12, 0.2) 75%, rgba(6, 8, 12, 0.08) 100%),
    linear-gradient(0deg, rgba(6, 8, 12, 0.96) 0%, transparent 55%);
}
.hero-content { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: inherit; max-width: 680px; padding: clamp(26px, 4vw, 54px); }
.hero-top { position: absolute; top: clamp(22px, 3vw, 34px); left: clamp(26px, 4vw, 54px); display: flex; align-items: center; gap: 10px; }
.hero h2 {
  margin: 14px 0 0;
  font-size: clamp(34px, 4.4vw, 60px);
  line-height: 1.04;
  letter-spacing: -0.045em;
  font-weight: 700;
  text-wrap: balance;
}
.hero-desc {
  margin: 18px 0 0;
  max-width: 520px;
  color: var(--text-soft);
  font-size: 13.5px;
  line-height: 1.8;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 18px; color: var(--muted); font-size: 11.5px; }
.hero-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.hero-stats {
  position: absolute;
  right: clamp(22px, 3vw, 36px);
  bottom: clamp(22px, 3vw, 36px);
  display: flex;
  gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(8, 11, 16, 0.58);
  backdrop-filter: blur(16px);
  overflow: hidden;
}
.hero-stat { padding: 12px 18px; border-left: 1px solid rgba(255, 255, 255, 0.08); }
.hero-stat:first-child { border-left: 0; }
.hero-stat .n { font-family: var(--font-latin); font-size: 20px; line-height: 1; color: var(--text); }
.hero-stat .l { margin-top: 5px; font-size: 9px; color: var(--faint); letter-spacing: 0.1em; }

.home-empty {
  position: relative;
  min-height: 440px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background:
    radial-gradient(700px 420px at 70% 20%, rgba(232, 184, 109, 0.09), transparent 60%),
    linear-gradient(150deg, #10151d, #080b10);
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: clamp(28px, 4vw, 56px);
}
.home-empty::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(circle at 70% 40%, #000, transparent 68%);
}
.empty-frames { position: absolute; right: 3%; top: 50%; transform: translateY(-50%); display: flex; gap: 14px; opacity: 0.55; }
.empty-frame {
  width: clamp(100px, 12vw, 170px);
  aspect-ratio: 2 / 3;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(232, 184, 109, 0.13), rgba(255, 255, 255, 0.015));
  transform: rotate(-7deg) translateY(10px);
}
.empty-frame:nth-child(2) { transform: rotate(2deg) translateY(-16px); background: linear-gradient(160deg, rgba(122, 216, 194, 0.1), rgba(255, 255, 255, 0.015)); }
.empty-frame:nth-child(3) { transform: rotate(9deg) translateY(16px); }
.home-empty .copy { position: relative; max-width: 580px; }
.home-empty h2 { margin: 16px 0 0; font-size: clamp(32px, 4vw, 52px); line-height: 1.08; letter-spacing: -0.04em; }
.home-empty p { margin: 16px 0 0; color: var(--muted); font-size: 14px; line-height: 1.85; max-width: 440px; }
.home-empty .actions { margin-top: 26px; display: flex; gap: 10px; flex-wrap: wrap; }

.home-section { margin-top: clamp(34px, 4.4vw, 56px); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-head h3 { margin: 0; font-size: 20px; letter-spacing: -0.02em; font-weight: 650; }
.section-head .sub { margin: 5px 0 0; color: var(--faint); font-size: 11.5px; }
.section-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; transition: 0.18s; }
.section-link:hover { color: var(--gold); gap: 9px; }
.section-link svg { width: 14px; height: 14px; }

.home-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 22px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.home-stat { padding: 18px 6px 18px 0; display: flex; align-items: baseline; gap: 10px; }
.home-stat + .home-stat { padding-left: 22px; border-left: 1px solid var(--line); }
.home-stat .n { font-family: var(--font-latin); font-size: 26px; line-height: 1; letter-spacing: -0.02em; }
.home-stat .l { color: var(--faint); font-size: 10.5px; letter-spacing: 0.04em; }

.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(250px, 300px);
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }

/* home discovery rows */
.home-rail-head { margin-bottom: 4px; }
.home-rail-section { margin-top: 26px; }
.home-rail-section:first-of-type { margin-top: 18px; }
.home-rail { grid-auto-columns: minmax(210px, 238px); gap: 14px; }
.home-rail-card { min-width: 0; cursor: pointer; }
.home-rail-thumb { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #0b0f14; }
.home-rail-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .45s var(--ease), filter .25s; }
.home-rail-card:hover .home-rail-thumb img { transform: scale(1.035); filter: brightness(.82); }
.home-rail-thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(4,6,9,.68), transparent 55%); pointer-events: none; }
.home-rail-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(4,6,9,.45); border: 1px solid rgba(255,255,255,.35); opacity: 0; transition: opacity .2s; z-index: 2; }
.home-rail-play svg { width: 15px; height: 15px; }
.home-rail-card:hover .home-rail-play { opacity: 1; }
.home-rail-count { position: absolute; left: 7px; bottom: 7px; z-index: 2; display: inline-flex; align-items: center; gap: 3px; padding: 3px 6px; border-radius: 4px; color: #fff; background: rgba(4,6,9,.64); font-family: var(--font-mono); font-size: 8px; }
.home-rail-count svg { width: 10px; height: 10px; color: var(--gold); }
.home-rail-processing { position: absolute; right: 7px; top: 7px; z-index: 2; padding: 3px 6px; border-radius: 4px; color: var(--text); background: rgba(4,6,9,.7); font-size: 8px; }
.home-rail-body { padding: 8px 2px 0; }
.home-rail-title { color: var(--text); font-size: 12px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-rail-meta { color: var(--faint); font-size: 9.5px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-period-wrap { position: relative; flex: none; }
.home-period-trigger { border: 0; background: transparent; font: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.home-period-trigger svg { width: 13px; height: 13px; }
.home-period-menu { position: absolute; right: 0; top: calc(100% + 7px); z-index: 30; min-width: 132px; padding: 5px; border: 1px solid var(--line-strong); border-radius: 9px; background: #10161d; box-shadow: var(--shadow-soft); }
.home-period-menu[hidden] { display: none; }
.home-period-menu button { display: block; width: 100%; border: 0; border-radius: 6px; padding: 7px 9px; text-align: left; color: var(--text-soft); background: transparent; font-size: 11px; cursor: pointer; }
.home-period-menu button:hover { background: rgba(255,255,255,.06); color: var(--text); }
.home-period-menu button.active { color: var(--gold); background: rgba(232,184,109,.08); }

.popular-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 26px; }
.popular-item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; min-width: 0; }
.popular-item:last-child { border-bottom: 0; }
.popular-item .rank {
  width: 28px;
  flex: none;
  font-family: var(--font-latin);
  font-size: 17px;
  color: var(--faint);
  font-style: italic;
}
.popular-item:nth-child(-n+2) .rank { color: var(--gold); }
.popular-item .thumb { width: 78px; aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden; flex: none; background: var(--panel-3); }
.popular-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.popular-item .copy { min-width: 0; flex: 1; }
.popular-item .title { font-size: 13px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.popular-item .meta { margin-top: 3px; color: var(--faint); font-size: 10.5px; }
.popular-item .arrow { color: var(--faint); transition: 0.18s; }
.popular-item:hover .arrow { color: var(--gold); transform: translateX(3px); }
.popular-item .arrow svg { width: 16px; height: 16px; }

.image-wall { columns: 3; column-gap: 14px; }
.wall-item {
  position: relative;
  display: block;
  margin: 0 0 14px;
  break-inside: avoid;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel-3);
  cursor: pointer;
}
.wall-item img { width: 100%; height: auto; min-height: 140px; object-fit: cover; transition: transform 0.5s var(--ease), filter 0.3s; }
.wall-item:hover img { transform: scale(1.035); filter: brightness(0.75); }
.wall-item .overlay {
  position: absolute;
  inset: auto 0 0;
  padding: 32px 14px 12px;
  background: linear-gradient(0deg, rgba(4, 6, 9, 0.88), transparent);
  opacity: 0;
  transition: opacity 0.25s;
}
.wall-item:hover .overlay { opacity: 1; }
.wall-item .overlay .t { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wall-item .overlay .m { color: var(--muted); font-size: 10px; margin-top: 2px; }

.announce {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 18px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(232, 184, 109, 0.055), rgba(255, 255, 255, 0.015));
  color: var(--text-soft);
  font-size: 12.5px;
  line-height: 1.75;
}
.announce svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--gold); }
.announce .label { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.16em; color: var(--gold); margin-right: 8px; }

/* ---------- media cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(246px, 1fr));
  gap: 18px;
}
.media-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--panel);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.28s var(--ease), border-color 0.28s, box-shadow 0.28s;
}
.media-card:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: var(--shadow-soft); }
.card-visual { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: linear-gradient(150deg, #1a222c, #0e131a); }
.card-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(4, 6, 9, 0.55), transparent 46%);
  pointer-events: none;
}
.card-visual .thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease), opacity 0.3s;
}
.media-card:hover .card-visual .thumb { transform: scale(1.045); }
.card-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s;
  z-index: 1;
}
.media-card.is-previewing .card-preview { opacity: 1; }
.media-card.is-previewing .thumb { opacity: 0; }
.card-fallback {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--faint);
  background: radial-gradient(ellipse at 50% 45%, rgba(232, 184, 109, 0.09), transparent 65%), #121821;
}
.card-fallback svg { width: 28px; height: 28px; opacity: 0.6; }
.card-fallback span { font-size: 9px; letter-spacing: 0.14em; }
.card-visual.broken .card-fallback { display: flex; }
.card-visual.broken .thumb, .card-visual.broken .card-preview { display: none; }

.card-top { position: absolute; inset: 11px 11px auto; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: rgba(6, 8, 11, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.82);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.08em;
}
.badge svg { width: 11px; height: 11px; }
.badge.duration { font-family: var(--font-mono); letter-spacing: 0.04em; }
.badge.status-processing { color: var(--gold-bright); border-color: var(--gold-line); }
.badge.status-failed { color: #ffc0bc; border-color: rgba(239, 129, 123, 0.35); }
.card-top-right { display: flex; gap: 6px; }

.play-orb {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.82);
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(7, 9, 13, 0.38);
  backdrop-filter: blur(10px);
  color: #fff;
  opacity: 0;
  transition: 0.28s var(--ease);
}
.play-orb svg { width: 18px; height: 18px; margin-left: 2px; }
.media-card:hover .play-orb { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.card-info { padding: 13px 15px 14px; min-width: 0; }
.card-title { font-size: 13.5px; font-weight: 600; line-height: 1.45; letter-spacing: -0.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { display: flex; align-items: center; gap: 7px; margin-top: 7px; color: var(--faint); font-size: 10.5px; }
.card-meta .sep { width: 2px; height: 2px; border-radius: 50%; background: var(--faint); }
.card-meta .owner { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.card-meta .owner .avatar { width: 16px; height: 16px; font-size: 7px; border: none; }
.card-meta .owner span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-edit {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 5;
  opacity: 0;
  transition: 0.2s;
}
.media-card:hover .card-edit { opacity: 1; }

/* ---------- library ---------- */
.category-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  min-width: 0;
}
.category-strip-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
}
.category-strip-label svg { width: 13px; height: 13px; }
.category-strip-scroll { display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; min-width: 0; padding: 2px; }
.category-strip-scroll::-webkit-scrollbar { display: none; }
.cat-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  transition: 0.18s;
}
.cat-chip span { color: var(--faint); font-family: var(--font-mono); font-size: 9px; }
.cat-chip:hover { color: var(--text); border-color: var(--line-strong); }
.cat-chip.active { color: var(--gold-bright); border-color: var(--gold-line); background: var(--gold-dim); }
.cat-chip.active span { color: var(--gold); }
.home-category-row { margin-top: 18px; }
.home-category-row .category-strip { margin: 0; }
.library-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 24px; }
.library-head h1 { margin: 8px 0 0; font-size: clamp(30px, 3.4vw, 46px); letter-spacing: -0.04em; line-height: 1.1; }
.library-head .count { color: var(--faint); font-family: var(--font-latin); font-size: 17px; margin-left: 10px; letter-spacing: 0; }
.library-head p { margin: 8px 0 0; color: var(--muted); font-size: 12.5px; }
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 0 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, 0.02); }
.segmented button {
  height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
  transition: 0.18s;
}
.segmented button:hover { color: var(--text); }
.segmented button.active { background: rgba(232, 184, 109, 0.14); color: var(--gold-bright); box-shadow: inset 0 0 0 1px rgba(232, 184, 109, 0.2); }
.toolbar-spacer { flex: 1; }
.toolbar .select { width: auto; min-width: 118px; height: 34px; border-radius: 999px; font-size: 12px; }
.toolbar .search-inline { position: relative; width: 220px; }
.toolbar .search-inline svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--faint); }
.toolbar .search-inline input {
  width: 100%;
  height: 34px;
  padding: 0 12px 0 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  font-size: 12px;
  outline: none;
}
.toolbar .search-inline input:focus { border-color: var(--gold-line); }
.active-filter { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 11px; }
.active-filter button { border: 0; background: none; color: var(--muted); padding: 0; line-height: 0; }
.active-filter svg { width: 12px; height: 12px; }

.load-more { display: flex; justify-content: center; margin-top: 32px; }

.empty-state {
  min-height: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: radial-gradient(400px 300px at 50% 0%, rgba(232, 184, 109, 0.04), transparent 70%);
}
.empty-state .empty-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  color: var(--faint);
  margin-bottom: 20px;
}
.empty-state .empty-icon svg { width: 28px; height: 28px; }
.empty-state h3 { margin: 0; font-size: 20px; letter-spacing: -0.02em; }
.empty-state p { margin: 9px 0 22px; max-width: 380px; color: var(--muted); font-size: 12.5px; line-height: 1.8; }
.empty-state .actions { display: flex; gap: 10px; }

/* ---------- skeletons ---------- */
.skeleton { position: relative; overflow: hidden; background: rgba(255, 255, 255, 0.04); border-radius: 8px; }
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.055), transparent);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.skeleton-card { border: 1px solid var(--line); border-radius: 15px; overflow: hidden; background: var(--panel); }
.skeleton-card .sk-v { aspect-ratio: 16 / 10; }
.skeleton-card .sk-b { padding: 14px; display: flex; flex-direction: column; gap: 9px; }
.skeleton-card .sk-b .l1 { height: 12px; width: 74%; }
.skeleton-card .sk-b .l2 { height: 9px; width: 45%; }

/* ---------- viewer ---------- */
.viewer {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  background: rgba(4, 6, 9, 0.97);
  backdrop-filter: blur(24px);
  animation: viewer-in 0.32s var(--ease);
}
@keyframes viewer-in { from { opacity: 0; } to { opacity: 1; } }
.viewer-top {
  height: 68px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 clamp(16px, 2.4vw, 28px);
  border-bottom: 1px solid var(--line);
  background: rgba(6, 8, 11, 0.55);
}
.viewer-top .v-title { min-width: 0; flex: 1; }
.viewer-top .v-title .k { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.18em; color: var(--faint); }
.viewer-top .v-title .t { margin-top: 2px; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-top .v-actions { display: flex; align-items: center; gap: 7px; }
.viewer-close { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: rgba(255, 255, 255, 0.04); color: var(--text); display: grid; place-items: center; }
.viewer-close:hover { background: rgba(255, 255, 255, 0.09); }
.viewer-close svg { width: 18px; height: 18px; }
.viewer-main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 350px; }
.viewer-left { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; background: #05070a; }
.viewer-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: clamp(12px, 2vw, 26px);
  background:
    radial-gradient(ellipse at 50% 45%, rgba(255, 255, 255, 0.028), transparent 65%),
    #05070a;
  overflow: hidden;
}
.viewer-stage video, .viewer-stage .viewer-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  background: #000;
}
.viewer-stage video { width: auto; max-width: 100%; max-height: calc(100dvh - 140px); object-fit: contain; }
.video-shell { position: relative; width: 100%; display: flex; align-items: center; justify-content: center; }
.danmaku-layer { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 3; }
.danmaku-item {
  position: absolute; left: 100%; white-space: nowrap;
  font-size: clamp(13px, 1.4vw, 18px); font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .95), 0 0 14px rgba(0, 0, 0, .65);
  animation: danmaku-fly 8s linear forwards;
}
@keyframes danmaku-fly { from { transform: translateX(0); } to { transform: translateX(calc(-100vw - 100%)); } }
.viewer-image-wrap { position: relative; max-width: 100%; max-height: 100%; display: flex; align-items: center; justify-content: center; overflow: auto; }

/* episodes + tags */
.viewer-episodes { flex: none; border-top: 1px solid var(--line); padding: 12px 22px 13px; background: #070a0e; }
.episode-strip { display: flex; gap: 7px; overflow-x: auto; padding: 3px 1px 5px; margin-top: 7px; scrollbar-width: thin; }
.episode-chip { flex: 0 0 auto; max-width: 230px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 255, 255, .025); color: var(--text-soft); cursor: pointer; text-align: left; }
.episode-chip:hover { border-color: rgba(232, 184, 109, .45); color: var(--text); }
.episode-chip.active { border-color: var(--gold); background: rgba(232, 184, 109, .1); color: var(--gold); }
.episode-chip .ep-no { font-family: var(--font-mono); font-size: 8px; letter-spacing: .08em; opacity: .8; }
.episode-chip .ep-name { font-size: 11px; max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-tags { flex: none; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 9px 22px; border-top: 1px solid var(--line); background: #06090d; }
.tag-label { display: inline-flex; align-items: center; gap: 4px; color: var(--faint); font-family: var(--font-mono); font-size: 8px; letter-spacing: .1em; margin-right: 2px; }
.tag-label svg { width: 11px; height: 11px; }
.tag-chip { display: inline-flex; align-items: center; gap: 3px; padding: 3px 8px; border: 1px solid rgba(232, 184, 109, .22); border-radius: 999px; color: var(--gold); background: rgba(232, 184, 109, .06); font-size: 10px; }
.tag-chip button { border: 0; background: transparent; color: var(--faint); padding: 0; display: grid; place-items: center; cursor: pointer; }
.tag-chip button:hover { color: var(--danger); }
.tag-chip button svg { width: 9px; height: 9px; }
.tag-add { display: inline-flex; align-items: center; gap: 2px; }
.tag-add input { width: 86px; height: 25px; border: 1px dashed var(--line); border-radius: 999px; background: transparent; color: var(--text-soft); padding: 0 8px; font-size: 10px; outline: none; }
.tag-add input:focus { border-color: rgba(232, 184, 109, .5); }
.tag-add button { width: 24px; height: 24px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--text-soft); display: grid; place-items: center; cursor: pointer; }
.tag-add button svg { width: 11px; height: 11px; }

/* admin series */
.series-admin-list { display: flex; flex-direction: column; gap: 10px; padding: 12px 0; }
.series-admin-card { display: flex; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .018); }
.series-admin-cover { width: 96px; height: 68px; flex: none; border-radius: 7px; overflow: hidden; background: #0b0f14; display: grid; place-items: center; color: var(--faint); }
.series-admin-cover img { width: 100%; height: 100%; object-fit: cover; }
.series-admin-cover svg { width: 22px; height: 22px; }
.series-admin-main { min-width: 0; flex: 1; }
.series-admin-head { display: flex; align-items: flex-start; gap: 10px; }
.series-admin-head h3 { font-size: 13px; margin: 0; }
.series-admin-head p { color: var(--faint); font-size: 10px; margin: 3px 0 0; }
.series-admin-meta { color: var(--faint); font-family: var(--font-mono); font-size: 8px; margin: 5px 0 7px; }
.series-admin-episodes { display: flex; flex-direction: column; gap: 3px; max-height: 140px; overflow-y: auto; }
.series-admin-episode { display: flex; align-items: center; gap: 7px; font-size: 10.5px; color: var(--text-soft); }
.series-admin-episode .ep-no { flex: none; font-family: var(--font-mono); font-size: 8px; color: var(--gold); width: 52px; }
.series-admin-episode .ep-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.series-admin-episode .icon-btn { width: 20px; height: 20px; }
.series-admin-episode .icon-btn svg { width: 10px; height: 10px; }
.series-admin-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* watch heat + comments */
.viewer-social { flex: none; border-top: 1px solid var(--line); padding: 16px 22px 30px; background: #070a0e; }
.social-heat { margin-bottom: 14px; }
.social-head { display: flex; justify-content: space-between; align-items: center; color: var(--faint); font-family: var(--font-mono); font-size: 8px; letter-spacing: .12em; }
.social-foot { margin-top: 5px; color: var(--faint); font-size: 9px; }
.heat-strip { display: flex; align-items: flex-end; gap: 2px; height: 34px; padding: 4px; margin-top: 7px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255, 255, 255, .025); cursor: pointer; }
.heat-strip button { flex: 1; min-width: 2px; border: 0; border-radius: 2px 2px 0 0; padding: 0; background: linear-gradient(to top, rgba(232, 184, 109, .25), rgba(232, 184, 109, .95)); opacity: .75; cursor: pointer; transition: opacity .15s; }
.heat-strip button:hover { opacity: 1; }
.danmaku-compose { display: flex; gap: 8px; margin-bottom: 18px; }
.danmaku-compose .input { height: 34px; font-size: 11px; }
.comments-block { border-top: 1px solid var(--line); padding-top: 15px; }
.comments-list { max-height: 270px; overflow-y: auto; margin: 8px 0 12px; display: flex; flex-direction: column; gap: 9px; }
.comment-item { display: flex; gap: 9px; }
.comment-body { min-width: 0; flex: 1; }
.comment-head { display: flex; align-items: baseline; gap: 8px; color: var(--text-soft); font-size: 11px; }
.comment-head > span:nth-child(2) { color: var(--faint); font-family: var(--font-mono); font-size: 8px; }
.comment-del { margin-left: auto; border: 0; background: transparent; color: var(--faint); cursor: pointer; padding: 0; }
.comment-del:hover { color: var(--danger); }
.comment-del svg { width: 12px; height: 12px; }
.comment-text { color: var(--text-soft); font-size: 12px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.comment-compose { display: flex; gap: 8px; align-items: flex-end; }
.comment-compose textarea { resize: vertical; min-height: 38px; }
.social-loading, .social-empty { color: var(--faint); font-size: 10px; padding: 10px 0; }
.social-loading .spinner { width: 12px; height: 12px; display: inline-block; vertical-align: middle; margin-right: 5px; }

.transcode-stage {
  position: relative;
  width: min(100%, 1180px);
  aspect-ratio: 16 / 9;
  max-height: calc(100dvh - 140px);
  border-radius: 8px;
  overflow: hidden;
  background: #04060a;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.transcode-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.3; filter: blur(2px) saturate(0.8); }
.transcode-stage::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 50%, rgba(4, 6, 10, 0.25), rgba(4, 6, 10, 0.86)); }
.transcode-panel {
  position: relative;
  z-index: 2;
  width: min(440px, 84%);
  padding: 24px 24px 22px;
  text-align: center;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: rgba(10, 14, 20, 0.84);
  backdrop-filter: blur(16px);
  color: var(--text-soft);
}
.transcode-panel .spinner { margin: 0 auto 14px; color: var(--gold); border-color: rgba(255, 255, 255, 0.14); border-top-color: var(--gold); }
.transcode-panel > svg { width: 26px; height: 26px; margin: 0 auto 12px; color: var(--danger); }
.transcode-panel .ts-title { font-size: 15px; font-weight: 650; color: var(--text); }
.transcode-panel p { margin: 9px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.8; }
.transcode-panel .ts-bar { height: 2px; margin: 18px auto 0; width: 72%; border-radius: 2px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.transcode-panel .ts-bar span { display: block; width: 34%; height: 100%; background: var(--gold); animation: ts-slide 1.6s var(--ease) infinite; }
@keyframes ts-slide { 0% { transform: translateX(-110%); } 100% { transform: translateX(330%); } }
.v-success {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(122, 216, 194, 0.26);
  border-radius: 10px;
  background: var(--mint-dim);
  color: #b8f0e3;
  font-size: 11px;
  line-height: 1.65;
}
.v-success svg { width: 14px; height: 14px; flex: none; margin-top: 1px; color: var(--mint); }
.viewer-image { transition: transform 0.22s var(--ease); cursor: zoom-in; }
.viewer-image.zoomed { cursor: zoom-out; }
.viewer-image-tools {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 11, 16, 0.78);
  backdrop-filter: blur(14px);
  z-index: 4;
}
.viewer-image-tools button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: var(--text-soft); display: grid; place-items: center; }
.viewer-image-tools button:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.viewer-image-tools svg { width: 16px; height: 16px; }
.viewer-image-tools .divider { width: 1px; background: var(--line); margin: 6px 3px; }

.viewer-side {
  border-left: 1px solid var(--line);
  background: rgba(10, 13, 18, 0.72);
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.v-kicker { display: flex; align-items: center; gap: 8px; color: var(--gold); font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.18em; }
.v-kicker svg { width: 14px; height: 14px; }
.v-side-title { margin: 9px 0 0; font-size: 22px; line-height: 1.3; letter-spacing: -0.025em; font-weight: 650; word-break: break-word; }
.v-side-desc { margin: 12px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.85; white-space: pre-wrap; }
.v-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--line); }
.v-meta { background: var(--panel); padding: 10px 12px; }
.v-meta .k { color: var(--faint); font-size: 9.5px; letter-spacing: 0.06em; }
.v-meta .v { margin-top: 3px; color: var(--text-soft); font-size: 12px; word-break: break-word; }
.v-owner { display: flex; align-items: center; gap: 10px; }
.v-owner .who { font-size: 12px; }
.v-owner .who .n { font-weight: 600; }
.v-owner .who .d { color: var(--faint); font-size: 10px; margin-top: 1px; }
.v-actions-list { display: flex; flex-wrap: wrap; gap: 8px; }
.v-preview-section { border-top: 1px solid var(--line); padding-top: 20px; }
.v-preview-section .head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.v-preview-section .head .t { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.16em; color: var(--faint); }
.v-preview-section .head .n { font-family: var(--font-mono); font-size: 9px; color: var(--faint); }
.preview-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.preview-strip button { padding: 0; border: 1px solid transparent; border-radius: 6px; overflow: hidden; background: var(--panel-3); aspect-ratio: 16 / 10; position: relative; }
.preview-strip button img { width: 100%; height: 100%; object-fit: cover; opacity: 0.7; transition: 0.18s; }
.preview-strip button:hover img { opacity: 1; }
.preview-strip button.active { border-color: var(--gold); }
.preview-strip button.active img { opacity: 1; }
.v-warning {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(239, 129, 123, 0.28);
  border-radius: 10px;
  background: var(--danger-dim);
  color: #ffc3bf;
  font-size: 11px;
  line-height: 1.6;
}
.v-warning svg { width: 14px; height: 14px; flex: none; margin-top: 1px; }

/* ---------- game room ---------- */
.game-shell {
  height: calc(100dvh - var(--topbar) - 190px);
  min-height: 540px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #04131c;
  box-shadow: var(--shadow-soft);
}
.game-hud {
  flex: none;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(122, 216, 194, 0.12);
  background: rgba(5, 21, 29, 0.96);
  color: var(--mint);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
}
.game-hud .dot { width: 5px; height: 5px; }
.game-hud-sep { width: 1px; height: 11px; background: var(--line); }
.game-hud-right { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; color: var(--faint); letter-spacing: 0.04em; }
.game-hud-right svg { width: 12px; height: 12px; }
.game-shell iframe { flex: 1; width: 100%; border: 0; background: #04131c; }
.game-shell:fullscreen { height: 100dvh; border-radius: 0; }
.game-shell:fullscreen .game-hud { display: none; }
.game-page-head { margin-bottom: 18px; }

/* ---------- upload page ---------- */
.upload-page-card { border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.018); padding: 14px; }
.upload-page-tools { display: flex; flex-direction: column; gap: 10px; }
.upload-page-pick { display: flex; align-items: center; gap: 14px; padding: 18px; border: 1px dashed var(--line-strong); border-radius: 12px; cursor: pointer; }
.upload-page-pick.dragover { border-color: var(--gold); background: rgba(232,184,109,.06); }
.upload-page-pick .up-icon { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: rgba(232,184,109,.1); color: var(--gold); flex: none; }
.upload-page-pick .up-icon svg { width: 19px; height: 19px; }
.upload-page-pick .t { font-size: 13px; font-weight: 600; }
.upload-page-pick .h { color: var(--faint); font-size: 10px; margin-top: 4px; }
.upload-page-pick .btn { margin-left: auto; flex: none; }
.upload-page-category { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 10px; color: var(--faint); }
.upload-page-category .select { min-width: 150px; }
.upload-page-list { margin-top: 12px; display: flex; flex-direction: column; gap: 7px; }
.upload-page-empty { color: var(--faint); font-size: 10px; padding: 14px 4px; }
.upload-entry { display: flex; align-items: center; gap: 11px; border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; background: rgba(255,255,255,.015); }
.upload-entry-icon { width: 32px; height: 32px; border-radius: 7px; background: #0b0f14; color: var(--faint); display: grid; place-items: center; flex: none; }
.upload-entry-icon svg { width: 15px; height: 15px; }
.upload-entry-main { flex: 1; min-width: 0; }
.upload-entry-name { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upload-entry-meta { color: var(--faint); font-size: 9px; margin-top: 2px; }
.upload-entry-bar { height: 3px; border-radius: 2px; background: rgba(255,255,255,.07); overflow: hidden; margin-top: 5px; }
.upload-entry-bar span { display: block; height: 100%; background: var(--gold); transition: width .2s; }
.upload-entry.done .upload-entry-bar span { background: var(--mint); }
.upload-entry.error .upload-entry-bar span { background: var(--danger); }
.upload-entry-actions { display: flex; align-items: center; gap: 3px; flex: none; }

/* ---------- welcome popups ---------- */
.welcome-popup img { display: block; width: 100%; max-height: 46dvh; object-fit: cover; border-radius: 10px; margin-bottom: 14px; }
.welcome-copy { color: var(--text-soft); font-size: 13px; line-height: 1.9; white-space: pre-wrap; }
.welcome-admin-list { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; }
.welcome-admin-card { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.welcome-admin-thumb { width: 86px; height: 60px; border-radius: 6px; overflow: hidden; background: #0b0f14; display: grid; place-items: center; color: var(--faint); flex: none; }
.welcome-admin-thumb img { width: 100%; height: 100%; object-fit: cover; }
.welcome-admin-thumb svg { width: 20px; height: 20px; }
.welcome-admin-main { min-width: 0; flex: 1; }
.welcome-admin-head { display: flex; align-items: center; gap: 8px; }
.welcome-admin-head h3 { font-size: 12px; margin: 0; }
.welcome-admin-main p { color: var(--faint); font-size: 10px; margin: 4px 0; line-height: 1.5; max-height: 32px; overflow: hidden; }
.welcome-admin-actions { display: flex; gap: 5px; flex: none; }
.welcome-admin-image { min-height: 80px; display: grid; place-items: center; background: #0b0f14; border-radius: 8px; overflow: hidden; margin-bottom: 7px; }
.welcome-admin-image img { max-width: 100%; max-height: 180px; object-fit: contain; }
.pill.muted { opacity: .45; }

/* ---------- featured picks ---------- */
.home-featured { margin: 0 0 24px; }
.featured-picks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 12px; }
.featured-pick .home-rail-thumb { aspect-ratio: 16 / 9; border-radius: 12px; }
.featured-pick .home-rail-title { font-size: 14px; }
.featured-pick .home-rail-meta { font-size: 10px; }
.featured-pick .home-rail-count { font-size: 9px; padding: 4px 7px; }
.featured-pick.lead .home-rail-thumb { box-shadow: 0 14px 40px rgba(0,0,0,.35); }

/* ---------- game lobby ---------- */
.game-lobby { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin: 18px 0; }
.game-lobby-card { display: flex; align-items: center; gap: 14px; text-align: left; border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: rgba(255,255,255,.025); color: var(--text); cursor: pointer; transition: border-color .2s, transform .2s; }
.game-lobby-card:hover { border-color: rgba(232,184,109,.45); transform: translateY(-2px); }
.game-lobby-cover { width: 82px; height: 82px; flex: none; border-radius: 10px; background: linear-gradient(145deg,#1d2834,#0c1117); display: grid; place-items: center; overflow: hidden; color: var(--gold); }
.game-lobby-cover img { width: 100%; height: 100%; object-fit: cover; }
.game-lobby-cover svg { width: 32px; height: 32px; }
.game-lobby-info { min-width: 0; flex: 1; }
.game-lobby-kicker { color: var(--faint); font-family: var(--font-mono); font-size: 8px; letter-spacing: .14em; }
.game-lobby-info h3 { font-size: 15px; margin: 3px 0; }
.game-lobby-info p { color: var(--faint); font-size: 10px; margin: 0; line-height: 1.55; }
.game-lobby-play { width: 30px; height: 30px; border-radius: 50%; background: var(--gold); color: #0a0d12; display: grid; place-items: center; flex: none; }
.game-lobby-play svg { width: 13px; height: 13px; }

/* ---------- shorts ---------- */
.view.shorts-mode { padding: 0; overflow: hidden; }
.shorts-feed { height: calc(100dvh - 126px); overflow-y: auto; scroll-snap-type: y mandatory; background: #000; scrollbar-width: none; }
.shorts-feed::-webkit-scrollbar { display: none; }
.shorts-head { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 8; display: flex; gap: 16px; align-items: center; color: rgba(255,255,255,.75); font-family: var(--font-mono); font-size: 9px; letter-spacing: .15em; }
.shorts-head a { color: #fff; background: rgba(0,0,0,.4); border: 1px solid rgba(255,255,255,.2); border-radius: 999px; padding: 5px 10px; }
.short-item { position: relative; height: calc(100dvh - 126px); min-height: 420px; scroll-snap-align: start; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #000; }
.short-video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.short-shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(0deg, rgba(0,0,0,.8), transparent 38%, transparent 72%, rgba(0,0,0,.35)); }
.short-actions { position: absolute; right: 14px; bottom: 156px; z-index: 3; display: flex; flex-direction: column; gap: 16px; align-items: center; }
.short-action { border: 0; background: transparent; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 9px; cursor: pointer; text-shadow: 0 1px 4px #000; }
.short-action svg { width: 26px; height: 26px; }
.short-action.active svg { color: #ff6b8a; fill: rgba(255,107,138,.2); }
.short-action[data-short-favorite].active svg { color: var(--gold); fill: rgba(232,184,109,.2); }
.short-copy { position: absolute; left: 18px; right: 76px; bottom: 74px; z-index: 3; color: #fff; text-shadow: 0 1px 5px #000; }
.short-title { font-size: 17px; font-weight: 650; line-height: 1.35; }
.short-meta { display: flex; align-items: center; gap: 7px; margin-top: 7px; font-size: 10px; color: rgba(255,255,255,.8); }
.short-meta .avatar { width: 20px; height: 20px; font-size: 8px; }
.short-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; font-size: 9px; color: var(--gold); }
.short-comments { max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 9px; }
.shorts-loading { min-height: 50vh; display: grid; place-items: center; color: var(--faint); font-size: 11px; gap: 8px; }

/* viewer likes + recommendations */
.v-social-actions { display: flex; gap: 8px; margin: 4px 0 2px; }
.v-social-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.025); color: var(--text-soft); padding: 7px 10px; font-size: 10px; cursor: pointer; }
.v-social-btn svg { width: 14px; height: 14px; }
.v-social-btn.active { color: #ff8aa2; border-color: rgba(255,107,138,.35); }
.v-social-btn[data-v-favorite].active { color: var(--gold); border-color: rgba(232,184,109,.35); }
.viewer-recommendations { flex: none; padding: 16px 22px 26px; border-top: 1px solid var(--line); background: #070a0e; }
.viewer-recommendations:empty { display: none; }
.viewer-recommendations .rail { margin-top: 10px; }

/* auth captcha */
.captcha-row { display: flex; gap: 9px; align-items: center; }
.captcha-row .input { flex: 1; min-width: 0; }
.captcha-image { flex: none; width: 150px; height: 46px; padding: 0; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: #11171f; cursor: pointer; }
.captcha-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.input-action { width: auto; min-width: 42px; padding: 0 8px; }

/* ---------- admin bulk ---------- */
.admin-bulk-tools { border-top: 1px solid var(--line); padding-top: 10px; margin-top: -2px; }
.admin-bulk-tools .btn { gap: 7px; }
.admin-bulk-tools .btn:disabled { opacity: .35; cursor: not-allowed; }
.select-col { width: 34px; text-align: center; }
.select-col input { accent-color: var(--gold); width: 14px; height: 14px; cursor: pointer; }

/* ---------- chat ---------- */
.chat-view { height: calc(100dvh - var(--topbar) - 72px); min-height: 540px; display: flex; flex-direction: column; }
.chat-shell {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 276px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: rgba(12, 16, 22, 0.6);
}
.chat-main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.chat-head { flex: none; padding: 16px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.chat-head > div:first-child { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--gold-dim); color: var(--gold); }
.chat-head > div:first-child svg { width: 18px; height: 18px; }
.chat-head .t { font-size: 14px; font-weight: 600; }
.chat-head .sub { color: var(--faint); font-size: 10.5px; margin-top: 1px; }
.chat-head .online { margin-left: auto; display: flex; align-items: center; gap: 7px; color: var(--mint); font-size: 11px; }
.chat-messages { flex: 1; min-height: 0; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 18px; scroll-behavior: smooth; }
.chat-day { align-self: center; padding: 2px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.04); color: var(--faint); font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.08em; }
.msg { display: flex; gap: 10px; max-width: 78%; }
.msg .avatar { margin-top: 2px; }
.msg-body { min-width: 0; }
.msg-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.msg-name { font-size: 11.5px; font-weight: 600; color: var(--text-soft); }
.msg-time { font-family: var(--font-mono); font-size: 9px; color: var(--faint); }
.bot-tag { padding: 1px 5px; border: 1px solid rgba(196, 167, 231, 0.35); border-radius: 4px; color: #c4a7e7; font-family: var(--font-mono); font-size: 7.5px; letter-spacing: 0.08em; }
.msg.bot .msg-text { border-color: rgba(196, 167, 231, 0.22); background: rgba(196, 167, 231, 0.07); }
.msg-text {
  display: inline-block;
  padding: 9px 13px;
  border-radius: 4px 14px 14px 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}
.msg.own { align-self: flex-end; flex-direction: row-reverse; }
.msg.own .msg-body { text-align: right; }
.msg.own .msg-head { flex-direction: row-reverse; }
.msg.own .msg-text {
  border-radius: 14px 4px 14px 14px;
  background: linear-gradient(135deg, rgba(232, 184, 109, 0.18), rgba(232, 184, 109, 0.07));
  border-color: rgba(232, 184, 109, 0.24);
  color: var(--text);
  text-align: left;
}
.msg-tools { display: inline-flex; vertical-align: bottom; margin: 0 0 2px 4px; opacity: 0; transition: 0.18s; }
.msg:hover .msg-tools { opacity: 1; }
.msg-tools button { border: 0; background: transparent; color: var(--faint); width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; }
.msg-tools button:hover { color: var(--danger); background: var(--danger-dim); }
.msg-tools svg { width: 13px; height: 13px; }
.chat-empty { margin: auto; text-align: center; color: var(--faint); padding: 40px 20px; }
.chat-empty .mark { width: 44px; height: 44px; margin: 0 auto 14px; color: var(--gold); opacity: 0.55; }
.chat-empty h3 { margin: 0; color: var(--text-soft); font-size: 17px; font-weight: 600; }
.chat-empty p { margin: 8px auto 0; max-width: 280px; font-size: 12px; line-height: 1.8; }
.chat-compose { flex: none; padding: 12px 16px calc(12px + var(--safe-bottom)); border-top: 1px solid var(--line); background: rgba(8, 11, 16, 0.55); }
.compose-box { display: flex; align-items: flex-end; gap: 8px; padding: 6px 6px 6px 12px; border: 1px solid var(--line-strong); border-radius: 16px; background: rgba(255, 255, 255, 0.028); transition: 0.18s; }
.compose-box:focus-within { border-color: var(--gold-line); box-shadow: 0 0 0 3px rgba(232, 184, 109, 0.06); }
.compose-box textarea {
  flex: 1;
  min-height: 36px;
  max-height: 120px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  resize: none;
  outline: none;
  font-size: 13px;
  line-height: 1.6;
}
.compose-box textarea::placeholder { color: var(--faint); }
.compose-actions { display: flex; align-items: center; gap: 3px; flex: none; }
.compose-send { width: 34px; height: 34px; border: 0; border-radius: 10px; background: var(--gold); color: #151109; display: grid; place-items: center; transition: 0.18s; }
.compose-send:hover { background: var(--gold-bright); }
.compose-send:disabled { opacity: 0.4; }
.compose-send svg { width: 16px; height: 16px; }
.chat-hint { display: flex; justify-content: space-between; gap: 12px; margin-top: 7px; padding: 0 4px; color: var(--faint); font-size: 9.5px; }
.emoji-pop {
  position: absolute;
  bottom: 74px;
  right: 20px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2px;
  width: 228px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(15, 20, 27, 0.98);
  box-shadow: var(--shadow);
  z-index: 6;
}
.emoji-pop[hidden] { display: none; }
.emoji-pop button { border: 0; background: transparent; font-size: 18px; line-height: 1; padding: 7px 0; border-radius: 7px; }
.emoji-pop button:hover { background: rgba(255, 255, 255, 0.07); }
.chat-aside { border-left: 1px solid var(--line); padding: 20px 18px; overflow-y: auto; background: rgba(255, 255, 255, 0.012); }
.chat-aside h4 { margin: 0 0 4px; font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.16em; color: var(--faint); font-weight: 500; }
.chat-aside .aside-block + .aside-block { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.online-list { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }
.online-user { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-soft); }
.online-user .dot { width: 5px; height: 5px; color: var(--mint); background: var(--mint); margin-left: auto; }
.chat-tip { margin: 10px 0 0; color: var(--faint); font-size: 10.5px; line-height: 1.8; }
.chat-tip strong { color: var(--text-soft); font-weight: 500; }
.chat-closed { margin: auto; text-align: center; padding: 48px 24px; color: var(--muted); }
.chat-closed svg { width: 34px; height: 34px; margin: 0 auto 14px; color: var(--faint); }
.chat-loading { margin: auto; display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 12px; }

/* ---------- admin ---------- */
.admin-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 6px 0 28px; overflow-x: auto; scrollbar-width: none; }
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tab {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 13px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 550;
  transition: 0.18s;
}
.admin-tab svg { width: 14px; height: 14px; opacity: 0.75; }
.admin-tab:hover { color: var(--text); }
.admin-tab.active { color: var(--gold-bright); }
.admin-tab.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--gold); }
.admin-tab .n { margin-left: 5px; color: var(--faint); font-family: var(--font-mono); font-size: 9px; }

.admin-commandbar {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(90deg, rgba(122, 216, 194, 0.045), rgba(232, 184, 109, 0.035));
}
.cmd-status { display: flex; align-items: center; gap: 8px; padding: 2px 16px; border-left: 1px solid var(--line); min-width: 0; }
.cmd-status:first-child { border-left: 0; padding-left: 2px; }
.cmd-status .cmd-ico { color: var(--faint); }
.cmd-status .cmd-ico svg { width: 14px; height: 14px; }
.cmd-status .k { display: block; color: var(--faint); font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.1em; }
.cmd-status .v { display: block; margin-top: 2px; color: var(--text-soft); font-size: 10.5px; white-space: nowrap; }
.cmd-status .v.on { color: var(--mint); }
.cmd-status .v.off { color: var(--coral); }
.cmd-actions { display: flex; gap: 6px; margin-left: auto; padding-left: 14px; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi {
  position: relative;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.008));
  overflow: hidden;
}
.kpi::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -36px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 184, 109, 0.08), transparent 70%);
}
.kpi .k-top { display: flex; align-items: center; justify-content: space-between; color: var(--faint); font-size: 10px; letter-spacing: 0.08em; }
.kpi .k-top svg { width: 16px; height: 16px; opacity: 0.6; }
.kpi .k-n { margin-top: 14px; font-family: var(--font-latin); font-size: 32px; line-height: 1; letter-spacing: -0.03em; }
.kpi .k-n small { font-family: var(--font-sans); font-size: 11px; color: var(--faint); letter-spacing: 0; margin-left: 5px; }
.kpi .k-foot { display: flex; align-items: center; gap: 6px; margin-top: 11px; color: var(--faint); font-size: 10.5px; }
.kpi .delta { color: var(--mint); }
.kpi .delta.down { color: var(--coral); }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 20, 27, 0.72);
  overflow: hidden;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px 19px; border-bottom: 1px solid var(--line); }
.panel-head .t { font-size: 13px; font-weight: 600; }
.panel-head .s { color: var(--faint); font-size: 10.5px; margin-top: 2px; }
.panel-body { padding: 18px 19px; }
.panel-link { color: var(--muted); font-size: 11px; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; flex: none; }
.panel-link svg { width: 13px; height: 13px; }
.panel-head > svg { color: var(--faint); }
.panel-link:hover { color: var(--gold); }
.chart-legend { display: flex; gap: 16px; align-items: center; }
.legend-item { display: flex; align-items: center; gap: 6px; color: var(--faint); font-size: 10px; }
.legend-item i { width: 7px; height: 7px; border-radius: 2px; background: var(--gold); display: block; }
.legend-item.teal i { background: var(--mint); }
.activity-chart { width: 100%; height: auto; overflow: visible; }
.activity-chart text { font-family: var(--font-mono); font-size: 9px; fill: var(--faint); }
.activity-chart .grid-line { stroke: rgba(255, 255, 255, 0.055); stroke-width: 1; }
.activity-chart .area { fill: url(#chart-fill); }
.activity-chart .line { fill: none; stroke: var(--mint); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.activity-chart .bar { fill: rgba(232, 184, 109, 0.32); }
.activity-chart .bar:hover { fill: rgba(232, 184, 109, 0.7); }
.chart-tip { margin-top: 10px; color: var(--faint); font-size: 10px; display: flex; justify-content: space-between; }
.chart-tip .n { color: var(--text-soft); }

.storage-panel .ring-row { display: flex; align-items: center; gap: 18px; }
.storage-ring {
  --p: 0%;
  position: relative;
  width: 108px;
  height: 108px;
  flex: none;
  border-radius: 50%;
  background: conic-gradient(var(--gold) 0 var(--p), rgba(255, 255, 255, 0.055) var(--p) 100%);
  display: grid;
  place-items: center;
}
.storage-ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--panel); }
.storage-ring .inner { position: relative; text-align: center; }
.storage-ring .v { font-family: var(--font-latin); font-size: 19px; line-height: 1; }
.storage-ring .l { color: var(--faint); font-size: 8.5px; margin-top: 4px; letter-spacing: 0.1em; }
.storage-legend { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 11px; }
.storage-legend .row { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.storage-legend .sw { width: 7px; height: 7px; border-radius: 2px; background: var(--gold); flex: none; }
.storage-legend .sw.image { background: var(--mint); }
.storage-legend .sw.other { background: rgba(255, 255, 255, 0.2); }
.storage-legend .rg { margin-left: auto; color: var(--text-soft); font-family: var(--font-mono); font-size: 10px; }
.mini-divider { height: 1px; background: var(--line); margin: 16px 0; }

.top-list { display: flex; flex-direction: column; gap: 2px; }
.top-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; min-width: 0; }
.top-item .rank { width: 16px; flex: none; font-family: var(--font-latin); font-size: 12px; color: var(--faint); font-style: italic; }
.top-item .im { width: 40px; height: 26px; flex: none; border-radius: 5px; overflow: hidden; background: var(--panel-3); }
.top-item .im img { width: 100%; height: 100%; object-fit: cover; }
.top-item .tx { min-width: 0; flex: 1; }
.top-item .tx .a { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-item .tx .b { color: var(--faint); font-size: 9px; margin-top: 1px; }
.top-item .vv { font-family: var(--font-mono); font-size: 9px; color: var(--muted); }

.recent-list { display: flex; flex-direction: column; }
.recent-item { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.recent-item:last-child { border-bottom: 0; }
.recent-icon { width: 30px; height: 30px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--gold-dim); color: var(--gold); }
.recent-icon svg { width: 14px; height: 14px; }
.recent-icon.delete { background: var(--danger-dim); color: var(--danger); }
.recent-icon.chat { background: var(--mint-dim); color: var(--mint); }
.recent-item .tx { min-width: 0; flex: 1; }
.recent-item .tx .a { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-item .tx .b { color: var(--faint); font-size: 9.5px; margin-top: 2px; }
.recent-item .time { color: var(--faint); font-family: var(--font-mono); font-size: 9px; flex: none; }

.system-panel .sys-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.system-panel .sys-row:last-child { border-bottom: 0; }
.system-panel .sys-row .k { color: var(--faint); }
.system-panel .sys-row .v { color: var(--text-soft); text-align: right; word-break: break-all; }
.tailnet-box { display: flex; align-items: center; gap: 8px; padding: 9px 10px; margin-top: 10px; border: 1px solid var(--gold-line); border-radius: 9px; background: var(--gold-dim); }
.tailnet-box .url { flex: 1; min-width: 0; color: var(--gold-bright); font-family: var(--font-mono); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tailnet-box button { border: 0; background: transparent; color: var(--gold); width: 24px; height: 24px; display: grid; place-items: center; border-radius: 5px; }
.tailnet-box button:hover { background: rgba(232, 184, 109, 0.12); }
.tailnet-box svg { width: 13px; height: 13px; }

.admin-banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 15px; margin-bottom: 16px; border: 1px solid var(--gold-line); border-radius: 12px; background: var(--gold-dim); color: var(--text-soft); font-size: 11.5px; line-height: 1.7; }
.admin-banner svg { width: 15px; height: 15px; flex: none; margin-top: 1px; color: var(--gold); }
.admin-banner.danger { border-color: rgba(239, 129, 123, 0.3); background: var(--danger-dim); }
.admin-banner.danger svg { color: var(--danger); }
.admin-banner a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; margin-left: 4px; }
.invite-summary { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 18px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: radial-gradient(600px 200px at 0% 0%, rgba(232, 184, 109, 0.08), transparent 65%), rgba(15, 20, 27, 0.72); }
.invite-summary-copy h2 { margin: 7px 0 0; font-size: 25px; letter-spacing: -0.03em; }
.invite-summary-copy p { margin: 7px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.75; max-width: 520px; }
.invite-summary-stats { display: flex; align-items: center; gap: 24px; flex: none; }
.invite-summary-stats > div { text-align: right; }
.invite-summary-stats .n { display: block; font-family: var(--font-latin); font-size: 24px; line-height: 1; }
.invite-summary-stats .l { display: block; color: var(--faint); font-size: 9px; margin-top: 4px; }
.invite-code { font-family: var(--font-mono); color: var(--gold-bright); font-size: 12px; letter-spacing: 0.06em; white-space: nowrap; }
.invite-note { color: var(--faint); font-size: 9.5px; margin-top: 3px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invite-uses { font-family: var(--font-mono); font-size: 10.5px; }
.status-badge.used { color: var(--faint); }
.invite-result { text-align: center; padding: 8px 0 2px; }
.invite-result-code { display: inline-block; padding: 14px 20px; border: 1px dashed var(--gold-line); border-radius: 12px; background: var(--gold-dim); color: var(--gold-bright); font-family: var(--font-mono); font-size: clamp(20px, 4vw, 30px); letter-spacing: 0.12em; }
.invite-result-meta { margin-top: 12px; color: var(--muted); font-size: 11px; }
.invite-result-actions { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.invite-result-hint { margin: 16px auto 0; max-width: 360px; color: var(--faint); font-size: 10.5px; line-height: 1.8; }
.table-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: rgba(15, 20, 27, 0.72); }
.table-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.table-tools .search-inline { position: relative; flex: 1; max-width: 320px; }
.table-tools .search-inline svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--faint); }
.table-tools input { width: 100%; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025); padding: 0 12px 0 34px; font-size: 12px; outline: none; }
.table-tools input:focus { border-color: var(--gold-line); }
.table-tools .select { height: 34px; font-size: 12px; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; min-width: 720px; }
table.data th {
  padding: 10px 14px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 500;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.012);
  white-space: nowrap;
}
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 11.5px; color: var(--text-soft); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: rgba(255, 255, 255, 0.018); }
.table-media { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.table-media .im { width: 52px; height: 33px; flex: none; border-radius: 5px; overflow: hidden; background: var(--panel-3); }
.table-media .im img { width: 100%; height: 100%; object-fit: cover; }
.table-media .t { min-width: 0; }
.table-media .t .a { font-size: 11.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.table-media .t .b { color: var(--faint); font-size: 9px; margin-top: 2px; }
.row-actions { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.row-actions .icon-btn { width: 28px; height: 28px; }
.row-actions svg { width: 14px; height: 14px; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 9.5px; font-weight: 600; white-space: nowrap; }
.status-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-badge.ready { color: var(--mint); }
.status-badge.processing { color: var(--gold); }
.status-badge.failed { color: var(--danger); }
.role-badge { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; font-size: 9.5px; font-weight: 650; }
.role-badge.admin { color: var(--gold-bright); background: var(--gold-dim); border: 1px solid var(--gold-line); }
.role-badge.user { color: var(--muted); background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
.role-badge.bot { color: #c4a7e7; background: rgba(196, 167, 231, 0.09); border: 1px solid rgba(196, 167, 231, 0.24); }
.table-empty { padding: 46px 20px; text-align: center; color: var(--faint); font-size: 12px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--faint); font-size: 10.5px; }
.pagination .pages { display: flex; gap: 4px; }
.pagination button { min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: var(--muted); font-size: 11px; }
.pagination button:hover:not(:disabled) { border-color: var(--line-strong); color: var(--text); }
.pagination button.active { background: var(--gold); border-color: var(--gold); color: #16120a; font-weight: 700; }
.pagination button:disabled { opacity: 0.3; }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.settings-card { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(15, 20, 27, 0.72); padding: 20px; }
.settings-card.wide { grid-column: 1 / -1; }
.settings-card h3 { margin: 0; font-size: 14px; font-weight: 600; }
.settings-card .desc { margin: 5px 0 18px; color: var(--faint); font-size: 10.5px; line-height: 1.7; }
.settings-card .field + .field { margin-top: 14px; }
.settings-card .btn { margin-top: 16px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.switch-row:last-of-type { border-bottom: 0; }
.switch-row .l { font-size: 12px; color: var(--text-soft); }
.switch-row .h { color: var(--faint); font-size: 10px; margin-top: 2px; line-height: 1.6; }
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 2; }
.switch .track { position: absolute; inset: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.12); transition: 0.2s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #b7bdc5; transition: 0.2s var(--ease); }
.switch input:checked + .track { background: var(--gold); }
.switch input:checked + .track::after { transform: translateX(16px); background: #171208; }
.switch input:focus-visible + .track { outline: 2px solid var(--gold); outline-offset: 2px; }
.danger-zone { border-color: rgba(239, 129, 123, 0.22); background: linear-gradient(150deg, rgba(239, 129, 123, 0.045), rgba(255, 255, 255, 0.01)); }
.danger-zone .btn { margin-top: 0; }

.ban-reason { color: var(--danger); font-size: 9px; margin-top: 2px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ban-user-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, 0.02); }
.ban-user-row .n { font-size: 13px; color: var(--text); }
.ban-user-row .u { color: var(--faint); font-size: 10px; margin-top: 2px; }
.category-admin-list { display: flex; flex-direction: column; }
.category-admin-row { display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.category-admin-row:last-child { border-bottom: 0; }
.category-admin-row .cat-drag { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--gold-dim); color: var(--gold); }
.category-admin-row .cat-drag svg { width: 14px; height: 14px; }
.category-admin-row .cat-name { flex: 1; min-width: 0; }
.category-admin-row .cat-name .n { font-size: 13px; color: var(--text); }
.category-admin-row .cat-name .m { color: var(--faint); font-size: 9.5px; margin-top: 2px; }
.category-admin-row .cat-order { display: flex; flex-direction: column; gap: 2px; }
.category-admin-row .cat-order .icon-btn { width: 24px; height: 20px; }
.category-admin-row .cat-order svg { width: 12px; height: 12px; }
.category-admin-row .icon-btn:disabled { opacity: 0.2; }
.category-admin-note { padding: 10px 18px 14px; color: var(--faint); font-size: 10px; border-top: 1px solid var(--line); }
.audit-action { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--text-soft); white-space: nowrap; }
.audit-action .ic { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.045); color: var(--muted); }
.audit-action .ic svg { width: 12px; height: 12px; }
.ip { font-family: var(--font-mono); font-size: 9px; color: var(--faint); }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 5, 8, 0.72);
  backdrop-filter: blur(10px);
  animation: fade-in 0.2s ease;
}
@keyframes fade-in { from { opacity: 0; } }
.modal {
  width: min(520px, 100%);
  max-height: min(88dvh, 820px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: linear-gradient(165deg, #141a23, #0d1117);
  box-shadow: var(--shadow);
  animation: modal-in 0.3s var(--ease);
  overflow: hidden;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(0.985); } }
.modal.wide { width: min(700px, 100%); }
.modal.narrow { width: min(420px, 100%); }
.modal-head { flex: none; display: flex; align-items: flex-start; gap: 16px; padding: 20px 22px 16px; border-bottom: 1px solid var(--line); }
.modal-head .mt { flex: 1; }
.modal-head .k { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.16em; color: var(--gold); }
.modal-head h3 { margin: 5px 0 0; font-size: 20px; letter-spacing: -0.02em; font-weight: 650; }
.modal-head p { margin: 5px 0 0; color: var(--faint); font-size: 11.5px; }
.modal-close { width: 32px; height: 32px; flex: none; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--muted); display: grid; place-items: center; }
.modal-close:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.modal-close svg { width: 15px; height: 15px; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { flex: none; display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 14px 22px; border-top: 1px solid var(--line); background: rgba(0, 0, 0, 0.12); }
.modal-foot .left { margin-right: auto; color: var(--faint); font-size: 10.5px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.confirm-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--danger-dim); color: var(--danger); margin-bottom: 4px; }
.confirm-icon.warn { background: var(--gold-dim); color: var(--gold); }
.confirm-icon svg { width: 22px; height: 22px; }
.confirm-copy { color: var(--muted); font-size: 12.5px; line-height: 1.8; }
.confirm-copy strong { color: var(--text); font-weight: 600; }

/* upload */
.upload-zone {
  position: relative;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  padding: 34px 20px;
  text-align: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(232, 184, 109, 0.055), transparent 70%);
  transition: 0.2s;
  cursor: pointer;
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--gold-line); background: rgba(232, 184, 109, 0.04); }
.upload-zone .up-icon { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 15px; display: grid; place-items: center; border: 1px solid var(--gold-line); background: var(--gold-dim); color: var(--gold); }
.upload-zone .up-icon svg { width: 23px; height: 23px; }
.upload-zone h4 { margin: 0; font-size: 15px; font-weight: 600; }
.upload-zone p { margin: 6px auto 0; color: var(--faint); font-size: 11px; line-height: 1.7; max-width: 360px; }
.upload-zone .formats { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; margin-top: 12px; }
.upload-zone .formats span { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.06em; color: var(--faint); padding: 2px 6px; border: 1px solid var(--line); border-radius: 4px; }
.upload-category-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.02);
}
.upload-category-row .uc-title { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-soft); }
.upload-category-row .uc-title svg { width: 14px; height: 14px; color: var(--gold); }
.upload-category-row .uc-hint { margin-top: 2px; color: var(--faint); font-size: 9.5px; }
.upload-category-row .select { width: 140px; flex: none; height: 34px; font-size: 11.5px; }
.upload-list { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow-y: auto; }
.upload-item { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, 0.02); }
.upload-item .fi { width: 32px; height: 32px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--panel-3); color: var(--muted); }
.upload-item .fi svg { width: 15px; height: 15px; }
.upload-item .tx { flex: 1; min-width: 0; }
.upload-item .tx .n { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upload-item .tx .s { color: var(--faint); font-size: 9.5px; margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.upload-item .tx .s .err { color: var(--danger); }
.upload-item .pct { font-family: var(--font-mono); font-size: 10px; color: var(--muted); flex: none; }
.upload-item .ok { color: var(--mint); flex: none; }
.upload-item .ok svg { width: 17px; height: 17px; }
.upload-bar { height: 2px; border-radius: 2px; background: rgba(255, 255, 255, 0.07); overflow: hidden; margin-top: 5px; }
.upload-bar span { display: block; height: 100%; background: var(--gold); transition: width 0.2s; }
.upload-item.done .upload-bar span { background: var(--mint); }
.upload-item.error { border-color: rgba(239, 129, 123, 0.3); }
.upload-total { display: flex; align-items: center; gap: 12px; margin-top: 14px; color: var(--faint); font-size: 10px; }
.upload-total .bar { flex: 1; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.upload-total .bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-bright)); transition: width 0.3s; }

/* profile */
.profile-head { display: flex; align-items: center; gap: 14px; padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.profile-head .who { flex: 1; }
.profile-head .n { font-size: 18px; font-weight: 650; }
.profile-head .u { color: var(--faint); font-family: var(--font-mono); font-size: 10px; margin-top: 2px; }
.profile-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--line); margin-bottom: 20px; }
.profile-stat { background: var(--panel); padding: 12px 10px; text-align: center; }
.profile-stat .n { font-family: var(--font-latin); font-size: 18px; }
.profile-stat .l { color: var(--faint); font-size: 9px; margin-top: 3px; }
.color-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.color-dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; padding: 0; background: var(--c); position: relative; }
.color-dot.active { border-color: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12); }
.profile-section + .profile-section { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.profile-section h4 { margin: 0 0 12px; font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.15em; color: var(--faint); font-weight: 500; }

/* toast */
.toast-root { position: fixed; right: 20px; bottom: 22px; z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 240px;
  max-width: 360px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(18, 24, 32, 0.97);
  box-shadow: var(--shadow);
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.6;
  pointer-events: auto;
  animation: toast-in 0.3s var(--ease);
}
.toast.out { animation: toast-out 0.25s ease forwards; }
.toast svg { width: 15px; height: 15px; flex: none; margin-top: 1px; color: var(--mint); }
.toast.error svg { color: var(--danger); }
.toast.gold svg { color: var(--gold); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* bottom nav */
.bottom-nav { display: none; }

/* responsive */
@media (max-width: 1240px) {
  :root { --sidebar: 224px; }
  .hero-stats { display: none; }
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .viewer-main { grid-template-columns: minmax(0, 1fr) 320px; }
}

@media (max-width: 1020px) {
  .auth { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-panel { min-height: 100dvh; padding: 40px 24px; }
  .auth-mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 36px;
    color: var(--gold);
  }
  .auth-mobile-brand .mark { width: 30px; height: 30px; }
  .auth-mobile-brand .word { color: var(--text); font-size: 15px; letter-spacing: 0.26em; font-weight: 700; }
  .auth-mobile-brand .sub { color: var(--faint); font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.16em; }
  .auth-card { max-width: 420px; }
  .viewer-main { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .viewer-side { border-left: 0; border-top: 1px solid var(--line); max-height: 42dvh; }
  .viewer-stage { min-height: 34dvh; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-grid { grid-template-columns: 1fr; }
  .image-wall { columns: 2; }
}

@media (max-width: 860px) {
  :root { --topbar: 60px; }
  .sidebar { display: none; }
  .shell-main { margin-left: 0; padding-bottom: calc(66px + var(--safe-bottom)); }
  .topbar { padding: 0 16px; gap: 10px; height: var(--topbar); }
  .topbar-context { display: none; }
  .mobile-brand { display: flex; align-items: center; gap: 8px; flex: none; }
  .mobile-brand .mark { width: 28px; height: 28px; color: var(--gold); }
  .mobile-brand .word { font-size: 14px; font-weight: 700; letter-spacing: 0.2em; }
  .searchbar { display: none; }
  .top-actions { margin-left: auto; }
  .top-actions .upload-label { display: none; }
  .top-actions .btn-primary { width: 38px; min-height: 38px; padding: 0; border-radius: 50%; }
  .view { padding: 22px 16px 48px; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 14px; margin-bottom: 22px; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
  .hero { min-height: 460px; border-radius: 20px; }
  .hero-content { padding: 24px 20px 28px; max-width: none; }
  .hero-shade { background: linear-gradient(0deg, rgba(6, 8, 12, 0.98) 0%, rgba(6, 8, 12, 0.7) 48%, rgba(6, 8, 12, 0.15) 100%); }
  .hero h2 { font-size: 33px; }
  .hero-desc { font-size: 12.5px; -webkit-line-clamp: 3; }
  .hero-actions .btn { flex: 1; }
  .home-stats { grid-template-columns: 1fr 1fr; }
  .home-stat:nth-child(3) { border-left: 0; }
  .home-stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .home-stat { padding: 14px 6px; }
  .home-stat + .home-stat { padding-left: 16px; }
  .rail { grid-auto-columns: minmax(232px, 76vw); margin-right: -16px; padding-right: 16px; }
  .home-rail { grid-auto-columns: minmax(158px, 46vw); gap: 10px; }
  .home-rail-section { margin-top: 22px; }
  .home-rail-count { font-size: 7px; }
  .popular-grid { grid-template-columns: 1fr; gap: 0; }
  .image-wall { columns: 2; column-gap: 10px; }
  .wall-item { margin-bottom: 10px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .card-info { padding: 10px 11px 11px; }
  .card-title { font-size: 12.5px; }
  .card-meta { font-size: 9.5px; gap: 5px; }
  .card-meta .owner { display: none; }
  .play-orb { width: 40px; height: 40px; opacity: 1; transform: translate(-50%, -50%); background: rgba(7, 9, 13, 0.44); }
  .media-card:hover { transform: none; }
  .card-edit { display: none; }
  .library-head { margin-bottom: 16px; }
  .toolbar { gap: 8px; padding-bottom: 14px; margin-bottom: 16px; }
  .toolbar .search-inline { order: 3; width: 100%; }
  .toolbar-spacer { display: none; }
  .toolbar .select { margin-left: auto; }
  .chat-view { height: calc(100dvh - var(--topbar) - 46px); min-height: 460px; }
  .chat-shell { grid-template-columns: 1fr; border-radius: 16px; }
  .chat-aside { display: none; }
  .chat-messages { padding: 16px; }
  .msg { max-width: 88%; }
  .chat-head { padding: 12px 16px; }
  .chat-compose { padding: 10px 10px calc(8px + var(--safe-bottom)); }
  .chat-hint { display: none; }
  .admin-tabs { margin-bottom: 18px; }
  .admin-tab { padding: 0 12px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px; }
  .kpi .k-n { font-size: 26px; }
  .settings-grid { gap: 12px; }
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal { width: 100%; max-height: 92dvh; border-radius: 20px 20px 0 0; border-bottom: 0; animation: sheet-in 0.3s var(--ease); }
  @keyframes sheet-in { from { transform: translateY(100%); } }
  .modal-head { padding: 18px 18px 14px; }
  .modal-body { padding: 18px; }
  .modal-foot { padding: 12px 18px calc(12px + var(--safe-bottom)); }
  .form-grid { grid-template-columns: 1fr; }
  .viewer-top { height: 58px; padding: 0 12px; gap: 10px; }
  .viewer-top .v-actions .btn span { display: none; }
  .viewer-top .v-actions .btn { width: 36px; min-height: 36px; padding: 0; }
  .viewer-stage { padding: 6px; }
  .viewer-side { padding: 18px; max-height: 46dvh; }
  .viewer-image-wrap { max-height: 100%; }
  .viewer-image-tools { bottom: 12px; }
  .toast-root { left: 14px; right: 14px; top: calc(var(--topbar) + 10px); bottom: auto; align-items: center; }
  .toast { width: 100%; max-width: none; }
  .bottom-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    height: calc(62px + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    border-top: 1px solid var(--line);
    background: rgba(8, 11, 16, 0.92);
    backdrop-filter: blur(20px) saturate(1.2);
  }
  .bottom-link {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--faint);
    font-size: 9.5px;
    position: relative;
    border: 0;
    background: transparent;
    font-family: inherit;
    padding: 0;
  }
  .bottom-link svg { width: 20px; height: 20px; }
  .bottom-link.active { color: var(--gold); }
  .bottom-link.active::before { content: ""; position: absolute; top: 0; width: 18px; height: 2px; border-radius: 2px; background: var(--gold); }
  .bottom-link .nav-badge { position: absolute; top: 8px; left: calc(50% + 7px); margin: 0; }
}

@media (max-width: 520px) {
  .hero { min-height: 440px; }
  .hero h2 { font-size: 30px; }
  .hero-actions { margin-top: 20px; }
  .hero-actions .btn { min-height: 44px; font-size: 13px; }
  .home-empty { min-height: 400px; padding: 24px 20px; }
  .home-empty .empty-frames { display: none; }
  .home-empty h2 { font-size: 32px; }
  .home-empty .actions .btn { flex: 1; }
  .home-stat .n { font-size: 21px; }
  .home-stat .l { font-size: 9px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .card-visual { aspect-ratio: 4 / 3; }
  .card-top { inset: 8px 8px auto; }
  .badge { height: 19px; padding: 0 6px; font-size: 8px; }
  .card-title { font-size: 12px; }
  .image-wall { columns: 1; }
  .profile-stats { grid-template-columns: 1fr 1fr; }
  .auth-claim h1 { font-size: 38px; }
  .auth-card h2 { font-size: 28px; }
  .auth-panel { padding: 28px 20px; }
  .v-side-title { font-size: 19px; }
  .preview-strip { grid-template-columns: repeat(3, 1fr); }
  .kpi .k-n { font-size: 23px; }
  .modal-head h3 { font-size: 18px; }
  .table-tools { padding: 11px 12px; }
}

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

/* ---------- late refinements ---------- */
.chat-main { position: relative; }
.chat-shell { min-height: 0; }
.chat-view { height: calc(100dvh - var(--topbar) - 190px); min-height: 500px; }
.view.chat-mode { padding-bottom: 18px; }
.panel-body .k-n { font-family: var(--font-latin); line-height: 1; letter-spacing: -0.02em; }
.table-media .im img, .top-item .im img { background: var(--panel-3); }
.modal .textarea { resize: vertical; }
.profile-head .avatar.lg { box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.04); }
.msg .msg-text { max-width: 100%; }
.msg-tools { margin-bottom: 1px; }
@media (hover: none) {
  .msg-tools { display: none; }
}
.chat-new-hint { position: absolute; }
.viewer-side .v-meta-grid + .v-owner { margin-top: 2px; }
@media (max-width: 860px) {
  .chat-view { height: calc(100dvh - var(--topbar) - 185px); min-height: 360px; }
  .view.chat-mode { padding-bottom: 12px; }
  .chat-page-head { margin-bottom: 10px !important; }
  .chat-page-head p { display: none; }
  .chat-page-head .actions { display: none; }
  .chat-page-head h1 { font-size: 30px; }
  .admin-tabs { position: sticky; top: var(--topbar); z-index: 8; background: rgba(8, 11, 16, 0.94); backdrop-filter: blur(14px); margin-top: -4px; }
  .panel-head { padding: 14px 15px; }
  .panel-body { padding: 14px 15px; }
  .chart-legend { display: none; }
  .dash-grid { gap: 12px; }
  .storage-ring { width: 92px; height: 92px; }
  .table-tools .select { max-width: 112px; }
  .settings-card { padding: 16px; }
  .audit-action { white-space: normal; }
}
@media (max-width: 520px) {
  .chat-view { height: calc(100dvh - var(--topbar) - 176px); min-height: 340px; }
  .chat-head .online { font-size: 10px; }
  .chat-messages { gap: 14px; }
  .msg { max-width: 92%; }
  .compose-box { padding-left: 10px; }
  .kpi-grid { gap: 8px; }
  .kpi { padding: 13px 12px; }
  .kpi .k-top { font-size: 9px; }
  .kpi .k-foot { font-size: 9px; }
  .panel-head .s { display: none; }
  .table-tools { gap: 7px; }
  .table-tools .search-inline { max-width: none; flex-basis: 100%; }
  .formats span:nth-child(n+6) { display: none; }
}

/* Enhanced auth layout */
.auth-status {
  position: absolute;
  top: clamp(30px, 4.4vw, 64px);
  right: clamp(30px, 4.4vw, 64px);
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--mint);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
}
.auth-room-stats { display: flex; gap: 0; margin-top: 28px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); width: min(100%, 440px); }
.auth-room-stats > div { flex: 1; padding: 13px 0; border-left: 1px solid var(--line); padding-left: 18px; }
.auth-room-stats > div:first-child { border-left: 0; padding-left: 0; }
.auth-room-stats .n { display: block; font-family: var(--font-latin); font-size: 21px; line-height: 1; color: var(--text); }
.auth-room-stats .l { display: block; margin-top: 5px; color: var(--faint); font-size: 9px; letter-spacing: 0.06em; }
.auth-mini-line { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 17px; color: var(--faint); font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.14em; }
.auth-mini-line span::before { content: "·"; margin-right: 6px; color: var(--gold); }
.auth-panel { overflow-y: auto; }
.auth-tabs { display: flex; gap: 3px; padding: 3px; margin-bottom: 20px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255, 255, 255, 0.02); }
.auth-tab { flex: 1; height: 35px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; transition: 0.18s; }
.auth-tab:hover:not(:disabled) { color: var(--text); }
.auth-tab.active { background: rgba(232, 184, 109, 0.14); color: var(--gold-bright); box-shadow: inset 0 0 0 1px rgba(232, 184, 109, 0.18); }
.auth-tab:disabled { opacity: 0.4; cursor: not-allowed; }
.auth-card h2 { font-size: clamp(28px, 2.4vw, 34px); }
.auth-switch-line { margin-top: 17px; text-align: center; color: var(--faint); font-size: 11px; }
.text-link { border: 0; background: none; color: var(--gold); font-size: inherit; padding: 0 2px; text-decoration: underline; text-underline-offset: 3px; }
.text-link:hover { color: var(--gold-bright); }
.auth-closed-note { display: flex; gap: 9px; align-items: flex-start; padding: 11px 13px; margin: 0 0 15px; border: 1px dashed var(--line-strong); border-radius: 10px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.auth-closed-note svg { width: 14px; height: 14px; flex: none; margin-top: 1px; color: var(--gold); }
.invite-field .req { margin-left: 7px; padding: 1px 5px; border-radius: 4px; background: var(--gold-dim); color: var(--gold); font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.06em; vertical-align: 2px; }
.input-icon { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.input-icon svg { width: 15px; height: 15px; }
#auth-invite { font-family: var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; padding-right: 42px; }
.auth-mobile-stats { display: none; }
@media (max-width: 1020px) {
  .auth-status { display: none; }
  .auth-panel { justify-content: flex-start; padding-top: 28px; overflow-y: auto; }
  .auth-mobile-brand { margin-bottom: 18px; }
  .auth-mobile-stats { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; color: var(--faint); font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.04em; }
  .auth-mobile-stats span { display: inline-flex; align-items: center; gap: 5px; }
  .auth-mobile-stats .dot { width: 5px; height: 5px; }
  .auth-card h2 { font-size: 29px; }
}
.auth-card.is-register .auth-lead { margin-bottom: 20px; }
.auth-card.is-register .auth-form { gap: 13px; }
.auth-card.is-register .auth-note { margin-top: 18px; }

/* Mobile video surface: remove blur/compositing effects that cause black
   hardware-overlay video on several Android browsers. */
@media (max-width: 860px) {
  .viewer { backdrop-filter: none; background: #04060a; }
  .viewer-main { display: block; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .viewer-left { display: block; overflow: visible; }
  .viewer-stage { padding: 0; min-height: 0; max-height: none; background: #000; overflow: hidden; align-items: center; }
  .viewer-stage video {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 55dvh;
    margin: 0 auto;
    border-radius: 0;
    box-shadow: none;
    object-fit: contain;
    background: #000;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
  }
  .video-shell { min-height: 0; }
  .viewer-social { padding: 14px 14px 32px; }
  .viewer-episodes { padding: 11px 14px 12px; }
  .viewer-tags { padding: 8px 14px; }
  .series-admin-card { flex-direction: column; gap: 8px; }
  .series-admin-cover { width: 100%; height: 120px; }
  .comments-list { max-height: 240px; }
  .heat-strip { height: 28px; }
  .danmaku-item { font-size: 13px; }
  .viewer-side { max-height: none; min-height: 0; }
  .transcode-stage { width: 100%; height: 100%; aspect-ratio: auto; max-height: none; border-radius: 0; box-shadow: none; }
  .transcode-panel { width: min(340px, 84%); padding: 18px; }

  .category-strip { display: block; margin-bottom: 14px; }
  .category-strip-label { margin: 0 0 8px 2px; }
  .category-strip-scroll { margin-right: -16px; padding-right: 16px; }
  .home-category-row { margin-top: 14px; }
  .upload-category-row { align-items: flex-start; flex-direction: column; gap: 9px; }
  .upload-category-row .select { width: 100%; }
  .category-admin-row { flex-wrap: wrap; gap: 9px; padding: 12px 14px; }
  .category-admin-row .cat-name { flex-basis: calc(100% - 50px); }
  .category-admin-row .cat-order { flex-direction: row; margin-left: auto; }
  .invite-summary { align-items: flex-start; flex-direction: column; gap: 16px; padding: 16px; }
  .invite-summary-stats { width: 100%; gap: 16px; }
  .invite-summary-stats > div { text-align: left; }
  .invite-summary-stats .btn { margin-left: auto; }
  .invite-table .invite-code { font-size: 10.5px; }
  .game-shell { height: calc(100dvh - var(--topbar) - 182px); min-height: 420px; border-radius: 14px; }
  .game-page-head { margin-bottom: 10px; }
  .game-page-head p { display: none; }
  .game-page-head .actions { gap: 6px; }
  .game-page-head .actions .btn { flex: 1; min-height: 34px; padding: 0 8px; font-size: 11px; }
  .game-hud { height: 32px; font-size: 7.5px; }
  .game-hud-right { display: none; }
  .admin-commandbar { gap: 8px; padding: 11px 12px; }
  .cmd-status { border-left: 0; padding: 0 7px; }
  .cmd-status:nth-child(6) { display: none; }
  .cmd-actions { width: 100%; margin-left: 0; padding-left: 0; }
  .cmd-actions .btn { flex: 1; }
}
