/* ═══════════════════════════════════════════════════════════════
   书香浅色主题 · 扁平悬浮风
   · 宣纸米底 + 茶褐主色 + 朱砂点缀
   · 纯系统字体，无衬线
   · 保留所有 class 名，HTML/JS 零改动
═══════════════════════════════════════════════════════════════ */

/* ─── RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* 背景层 */
  --bg:       #FAF7F0;   /* 宣纸底（最外层） */
  --surface:  #FFFDF7;   /* 侧栏 / topbar / 模态框底 */
  --card:     #FFFFFF;   /* 卡片 / 输入框底 */
  --hover:    #F0E7D5;   /* hover 态柔米色 */

  /* 线 */
  --border:   rgba(107,84,66,0.08);   /* 极浅棕边线（默认） */
  --border2:  rgba(107,84,66,0.15);   /* 稍重边线 hover 用 */

  /* 阴影（悬浮感核心）*/
  --shadow-sm: 0 1px 3px rgba(107,84,66,0.04), 0 0 0 0.5px rgba(107,84,66,0.06);
  --shadow:    0 2px 10px rgba(107,84,66,0.05), 0 0 0 0.5px rgba(107,84,66,0.06);
  --shadow-lg: 0 8px 24px rgba(107,84,66,0.08), 0 0 0 0.5px rgba(107,84,66,0.06);
  --shadow-brand: 0 4px 14px rgba(107,84,66,0.22);

  /* 品牌 & 强调（保留 gold 命名以兼容 HTML/JS）*/
  --gold:     #6B5442;   /* 茶褐主色（原金色替换） */
  --gold2:    #7D6450;   /* 主色 hover */

  /* 文字 */
  --text:     #2E2824;   /* 墨色（正文）*/
  --muted:    #85776A;   /* 辅助文字 */
  --dim:      #B5A58B;   /* 更浅辅助 / placeholder */

  /* 语义色 */
  --green:    #4A8563;   /* 茶绿：成功 */
  --red:      #A13C2F;   /* 朱砂：危险 / 到期 */
  --yellow:   #C99366;   /* 赭金：进行中 */
  --blue:     #4A6B85;   /* 靛青：信息 */

  /* 圆角 */
  --r-sm:     8px;
  --r-md:     12px;
  --r-lg:     16px;

  /* 布局 */
  --sidebar:  240px;

  font-size:  15px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

button, input, textarea, select { font-family: inherit; }

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold2); }

/* ─── SCREENS ──────────────────────────────────────────────── */
.screen { display: none; width: 100%; height: 100%; }
.screen.active { display: flex; }

/* ─── LOGIN ────────────────────────────────────────────────── */
#login {
  align-items: center; justify-content: center;
  background: var(--bg);
  position: relative; overflow: hidden; flex-direction: column;
}
/* 保留原网格与光晕，但色调换成米色系 */
.login-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(107,84,66,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(107,84,66,0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 30%, transparent 100%);
}
.login-glow {
  position: absolute; width: 700px; height: 700px; border-radius: 50%;
  background: radial-gradient(circle, rgba(184,135,78,0.14) 0%, transparent 65%);
  top: 50%; left: 50%; transform: translate(-50%, -55%);
  pointer-events: none;
}
.login-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 400px; margin: 1rem;
  background: var(--card);
  border: none;
  border-radius: var(--r-lg);
  padding: 2.5rem 2.5rem 2rem;
  box-shadow: var(--shadow-lg);
  animation: fadeUp 0.4s ease;
}
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 2rem; }
.login-logo-mark {
  width: 40px; height: 40px;
  background: var(--gold);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(107,84,66,0.22);
}
.login-logo-mark svg { width: 22px; height: 22px; fill: var(--bg); }
.logo-name { font-size: 1.1rem; font-weight: 500; color: var(--text); letter-spacing: 0.02em; }
.logo-sub  { font-size: 0.72rem; color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; }
.login-title { font-size: 1.5rem; font-weight: 500; margin-bottom: 0.3rem; color: var(--text); letter-spacing: -0.01em; }
.login-sub   { font-size: 0.82rem; color: var(--muted); margin-bottom: 1.75rem; }

