/* ==========================================================================
   Ermek Music · 运营后台设计系统
   结构：令牌 → 基础排版 → 控件 → 提示 → 应用外壳 → 卡片 → 总览部件 →
        媒体库 → 祝福/用户 → 业务模块统一 → 响应式
   ========================================================================== */

/* 1. 设计令牌 ------------------------------------------------------------- */
:root {
  color-scheme: light;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* 表面与分隔线 */
  --bg: #f4f6f5;
  --surface: #ffffff;
  --surface-2: #f8faf9;
  --surface-3: #f1f4f2;
  --line: #e4e9e6;
  --line-strong: #d5dcd8;
  --ink-soft: #85918c;

  /* 文字层级 */
  --ink: #101d18;
  --ink-2: #33443d;
  --ink-3: #5b6b65;
  --ink-4: #657069;

  /* 品牌与状态 */
  --brand: #0f6b4b;
  --brand-2: #0b5138;
  --brand-soft: #e7f2ed;
  --brand-line: #c6e0d4;
  --danger: #b03730;
  --danger-soft: #fdeceb;
  --danger-line: #f0cdca;
  --warning: #8a5b12;
  --warning-soft: #fdf4e4;
  --warning-line: #ecdcba;
  --ok: #14795a;
  --ok-soft: #e7f4ee;

  /* 圆角、间距、阴影 */
  --r-1: 6px;
  --r-2: 8px;
  --r-3: 10px;
  --r-4: 12px;
  --r-pill: 999px;
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 32px;
  --s-8: 40px;
  --shadow-1: 0 1px 2px rgba(16, 29, 24, 0.05);
  --shadow-2: 0 12px 32px -18px rgba(16, 29, 24, 0.4);

  /* 字号 */
  --fs-xs: 11.5px;
  --fs-sm: 12.5px;
  --fs-base: 13.5px;
  --fs-md: 15px;
  --fs-lg: 19px;
  --fs-xl: 26px;

  /* 外壳尺寸 */
  --sidebar-w: 264px;
  --topbar-h: 64px;

  /* 兼容旧模块样式表的变量别名 */
  --panel: var(--surface);
  --border: var(--line);
  --muted: var(--ink-3);
  --accent: var(--brand);
  --accent-dark: var(--brand-2);
  --accent-soft: var(--brand-soft);
  --nav: #0e1a16;
  --nav-muted: #92a49d;
}

/* 2. 基础排版 ------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { min-width: 320px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.55;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, p, figure { margin: 0; }

h1 { font-size: var(--fs-lg); font-weight: 660; letter-spacing: -0.012em; line-height: 1.3; }
h2 { font-size: var(--fs-md); font-weight: 650; letter-spacing: -0.006em; line-height: 1.4; }
h3 { font-size: var(--fs-md); font-weight: 640; letter-spacing: -0.004em; line-height: 1.45; }
h4 { font-size: var(--fs-base); font-weight: 640; line-height: 1.5; }
h5, h6 { font-size: var(--fs-base); font-weight: 620; line-height: 1.5; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

code, samp, kbd { font-family: var(--font-mono); font-size: 0.94em; overflow-wrap: anywhere; }

strong, b { font-weight: 640; }

.muted, .subheading { color: var(--ink-3); font-size: var(--fs-sm); line-height: 1.65; }

.eyebrow {
  font-size: var(--fs-xs);
  font-weight: 620;
  letter-spacing: 0.085em;
  text-transform: uppercase;
  color: var(--ink-4);
}

.count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface-3);
  color: var(--ink-3);
  font-size: var(--fs-xs);
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
  margin-left: var(--s-2);
}

/* 3. 控件 ----------------------------------------------------------------- */
button, input, select, textarea { font: inherit; color: inherit; }
button, input, select, audio, video, textarea { max-width: 100%; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.5; }
input:disabled, select:disabled, textarea:disabled { opacity: 0.6; background: var(--surface-3); }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: var(--r-1); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--r-2);
  background: var(--brand);
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 620;
  letter-spacing: 0.005em;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.button:hover:not(:disabled) { background: var(--brand-2); text-decoration: none; }

.button.secondary {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink-2);
}
.button.secondary:hover:not(:disabled) { background: var(--surface-2); border-color: var(--ink-4); }

.button.danger-outline {
  background: var(--surface);
  border-color: var(--danger-line);
  color: var(--danger);
}
.button.danger-outline:hover:not(:disabled) { background: var(--danger-soft); border-color: var(--danger); }

.button.compact { min-height: 30px; padding: 0 11px; font-size: var(--fs-xs); }

.text-button {
  border: 0;
  background: transparent;
  padding: 2px;
  color: var(--brand);
  font-size: var(--fs-sm);
  font-weight: 620;
}
.text-button:hover:not(:disabled) { text-decoration: underline; }

label {
  display: block;
  margin-bottom: var(--s-1);
  color: var(--ink-2);
  font-size: var(--fs-sm);
  font-weight: 600;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select,
textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--fs-base);
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

