/* 大肥鱼刷B站 · 多人托管面板 —— 纯静态深色主题 */
:root {
  --bg: #0b1220;
  --bg-2: #08101c;
  --panel: rgba(18, 31, 51, 0.66);
  --panel-2: rgba(24, 41, 65, 0.78);
  --border: rgba(110, 231, 255, 0.14);
  --border-strong: rgba(110, 231, 255, 0.32);
  --text: #e7f2ff;
  --muted: #8ba7c4;
  --primary: #37c5ff;
  --accent: #6ee7ff;
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #fb7185;
  --idle: #7c8ea6;
  --radius: 14px;
  --shadow: 0 10px 32px rgba(3, 10, 20, 0.45);
}

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

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  background:
    radial-gradient(1100px 560px at 8% -12%, rgba(55, 197, 255, 0.16), transparent 62%),
    radial-gradient(900px 480px at 108% 2%, rgba(110, 231, 255, 0.10), transparent 58%),
    linear-gradient(180deg, #0b1220 0%, #08101c 58%, #070c15 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* 背景气泡（鱼在游的氛围） */
.bg-decor { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bubble {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, rgba(110, 231, 255, 0.30), rgba(55, 197, 255, 0.04) 62%, transparent 70%);
  filter: blur(1px);
  animation: drift 26s ease-in-out infinite;
}
.bubble.b1 { width: 220px; height: 220px; left: -60px; top: 18%; animation-duration: 30s; }
.bubble.b2 { width: 130px; height: 130px; right: 6%; top: 12%; animation-duration: 23s; animation-delay: -7s; }
.bubble.b3 { width: 76px; height: 76px; left: 42%; bottom: 8%; animation-duration: 19s; animation-delay: -3s; }
@keyframes drift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.75; }
  50% { transform: translate3d(18px, -26px, 0) scale(1.06); opacity: 1; }
}

#app-view, #login-view { position: relative; z-index: 1; }