.tabs { display: flex; gap: 4px; background: var(--bg); border-radius: var(--r-sm); padding: 4px; margin-bottom: 1.5rem; }
.tab-btn {
  flex: 1; padding: 0.5rem; border: none; background: none;
  color: var(--muted); border-radius: 6px; cursor: pointer;
  font-size: 0.88rem; transition: all 0.2s;
}
.tab-btn.active { background: var(--card); color: var(--text); box-shadow: var(--shadow-sm); }

.field { margin-bottom: 1rem; }
.field label {
  display: block; font-size: 0.75rem; color: var(--muted);
  letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 6px;
}
.field-wrap { position: relative; }
.field input {
  width: 100%;
  background: var(--bg);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--text); font-size: 0.95rem;
  padding: 0.72rem 1rem; outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.field input:focus { border-color: var(--gold); background: var(--card); }
.field input::placeholder { color: var(--dim); }
.field input.has-eye { padding-right: 2.8rem; }

.eye-btn {
  position: absolute; right: 0; top: 0; height: 100%;
  padding: 0 0.85rem; background: none; border: none; cursor: pointer;
  color: var(--muted); display: flex; align-items: center; transition: color 0.15s;
}
.eye-btn:hover { color: var(--text); }
.eye-btn svg { width: 18px; height: 18px; }

.form-error { font-size: 0.82rem; color: var(--red); min-height: 1.2em; margin-bottom: 0.5rem; }