input[type="search"] { -webkit-appearance: none; appearance: none; }

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):hover:not(:disabled),
select:hover:not(:disabled),
textarea:hover:not(:disabled) { border-color: var(--ink-4); }

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
  outline: none;
}

input::placeholder, textarea::placeholder { color: var(--ink-soft); }

input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); }

.field { display: flex; flex-direction: column; min-width: 0; }
.field > label { margin-bottom: var(--s-1); }

.form-status {
  margin: var(--s-3) 0 0;
  color: var(--ink-3);
  font-size: var(--fs-sm);
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.form-status:empty { display: none; }

progress {
  width: 100%;
  height: 8px;
  border: 0;
  border-radius: var(--r-pill);
  accent-color: var(--brand);
}
.progress-wrap { margin-top: var(--s-4); }
.progress-wrap label { margin-bottom: var(--s-2); color: var(--brand); }

/* 4. 提示与状态 ----------------------------------------------------------- */
.notice {
  margin: 0 var(--s-6) var(--s-3);
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  background: var(--surface);
  color: var(--ink-3);
  font-size: var(--fs-sm);
  line-height: 1.6;
}
.notice.warning { border-color: var(--warning-line); background: var(--warning-soft); color: var(--warning); }
.notice.error, .error { color: var(--danger) !important; }
.notice.error { border-color: var(--danger-line); background: var(--danger-soft); }
.success { color: var(--ok); }

.boot { display: flex; flex-direction: column; }
.boot > .button { align-self: center; margin-bottom: var(--s-3); }

.sync-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--brand-line);
  border-radius: var(--r-pill);
  background: var(--brand-soft);
  color: var(--brand-2);
  font-size: var(--fs-xs);
  font-weight: 620;
  white-space: nowrap;
}
.sync-state::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
}

/* 5. 登录 ----------------------------------------------------------------- */
.login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 32px);
  padding: var(--s-6);
}

.login-card {
  width: min(100%, 420px);
  padding: var(--s-7);
  border: 1px solid var(--line);
  border-radius: var(--r-4);
  background: var(--surface);
  box-shadow: var(--shadow-2);
}

