/* 泡泡选题皮肤。原来是三层叠加覆盖（基础皮肤 → POP 深色顶栏 → 字号补丁），2026-10-01 合成这一份，每个选择器只写一次。
   顶栏与白卡片同色、底边一条细线，只有 POP 徽标用实色；当前栏目浅蓝底蓝字。
   正式页 HTML 的 id 和按钮不要动，不要把静态样稿 HTML 贴进来。 */
:root {
  --paper: #ffffff;
  --ink: #111827;
  --muted: #6B7280;
  --line: #E5E7EB;
  --bg-page: #F7F6F2;
  --bg-main: #f3f5f7;

  --primary: #0d9488;
  --primary-hover: #0f766e;
  --primary-light: #ccfbf1;
  --nav-bg: #ffffff;

  --green: #059669;
  --green-bg: #ecfdf5;
  --red: #dc2626;
  --red-bg: #fef2f2;
  --amber: #d97706;
  --amber-bg: #fffbeb;
  --blue: #2563eb;
  --blue-bg: #eff6ff;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.02), 0 4px 12px rgba(0,0,0,.01);
  --shadow-lg: 0 12px 28px -4px rgba(0, 0, 0, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  font: 14px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg-page);
  letter-spacing: -0.01em;
  overflow-x: hidden;
}

/* ---------- 顶栏 ---------- */
.top {
  height: 60px;
  background: var(--nav-bg);
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 20;
  overflow: visible;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(17,24,39,.04);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-width: max-content;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
  color: var(--ink);
}
.brand small { display: none; }


.logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  position: relative;
  z-index: 2;
  height: 22px;
  padding: 0 7px;
  border-radius: 6px;
  background: linear-gradient(135deg, #3B82F6 0%, #6366F1 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .4px;
  line-height: 1;
  box-shadow: 0 2px 4px rgba(59,130,246,.25);
}
.logo-title { font-size: 15px; font-weight: 700; letter-spacing: -.3px; line-height: 1; color: var(--ink); }