.btn-primary {
  width: 100%; background: var(--text); color: var(--bg);
  border: none; border-radius: var(--r-sm);
  font-size: 0.95rem; font-weight: 500; padding: 0.85rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(46,40,36,0.2);
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
}
.btn-primary:hover { background: #423832; box-shadow: 0 6px 16px rgba(46,40,36,0.26); }
.btn-primary:active { transform: scale(0.98); }

.login-footer { margin-top: 1.25rem; font-size: 0.78rem; color: var(--muted); text-align: center; }
.login-footer span { color: var(--gold); font-weight: 500; }

/* ─── APP SHELL ────────────────────────────────────────────── */
#app { flex-direction: row; overflow: hidden; }

.sidebar {
  width: var(--sidebar); flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 1.3rem 1.2rem 1rem;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.s-logo-mark {
  width: 32px; height: 32px; background: var(--gold);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(107,84,66,0.22);
}
.s-logo-mark svg { width: 17px; height: 17px; fill: var(--bg); }
.sidebar-logo span { font-size: 1rem; font-weight: 500; color: var(--text); white-space: nowrap; letter-spacing: 0.01em; }

.nav { flex: 1; padding: 0.75rem; overflow-y: auto; }
.nav-section-label {
  font-size: 0.68rem; color: var(--muted);
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 0.6rem 0.65rem 0.35rem;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 0.6rem 0.75rem; border-radius: var(--r-sm);
  cursor: pointer; color: var(--muted);
  font-size: 0.9rem; transition: background 0.15s, color 0.15s;
  white-space: nowrap; user-select: none;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.active { background: rgba(107,84,66,0.09); color: var(--gold); font-weight: 500; }
.nav-sep { height: 1px; background: var(--border); margin: 0.5rem 0; }

.sidebar-user {
  padding: 0.9rem 1rem;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--gold); color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 500;
  flex-shrink: 0; text-transform: uppercase;
}
.avatar.lg { width: 44px; height: 44px; font-size: 1rem; }
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 0.88rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.user-role { font-size: 0.72rem; color: var(--muted); }

.icon-btn {
  background: none; border: none; color: var(--muted);
  cursor: pointer; padding: 6px; border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { color: var(--red); background: rgba(161,60,47,0.08); }
.icon-btn svg { width: 15px; height: 15px; }

.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 0 1.25rem; height: 56px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0; background: var(--surface);
}
.menu-btn {
  display: none; background: none; border: none; cursor: pointer;
  color: var(--muted); padding: 6px; border-radius: var(--r-sm);
  transition: color 0.15s, background 0.15s;
}
.menu-btn:hover { color: var(--text); background: var(--hover); }
.menu-btn svg { width: 20px; height: 20px; display: block; }

.topbar-title { font-weight: 500; font-size: 0.98rem; flex: 1; color: var(--text); }

.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  padding: 0.45rem 0.9rem; width: 220px;
  transition: border-color 0.2s, background 0.2s;
}
.search-box:focus-within { border-color: var(--gold); background: var(--card); }
.search-box svg { width: 14px; height: 14px; color: var(--muted); flex-shrink: 0; }
.search-box input { background: none; border: none; outline: none; color: var(--text); font-size: 0.85rem; width: 100%; }
.search-box input::placeholder { color: var(--dim); }

.tag-strip {
  display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto;
  padding: 0.75rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  scrollbar-width: none; flex-shrink: 0;
}
.tag-strip::-webkit-scrollbar { display: none; }
.tag {
  flex-shrink: 0; padding: 0.35rem 0.9rem;
  background: var(--card);
  border: none; border-radius: 999px;
  font-size: 0.8rem; cursor: pointer;
  color: var(--muted);
  box-shadow: inset 0 0 0 0.5px var(--border2);
  transition: all 0.15s; user-select: none;
}
.tag:hover { color: var(--text); box-shadow: inset 0 0 0 0.5px var(--gold); }
.tag.on { background: var(--text); color: var(--bg); box-shadow: none; }

.content {
  flex: 1; overflow-y: auto;
  padding: 1.5rem;
  scrollbar-width: thin; scrollbar-color: var(--dim) transparent;
}
.content::-webkit-scrollbar { width: 6px; }
.content::-webkit-scrollbar-thumb { background: var(--dim); border-radius: 3px; }

/* ─── 公告条 ──────────────────────────────────────────────── */
.ann-banner {
  background: var(--card);
  border: none;
  border-radius: var(--r-md);
  padding: 0.85rem 1.1rem; margin-bottom: 1rem;
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 0.88rem;
  box-shadow: var(--shadow-sm);
  border-left: 3px solid var(--gold);
}
.ann-banner-icon { color: var(--gold); flex-shrink: 0; margin-top: 1px; }
.ann-banner-title { font-weight: 500; color: var(--text); margin-bottom: 3px; }
.ann-banner-body { color: var(--muted); line-height: 1.6; }
.ann-banner-close {
  margin-left: auto; flex-shrink: 0; cursor: pointer;
  color: var(--muted); font-size: 1.1rem; line-height: 1;
}
.ann-banner-close:hover { color: var(--text); }

/* ─── 会员到期条 ───────────────────────────────────────────── */
.expired-banner {
  background: var(--card);
  border: none;
  border-left: 3px solid var(--red);
  border-radius: var(--r-md);
  padding: 0.85rem 1.1rem; margin-bottom: 1rem;
  display: flex; align-items: center; gap: 14px;
  font-size: 0.88rem;
  box-shadow: var(--shadow-sm);
}
.expired-banner .eb-text { flex: 1; }
.expired-banner .eb-title { font-weight: 500; color: var(--red); margin-bottom: 3px; }
.expired-banner .eb-sub { color: var(--muted); }
.btn-renew {
  background: var(--gold); color: var(--bg);
  border: none; border-radius: var(--r-sm);
  padding: 0.55rem 1.3rem;
  font-size: 0.88rem; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow-brand);
  transition: background 0.15s, transform 0.1s;
}
.btn-renew:hover { background: var(--gold2); }
.btn-renew:active { transform: scale(0.98); }

/* ─── 统计卡片 ─────────────────────────────────────────────── */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 1.5rem; }
.stat-card {
  background: var(--card);
  border: none;
  border-radius: var(--r-md);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
}
.stat-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.stat-label { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px; }
.stat-num { font-size: 1.6rem; font-weight: 500; color: var(--text); letter-spacing: -0.01em; }
.stat-num.gold  { color: var(--gold); }
.stat-num.green { color: var(--green); }
.stat-num.red   { color: var(--red); }
.stat-num.blue  { color: var(--blue); }

/* ─── 主播 / 录制列表 ──────────────────────────────────────── */
.anchor-card {
  background: var(--card);
  border: none;
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s, transform 0.15s;
}
.anchor-card:hover { box-shadow: var(--shadow-lg); }
.anchor-head { display: flex; align-items: center; gap: 12px; padding: 1rem 1.1rem; cursor: pointer; user-select: none; }
.anc-av {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--hover); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 500; flex-shrink: 0;
}
.anc-meta { flex: 1; min-width: 0; }
.anc-name { font-weight: 500; font-size: 0.95rem; color: var(--text); }
.anc-sub  { font-size: 0.78rem; color: var(--muted); margin-top: 3px; }
.anc-sub .done { color: var(--green); }
.anc-chevron { width: 20px; height: 20px; color: var(--muted); transition: transform 0.25s; flex-shrink: 0; }
.anc-chevron.open { transform: rotate(180deg); }