.login-brand { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-4); }
.login-brand .eyebrow { margin-bottom: 2px; }
.login-note { color: var(--ink-3); font-size: var(--fs-sm); line-height: 1.7; margin-bottom: var(--s-5); }
.login-form { display: grid; gap: var(--s-4); }
.login-form .button { width: 100%; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: var(--r-3);
  background: linear-gradient(150deg, #14805a, #0a4a34);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* 6. 应用外壳 ------------------------------------------------------------- */
.workspace {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  align-items: start;
  min-height: 100vh;
  background: var(--bg);
}

/* 6.1 侧边栏 */
.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: var(--s-4) var(--s-3) var(--s-3);
  background: #0e1a16;
  background-image: radial-gradient(120% 60% at 0% 0%, rgba(30, 122, 88, 0.22), transparent 60%);
  color: #e8eeeb;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  height: calc(var(--topbar-h) - var(--s-4));
  padding: 0 var(--s-2) 0 var(--s-1);
  margin-bottom: var(--s-4);
}
.sidebar-brand-copy { display: grid; gap: 1px; min-width: 0; }
.sidebar-brand-copy strong { font-size: var(--fs-base); font-weight: 650; color: #fff; letter-spacing: -0.004em; }
.sidebar-brand-copy span { font-size: var(--fs-xs); color: var(--nav-muted); }

.nav { display: grid; gap: var(--s-4); flex: 1; align-content: start; }

.nav-group { display: grid; gap: 2px; }

.nav-label {
  padding: 0 var(--s-3) var(--s-1);
  color: #7a8c85;
  font-size: 10.5px;
  font-weight: 620;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.nav button {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  padding: 0 var(--s-3);
  border: 0;
  border-radius: var(--r-2);
  background: transparent;
  color: #b9c7c1;
  font-size: var(--fs-sm);
  font-weight: 560;
  text-align: left;
  transition: background-color 0.13s ease, color 0.13s ease;
}
.nav button:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav button[aria-current="page"] { background: rgba(255, 255, 255, 0.1); color: #fff; font-weight: 620; }
.nav button[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: var(--r-pill);
  background: #46c294;
}

.nav-icon { display: grid; place-items: center; width: 18px; height: 18px; color: currentColor; opacity: 0.9; }
.nav-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.nav b {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.1);
  color: #d6e2dc;
  font-size: 10.5px;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.nav button[aria-current="page"] b { background: rgba(70, 194, 148, 0.24); color: #9ee6c4; }

.sidebar-foot {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-5);
  padding: var(--s-3) var(--s-2) 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar-foot div { display: grid; gap: 1px; min-width: 0; }
.sidebar-foot strong { font-size: var(--fs-xs); font-weight: 620; color: #d9e3de; }
.sidebar-foot span:not(.status-dot) { font-size: 10.5px; color: #7a8c85; }

.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #46c294;
  box-shadow: 0 0 0 3px rgba(70, 194, 148, 0.16);
}

/* 6.2 主区域与顶栏 */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  min-height: var(--topbar-h);
  padding: 0 var(--s-6);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(150%) blur(8px);
}

.topbar-title { display: grid; gap: 1px; min-width: 0; }
.topbar-title .eyebrow { margin-bottom: 0; }
.topbar-title h1 { font-size: 17px; font-weight: 660; letter-spacing: -0.01em; }
.topbar-desc {
  color: var(--ink-3);
  font-size: var(--fs-sm);
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions { display: flex; align-items: center; gap: var(--s-2); flex-shrink: 0; }

.content {
  flex: 1;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: var(--s-6);
}

.page-foot {
  padding: var(--s-4) var(--s-6) var(--s-6);
  border-top: 1px solid var(--line);
  color: var(--ink-4);
  font-size: var(--fs-xs);
  text-align: center;
}

.admin-section { display: grid; gap: var(--s-4); align-content: start; animation: section-in 0.16s ease-out; }
@keyframes section-in { from { opacity: 0.45; transform: translateY(2px); } to { opacity: 1; transform: none; } }

/* 7. 卡片与区块标题 ------------------------------------------------------- */
.panel {
  padding: var(--s-5) var(--s-6) var(--s-6);
  border: 1px solid var(--line);
  border-radius: var(--r-4);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  min-width: 0;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-4);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--line);
}
.section-heading > div { display: grid; gap: 2px; min-width: 0; }
.section-heading .eyebrow { margin-bottom: 0; }
.section-heading h3 { font-size: var(--fs-md); }

.section-note { margin: 0 0 var(--s-4); color: var(--ink-3); font-size: var(--fs-sm); line-height: 1.7; }

.empty-state {
  margin: 0;
  padding: var(--s-7) var(--s-4);
  color: var(--ink-3);
  font-size: var(--fs-sm);
  line-height: 1.7;
  text-align: center;
}

/* 8. 总览 --------------------------------------------------------------- */
.ov-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: var(--s-3);
}

.kpi {
  position: relative;
  display: grid;
  gap: var(--s-1);
  padding: var(--s-4) var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  min-width: 0;
  overflow: hidden;
}
.kpi::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--line-strong);
}
.kpi.accent::before { background: var(--brand); }
.kpi-label {
  color: var(--ink-4);
  font-size: var(--fs-xs);
  font-weight: 620;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.kpi-value {
  font-size: 24px;
  font-weight: 660;
  letter-spacing: -0.02em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.kpi-note {
  color: var(--ink-4);
  font-size: var(--fs-xs);
  line-height: 1.5;
  min-height: 1.5em;
}

.ov-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); align-items: start; }
.ov-body { min-width: 0; }
.ov-subhead {
  margin: var(--s-5) 0 var(--s-2);
  color: var(--ink-4);
  font-size: var(--fs-xs);
  font-weight: 620;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.ov-caption { margin: var(--s-3) 0 0; color: var(--ink-4); font-size: var(--fs-xs); line-height: 1.65; }

.ov-trend-tools { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.ov-updated { color: var(--ink-4); font-size: var(--fs-xs); white-space: nowrap; }

.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--surface-3);
}
.segmented button {
  border: 0;
  border-radius: var(--r-1);
  background: transparent;
  color: var(--ink-3);
  padding: 5px 11px;
  font-size: var(--fs-sm);
  font-weight: 600;
}
.segmented button:hover { color: var(--ink); }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--brand-2); box-shadow: var(--shadow-1); }

.ov-trend { min-height: 148px; }

.trend-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 148px;
  padding: var(--s-2) 0 0;
  border-bottom: 1px solid var(--line);
  background-image: repeating-linear-gradient(to top, var(--line) 0 1px, transparent 1px 37px);
}
.trend-col {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 2px;
  height: 100%;
  min-width: 0;
}
.trend-bars { display: flex; align-items: flex-end; gap: 2px; width: 100%; height: 100%; justify-content: center; }
.trend-bar {
  display: block;
  width: min(46%, 14px);
  min-width: 3px;
  border-radius: 2px 2px 0 0;
  transition: height 0.2s ease;
}
.trend-bar.visits { background: var(--brand); }
.trend-bar.plays { background: var(--brand-line); }
.trend-day {
  color: var(--ink-4);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  height: 12px;
}
.trend-legend { display: flex; gap: var(--s-4); margin: var(--s-2) 0 0; }
.trend-key { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: var(--fs-xs); }
.trend-key::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--brand); }
.trend-key.plays::before { background: var(--brand-line); }
.trend-peak { margin: var(--s-1) 0 0; color: var(--ink-4); font-size: var(--fs-xs); }