.nav {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  height: auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav.ovf { -webkit-mask-image: linear-gradient(90deg,#000 90%,transparent); mask-image: linear-gradient(90deg,#000 90%,transparent); }
.nav button {
  position: relative;
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #4B5563;
  font-size: 14px;
  font-weight: 500;
  line-height: 32px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}
.nav button:hover { color: var(--ink); background: #F3F4F6; }
.nav button.active { background: #EFF6FF; color: #2563EB; font-weight: 600; }

/* 「管理」下拉：挂在 .nav 外按 fixed 定位（.nav 横向可滚，会裁掉普通绝对定位的下拉） */
.admin-menu { position: relative; height: auto; display: flex; align-items: center; flex: 0 0 auto; margin-left: 4px; }
.admin-toggle {
  height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer;
}
.admin-toggle:hover { background: #F9FAFB; }
.admin-drop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  min-width: 168px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(17,24,39,.16);
}
.admin-drop.open {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
}
/* 下拉会挂到 body，不能依赖 .nav 祖先选择器 */
.admin-drop button {
  display: block;
  width: 100%;
  flex: 0 0 auto;
  height: auto !important;
  margin: 0;
  padding: 10px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #1F2937;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  white-space: nowrap;
  box-shadow: none;
  cursor: pointer;
}
.admin-drop button:hover,
.admin-drop button.active { background: #F3F4F6; color: var(--ink); }
.admin-drop button[style*="display: none"],
.admin-drop button[hidden] { display: none !important; }

.search {
  display: flex;
  position: relative;
  margin-left: auto;
  flex: 0 1 200px;
  width: 200px;
  min-width: 0;
  height: 34px;
  background: #F9FAFB;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.search:focus-within { border-color: #3B82F6; box-shadow: 0 0 0 2px rgba(59,130,246,.25); }
.search input {
  width: 100%;
  padding: 8px 36px 8px 14px;
  border: 1px solid transparent;
  border-radius: 20px;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}
.search input::placeholder { color: #9CA3AF; }
.search button {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
}
.search button:hover { color: var(--ink); }

.who {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: 8px;
  flex: 0 0 auto;
}
.who-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 260px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #F9FAFB;
  color: #374151;
  font-size: 14px;
  cursor: pointer;
}
.who-toggle:hover { background: #F3F4F6; border-color: #D1D5DB; }
.who-toggle .name {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
}
.who-toggle .who-text {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}
.who-toggle .who-display {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.who-toggle .role {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.who-caret {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
}
.who .avatar {
  width: 28px;
  height: 28px;
  margin-right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid #BFDBFE;
  background: #EFF6FF;
  color: #2563EB;
  font-size: 12px;
  font-weight: 600;
  flex: 0 0 auto;
}
.who-drop-meta {
  padding: 8px 12px 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.who-drop-sep {
  height: 1px;
  margin: 4px 6px;
  background: var(--line);
}
.admin-menu, .admin-toggle { display: none !important; }

/* ---------- 页面骨架 ---------- */
.wrap { max-width: 1280px; margin: 0 auto; padding: 24px; min-width: 0; }
.view { min-width: 0; max-width: 100%; }
.band, .card { min-width: 0; max-width: 100%; }
.view { display: none; }
.view.active { display: block; }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-head h1 { margin: 0; font-size: 22px; font-weight: 700; color: var(--ink); }
.section-head p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.muted, .sub, .gray { color: var(--muted); }
.empty { padding: 38px; text-align: center; color: var(--muted); }

.band, .card {
  margin-bottom: 20px;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.band-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: #fafbfc;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}
.band-title .count, .card-count-badge { background: #EFF6FF; color: #1D4ED8; border-radius: 12px; }

/* 指标卡片 */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat {
  padding: 18px 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat:hover { transform: translateY(-2px); }
.stat b { display: block; font-size: 28px; font-weight: 800; line-height: 1.2; color: var(--ink); letter-spacing: -0.5px; }
.stat span { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; font-weight: 500; }

/* 胶囊分段控件 */
.segments { display: inline-flex; gap: 2px; padding: 3px; background: #e2e8f0; border-radius: var(--radius-md); }
.segments button {
  min-width: 90px;
  padding: 6px 14px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.segments button:hover { color: var(--ink); }
.segments button.active { background: #ffffff; color: var(--ink); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08); }
.segments button .cnt { margin-left: 6px; padding: 1px 6px; border-radius: 10px; background: rgba(0, 0, 0, 0.06); font-size: 11px; }
.segments button.active .cnt { background: var(--primary-light); color: var(--primary-hover); }

/* 菜单行 / 筛选栏 */
.menu-row, .format-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  padding: 12px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.menu-row .lv { padding: 3px 10px; border-radius: 6px; background: #f1f5f9; color: var(--muted); font-size: 12px; font-weight: 700; }
.format-note { margin-left: auto; color: var(--muted); font-size: 13px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 表格 ---------- */
.table-scroll {
  overflow: auto;
  max-height: 680px;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
table { width: 100%; min-width: 850px; border-collapse: separate; border-spacing: 0; }
th, td { padding: 12px 16px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
td { color: #374151; border-bottom-color: #F3F4F6; }
/* 中文表头没有空格，列一挤就会一字一行；不换行，放不下由 .table-scroll 横向滚动 */
th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #FAFAFA;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
}
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #FAFBFD; }
.band table td.tnum, .band table td .datum, td button { white-space: nowrap; }

.title-link { font-weight: 600; color: var(--ink); cursor: pointer; text-decoration: none; transition: color 0.15s; }
.title-link:hover { color: var(--primary); }
.rank { font-weight: 700; font-size: 14px; color: var(--muted); }
.rank, .cnt, .datum, .tnum { font-variant-numeric: tabular-nums; }
.tbl-actions { white-space: nowrap; }
.medal { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; font-size: 12px; font-weight: 700; background: var(--bg-main); }
.medal.g1 { background: linear-gradient(135deg,#fbbf24,#f59e0b); color: #fff; }
.medal.g2 { background: linear-gradient(135deg,#cbd5e1,#94a3b8); color: #fff; }
.medal.g3 { background: linear-gradient(135deg,#d8a47f,#b3765a); color: #fff; }

/* 标签 */
.tag, .badge {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  margin: 2px 4px 2px 0;
  padding: 3px 8px;
  border-radius: 6px;
  background: #F3F4F6;
  color: #374151;
  font-size: 12px;
  font-weight: 500;
}
.tag.green { background: var(--green-bg); color: var(--green); border: 1px solid rgba(5, 150, 105, 0.15); }
.tag.amber { background: var(--amber-bg); color: var(--amber); border: 1px solid rgba(217, 119, 6, 0.15); }
.tag.red { background: var(--red-bg); color: var(--red); border: 1px solid rgba(220, 38, 38, 0.15); }
.tag.blue { background: var(--blue-bg); color: var(--blue); border: 1px solid rgba(37, 99, 235, 0.15); }
.pct-tag { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 4px; background: #F3F4F6; color: var(--muted); font-size: 11px; font-weight: 500; }

/* ---------- 表单与按钮 ---------- */
.filters select, .filters input, .form input, .form select, .form textarea {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  transition: all 0.2s;
}
.filters select:focus, .filters input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15); }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); }
.form .wide { grid-column: 1/-1; }
.form textarea { min-height: 70px; resize: vertical; }

button.primary, button.secondary, button.danger {
  padding: 8px 16px;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}
button.primary { background: var(--primary); color: #fff; box-shadow: 0 2px 4px rgba(13, 148, 136, 0.2); }
button.primary:hover { background: var(--primary-hover); }
button.secondary { background: #f1f5f9; color: #334155; }
button.secondary:hover { background: #e2e8f0; }
button.danger { background: var(--red-bg); color: var(--red); }
button.danger:hover { background: #fecaca; }

/* ---------- 侧边抽屉（详情 / 表单） ---------- */
.drawer { position: fixed; inset: 0; z-index: 40; display: none; }
.drawer.open { display: block; }
.shade { position: absolute; inset: 0; background: #0008; }
.panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(760px, 96vw);
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.panel-head {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.panel-head h2 { margin: 0; font-size: 18px; font-weight: 700; color: var(--ink); }
.panel-body { padding: 16px 20px; }
.icon-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
}
.icon-btn:hover { background: #e2e8f0; color: var(--ink); }
.detail-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 12px 0; }
.datum { background: #fff; border: 1px solid var(--line); padding: 10px; border-radius: 4px; }
.datum span { display: block; color: var(--muted); font-size: 12px; }
.datum b { display: block; margin-top: 3px; }
.subhead { font-size: 15px; margin: 18px 0 8px; }

/* ---------- 各页专用 ---------- */
.search-results { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.result { display: flex; justify-content: space-between; gap: 10px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 5px; cursor: pointer; }
.result:hover { border-color: #0d9488; }
#searchTabs { margin-bottom: 16px; flex-wrap: wrap; }
.search-group { margin-bottom: 24px; }
.search-group .subhead { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.search-group .search-note { font-size: 12px; font-weight: 400; }

.source-list { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; padding: 14px; }
.source { border: 1px solid var(--line); border-radius: 5px; padding: 12px; }
.source-head { display: flex; justify-content: space-between; gap: 10px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: #9aa39e; margin-right: 6px; }
.dot.public, .dot.valid { background: #10b981; }
.dot.warning { background: #f59e0b; }
.dot.expired, .dot.failed { background: #ef4444; }

.user-form { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; padding: 14px; border-bottom: 1px solid var(--line); }
.user-form label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 13px; }
.user-form input, .user-form select { border: 1px solid #cfd7d2; border-radius: 4px; padding: 8px 10px; }
.user-form .actions { display: flex; align-items: flex-end; gap: 8px; }

/* 投放榜分布条：分类用蓝，受众用靛、集数用青，只留在对应那一张图上 */
.chart-row { display: flex; align-items: center; gap: 16px; margin: 8px 0; }
.chart-label { flex: 0 0 88px; text-align: right; font-size: 13px; font-weight: 500; color: #374151; white-space: nowrap; }
.chart-bar-container { flex: 1; height: 12px; background: #F3F4F6; border-radius: 999px; overflow: hidden; }
.chart-bar-fill { height: 100%; border-radius: 999px; }
.chart-bar-fill.is-blue { background: #3B82F6; }
.chart-bar-fill.is-indigo { background: #6366F1; }
.chart-bar-fill.is-teal { background: #14B8A6; }
.chart-data { flex: 0 0 108px; display: flex; align-items: baseline; gap: 6px; }
.chart-num { font-size: 13px; font-weight: 700; color: var(--ink); }
.chart-pct { font-size: 11px; color: var(--muted); }

.toast { position: fixed; right: 18px; bottom: 18px; z-index: 99; display: none; padding: 11px 15px; border-radius: 4px; background: #0f172a; color: #fff; }
.toast.show { display: block; }

/* ---------- 窄屏 ---------- */

/* ========== 手机 / 窄屏适配 ========== */
@media (max-width: 900px) {
  html { -webkit-text-size-adjust: 100%; }

  .top {
    height: auto;
    min-height: 52px;
    padding: 8px 12px;
    padding-top: max(8px, env(safe-area-inset-top));
    flex-wrap: wrap;
    gap: 8px 10px;
    row-gap: 8px;
  }
  .brand { gap: 8px; max-width: 46vw; }
  .logo-title { font-size: 16px; }
  .logo-badge { height: 20px; padding: 0 6px; font-size: 11px; }

  /* 导航：整行横滑，不换行 */
  .nav {
    order: 3;
    width: 100%;
    flex: 1 1 100%;
    gap: 4px;
    padding: 0 0 4px;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav button {
    flex: 0 0 auto;
    height: 36px;
    padding: 0 12px;
    font-size: 14px;
    line-height: 36px;
    white-space: nowrap;
  }

  .search {
    order: 4;
    width: 100%;
    flex: 1 1 100%;
    min-width: 0;
    height: 40px;
  }
  .search input { font-size: 16px; } /* 避免 iOS 聚焦放大 */
  .who {
    order: 2;
    margin-left: auto;
  }
  .who-toggle {
    min-height: 36px;
    max-width: 48vw;
    padding: 3px 8px 3px 3px;
  }
  .who-toggle .who-text .role { display: none; }
  .who-toggle .who-display {
    max-width: 28vw;
  }
  .admin-drop {
    z-index: 200 !important;
  }


  .wrap {
    padding: 12px 12px max(28px, env(safe-area-inset-bottom));
  }
  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
  }
  .section-head h1 { font-size: 22px; }
  .section-head p { font-size: 13px; line-height: 1.5; }

  /* 筛选：控件尽量铺满，好点选 */
  .filters {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .filters input,
  .filters select,
  .filters button {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    font-size: 14px;
  }
  .filters button.secondary,
  .filters > button {
    grid-column: 1 / -1;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
  }
  .stat { padding: 12px 12px; }
  .stat b { font-size: 22px; }
  .stat span { font-size: 12px; line-height: 1.35; }

  .band-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 12px 14px;
    font-size: 14px;
  }
  .band-title .muted { font-size: 12px; line-height: 1.4; }

  .menu-row, .format-bar {
    gap: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
  }
  .segments {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }
  .segments::-webkit-scrollbar { display: none; }
  .segments button {
    min-width: auto;
    flex: 0 0 auto;
    min-height: 34px;
    padding: 6px 12px;
  }
  .format-note { margin-left: 0; width: 100%; font-size: 12px; }

  .table-scroll {
    max-height: min(70vh, 560px);
    margin: 0 -1px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  }
  .table-scroll::before {
    content: "左右滑动查看更多列";
    display: block;
    padding: 8px 14px;
    background: #F8FAFC;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
    position: sticky;
    left: 0;
    z-index: 4;
  }
  table { min-width: 640px; font-size: 13px; }
  th, td { padding: 10px 12px; }
  /* 粘住首列；书名列给足最小宽度，横滑时不丢锚点 */
  th:first-child,
  td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #fff;
    box-shadow: 4px 0 8px -6px rgba(15, 23, 42, 0.25);
  }
  thead th:first-child { z-index: 3; background: #F9FAFB; }
  th:nth-child(2),
  td:nth-child(2) { min-width: 140px; }
  td .title-link {
    max-width: 46vw;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
  }

  .user-form, .form { grid-template-columns: 1fr; }
  .form .wide { grid-column: auto; }
  .detail-grid, .source-list, .search-results { grid-template-columns: 1fr; }

  /* 详情抽屉：窄屏改底部大面板，更像 App */
  .drawer.open { overscroll-behavior: none; }
  .panel {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    max-height: min(92vh, 920px);
    border-radius: 16px 16px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .panel-head { padding: 12px 16px; }
  .panel-head h2 { font-size: 16px; line-height: 1.35; max-width: calc(100vw - 72px); }
  .panel-body { padding: 12px 16px 24px; }
  .icon-btn { width: 40px; height: 40px; font-size: 22px; }
  .datum { padding: 10px 12px; }
  .subhead { font-size: 14px; margin: 14px 0 8px; }

  .toast {
    left: 12px;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
  }

  /* 投放榜等图表区 */
  .chart, .bars, .style-bars { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

@media (max-width: 480px) {
  .stats { gap: 8px; }
  .stat b { font-size: 20px; }
  .nav button { padding: 0 10px; font-size: 13px; }
  .filters { grid-template-columns: 1fr; }
  table { min-width: 560px; }
  .brand small, .logo-title + small { display: none !important; }
}


.plot-dims { display: grid; gap: 8px; }
.plot-summary { font-size: 14px; line-height: 1.55; margin-bottom: 4px; }
.plot-dim { display: grid; grid-template-columns: 72px 1fr; gap: 8px; align-items: start; }
.plot-dim .tag { margin: 0 6px 6px 0; }
.plot-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-top: 12px; }
.plot-block { background: #F9FAFB; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.plot-block h4 { margin: 0 0 6px; font-size: 13px; }
.plot-block ul { margin: 0; padding-left: 18px; }
.plot-block li { margin: 0 0 4px; font-size: 12px; line-height: 1.45; color: #374151; }
@media (max-width: 900px) {
  .plot-dim { grid-template-columns: 1fr; gap: 4px; }
  .plot-detail-grid { grid-template-columns: 1fr; }
}

.cand-link{cursor:pointer;color:inherit;text-decoration:none;transition:color .15s}
.cand-link:hover{color:#2563eb;text-decoration:underline;text-underline-offset:3px}

.cand-cell{display:flex;gap:10px;align-items:flex-start}
.cand-cover{position:relative;flex:0 0 40px;width:40px;height:54px;border-radius:6px;overflow:hidden;border:1px solid var(--line,#e5e7eb);background:linear-gradient(135deg,#e0e7ff,#f1f5f9);display:flex;align-items:center;justify-content:center;color:#64748b;font-weight:600;font-size:15px}
.cand-cover i{font-style:normal}
.cand-cover img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;background:#f3f4f6}
.cand-cover.cand-link:hover{text-decoration:none;box-shadow:0 0 0 2px #93c5fd}

.thumb-cell{display:flex;gap:10px;align-items:flex-start}
.thumb-cell>div{min-width:0}
.thumb{position:relative;flex:0 0 40px;width:40px;height:54px;border-radius:6px;overflow:hidden;border:1px solid var(--line,#e5e7eb);background:linear-gradient(135deg,#e0e7ff,#f1f5f9);display:flex;align-items:center;justify-content:center;color:#64748b;font-weight:600;font-size:15px}
.thumb i{font-style:normal}
.thumb img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;background:#f3f4f6}
.thumb[data-open-detail]{cursor:pointer}
.thumb[data-open-detail]:hover{box-shadow:0 0 0 2px #93c5fd}
@media (max-width: 760px){.thumb,.cand-cover{flex-basis:32px;width:32px;height:44px;font-size:13px}.thumb-cell,.cand-cell{gap:8px}}

.play-btn{display:inline-flex;align-items:center;gap:6px;padding:8px 14px;border-radius:8px;background:#111827;color:#fff;font-weight:600;font-size:13px;text-decoration:none;border:none;cursor:pointer}
.play-btn:hover{background:#2563eb;color:#fff}
.play-link{display:inline-block;margin-left:6px;padding:1px 7px;border-radius:999px;background:#111827;color:#fff;font-size:11px;line-height:1.6;text-decoration:none;vertical-align:middle}
.play-link:hover{background:#2563eb;color:#fff}
.detail-play{padding-bottom:4px}

.thumb-play{position:absolute;right:3px;bottom:3px;z-index:2;width:18px;height:18px;border-radius:50%;background:rgba(17,24,39,.62);backdrop-filter:blur(2px);display:flex;align-items:center;justify-content:center;box-shadow:0 1px 3px rgba(0,0,0,.25);transition:background .15s,transform .15s}
.thumb-play svg{width:8px;height:8px;fill:#fff;margin-left:1px}
.thumb-play:hover{background:#fe2c55;transform:scale(1.15)}
.play-btn{display:inline-flex;align-items:center;gap:8px;padding:6px 14px 6px 6px;border-radius:999px;background:#fff;color:var(--ink,#111827);border:1px solid var(--line,#e5e7eb);font-weight:600;font-size:13px;text-decoration:none;box-shadow:0 1px 2px rgba(15,23,42,.06);transition:border-color .15s,color .15s,box-shadow .15s}
.play-btn:hover{background:#fff;color:#fe2c55;border-color:#fe2c55;box-shadow:0 2px 8px rgba(254,44,85,.18)}
.play-ico{width:22px;height:22px;border-radius:50%;background:#fe2c55;display:inline-flex;align-items:center;justify-content:center}
.play-ico svg{width:9px;height:9px;fill:#fff;margin-left:1px}
.result{align-items:flex-start}
.result .thumb-cell{flex:1;min-width:0}
.result-meta{flex:0 0 auto;text-align:right;min-width:72px}


.market-grid{align-items:start}
@media (max-width:900px){.market-grid{grid-template-columns:1fr!important}}
#market .stat em{display:block;font-style:normal;font-size:11px;margin-top:2px}

.search-wrap { display: flex; align-items: center; margin-left: auto; gap: 8px; flex: none; }
.search-wrap .search { margin-left: 0; }
.search-kind { display: inline-flex; height: 34px; padding: 3px; background: #e2e8f0; border-radius: 8px; flex: none; }
.search-kind button { border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; padding: 0 12px; border-radius: 6px; cursor: pointer; }
.search-kind button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(15,23,42,.08); }

.hist-fit { overflow: visible; max-height: none; }
.hist-fit table { min-width: 0; }
.hist-fit td { white-space: normal; word-break: break-word; }

# 候选池 / 申请中心：分段、行内按钮和状态下拉跟榜单同一套尺寸
#candFilters { margin: 14px 16px 4px; }
#candidates .tbl-actions button, #applications .tbl-actions button { padding: 4px 10px; font-size: 12px; box-shadow: none; }
#applicationRows select, #applications select.app-status { padding: 4px 8px; font-size: 12px; min-width: 108px; }

#tenantSwitch { height: 32px; margin-right: 10px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); font-size: 13px; }

.hg-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; padding:16px; }
.hg-bucket { min-width:0; }
.hg-bucket-h { display:flex; justify-content:space-between; gap:8px; margin-bottom:8px; font-size:13px; }
.hg-bucket .chart-label { width:36px; }
.sort-th { cursor:pointer; user-select:none; }
.sort-th:hover { color:var(--ink); }
@media (max-width:1100px) { .hg-grid { grid-template-columns:1fr 1fr; } }


.tenant-scope { height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); font-size: 13px; }
.head-tools { display: flex; gap: 8px; align-items: center; }

#todayBookPane[hidden],#todayDramaPane[hidden]{display:none}

#today .section-head { align-items: center; margin-bottom: 14px; }
#today .section-head p { max-width: 560px; }
#todayFilters { margin: 0 0 18px; justify-content: flex-start; }
#hotThemes.theme-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 20px 16px; }
#hotThemes.theme-chips button { min-width: 0; padding: 4px 10px; border: 0; border-radius: 999px; background: #f1f5f9; color: var(--ink); font-size: 13px; font-weight: 500; cursor: default; }