.sessions { border-top: 1px solid var(--border); }
.session-item {
  display: flex; align-items: center; gap: 12px;
  padding: 0.85rem 1.1rem; cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.session-item:last-child { border-bottom: none; }
.session-item:hover { background: var(--bg); }

.s-bar { width: 3px; height: 38px; border-radius: 2px; flex-shrink: 0; }
.s-bar.done  { background: var(--green); }
.s-bar.pend  { background: var(--dim); }
.s-bar.trans { background: var(--yellow); }
.s-info { flex: 1; min-width: 0; }
.s-date { font-size: 0.86rem; font-weight: 500; color: var(--text); }
.s-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }

.chip {
  font-size: 0.7rem; padding: 2px 8px;
  border-radius: 4px; font-weight: 500;
}
.chip-done  { background: rgba(74,133,99,0.12);  color: var(--green); }
.chip-pend  { background: rgba(181,165,139,0.2); color: var(--muted); }
.chip-trans { background: rgba(201,147,102,0.15);color: #8B5E2B; }
.chip-media { background: rgba(107,84,66,0.1);   color: var(--gold); }

.s-words { font-size: 0.78rem; color: var(--muted); flex-shrink: 0; }
.s-arrow { color: var(--dim); font-size: 1.1rem; flex-shrink: 0; }

/* ─── 空状态 ──────────────────────────────────────────────── */
.state-box { padding: 3.5rem 1rem; text-align: center; color: var(--muted); }
.state-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.state-msg { font-size: 0.9rem; }
@keyframes pulse { 0%,100%{opacity:1}50%{opacity:0.4} }
.dot { display: inline-block; animation: pulse 1.2s infinite; }
.dot:nth-child(2) { animation-delay: .2s }
.dot:nth-child(3) { animation-delay: .4s }

/* ─── 管理后台 ─────────────────────────────────────────────── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem; flex-wrap: wrap; gap: 10px;
}
.page-header h2 { font-size: 1.15rem; font-weight: 500; color: var(--text); letter-spacing: -0.01em; }

/* 表格 */
.table-wrap {
  background: var(--card);
  border: none;
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.data-table th {
  text-align: left; padding: 0.85rem 1rem;
  font-size: 0.72rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  font-weight: 500;
}
.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle; color: var(--text);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background 0.12s; cursor: default; }
.data-table tbody tr:hover { background: var(--bg); }
.data-table .empty-row td { text-align: center; color: var(--muted); padding: 2.5rem; }

/* 徽章 */
.badge {
  display: inline-flex; align-items: center;
  font-size: 0.72rem; padding: 2px 9px;
  border-radius: 4px; font-weight: 500;
  white-space: nowrap;
}
.badge-green  { background: rgba(74,133,99,0.12);   color: var(--green); }
.badge-yellow { background: rgba(201,147,102,0.15); color: #8B5E2B; }
.badge-gray   { background: rgba(181,165,139,0.2); color: var(--muted); }
.badge-red    { background: rgba(161,60,47,0.1);   color: var(--red); }
.badge-gold   { background: rgba(107,84,66,0.1);   color: var(--gold); }
.badge-blue   { background: rgba(74,107,133,0.12); color: var(--blue); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0.5rem 1rem;
  border-radius: var(--r-sm);
  font-size: 0.85rem; font-weight: 500;
  cursor: pointer; border: none;
  transition: all 0.15s;
}
.btn-ghost {
  background: var(--card);
  color: var(--muted);
  box-shadow: inset 0 0 0 0.5px var(--border2);
}
.btn-ghost:hover { color: var(--text); box-shadow: inset 0 0 0 0.5px var(--gold); }
.btn-danger {
  background: rgba(161,60,47,0.08);
  color: var(--red);
  box-shadow: inset 0 0 0 0.5px rgba(161,60,47,0.25);
}
.btn-danger:hover { background: rgba(161,60,47,0.15); }
.btn-success {
  background: rgba(74,133,99,0.1);
  color: var(--green);
  box-shadow: inset 0 0 0 0.5px rgba(74,133,99,0.3);
}
.btn-success:hover { background: rgba(74,133,99,0.18); }
.btn-gold {
  background: var(--gold); color: var(--bg);
  box-shadow: var(--shadow-brand);
}
.btn-gold:hover { background: var(--gold2); }
.btn svg { width: 14px; height: 14px; }

/* 分页 */
.pagination {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 8px; margin-top: 1rem;
  font-size: 0.85rem; color: var(--muted);
}
.page-btn {
  background: var(--card);
  border: none;
  box-shadow: inset 0 0 0 0.5px var(--border2);
  color: var(--muted);
  padding: 0.4rem 0.8rem; border-radius: 6px;
  cursor: pointer; transition: all 0.15s;
}
.page-btn:hover:not(:disabled) { color: var(--gold); box-shadow: inset 0 0 0 0.5px var(--gold); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-btn.current { background: var(--gold); color: var(--bg); box-shadow: var(--shadow-brand); }

/* 模态框 */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(46,40,36,0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200; display: none;
  align-items: flex-start; justify-content: center;
  overflow-y: auto; padding: 2rem 0;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--card);
  border: none;
  border-radius: var(--r-lg);
  padding: 1.75rem;
  width: 100%; max-width: 440px; margin: 1rem;
  box-shadow: var(--shadow-lg);
  animation: fadeUp 0.25s ease; flex-shrink: 0;
}
.modal-title { font-size: 1.05rem; font-weight: 500; margin-bottom: 1.3rem; color: var(--text); letter-spacing: -0.01em; }
.modal-footer { display: flex; gap: 8px; justify-content: flex-end; margin-top: 1.5rem; }
.modal-body { display: flex; flex-direction: column; gap: 0.95rem; }
.modal-body textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--text); font-size: 0.92rem;
  padding: 0.7rem 0.95rem; outline: none;
  resize: vertical; min-height: 80px;
  transition: border-color 0.2s, background 0.2s;
  font-family: inherit;
}
.modal-body textarea:focus { border-color: var(--gold); background: var(--card); }
.modal-body label { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; display: block; margin-bottom: 5px; }
.modal-body input {
  width: 100%;
  background: var(--bg);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--text); font-size: 0.92rem;
  padding: 0.7rem 0.95rem; outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.modal-body input:focus { border-color: var(--gold); background: var(--card); }