/* 统一表格 */
.data-table { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-2); }
.data-table table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); text-align: left; }
.data-table th,
.data-table td { padding: 8px 11px; border-bottom: 1px solid var(--line); vertical-align: middle; overflow-wrap: anywhere; }
.data-table th {
  background: var(--surface-3);
  color: var(--ink-4);
  font-size: var(--fs-xs);
  font-weight: 620;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table td { font-variant-numeric: tabular-nums; }
.data-table td.truncate { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-mono); font-size: 11.5px; }

.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 620;
  white-space: nowrap;
}
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warning-soft); color: var(--warning); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }

.ov-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: var(--s-3);
  margin: 0;
}
.ov-stats > div { display: grid; gap: 2px; }
.ov-stats dt { color: var(--ink-4); font-size: var(--fs-xs); }
.ov-stats dd {
  margin: 0;
  font-size: 19px;
  font-weight: 660;
  letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums;
}

/* 9. 媒体库 --------------------------------------------------------------- */

.quick-actions button {
  display: grid;
  gap: var(--s-1);
  justify-items: start;
  padding: var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  background: var(--surface-2);
  color: var(--ink);
  text-align: left;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}
.quick-actions button:hover { border-color: var(--brand-line); background: var(--brand-soft); }
.quick-actions button > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: var(--s-2);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--surface);
  color: var(--brand);
}
.quick-actions button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.quick-actions strong { font-size: var(--fs-sm); font-weight: 620; }
.quick-actions small { color: var(--ink-3); font-size: var(--fs-xs); line-height: 1.5; }

.recent-media { display: grid; }

.recent-media-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s-3);
  padding: 9px var(--s-2);
  border-radius: var(--r-2);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.recent-media-item:last-child { border-bottom: 0; }
.recent-media-item:hover { background: var(--surface-2); }
.recent-media-item > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--r-1);
  background: var(--surface-3);
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 620;
}
.recent-media-item strong,
.recent-media-item small { display: block; min-width: 0; }
.recent-media-item strong {
  font-size: var(--fs-sm);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recent-media-item small { margin-top: 2px; color: var(--ink-4); font-size: var(--fs-xs); }
.recent-media-item b {
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 620;
  white-space: nowrap;
}

.system-panel { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--s-4); }
.system-panel > div:first-child { display: grid; gap: 2px; }
.system-checks { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); }
.system-checks span { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-3); font-size: var(--fs-sm); }
.system-checks i { display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }

/* 9. 媒体库 --------------------------------------------------------------- */
.file-picker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-3);
  padding: var(--s-4);
  margin-bottom: var(--s-4);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-3);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}
.file-picker:hover { border-color: var(--brand); background: var(--brand-soft); }
.file-symbol {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--r-2);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--brand);
  font-size: 15px;
}
.file-picker strong { display: block; font-size: var(--fs-sm); font-weight: 620; margin-bottom: 2px; }
.file-picker .muted { display: block; font-size: var(--fs-xs); }
.file-picker input { width: 220px; margin-left: auto; border: 0; background: transparent; font-size: var(--fs-xs); }
.file-picker input::file-selector-button {
  margin-right: var(--s-2);
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
  background: var(--surface);
  color: var(--ink-2);
  font-size: var(--fs-xs);
  font-weight: 600;
  cursor: pointer;
}

.upload-fields {
  display: grid;
  grid-template-columns: minmax(160px, 2fr) 1fr 1fr auto;
  align-items: end;
  gap: var(--s-3);
}

.library-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.9fr);
  align-items: start;
  gap: var(--s-4);
}

.library-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--line);
}

.filters, .dedication-filters {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--surface-3);
}
.filters button, .dedication-filters button {
  border: 0;
  border-radius: var(--r-1);
  background: transparent;
  color: var(--ink-3);
  padding: 5px 11px;
  font-size: var(--fs-sm);
  font-weight: 600;
}
.filters button:hover, .dedication-filters button:hover { color: var(--ink); }
.filters button[aria-pressed="true"], .dedication-filters button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--brand-2);
  box-shadow: var(--shadow-1);
}

.search-label {
  flex: 1;
  max-width: 240px;
  min-width: 150px;
  margin-bottom: 0;
  color: var(--ink-4);
  font-size: var(--fs-xs);
  font-weight: 600;
}
.search-label input { margin-top: 3px; min-height: 34px !important; font-size: var(--fs-sm) !important; }

.media-list { list-style: none; margin: 0; padding: 0; }
.media-list li { border-bottom: 1px solid var(--line); }
.media-list li:last-child { border-bottom: 0; }

.media-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  padding: 10px var(--s-2);
  border: 0;
  border-radius: var(--r-1);
  background: none;
  color: inherit;
  text-align: left;
}
.media-row:hover { background: var(--surface-2); }
.media-row[aria-current="true"] { background: var(--brand-soft); box-shadow: inset 2px 0 var(--brand); }