/* ---------- 品牌 ---------- */
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 44px; height: 44px; flex: 0 0 auto;
  display: grid; place-items: center;
  font-size: 23px;
  border-radius: 13px;
  background: linear-gradient(150deg, rgba(55, 197, 255, 0.28), rgba(110, 231, 255, 0.08));
  border: 1px solid var(--border-strong);
  box-shadow: 0 6px 20px rgba(55, 197, 255, 0.18);
}
.brand-text { min-width: 0; }
.brand-title {
  font-size: 19px; font-weight: 700; letter-spacing: 0.5px;
  background: linear-gradient(90deg, #37c5ff, #6ee7ff, #b9f4ff, #37c5ff);
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: swim 9s linear infinite;
  white-space: nowrap;
}
.brand-sub { font-size: 12px; color: var(--muted); letter-spacing: 1px; }
@keyframes swim { from { background-position: 0% 50%; } to { background-position: 300% 50%; } }
@media (prefers-reduced-motion: reduce) {
  .brand-title, .bubble { animation: none; }
}

/* ---------- 玻璃卡片 ---------- */
.glass {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

/* ---------- 登录 ---------- */
.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}
.login-card { width: 100%; max-width: 400px; padding: 26px 24px 20px; }
.login-card .brand { margin-bottom: 20px; }
.login-foot { margin: 16px 0 0; font-size: 12px; color: var(--muted); text-align: center; }

.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border-radius: 12px;
  background: rgba(6, 14, 26, 0.6);
  border: 1px solid var(--border);
  margin-bottom: 18px;
}
.seg-btn {
  appearance: none; border: 0; cursor: pointer;
  padding: 9px 10px; border-radius: 9px;
  background: transparent; color: var(--muted);
  font-size: 14px; font-family: inherit; transition: all 0.18s ease;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active {
  color: #04121d; font-weight: 600;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 4px 14px rgba(55, 197, 255, 0.3);
}

.stack { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; color: var(--muted); letter-spacing: 0.4px; }

input[type="text"], input[type="password"], input[type="number"], input[type="time"],
input[type="date"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  background: rgba(6, 14, 26, 0.72);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px rgba(55, 197, 255, 0.14);
}
select option { background: #0d1a2b; color: var(--text); }

.form-error {
  color: var(--err);
  font-size: 13px;
  padding: 8px 11px;
  border-radius: 10px;
  background: rgba(251, 113, 133, 0.10);
  border: 1px solid rgba(251, 113, 133, 0.32);
}

/* ---------- 按钮 ---------- */
.btn {
  appearance: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 15px;
  font-family: inherit; font-size: 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(24, 41, 65, 0.7);
  color: var(--text);
  transition: transform 0.12s ease, background 0.16s ease, border-color 0.16s ease, opacity 0.16s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--border-strong); background: rgba(32, 54, 84, 0.8); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn.primary {
  border-color: transparent;
  color: #04121d; font-weight: 600;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 6px 18px rgba(55, 197, 255, 0.24);
}
.btn.primary:hover { background: linear-gradient(135deg, #4ed0ff, #8beeff); }
.btn.ghost { background: rgba(10, 20, 34, 0.55); color: var(--text); }
.btn.danger { color: var(--err); border-color: rgba(251, 113, 133, 0.34); background: rgba(251, 113, 133, 0.10); }
.btn.danger:hover { background: rgba(251, 113, 133, 0.2); }
.btn.sm { padding: 6px 10px; font-size: 12.5px; border-radius: 9px; }
.btn.block { width: 100%; }
.icon-btn {
  appearance: none; cursor: pointer; border: 0; background: transparent;
  color: var(--muted); font-size: 16px; line-height: 1; padding: 6px; border-radius: 8px;
}
.icon-btn:hover { color: var(--text); background: rgba(110, 231, 255, 0.1); }

.input { max-width: 190px; }

/* ---------- 顶栏 / 标签 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  background: rgba(9, 17, 29, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: sticky; top: 0; z-index: 20;
}
.brand.small .brand-mark { width: 38px; height: 38px; font-size: 20px; border-radius: 11px; }
.brand.small .brand-title { font-size: 16px; }
.brand.small .brand-sub { font-size: 11px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.user-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: 999px;
  font-size: 13px; color: var(--text);
  background: rgba(24, 41, 65, 0.7);
  border: 1px solid var(--border);
}
.user-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }

.tabs {
  display: flex; gap: 8px;
  padding: 12px 22px 0;
  max-width: 1240px; margin: 0 auto;
}
.tab {
  appearance: none; cursor: pointer; font-family: inherit; font-size: 14px;
  padding: 9px 16px; border-radius: 11px 11px 0 0;
  border: 1px solid transparent; border-bottom: none;
  background: transparent; color: var(--muted);
  transition: all 0.16s ease;
}
.tab:hover { color: var(--text); }
.tab.active {
  color: var(--text); font-weight: 600;
  background: var(--panel);
  border-color: var(--border);
  box-shadow: 0 -2px 18px rgba(55, 197, 255, 0.08) inset;
}

.main { max-width: 1240px; margin: 0 auto; padding: 18px 22px 64px; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-bottom: 16px;
}
.panel-head h2 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: 0.4px; }
.panel-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.empty {
  color: var(--muted); font-size: 13.5px;
  padding: 26px; text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(10, 20, 34, 0.4);
}

/* ---------- Cookie 折叠 ---------- */
.cookie-box { margin-bottom: 18px; overflow: hidden; }
.cookie-box > summary {
  cursor: pointer; list-style: none;
  padding: 13px 18px; font-size: 13.5px; color: var(--muted);
  user-select: none;
}
.cookie-box > summary::-webkit-details-marker { display: none; }
.cookie-box > summary:hover { color: var(--text); }
.cookie-box > summary::before { content: "▸ "; color: var(--primary); }
.cookie-box[open] > summary::before { content: "▾ "; }
.cookie-box form { padding: 0 18px 18px; }

/* ---------- 账号网格 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 16px;
}

.card {
  padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.card-top { display: flex; align-items: center; gap: 11px; }
.avatar-wrap {
  position: relative; width: 46px; height: 46px; flex: 0 0 auto;
  border-radius: 50%; overflow: hidden;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #10233a, #1c3c5c);
  border: 1px solid var(--border-strong);
}
.avatar-emoji { position: absolute; font-size: 21px; }
.avatar { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar.img-bad { display: none; }
.who { min-width: 0; flex: 1 1 auto; }
.uname { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta-line { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.badge {
  flex: 0 0 auto;
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid transparent; letter-spacing: 0.3px;
  background: rgba(124, 142, 166, 0.16); color: var(--idle);
  border-color: rgba(124, 142, 166, 0.3);
}
.badge.running {
  color: var(--ok); background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.36);
  animation: pulse 1.9s ease-in-out infinite;
}
.badge.paused { color: var(--warn); background: rgba(251, 191, 36, 0.12); border-color: rgba(251, 191, 36, 0.34); }
.badge.error { color: var(--err); background: rgba(251, 113, 133, 0.12); border-color: rgba(251, 113, 133, 0.36); }
.badge.idle { color: var(--idle); }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.34); }
  50% { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
}

.last-error {
  font-size: 12px; color: var(--err);
  background: rgba(251, 113, 133, 0.08);
  border: 1px solid rgba(251, 113, 133, 0.24);
  border-radius: 9px; padding: 6px 9px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.goal-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.bar > i {
  display: block; height: 100%; width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.5s ease;
}
.bar.goal-bar > i { box-shadow: 0 0 12px rgba(110, 231, 255, 0.4); }

.stats {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  padding: 10px 6px;
  border-radius: 11px;
  background: rgba(6, 14, 26, 0.42);
  border: 1px solid var(--border);
}
.stat { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; }
.stat b { font-size: 13.5px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.stat span { font-size: 10.5px; color: var(--muted); white-space: nowrap; }

.current {
  padding: 10px 10px 11px;
  border-radius: 11px;
  background: rgba(6, 14, 26, 0.42);
  border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 7px;
}
.current.empty-cur { padding: 12px 10px; }
.cur-title {
  font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.empty-cur .cur-title { color: var(--muted); font-size: 12.5px; }
.cur-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cur-bar { height: 6px; }

.card-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.card-actions .btn { flex: 1 1 auto; min-width: 66px; }

/* ---------- 实时画面 ---------- */
.live-layout { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(260px, 1fr); gap: 16px; margin-bottom: 16px; }
.live-stage {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: #050b14;
  aspect-ratio: 16 / 9;
  display: grid; place-items: center;
}
#live-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  opacity: 0; transition: opacity 0.25s ease;
  background: #050b14;
}
#live-img.on { opacity: 1; }
.live-empty {
  position: relative; z-index: 1;
  color: var(--muted); font-size: 13.5px;
  padding: 10px 16px; border-radius: 10px;
  background: rgba(6, 14, 26, 0.7);
  border: 1px dashed var(--border);
}

.live-meta { padding: 16px; display: flex; flex-direction: column; gap: 10px; font-size: 13px; min-height: 180px; }
.meta-loading { color: var(--muted); font-size: 13px; }
.meta-loading.err { color: var(--err); }
.meta-row { display: flex; gap: 10px; align-items: flex-start; }
.meta-row .k { flex: 0 0 74px; color: var(--muted); font-size: 12.5px; }
.meta-row .v { flex: 1 1 auto; min-width: 0; word-break: break-all; }
.meta-progress { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--muted); }
.meta-progress .bar { flex: 1 1 auto; }
.meta-sub { font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 9px; }

.logs { overflow: hidden; }
.logs-head {
  padding: 11px 16px; font-size: 12.5px; color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.logs-body {
  height: 320px; overflow: auto;
  padding: 10px 14px;
  font-family: "JetBrains Mono", "Cascadia Mono", Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.7;
}
.log-line { display: flex; gap: 9px; white-space: pre-wrap; word-break: break-word; }
.log-line .ts { flex: 0 0 auto; color: #5d7590; }
.log-line .lv { flex: 0 0 42px; text-transform: uppercase; font-size: 10.5px; padding-top: 2px; }
.log-line .msg { flex: 1 1 auto; min-width: 0; color: #cfe3f7; }
.lv-info .lv { color: var(--primary); }
.lv-warn .lv { color: var(--warn); }
.lv-warn .msg { color: #f3d79a; }
.lv-error .lv { color: var(--err); }
.lv-error .msg { color: #ffc0cb; }
.lv-debug .lv, .lv-trace .lv { color: var(--muted); }
.lv-debug .msg, .lv-trace .msg { color: var(--muted); }
.log-empty { color: var(--muted); }

/* ---------- 日记 ---------- */
.diary-sum {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px; padding: 16px 18px; margin-bottom: 18px;
}
.ds-item { display: flex; flex-direction: column; gap: 2px; }
.ds-item b { font-size: 19px; color: var(--accent); font-weight: 600; }
.ds-item span { font-size: 12px; color: var(--muted); }

.timeline { position: relative; padding-left: 22px; display: flex; flex-direction: column; gap: 14px; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(180deg, rgba(55, 197, 255, 0.5), rgba(110, 231, 255, 0.06));
  border-radius: 2px;
}
.diary-item { position: relative; }
.diary-dot {
  position: absolute; left: -21px; top: 20px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(55, 197, 255, 0.16), 0 0 12px rgba(55, 197, 255, 0.6);
}
.diary-card { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.diary-top { display: flex; gap: 12px; align-items: flex-start; }
.diary-cover {
  width: 116px; height: 68px; flex: 0 0 auto;
  object-fit: cover; border-radius: 9px;
  border: 1px solid var(--border);
  background: #0a1524;
}
.diary-title-wrap { min-width: 0; flex: 1 1 auto; }
.diary-title { font-size: 14.5px; font-weight: 600; }
.diary-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.diary-summary { margin: 0; font-size: 13px; color: #c6dbf0; line-height: 1.7; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 11.5px; padding: 3px 9px; border-radius: 999px;
  color: var(--accent);
  background: rgba(55, 197, 255, 0.10);
  border: 1px solid rgba(55, 197, 255, 0.26);
}
.frames { display: flex; gap: 8px; flex-wrap: wrap; }
.frame-thumb {
  width: 108px; height: 61px;
  object-fit: cover; border-radius: 8px;
  border: 1px solid var(--border);
  background: #0a1524;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease;
}
.frame-thumb:hover { transform: scale(1.03); border-color: var(--border-strong); }
.frame-thumb.img-bad { display: none; }
img.img-bad { display: none; }

/* ---------- 管理 ---------- */
.admin-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; align-items: start; }
.card-block { padding: 16px 18px; }
.card-block h3 { margin: 0 0 14px; font-size: 15px; font-weight: 600; }
.inline-form { display: flex; gap: 9px; margin-bottom: 14px; flex-wrap: wrap; }
.inline-form .input { flex: 1 1 180px; max-width: none; }

.invite-list { display: flex; flex-direction: column; gap: 9px; max-height: 420px; overflow: auto; }
.invite-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 11px;
  background: rgba(6, 14, 26, 0.5);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}
.invite-item.new { border-color: var(--border-strong); background: rgba(55, 197, 255, 0.10); }
.invite-code {
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 13px; letter-spacing: 1px; color: var(--accent);
  word-break: break-all;
}
.invite-meta { display: flex; gap: 9px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); flex: 1 1 120px; }
.invite-meta .used { color: var(--idle); }
.invite-meta .unused { color: var(--ok); }
.invite-ops { display: flex; gap: 6px; margin-left: auto; }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--border); }
.table th { font-size: 11.5px; color: var(--muted); font-weight: 500; letter-spacing: 0.4px; }
.table tbody tr:hover { background: rgba(55, 197, 255, 0.05); }
.role { font-size: 11px; padding: 2px 8px; border-radius: 999px; }
.role.admin { color: var(--warn); background: rgba(251, 191, 36, 0.12); border: 1px solid rgba(251, 191, 36, 0.3); }
.role.user { color: var(--idle); background: rgba(124, 142, 166, 0.14); border: 1px solid rgba(124, 142, 166, 0.28); }

/* ---------- 弹窗 ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center;
  padding: 22px 16px;
  background: rgba(3, 8, 16, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade 0.16s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal-shell { width: 100%; max-width: 540px; max-height: 88vh; overflow: auto; }
.modal-card {
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(2, 8, 16, 0.65);
  padding: 18px 20px 20px;
}
.modal-card.small { max-width: 400px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.confirm-text { margin: 0; font-size: 13.5px; color: #cfdff0; line-height: 1.7; }

.frow { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 7px 0; }
.frow + .frow { border-top: 1px solid rgba(110, 231, 255, 0.07); }
.frow .flabel { font-size: 13px; color: var(--muted); flex: 0 0 auto; }
.frow > input, .frow > select { flex: 1 1 auto; max-width: 230px; }
.frow > .time-row { flex: 1 1 auto; max-width: 300px; min-width: 0; }
.frow > .switch-group { flex: 1 1 auto; max-width: none; }
.time-row { display: flex; align-items: center; gap: 7px; min-width: 0; }
.time-row input[type="time"] { flex: 1 1 0; width: auto; min-width: 0; padding: 9px 8px; }
.time-row span { color: var(--muted); font-size: 12px; }
.switch-group { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }

.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span {
  position: relative; width: 38px; height: 21px; flex: 0 0 auto;
  border-radius: 999px; background: rgba(124, 142, 166, 0.34);
  border: 1px solid var(--border);
  transition: background 0.18s ease;
}
.switch span::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 15px; height: 15px; border-radius: 50%;
  background: #d7e6f5;
  transition: transform 0.18s ease, background 0.18s ease;
}
.switch input:checked + span { background: linear-gradient(135deg, var(--primary), var(--accent)); border-color: transparent; }
.switch input:checked + span::after { transform: translateX(17px); background: #04121d; }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px rgba(55, 197, 255, 0.25); }

/* ---------- 扫码 ---------- */
.qr-body { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 4px 0 2px; }
.qr-frame {
  width: 220px; height: 220px;
  display: grid; place-items: center;
  padding: 10px; border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 26px rgba(3, 10, 20, 0.5);
}
.qr-frame img { width: 100%; height: 100%; object-fit: contain; display: block; }
.qr-frame img:not([src]) { opacity: 0; }
.qr-status { margin: 0; font-size: 13px; color: var(--muted); text-align: center; min-height: 20px; }
.qr-status.warn { color: var(--warn); }
.qr-status.err { color: var(--err); }
.hint { margin: 0; font-size: 12px; color: var(--muted); text-align: center; }

/* ---------- Toast ---------- */
.toasts {
  position: fixed; right: 18px; bottom: 18px; z-index: 120;
  display: flex; flex-direction: column; gap: 9px;
  max-width: min(360px, calc(100vw - 36px));
  pointer-events: none;
}
.toast {
  padding: 11px 14px;
  font-size: 13px; line-height: 1.5;
  border-radius: 11px;
  color: var(--text);
  background: rgba(20, 34, 54, 0.96);
  border: 1px solid var(--border-strong);
  box-shadow: 0 12px 30px rgba(2, 8, 16, 0.6);
  animation: toast-in 0.2s ease;
  word-break: break-word;
}
.toast.ok { border-color: rgba(52, 211, 153, 0.45); }
.toast.error { border-color: rgba(251, 113, 133, 0.5); color: #ffe4e9; }
.toast.out { animation: toast-out 0.24s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(110, 231, 255, 0.18); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(110, 231, 255, 0.32); }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .live-layout { grid-template-columns: 1fr; }
  .admin-wrap { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .diary-sum { grid-template-columns: 1fr 1fr 1fr; }
  .main { padding: 14px 14px 56px; }
  .tabs { padding: 10px 14px 0; }
  .topbar { padding: 12px 14px; }
  .brand-sub { display: none; }
  .logs-body { height: 260px; }
}
@media (max-width: 520px) {
  .card-actions .btn { flex: 1 1 42%; }
  .frow { flex-direction: column; align-items: stretch; gap: 7px; }
  .frow > input, .frow > select, .frow > .time-row, .frow > .switch-group { max-width: none; }
  .diary-cover { width: 84px; height: 50px; }
  .ds-item b { font-size: 16px; }
}

/* ---------- 概览条 ---------- */
.overview {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 13px 18px; margin-bottom: 16px; flex-wrap: wrap;
}
.ov-left { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.ov-item { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ov-item b { font-size: 15px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.ov-item span { font-size: 11px; color: var(--muted); white-space: nowrap; letter-spacing: 0.3px; }
.ov-item.run b { color: var(--ok); }
.ov-right { display: flex; align-items: flex-end; gap: 9px; }
.ov-chart-cap { font-size: 11px; color: var(--muted); padding-bottom: 2px; white-space: nowrap; }
.ov-chart { display: flex; align-items: flex-end; gap: 3px; height: 46px; }
.ov-bar {
  width: 9px; min-height: 3px; border-radius: 3px 3px 1px 1px;
  background: linear-gradient(180deg, var(--accent), rgba(55, 197, 255, 0.28));
  transition: height 0.3s ease, filter 0.15s ease;
}
.ov-bar:hover { filter: brightness(1.4); }
.ov-bar.zero { background: rgba(124, 142, 166, 0.26); }
.ov-bar.today { background: linear-gradient(180deg, #b9f4ff, var(--primary)); box-shadow: 0 0 10px rgba(110, 231, 255, 0.5); }

/* ---------- 立即刷一条 ---------- */
.btn.nudge {
  color: #eaf9ff;
  border-color: rgba(110, 231, 255, 0.44);
  background: linear-gradient(135deg, rgba(55, 197, 255, 0.22), rgba(110, 231, 255, 0.10));
}
.btn.nudge:hover { background: linear-gradient(135deg, rgba(55, 197, 255, 0.36), rgba(110, 231, 255, 0.2)); }

/* ---------- 空态引导 ---------- */
.empty-guide {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 26px 22px; text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: rgba(10, 20, 34, 0.45);
}
.eg-head { font-size: 16px; font-weight: 600; }
.eg-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.eg-steps li {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--muted);
  background: rgba(6, 14, 26, 0.6);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 12px;
}
.eg-steps li b { color: var(--accent); font-weight: 600; }
.eg-hint { margin: 0; font-size: 12px; color: var(--muted); max-width: 470px; line-height: 1.6; }

/* ---------- 设置项说明 ---------- */
.frow > .with-hint { flex: 1 1 auto; min-width: 0; max-width: 240px; display: flex; flex-direction: column; gap: 4px; }
.fhint { font-size: 11px; color: var(--muted); line-height: 1.5; }

/* ---------- 日记标签 ---------- */
.diary-tags { justify-content: flex-end; }
.diary-tags .chip { color: #b9cfe4; background: rgba(124, 142, 166, 0.13); border-color: rgba(124, 142, 166, 0.26); }

@media (max-width: 900px) {
  .overview { gap: 12px; padding: 12px 14px; }
  .ov-left { gap: 14px; }
  .ov-chart { height: 38px; }
  .ov-bar { width: 7px; }
  .ov-chart-cap { display: none; }
}