.modal-body .hint { font-size: 0.78rem; color: var(--muted); }
.modal-error { font-size: 0.82rem; color: var(--red); min-height: 1em; }

/* 登录排行 */
.rank-item {
  display: flex; align-items: center; gap: 12px;
  padding: 0.7rem 0; border-bottom: 1px solid var(--border);
}
.rank-item:last-child { border-bottom: none; }
.rank-num { width: 24px; font-size: 0.88rem; color: var(--muted); text-align: right; flex-shrink: 0; }
.rank-num.top { color: var(--gold); font-weight: 500; }
.rank-bar-wrap { flex: 1; height: 6px; background: var(--hover); border-radius: 3px; overflow: hidden; }
.rank-bar { height: 100%; background: var(--gold); border-radius: 3px; transition: width 0.5s ease; }
.rank-count { font-size: 0.85rem; font-weight: 500; min-width: 32px; text-align: right; flex-shrink: 0; color: var(--text); }

/* 公告编辑 */
.ann-list { display: flex; flex-direction: column; gap: 10px; }
.ann-item {
  background: var(--card);
  border: none;
  border-radius: var(--r-md);
  padding: 1rem 1.15rem;
  display: flex; align-items: flex-start; gap: 12px;
  box-shadow: var(--shadow-sm);
}
.ann-item-body { flex: 1; min-width: 0; }
.ann-item-title { font-weight: 500; font-size: 0.94rem; margin-bottom: 5px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.ann-item-content { font-size: 0.85rem; color: var(--muted); line-height: 1.6; white-space: pre-wrap; }
.ann-item-meta { font-size: 0.72rem; color: var(--dim); margin-top: 7px; }
.ann-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* Toggle 开关 */
.toggle { position: relative; width: 36px; height: 20px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-track { position: absolute; inset: 0; background: var(--dim); border-radius: 10px; cursor: pointer; transition: background 0.2s; }
.toggle input:checked + .toggle-track { background: var(--green); }
.toggle-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 14px; height: 14px; background: var(--card);
  border-radius: 50%; transition: transform 0.2s;
  pointer-events: none; box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle input:checked ~ .toggle-thumb { transform: translateX(16px); }

/* 订单 */
.order-amount { font-weight: 500; color: var(--green); }

/* 移动端遮罩 */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(46,40,36,0.4);
  backdrop-filter: blur(2px);
  z-index: 99; opacity: 0; transition: opacity 0.3s;
  pointer-events: none;
}
.sidebar-overlay.open { opacity: 1; pointer-events: auto; }

/* 会员套餐卡 */
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.plan-card {
  background: var(--card);
  border: none;
  border-radius: var(--r-md);
  padding: 1.1rem 1rem;
  text-align: center; cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s;
}
.plan-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.plan-card.selected {
  background: var(--card);
  box-shadow: var(--shadow-lg), inset 0 0 0 2px var(--gold);
}
.plan-name { font-size: 0.88rem; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.plan-price { font-size: 1.5rem; font-weight: 500; color: var(--gold); letter-spacing: -0.01em; }
.plan-price span { font-size: 0.75rem; color: var(--muted); font-weight: 400; }
.plan-days { font-size: 0.75rem; color: var(--muted); margin-top: 4px; }
.plan-info { font-size: 0.75rem; color: var(--muted); margin-top: 5px; }
.plan-tag { color: var(--gold); font-weight: 500; }
.plan-save { color: var(--green); font-weight: 500; }
.plan-original { text-decoration: line-through; color: var(--muted); font-weight: 400; }

/* ─── 字体大小切换 ─────────────────────────────────────────── */
.font-size-btn {
  background: var(--card);
  border: none;
  box-shadow: inset 0 0 0 0.5px var(--border2);
  color: var(--muted); cursor: pointer;
  padding: 0.35rem 0.65rem;
  border-radius: var(--r-sm);
  font-size: 0.82rem; font-weight: 500;
  transition: all 0.15s; flex-shrink: 0;
}
.font-size-btn:hover { color: var(--gold); box-shadow: inset 0 0 0 0.5px var(--gold); }
.font-size-btn span { pointer-events: none; }

html.font-sm { font-size: 16px; }
html.font-md { font-size: 18px; }
html.font-lg { font-size: 20px; }

/* ─── 动画 ────────────────────────────────────────────────── */
@keyframes fadeUp { from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)} }
@keyframes shake  { 0%,100%{transform:translateX(0)}20%{transform:translateX(-8px)}40%{transform:translateX(8px)}60%{transform:translateX(-5px)}80%{transform:translateX(5px)} }