.media-icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-1);
  background: var(--surface-3);
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 620;
}
.media-icon.video { background: #f7f1e7; color: #7d5f34; }

.media-info { flex: 1; min-width: 0; }
.media-title { display: block; font-size: var(--fs-sm); font-weight: 600; overflow-wrap: anywhere; }
.media-meta { display: block; margin-top: 2px; color: var(--ink-4); font-size: var(--fs-xs); line-height: 1.5; }

.badge {
  padding: 2px 7px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 620;
  white-space: nowrap;
}
.badge.published { background: var(--ok-soft); color: var(--ok); }

.preview {
  margin-top: var(--s-2);
  padding: var(--s-2);
  border-radius: var(--r-2);
  background: var(--surface-3);
  overflow: hidden;
}
.preview audio, .preview video { display: block; width: 100%; }
.preview video { max-height: 240px; border-radius: var(--r-1); background: #0e1a16; }

.original-name { margin: var(--s-2) 0 var(--s-4); color: var(--ink-4); font-size: var(--fs-xs); line-height: 1.6; overflow-wrap: anywhere; }

#editor-form { display: grid; gap: var(--s-4); }
.editor-selects { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }

.publication {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-3);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--surface-2);
  cursor: pointer;
}
.publication input { width: 16px; height: 16px; margin: 1px 0 0; flex: 0 0 16px; }
.publication strong { display: block; font-size: var(--fs-sm); font-weight: 620; }
.publication small { display: block; margin-top: 2px; color: var(--ink-4); font-size: var(--fs-xs); font-weight: 400; line-height: 1.55; }

#save-submit { width: 100%; }

/* 10. 祝福与用户 ---------------------------------------------------------- */
.dedication-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin: var(--s-4) 0 var(--s-2);
}
.dedication-count { color: var(--ink-4); font-size: var(--fs-sm); }

.dedication-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }

.dedication-card {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-1);
}
.dedication-media { display: grid; place-items: center; min-height: 160px; background: var(--surface-3); overflow: hidden; }
.dedication-media img { display: block; width: 100%; height: 100%; min-height: 160px; object-fit: cover; }
.dedication-placeholder { color: var(--ink-soft); font-size: 22px; }
.dedication-body { min-width: 0; padding: var(--s-4); display: grid; align-content: start; gap: var(--s-2); }
.dedication-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-2); }
.dedication-card-top strong { font-size: var(--fs-sm); font-weight: 620; overflow-wrap: anywhere; }
.dedication-message {
  margin: 0;
  color: var(--ink-2);
  font-size: var(--fs-sm);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dedication-meta { color: var(--ink-4); font-size: var(--fs-xs); }
.dedication-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }

.status-badge { padding: 2px 8px; border-radius: var(--r-pill); font-size: 10.5px; font-weight: 620; white-space: nowrap; }
.status-badge.live { background: var(--ok-soft); color: var(--ok); }
.status-badge.removed { background: var(--danger-soft); color: var(--danger); }

.users-toolbar { display: flex; align-items: center; gap: var(--s-3); margin: var(--s-4) 0; }
.users-toolbar small { margin-left: auto; color: var(--ink-4); }

.user-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3); }
.user-summary-card {
  display: grid;
  gap: var(--s-1);
  padding: var(--s-4) var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.user-summary-card span { color: var(--ink-4); font-size: var(--fs-xs); font-weight: 620; letter-spacing: 0.05em; text-transform: uppercase; }
.user-summary-card strong { font-size: 22px; font-weight: 660; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.user-summary-card small { color: var(--ink-4); font-size: var(--fs-xs); }
.user-summary-card:first-child { border-color: transparent; background: linear-gradient(158deg, #11533a, #0c3a29); color: #fff; }
.user-summary-card:first-child span { color: #a9d6c2; }
.user-summary-card:first-child small { color: #9ec7b4; }

.user-profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
.user-profile-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  background: var(--surface);
}
.admin-user-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--ink-3);
  font-size: 11px;
  overflow: hidden;
}
.admin-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.admin-user-copy { min-width: 0; }
.admin-user-copy strong,
.admin-user-copy small { display: block; }
.admin-user-copy strong { font-size: var(--fs-sm); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-user-copy small { margin-top: 2px; color: var(--ink-4); font-size: var(--fs-xs); }
.admin-user-metrics { display: grid; gap: 4px; justify-items: end; text-align: right; }
.admin-user-metrics span {
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  color: var(--ink-3);
  font-size: 10.5px;
  white-space: nowrap;
}

/* 11. 业务模块统一（会员与订单 / 数据与 K 歌 / 账号关联） ------------------ */
/* 区段排序：概览 → 套餐 → 记录 → 账号关联 */
#billing-host { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }
#billing-host > .admin-billing { order: 0; }
#billing-host > .membership-editor { order: 1; }
#billing-host > .billing-records { order: 2; min-width: 0; }
#billing-host > .account-links { order: 3; }

#billing-host h3,
#insights-host h3,
#dedications-host h3,
#users-host h3 { font-size: var(--fs-md); font-weight: 650; }

#billing-host h4,
#insights-host h4 { margin: var(--s-5) 0 var(--s-2); font-size: var(--fs-base); font-weight: 640; }

#billing-host details,
#insights-host details { min-width: 0; }

#billing-host summary,
#insights-host summary,
#dedications-host summary,
#users-host summary {
  padding: 9px 0;
  color: var(--ink-2);
  font-size: var(--fs-sm);
  font-weight: 620;
  line-height: 1.6;
  cursor: pointer;
  overflow-wrap: anywhere;
}

/* 指标瓦片 */
#billing-host .billing-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s-3); margin: var(--s-3) 0; }
#billing-host .billing-summary article {
  display: grid;
  gap: var(--s-1);
  padding: var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  background: var(--surface-2);
}
#billing-host .billing-summary article span { color: var(--ink-4); font-size: var(--fs-xs); font-weight: 620; letter-spacing: 0.05em; text-transform: uppercase; }
#billing-host .billing-summary strong { font-size: 20px; font-weight: 660; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

#insights-host .insights-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-3); margin: var(--s-3) 0 var(--s-4); }
#insights-host .insights-card {
  display: grid;
  gap: var(--s-1);
  padding: var(--s-4) var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  overflow-wrap: anywhere;
}
#insights-host .insights-card:first-child {
  border-color: transparent;
  background: linear-gradient(158deg, #11533a, #0c3a29);
}
#insights-host .insights-card span { color: var(--ink-4); font-size: var(--fs-xs); font-weight: 620; letter-spacing: 0.05em; text-transform: uppercase; }
#insights-host .insights-card strong { font-size: 22px; font-weight: 660; letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
#insights-host .insights-card:first-child span { color: #a9d6c2; }
#insights-host .insights-card:first-child strong { color: #fff; }

/* 工具条 */
#insights-host .insights-toolbar,
#billing-host .billing-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2) var(--s-3);
  margin: 0 0 var(--s-3);
}
#insights-host .insights-toolbar label { display: inline-flex; align-items: center; gap: var(--s-2); margin: 0; color: var(--ink-3); font-size: var(--fs-sm); font-weight: 500; }
#insights-host .insights-toolbar input,
#insights-host .insights-toolbar select { width: auto; min-height: 34px; font-size: var(--fs-sm); }
#insights-host .insights-toolbar input { min-width: 190px; }
#insights-host .insights-toolbar small { margin-left: auto; color: var(--ink-4); }

#insights-host .insights-counts { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-3); }
#insights-host .insights-counts span {
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--ink-3);
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
}

/* 表格 */
#billing-host .billing-table-wrap,
#insights-host .insights-table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  background: var(--surface);
  overflow: auto;
  overscroll-behavior-x: contain;
}
#billing-host .billing-table-wrap table,
#insights-host .insights-table-wrap table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); text-align: left; }
#billing-host .billing-table-wrap th,
#billing-host .billing-table-wrap td,
#insights-host .insights-table-wrap th,
#insights-host .insights-table-wrap td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: anywhere;
}
#billing-host .billing-table-wrap th,
#insights-host .insights-table-wrap th {
  background: var(--surface-3);
  color: var(--ink-4);
  font-size: var(--fs-xs);
  font-weight: 620;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}
#billing-host .billing-table-wrap tbody tr:hover,
#insights-host .insights-table-wrap tbody tr:hover { background: var(--surface-2); }
#billing-host .billing-table-wrap tbody tr:last-child td,
#insights-host .insights-table-wrap tbody tr:last-child td { border-bottom: 0; }
#billing-host .billing-table-wrap td { font-variant-numeric: tabular-nums; }
#billing-host .billing-table-wrap td:first-child { min-width: 140px; white-space: normal; }

#insights-host .insights-id { display: block; margin-top: 2px; color: var(--ink-4); font-size: 10.5px; font-family: var(--font-mono); word-break: break-all; }
#insights-host .insights-downloads { display: flex; flex-wrap: wrap; gap: var(--s-1); min-width: 140px; }
#insights-host .insights-downloads a {
  padding: 3px 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
  background: var(--surface);
  color: var(--brand-2);
  font-size: var(--fs-xs);
  font-weight: 600;
  white-space: nowrap;
}
#insights-host .insights-downloads a:hover { background: var(--brand-soft); border-color: var(--brand-line); text-decoration: none; }

/* 提示条、状态标签 */
#billing-host .billing-policy {
  padding: 11px 14px;
  border: 1px solid var(--brand-line);
  border-left: 3px solid var(--brand);
  border-radius: var(--r-2);
  background: var(--brand-soft);
  color: var(--brand-2);
  font-size: var(--fs-sm);
  line-height: 1.7;
}
#billing-host .billing-channels { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: var(--s-3) 0; }
#billing-host .billing-channels span {
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--ink-3);
  font-size: var(--fs-xs);
}

#billing-host .billing-advanced { margin-top: var(--s-4); padding-top: var(--s-2); border-top: 1px solid var(--line); }
#billing-host .billing-advanced > p { margin: var(--s-2) 0; font-size: var(--fs-sm); line-height: 1.7; }