/* ─── 角色徽记 ─────────────────────────────────────────────── */
.av-admin  { background: var(--red) !important; color: var(--bg) !important; }
.name-admin { color: var(--red); }

.av-vip {
  background: var(--gold) !important;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--gold);
}
.name-vip { color: var(--gold); }

.av-member { background: var(--gold) !important; }
.name-member { color: var(--gold); }

/* ─── 详情 / 字幕 / 日志 ──────────────────────────────────── */
.detail-section {
  background: var(--card);
  border: none;
  border-radius: var(--r-md);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}
.session-hidden { opacity: 0.5; }
.s-admin-btns { display: flex; gap: 4px; flex-shrink: 0; }

.log-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0.8rem;
  font-family: ui-monospace, "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 0.78rem; color: var(--muted);
  line-height: 1.65;
  max-height: 300px; overflow-y: auto;
  white-space: pre-wrap; word-break: break-all;
}

.subtitle-panel {
  margin-top: 0.5rem;
  border-radius: var(--r-sm);
  background: var(--bg);
  position: relative;
}
.subtitle-panel:empty { display: none; }
.sub-scroll {
  max-height: 200px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--dim) transparent;
}
.sub-scroll::-webkit-scrollbar { width: 4px; }
.sub-scroll::-webkit-scrollbar-thumb { background: var(--dim); border-radius: 2px; }