#billing-host .membership-notice,
#billing-host .membership-confirm,
#billing-host .membership-edit-notice {
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: var(--fs-sm);
  line-height: 1.7;
}
#billing-host .membership-edit-notice { border-color: var(--warning-line); background: var(--warning-soft); color: var(--warning); }

#billing-host .billing-collection { margin-top: var(--s-5); min-width: 0; }
#billing-host .billing-collection h4 { margin: 0 0 var(--s-2); }
#billing-host .billing-collection-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: var(--s-3); }
#billing-host .billing-collection-card {
  min-width: 0;
  padding: var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  background: var(--surface-2);
  overflow-wrap: anywhere;
}
#billing-host .billing-collection-heading { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: var(--s-2); }
#billing-host .billing-collection-heading h5 { min-width: 0; margin: 0; font-size: var(--fs-base); line-height: 1.5; }
#billing-host .billing-collection-heading strong { flex-shrink: 0; padding: 2px 8px; border-radius: var(--r-pill); font-size: 10.5px; font-weight: 620; }
#billing-host .billing-collection-ready { background: var(--ok-soft); color: var(--ok); }
#billing-host .billing-collection-pending { background: var(--warning-soft); color: var(--warning); }
#billing-host .billing-collection-next { margin: var(--s-3) 0 var(--s-1); font-size: var(--fs-sm); line-height: 1.7; white-space: pre-wrap; }
#billing-host .billing-collection-card ul { margin: var(--s-1) 0; padding-left: 18px; }
#billing-host .billing-collection-card li { font-size: var(--fs-sm); line-height: 1.7; }

/* 套餐编辑 */
#billing-host .membership-plans { display: grid; gap: var(--s-3); margin-top: var(--s-3); }
#billing-host .membership-plan {
  padding: var(--s-4) var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  background: var(--surface-2);
  min-width: 0;
}
#billing-host .membership-plan h5 { margin-bottom: var(--s-2); }
#billing-host .membership-plan-summary { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-2) var(--s-3); margin: 0 0 var(--s-3); color: var(--ink-3); font-size: var(--fs-sm); }
#billing-host .membership-plan-summary strong { color: var(--ink); font-size: 18px; font-weight: 660; font-variant-numeric: tabular-nums; }
#billing-host .membership-state {
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink-3);
  font-size: var(--fs-xs);
}
#billing-host .membership-plan-editor,
#billing-host .membership-platform { border-top: 1px solid var(--line); padding-top: var(--s-2); }
#billing-host .membership-plan-form { padding-top: var(--s-3); }
#billing-host .membership-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); margin: 0; padding: 0; border: 0; min-width: 0; }
#billing-host .membership-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
#billing-host .membership-field label,
#billing-host .membership-rights legend { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
#billing-host .membership-rights { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--s-3); padding: var(--s-3); border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface); min-width: 0; }
#billing-host .membership-rights label,
#billing-host .membership-check,
#billing-host .membership-song-list label { display: flex; align-items: center; gap: var(--s-2); font-weight: 500; }
#billing-host .membership-song-list { list-style: none; margin: var(--s-3) 0; padding: 0 var(--s-3); border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface); max-height: 460px; overflow-y: auto; }
#billing-host .membership-song-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
#billing-host .membership-song-list li:last-child { border-bottom: 0; }
#billing-host .membership-song-list label { align-items: flex-start; font-size: var(--fs-sm); line-height: 1.6; }
#billing-host .membership-search { display: grid; grid-template-columns: auto minmax(100px, 1fr) auto auto minmax(100px, 150px); align-items: center; gap: var(--s-2); }
#billing-host .membership-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin: var(--s-3) 0; }
#billing-host .membership-benefits { margin: var(--s-2) 0 var(--s-4); color: var(--ink-3); font-size: var(--fs-sm); line-height: 1.75; }
#billing-host .membership-stages { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-5); list-style-position: inside; margin: var(--s-3) 0; padding: var(--s-3); border-radius: var(--r-2); background: var(--surface-3); color: var(--ink-3); font-size: var(--fs-sm); line-height: 1.8; }
#billing-host .membership-next-step { margin: var(--s-2) 0 var(--s-4); color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.7; }
#billing-host .membership-technical { grid-column: 1 / -1; min-width: 0; border-top: 1px solid var(--line); padding-top: var(--s-1); }
#billing-host .membership-technical p { font-size: var(--fs-sm); line-height: 1.7; overflow-wrap: anywhere; }
#billing-host .membership-platform { margin-top: var(--s-4); padding-top: var(--s-3); }
#billing-host .membership-platform h6 { margin: 0; font-size: var(--fs-sm); font-weight: 620; }
#billing-host .membership-save { justify-self: start; }

/* 账号关联 */
#billing-host .account-links { display: grid; gap: var(--s-3); }
#billing-host .account-links-notice,
#billing-host .account-links-preview { padding: var(--s-3); border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface-2); }
#billing-host .account-links small { color: var(--ink-4); font-size: var(--fs-xs); }

/* 12. 响应式 ------------------------------------------------------------- */
@media (max-width: 1180px) {
  .ov-split { grid-template-columns: minmax(0, 1fr); }
  .library-layout { grid-template-columns: minmax(0, 1fr); }
  .quick-actions { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
  #insights-host .insights-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dedication-grid, .user-profile-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1024px) {
  :root { --sidebar-w: 224px; }
  .content { padding: var(--s-5); }
  .topbar { padding: 0 var(--s-5); }
  .topbar-desc { display: none; }
  .notice { margin-inline: var(--s-5); }
}

/* 窄屏：侧边栏转为顶部横向导航 */
@media (max-width: 860px) {
  .workspace { grid-template-columns: minmax(0, 1fr); min-height: auto; }
  .sidebar {
    position: static;
    height: auto;
    padding: var(--s-2) var(--s-3) 0;
    overflow: visible;
  }
  .sidebar-brand { height: auto; padding: var(--s-2) var(--s-1) var(--s-3); margin-bottom: 0; }
  .nav { display: flex; gap: var(--s-1); width: 100%; overflow-x: auto; padding-bottom: var(--s-2); scrollbar-width: thin; }
  .nav-group { display: flex; gap: var(--s-1); align-items: center; }
  .nav-label { display: none; }
  .nav button { width: auto; min-height: 32px; padding: 0 12px; grid-template-columns: 16px auto auto; gap: var(--s-2); white-space: nowrap; }
  .nav button[aria-current="page"]::before { display: none; }
  .sidebar-foot { display: none; }
  .main { min-height: auto; }
  .topbar { min-height: 56px; padding: 0 var(--s-4); }
  .content { padding: var(--s-4); }
  .notice { margin-inline: var(--s-4); }
  .upload-fields { grid-template-columns: minmax(0, 2fr) 1fr 1fr; }
  .upload-fields > .button { grid-column: 1 / -1; }
  .system-panel { align-items: flex-start; flex-direction: column; }
  #billing-host .membership-fields,
  #billing-host .membership-search { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 620px) {
  :root { --fs-base: 13px; }
  .ov-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); }
  .kpi { padding: var(--s-3) var(--s-4); }
  .kpi-value { font-size: 21px; }
  /* Keep daily bars readable: 30-day windows scroll instead of compressing. */
  .trend-chart { overflow-x: auto; scrollbar-width: thin; gap: 4px; }
  .trend-col { flex: 0 0 16px; }
  .quick-actions { grid-template-columns: minmax(0, 1fr); }
  .quick-actions button { grid-template-columns: 30px minmax(0, 1fr); align-items: center; gap: var(--s-1) var(--s-3); }
  .quick-actions button > span { grid-row: 1 / 3; margin-bottom: 0; }
  .topbar { flex-wrap: wrap; gap: var(--s-2); padding: var(--s-3) var(--s-4); }
  .topbar-actions { width: 100%; justify-content: space-between; }
  .topbar-title h1 { font-size: 16px; }
  .content { padding: var(--s-3); gap: var(--s-3); }
  .panel { padding: var(--s-4); }
  .admin-section { gap: var(--s-3); }
  .upload-fields { grid-template-columns: 1fr 1fr; }
  .upload-fields > .field:first-child { grid-column: 1 / -1; }
  .editor-selects, .user-summary-grid { grid-template-columns: minmax(0, 1fr); }
  .file-picker { flex-wrap: wrap; }
  .file-picker input { width: 100%; margin-left: 0; }
  .dedication-card { grid-template-columns: minmax(0, 1fr); }
  .dedication-media { min-height: 140px; }
  .dedication-media img { min-height: 140px; }
  .user-profile-card { grid-template-columns: 40px minmax(0, 1fr); }
  .admin-user-metrics { grid-column: 1 / -1; justify-items: start; text-align: left; }
  .search-label { max-width: none; flex: 1 1 100%; }
  .system-checks { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); }
  .login { padding: var(--s-4); min-height: calc(100vh - 24px); }
  .login-card { padding: var(--s-5); }
  #billing-host { gap: var(--s-3); }
  #billing-host .billing-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #billing-host .billing-summary article { padding: var(--s-3); }
  #billing-host .billing-summary strong { font-size: 17px; }
  #billing-host .billing-collection-grid { grid-template-columns: minmax(0, 1fr); }
  #billing-host .membership-plan { padding: var(--s-3); }
  #insights-host .insights-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 460px) {
  .ov-kpis { grid-template-columns: minmax(0, 1fr); }
  .kpi { grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: var(--s-3); }
  .kpi-label, .kpi-note { grid-column: 1; }
  .kpi-value { grid-column: 2; grid-row: 1 / 3; font-size: 24px; }
  .filters button, .dedication-filters button, .segmented button { padding: 5px 9px; }
  .ov-trend-tools { width: 100%; justify-content: space-between; }
}

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

@media print {
  .sidebar, .topbar-actions, .page-foot { display: none !important; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .panel, .kpi, .data-table { box-shadow: none; break-inside: avoid; }
}