.sub-line {
  display: flex; gap: 8px;
  padding: 0.4rem 0.7rem; cursor: pointer;
  transition: background 0.15s;
  font-size: 0.85rem; line-height: 1.55;
  border-bottom: 1px solid var(--border);
}
.sub-line:last-child { border-bottom: none; }
.sub-line:hover { background: var(--hover); }
.sub-line.active { background: rgba(107,84,66,0.1); }
.sub-line.active .sub-text { color: var(--text); font-weight: 500; }

.sub-ts {
  color: var(--dim); font-size: 0.74rem;
  flex-shrink: 0; min-width: 38px; padding-top: 2px;
  font-family: ui-monospace, "SF Mono", monospace;
}
.sub-text { color: var(--muted); }

.sub-toggle-btn { text-align: center; font-size: 0.8rem; color: var(--gold); padding: 0.45rem; cursor: pointer; font-weight: 500; }
.sub-toggle-btn:hover { text-decoration: underline; }
.sub-back-btn {
  position: sticky; bottom: 0; text-align: center;
  font-size: 0.75rem; color: var(--gold);
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 0.35rem; cursor: pointer; font-weight: 500;
}
.sub-back-btn:hover { background: var(--hover); }

.detail-label { font-size: 0.86rem; font-weight: 500; margin-bottom: 0.65rem; color: var(--text); }
.detail-text-preview {
  font-size: 0.86rem; color: var(--muted); line-height: 1.75;
  max-height: 4.8em; overflow: hidden;
  white-space: pre-wrap; word-break: break-all;
  position: relative;
}
.detail-text-preview::after {
  content: ''; position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2em;
  background: linear-gradient(transparent, var(--card));
  pointer-events: none;
}
.detail-text-full {
  font-size: 0.86rem; color: var(--muted); line-height: 1.75;
  max-height: 400px; overflow-y: auto;
  white-space: pre-wrap; word-break: break-all;
  scrollbar-width: thin; scrollbar-color: var(--dim) transparent;
}
.detail-text-full::-webkit-scrollbar { width: 4px; }
.detail-text-full::-webkit-scrollbar-thumb { background: var(--dim); border-radius: 2px; }
.detail-text-full strong { color: var(--text); font-weight: 600; }

/* ─── 响应式 ──────────────────────────────────────────────── */

/* 大屏 */
@media (min-width: 1280px) {
  :root { --sidebar: 260px; }
}

/* 平板 */
@media (max-width: 1024px) {
  .stats-row { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 900px) {
  :root { --sidebar: 200px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .search-box { width: 150px; }
  .plan-grid { grid-template-columns: repeat(2, 1fr); }
}

/* 手机 */
@media (max-width: 640px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    z-index: 100; width: 260px !important;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { display: block; }
  .menu-btn { display: flex; }

  .search-box { display: none; }
  .search-box.mobile-open {
    display: flex; flex: 1; width: auto;
    border: none; background: transparent; padding: 0;
    box-shadow: none;
  }
  .search-box.mobile-open input { font-size: 0.92rem; }
  .mobile-search-btn { display: flex !important; }
  .mobile-search-close { display: flex !important; }
  .topbar-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .search-box.mobile-open ~ .topbar-title,
  .topbar-title.search-hide { display: none; }

  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .content { padding: 1rem; }
  .tag-strip { padding: 0.7rem 1rem; }
  .topbar { padding: 0 1rem; }
  .login-card { padding: 2rem 1.5rem; }
  .plan-grid { grid-template-columns: 1fr; }

  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table { min-width: 600px; }

  .modal { max-height: 90vh; overflow-y: auto; margin: 0.5rem; }
  .pagination { flex-wrap: wrap; font-size: 0.8rem; }
  .ann-actions { flex-direction: column; }
}

/* 移动端搜索按钮 */
.mobile-search-btn {
  display: none; background: none; border: none; cursor: pointer;
  color: var(--muted); padding: 6px; border-radius: var(--r-sm);
  transition: color 0.15s;
}
.mobile-search-btn:hover { color: var(--text); }
.mobile-search-btn svg { width: 18px; height: 18px; display: block; }

.mobile-search-close {
  display: none; background: none; border: none; cursor: pointer;
  color: var(--muted); padding: 4px; font-size: 1.2rem; flex-shrink: 0;
}
.mobile-search-close:hover { color: var(--text); }
