/* ==========================================================================
   剧集数据统计系统 — 样式表
   浅色现代后台风格（无外部字体 / 图片 / CDN，完全离线可用）
   ========================================================================== */

:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f9fafb;
  --border: #e5e7eb;
  --border-soft: #eef1f6;
  --text: #1f2937;
  --text-muted: #6b7280;
  --text-faint: #9ca3af;
  --primary: #2f6fed;
  --primary-dark: #1e56cc;
  --primary-soft: #eaf1ff;
  --success: #16a34a;
  --success-soft: #e8f7ee;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --violet: #7c3aed;
  --violet-soft: #f1eafe;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.1);
  --shadow-pop: 0 12px 32px rgba(16, 24, 40, 0.18);
  --font: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: clip;
  /* 滚动条常驻占位，避免切换页面时横向抖动 */
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p {
  margin: 0;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

.icon {
  display: inline-block;
  flex: none;
  vertical-align: -2px;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 500;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 12px;
}

/* ---------------------------------- 整体框架 ---------------------------------- */

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.header-inner {
  max-width: 1680px;
  margin: 0 auto;
  padding: 10px 24px;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: block;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: var(--shadow-card);
}

.brand-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.brand-sub {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.auth-area {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f3f4f6;
  color: #374151;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
}

/* ------------------------------ 左侧导航 / 内容区 ------------------------------ */

.app-body {
  flex: 1 1 auto;
  display: flex;
  align-items: flex-start;
  gap: 24px;
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 0 24px 24px;
}

.app-sidebar {
  flex: 0 0 216px;
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  /* 底部固定在页面底部并留出 24px 间距 */
  height: calc(100vh - 84px - 24px);
  max-height: calc(100vh - 84px - 24px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 10px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.sidebar-label {
  padding: 2px 10px 8px;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.side-nav .tab {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.side-nav .tab svg {
  flex: 0 0 auto;
  margin-right: 9px;
  opacity: 0.9;
}

.side-nav .tab:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.side-nav .tab[aria-selected="true"] {
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 600;
}

.side-nav .tab[aria-selected="true"]::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 16px;
  border-radius: 0 3px 3px 0;
  background: var(--primary);
  transform: translateY(-50%);
}

.side-nav .tab:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.app-content {
  flex: 1 1 auto;
  min-width: 0;
  padding-top: 20px;
}

/* ------------------------------ 页面标题行筛选控件 ------------------------------ */

.page-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
}

.pf-dates {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.pf-select {
  border: 0;
  background: transparent;
  padding: 3px 2px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.pf-select:focus {
  outline: none;
}

.pf-sep {
  color: var(--text-faint);
  font-size: 12px;
}

.pf-search {
  width: 170px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
}

.pf-search:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.16);
}

.pf-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ------------------------------ 日期范围选择器 ------------------------------ */

.date-picker {
  position: relative;
  display: inline-flex;
}

.dp-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}

.dp-trigger:hover {
  border-color: #b8c2d1;
}

.dp-trigger:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.16);
}

.dp-trigger-value {
  font-variant-numeric: tabular-nums;
}

.dp-trigger svg {
  color: var(--text-muted);
}

.dp-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 80;
  width: 520px;
  max-width: calc(100vw - 48px);
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.18);
}

.dp-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dp-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: #f3f4f6;
  color: #374151;
  cursor: pointer;
}

.dp-nav:hover {
  background: #e5e7eb;
}

.dp-titles {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  text-align: center;
}

.dp-title {
  color: #111827;
  font-size: 13.5px;
  font-weight: 600;
}

.dp-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 10px;
}

.dp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin-bottom: 4px;
}

.dp-weekday {
  padding: 2px 0;
  color: var(--text-muted);
  font-size: 11.5px;
  text-align: center;
}

.dp-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
}

.dp-blank {
  height: 30px;
}

.dp-day {
  height: 30px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.dp-day:hover:not(:disabled) {
  background: #eef2ff;
}

.dp-day.is-today {
  color: var(--primary);
  font-weight: 700;
}

.dp-day.is-disabled {
  color: #cbd5e1;
  cursor: not-allowed;
}

.dp-day.in-range {
  border-radius: 0;
  background: #eff6ff;
  color: var(--primary);
}

.dp-day.is-start,
.dp-day.is-end {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

@media (max-width: 600px) {
  .dp-pop {
    right: 0;
    left: auto;
    width: calc(100vw - 32px);
  }

  .dp-body {
    grid-template-columns: 1fr;
  }

  .dp-titles span:nth-child(2),
  .dp-body .dp-month:nth-child(2) {
    display: none;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field > label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.field select,
.field input {
  height: 36px;
  padding: 0 10px;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13.5px;
  color: var(--text);
  min-width: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field select {
  min-width: 152px;
  padding-right: 30px;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b7280' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}

.field input[type="search"] {
  width: 100%;
}

.field select:hover,
.field input:hover {
  border-color: #b8c2d1;
}

.field select:focus,
.field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.16);
}

/* --------------------------------- 主区域 --------------------------------- */

.app-main {
  margin: 0;
  padding: 0;
  /* 保证加载态与短页面时内容区高度稳定，避免切换页面时页面高度突变 */
  min-height: max(320px, calc(100vh - 280px));
  display: flex;
  flex-direction: column;
  gap: 16px;
  outline: none;
}

/* ---------------------------------- 按钮 ---------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: #374151;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  background: #f7f9fc;
  border-color: #c3cbd8;
}

.btn:active {
  background: #eef2f8;
}

.btn:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.22);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-primary:active {
  background: #1a4bb8;
  border-color: #1a4bb8;
}

.btn-ghost {
  background: var(--surface);
  color: #374151;
}

.btn-ghost:hover {
  color: var(--primary);
  border-color: #bfd3f8;
  background: #f6f9ff;
}

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

.btn-danger-ghost {
  background: var(--surface);
  color: var(--danger);
  border-color: #fecaca;
}

.btn-danger-ghost:hover {
  background: #fef2f2;
  border-color: #fca5a5;
}

.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12.5px;
}

.btn-xs {
  height: 26px;
  padding: 0 8px;
  font-size: 12px;
  border-radius: 6px;
}

/* --------------------------------- 卡片/面板 ------------------------------- */

.panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
}

.panel-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.panel-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--text);
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.panel-body {
  min-height: 180px;
}

.count-text {
  font-size: 12.5px;
  color: var(--text-muted);
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 18px;
  white-space: nowrap;
}

.chip-blue {
  background: var(--primary-soft);
  color: #1d4ed8;
}

.chip-green {
  background: var(--success-soft);
  color: #15803d;
}

.chip-gray {
  background: #f3f4f6;
  color: #4b5563;
}

/* ---------------------------------- 表格 ---------------------------------- */

.table-wrap {
  position: relative;
  overflow: auto;
  max-height: calc(100vh - 260px);
  min-height: 160px;
}

.table-wrap::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.table-wrap::-webkit-scrollbar-thumb {
  background: #cfd8e6;
  border: 2px solid var(--surface);
  border-radius: 8px;
}

.table-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

/* 视频明细：固定列宽布局，保证 1280px 下 8 列全部可见且标题省略号生效 */
.data-table.table-fixed {
  table-layout: fixed;
}

.data-table.table-fixed tbody td {
  overflow: hidden;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 10px 12px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--border);
  color: #4b5563;
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.data-table thead th.is-sortable {
  padding: 0;
}

.data-table thead th .th-label {
  display: block;
}

.data-table thead th.is-sortable .th-label {
  display: inline;
}

.th-sort {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.th-sort:hover {
  background: #eef3fb;
  color: var(--primary);
}

.th-sort:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.th-sort.is-active {
  color: var(--primary);
}

.data-table thead th.num .th-sort {
  justify-content: flex-end;
}

.data-table thead th.center .th-sort {
  justify-content: center;
}

.sort-ind {
  font-size: 9px;
  line-height: 1;
  color: var(--primary);
}

.data-table tbody td {
  height: 38px;
  padding: 8px 12px;
  border-bottom: 1px solid #f1f4f9;
  color: var(--text);
  vertical-align: middle;
  white-space: nowrap;
}

.data-table tbody tr:nth-child(even) {
  background: #fbfcfe;
}

.data-table tbody tr:hover {
  background: #f2f7ff;
}

.data-table td.num,
.data-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.data-table td.center,
.data-table th.center {
  text-align: center;
}

.data-table tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 3;
  padding: 10px 12px;
  background: var(--surface-soft);
  border-top: 1px solid var(--border);
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.data-table tfoot td.num {
  text-align: right;
}

.data-table tfoot td.center {
  text-align: center;
}

.total-label {
  color: #374151;
  font-weight: 600;
}

/* ------------------------------ 单元格辅助样式 ----------------------------- */

.cell-strong {
  font-weight: 600;
  color: #111827;
}

.mono {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: -0.2px;
  color: #4b5563;
}

.muted {
  color: var(--text-faint);
}

.nowrap {
  white-space: nowrap;
}

.cell-ellipsis,
.cell-ellipsis-150,
.cell-ellipsis-180,
.cell-ellipsis-200,
.cell-ellipsis-260,
.video-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-ellipsis {
  max-width: 200px;
}

.cell-ellipsis-150 {
  max-width: 150px;
}

.cell-ellipsis-180 {
  max-width: 180px;
}

.cell-ellipsis-200 {
  max-width: 200px;
}

.cell-ellipsis-260 {
  max-width: 280px;
}

.video-title {
  max-width: 420px;
}

/* 剧目列表：原生短剧ID 必须完整显示（自动换行，不省略） */
.native-id-cell {
  display: block;
  white-space: normal;
  word-break: break-all;
  overflow-wrap: anywhere;
  line-height: 1.55;
  font-size: 11.5px;
}

/* 剧目列表：文本 + 复制按钮 */
.cell-with-copy {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.cell-with-copy > .cell-ellipsis-260,
.cell-with-copy > .native-id-cell {
  flex: 1 1 auto;
  min-width: 0;
}

/* 原生短剧ID：复制按钮紧跟 ID 文本之后（内联排版，不右对齐） */
.cell-with-copy.id-inline-cell {
  display: block;
}

.cell-with-copy.id-inline-cell > .native-id-cell {
  display: inline;
  flex: none;
}

.cell-with-copy.id-inline-cell .copy-btn {
  margin-left: 8px;
  margin-top: 0;
  vertical-align: middle;
}

.copy-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 1px;
  padding: 1px 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 18px;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.copy-btn:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.copy-btn:active {
  transform: translateY(1px);
}

.rank-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 4px;
  border-radius: 6px;
  background: #f1f4f9;
  color: #4b5563;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------- 徽章 ----------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  white-space: nowrap;
}

.badge-green {
  background: var(--success-soft);
  color: #15803d;
}

.badge-red {
  background: var(--danger-soft);
  color: #b91c1c;
}

.badge-gray {
  background: #f3f4f6;
  color: #4b5563;
}

.badge-blue {
  background: var(--primary-soft);
  color: #1d4ed8;
}

.badge-purple {
  background: var(--violet-soft);
  color: #6d28d9;
}

/* ------------------------------ 百分比 / 条形 ------------------------------ */

.pct {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  width: 100%;
  min-width: 106px;
}

.pct-val {
  min-width: 54px;
  text-align: right;
  color: #374151;
  font-variant-numeric: tabular-nums;
}

.pct-track {
  flex: none;
  width: 52px;
  height: 6px;
  border-radius: 999px;
  background: #e8edf6;
  overflow: hidden;
}

.pct-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #7aa2f7, #2f6fed);
}

.bar-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  width: 100%;
  min-width: 190px;
}

.bar-val {
  min-width: 64px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.bar-track {
  flex: none;
  width: 110px;
  height: 7px;
  border-radius: 999px;
  background: #e8edf6;
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #7aa2f7, #2f6fed);
}

/* --------------------------------- 总览 ----------------------------------- */

.overview-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
  /* 数据页高度铺满视口：Top10 卡片底部与左侧导航底部对齐 */
  height: calc(100vh - 65px - 20px - 24px);
  min-height: 0;
}

.view-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.view-head-title {
  min-width: 0;
}

.view-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: auto;
}

.view-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.view-sub {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.kpi-grid {
  display: grid;
  /* 固定一行 4 个：8 张卡片正好两行，宽屏与窄屏都保持均衡 */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.kpi-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kpi-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent, var(--primary));
  opacity: 0.9;
}

.kpi-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.1);
}

.kpi-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.kpi-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent, var(--primary));
}

.kpi-value {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.5px;
  color: #111827;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}

.kpi-sub {
  min-height: 16px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-faint);
}

.accent-blue {
  --accent: #2f6fed;
}

.accent-cyan {
  --accent: #0891b2;
}

.accent-violet {
  --accent: #7c3aed;
}

.accent-green {
  --accent: #16a34a;
}

.accent-amber {
  --accent: #d97706;
}

.accent-rose {
  --accent: #e11d48;
}

.top-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  flex: 1 1 auto;
  min-height: 0;
  align-items: stretch;
}

@media (min-width: 1280px) {
  .top-panel {
    height: 100%;
    min-height: 0;
  }

  .top-panel .top-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
  }
}

.top-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 8px 10px;
}

.top-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.top-item:hover {
  background: #f2f7ff;
}

.top-item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.rank-badge {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: #eef2f9;
  color: #4b5563;
  font-size: 12px;
  font-weight: 700;
}

.rank-1 {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #fff;
}

.rank-2 {
  background: linear-gradient(135deg, #cbd5e1, #94a3b8);
  color: #fff;
}

.rank-3 {
  background: linear-gradient(135deg, #f0a97a, #d97756);
  color: #fff;
}

.top-name-wrap {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.top-name {
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 600;
  color: #111827;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-id {
  font-size: 11.5px;
  color: var(--text-faint);
}

.top-metrics {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.top-views {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  font-variant-numeric: tabular-nums;
}

.top-income {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.top-empty {
  padding: 26px 12px;
  color: var(--text-faint);
  font-size: 13px;
  text-align: center;
}

/* ------------------------------ 剧目列表：铺满视口 ------------------------------ */

/* 数据页通用：容器铺满视口，卡片底部与左侧导航底部对齐 */
.fill-view {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 65px - 20px - 24px);
  min-height: 0;
}

.fill-view > .panel {
  flex: 1 1 auto;
  min-height: 0;
}

.fill-view .panel-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.fill-view .table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

/* ------------------------------ 剧目列表搜索框 ------------------------------ */

.list-search {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-faint);
}

.list-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.16);
}

.list-search-input {
  width: 230px;
  max-width: 46vw;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  outline: none;
}

.list-search-input::placeholder {
  color: var(--text-faint);
}

/* ------------------------------ 视频明细工具栏 ----------------------------- */

.panel-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: #fcfdff;
  border-bottom: 1px solid var(--border-soft);
}

.toolbar-hint {
  margin-left: auto;
  padding-bottom: 8px;
  font-size: 12px;
  color: var(--text-faint);
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
}

.pager-info {
  font-size: 13px;
  color: var(--text-muted);
}

.pager-info strong {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.pager-actions {
  display: flex;
  gap: 8px;
}

/* --------------------------------- 每日趋势 -------------------------------- */

.note-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 16px 16px;
  padding: 12px 16px;
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.note-card .icon {
  margin-top: 2px;
  color: var(--text-faint);
}

/* --------------------------------- 导入记录 -------------------------------- */

.imports-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.upload-panel .panel-body {
  padding: 16px;
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 30px 20px;
  border: 2px dashed #c7d5ef;
  border-radius: var(--radius);
  background: #f8faff;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.dropzone:hover,
.dropzone:focus-visible {
  outline: none;
  border-color: var(--primary);
  background: #f2f7ff;
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.12);
}

.dropzone.is-drag {
  border-color: var(--primary);
  background: #eaf1ff;
}

.dz-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  margin-bottom: 2px;
  border-radius: 16px;
  background: #e8f0ff;
  color: var(--primary);
}

.dz-title {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}

.dz-hint {
  font-size: 12.5px;
  color: var(--text-muted);
}

.dz-pick {
  margin-top: 8px;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.file-icon {
  display: inline-flex;
  color: var(--primary);
}

.file-name {
  max-width: 340px;
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  font-size: 12px;
  color: var(--text-muted);
}

.file-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.progress-wrap {
  margin-top: 12px;
  padding: 12px 14px;
  background: #f8faff;
  border: 1px solid #e3ebfa;
  border-radius: 10px;
}

.progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.progress-pct {
  font-variant-numeric: tabular-nums;
  color: var(--primary);
  font-weight: 600;
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: #e8edf6;
  overflow: hidden;
}

.progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #7aa2f7, #2f6fed);
  transition: width 0.2s ease;
}

.progress-fill.indeterminate {
  width: 40% !important;
  animation: progress-slide 1.1s ease-in-out infinite;
}

@keyframes progress-slide {
  0% {
    margin-left: -40%;
  }
  100% {
    margin-left: 100%;
  }
}

.import-result {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
  padding: 12px 14px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
}

.result-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #15803d;
  font-size: 13.5px;
}

.result-head strong {
  font-size: 14px;
}

.result-batch {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: #dcfce7;
  color: #16a34a;
  font-size: 12px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px 16px;
}

.result-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.result-label {
  font-size: 11.5px;
  color: #4d7c5b;
}

.result-value {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  color: #14532d;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-warnings {
  padding: 8px 10px;
  background: #fefce8;
  border: 1px solid #fde68a;
  border-radius: 8px;
  color: #a16207;
  font-size: 12.5px;
}

.result-warning-list {
  margin: 6px 0 0;
  padding-left: 18px;
  line-height: 1.7;
  word-break: break-word;
}

.import-error {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  padding: 12px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  color: #b91c1c;
  font-size: 13px;
}

.import-error > .icon {
  margin-top: 1px;
}

.import-error-body {
  min-width: 0;
}

.import-error-body p {
  margin-top: 4px;
  color: #991b1b;
  line-height: 1.6;
  word-break: break-word;
}

.error-details {
  margin: 8px 0 0;
  padding-left: 18px;
  color: #991b1b;
  font-size: 12.5px;
  line-height: 1.7;
  word-break: break-word;
}

/* ------------------------------ 状态 / 加载骨架 ----------------------------- */

.state-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 260px;
  padding: 56px 24px;
  text-align: center;
}

.state-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 2px;
  border-radius: 16px;
  background: #eef4ff;
  color: var(--primary);
}

.state-icon-error {
  background: var(--danger-soft);
  color: var(--danger);
}

.state-panel h2,
.state-panel h3 {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
}

.state-desc {
  max-width: 460px;
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.7;
}

.state-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 8px;
}

.empty-hero {
  min-height: 320px;
  padding: 72px 24px;
}

.loading-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 56px 24px;
  color: var(--text-muted);
  font-size: 13.5px;
}

.loading-text {
  color: var(--text-muted);
}

.spinner {
  width: 26px;
  height: 26px;
  border: 3px solid #dbe4f5;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.skeleton-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(520px, 100%);
  margin-top: 6px;
}

.skeleton-line {
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #eef1f7 25%, #f7f9fc 37%, #eef1f7 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}

/* ---------------------------------- Toast --------------------------------- */

.toast-root {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.16);
  color: var(--text);
  font-size: 13.5px;
  pointer-events: auto;
  animation: toast-in 0.18s ease-out;
}

.toast .icon {
  margin-top: 1px;
}

.toast-msg {
  min-width: 0;
  word-break: break-word;
}

.toast-success {
  border-left-color: var(--success);
}

.toast-success .icon {
  color: var(--success);
}

.toast-error {
  border-left-color: var(--danger);
}

.toast-error .icon {
  color: var(--danger);
}

.toast-info {
  border-left-color: var(--primary);
}

.toast-info .icon {
  color: var(--primary);
}

.toast-out {
  animation: toast-out 0.22s ease-in forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateX(12px);
  }
}

/* ---------------------------------- 弹窗 ---------------------------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  animation: fade-in 0.15s ease;
}

.modal {
  width: min(400px, 100%);
  padding: 22px;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow-pop);
  animation: pop-in 0.18s ease;
}

.modal-sm {
  width: min(430px, 100%);
}

.modal-title {
  margin-bottom: 6px;
  font-size: 17px;
  font-weight: 700;
}

.modal-desc {
  margin-bottom: 16px;
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.7;
  white-space: pre-line;
  word-break: break-word;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-field > label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 12.5px;
}

.input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.16);
}

.modal-error {
  display: none;
  padding: 8px 10px;
  background: var(--danger-soft);
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-size: 13px;
}

.modal-error.is-visible {
  display: block;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* -------------------------------- 响应式 ---------------------------------- */

@media (max-width: 1099px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1279px) {
  .top-grid {
    grid-template-columns: 1fr;
  }

  .overview-view {
    height: auto;
    min-height: 0;
  }

  .fill-view {
    height: auto;
    min-height: 0;
  }

  .fill-view .table-wrap {
    max-height: calc(100vh - 260px);
  }

  .header-inner {
    padding: 10px 16px;
  }

  .app-body {
    gap: 16px;
    padding: 0 16px 16px;
  }

  .app-sidebar {
    flex-basis: 196px;
  }
}

@media (max-width: 899px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-body {
    flex-direction: column;
    gap: 0;
    padding: 0 16px 24px;
  }

  .app-sidebar {
    position: static;
    flex: none;
    width: 100%;
    height: auto;
    max-height: none;
    padding: 12px 0 8px;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: none;
  }

  .app-sidebar::-webkit-scrollbar {
    display: none;
  }

  .side-nav {
    flex-direction: row;
    gap: 6px;
  }

  .side-nav .tab {
    width: auto;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid transparent;
  }

  .side-nav .tab[aria-selected="true"] {
    border-color: var(--border);
  }

  .side-nav .tab[aria-selected="true"]::before {
    display: none;
  }

  .app-content {
    padding-top: 8px;
  }

  .app-main {
    padding: 0 0 32px;
  }

  .brand-sub {
    display: none;
  }

  .table-wrap {
    max-height: calc(100vh - 320px);
  }
}

@media (max-width: 639px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .kpi-value {
    font-size: 23px;
  }

  .header-inner {
    gap: 10px;
  }

  .brand-title {
    font-size: 16px;
  }

  .modal {
    padding: 18px;
  }

  .file-name {
    max-width: 180px;
  }

  .file-actions {
    width: 100%;
    margin-left: 0;
  }
}

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

/* ==========================================================================
   v2 多用户版新增组件：认证卡片 / 用户菜单 / 角色徽章 / 分段控件 /
   绑定页 / 团队页 / 系统设置页
   ========================================================================== */

/* ------------------------------ Header：用户区菜单 ------------------------------ */

.user-menu-wrap {
  position: relative;
}

.user-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 10px 0 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.user-btn:hover {
  background: #f7f9fc;
  border-color: #c3cbd8;
}

.user-btn:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.22);
}

.user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7aa2f7, #2f6fed);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  flex: none;
  user-select: none;
}

.user-name {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 90;
  min-width: 168px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-pop);
  animation: pop-in 0.16s ease;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}

.user-menu-item:hover {
  background: #f2f7ff;
  color: var(--primary);
}

.user-menu-item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.user-menu-item .icon {
  color: var(--text-muted);
}

.user-menu-item:hover .icon {
  color: var(--primary);
}

.user-menu-danger {
  color: var(--danger);
}

.user-menu-danger:hover {
  background: #fef2f2;
  color: var(--danger);
}

.user-menu-danger .icon,
.user-menu-danger:hover .icon {
  color: var(--danger);
}

.user-menu-sep {
  height: 1px;
  margin: 5px 4px;
  background: var(--border-soft);
}

/* --------------------------------- 登录 / 注册 --------------------------------- */

.auth-view {
  min-height: 100vh;
}

.auth-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  min-height: 100vh;
  padding: 40px 20px;
  background:
    radial-gradient(900px 480px at 18% -8%, #e7efff 0%, rgba(231, 239, 255, 0) 62%),
    radial-gradient(760px 420px at 100% 0%, #eef7f1 0%, rgba(238, 247, 241, 0) 60%),
    var(--bg);
}

.auth-brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  font-size: 24px;
  line-height: 1;
  object-fit: cover;
}

.auth-brand-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: #111827;
}

.auth-brand-sub {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.auth-card {
  width: min(380px, 100%);
  padding: 26px 26px 22px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(16, 24, 40, 0.12);
}

.auth-card-wide {
  width: min(440px, 100%);
}

.register-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.auth-title {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
}

.auth-sub {
  margin-top: 4px;
  margin-bottom: 18px;
  color: var(--text-muted);
  font-size: 13px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field > label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.auth-field .input {
  height: 40px;
}

.auth-field-hint {
  font-size: 11.5px;
  color: var(--text-faint);
}

.auth-error {
  display: none;
  padding: 9px 11px;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
  line-height: 1.6;
  word-break: break-word;
}

.auth-error.is-visible {
  display: block;
}

.auth-submit {
  height: 40px;
  margin-top: 2px;
  font-size: 14px;
}

/* 登录算术验证码：图片在左、输入框在右，同一行，整体与其他输入框同宽 */
.auth-field-captcha .captcha-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-field-captcha .captcha-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
  letter-spacing: 2px;
  font-variant-numeric: tabular-nums;
}

.captcha-img {
  display: block;
  flex: 0 0 58%;
  width: 58%;
  height: auto;
  aspect-ratio: 300 / 64;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  object-fit: contain;
  cursor: pointer;
  transition: border-color 0.15s ease, opacity 0.15s ease;
}

.captcha-img:hover {
  border-color: var(--primary);
}

.captcha-img:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.captcha-img.is-loading {
  opacity: 0.45;
  cursor: progress;
}

.captcha-img:not([src]) {
  background: repeating-linear-gradient(45deg, #f1f5f9, #f1f5f9 6px, #e2e8f0 6px, #e2e8f0 12px);
}

.auth-foot {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

.link-btn {
  padding: 0;
  border: none;
  background: transparent;
  color: var(--primary);
  font-size: inherit;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link-btn:hover {
  color: var(--primary-dark);
}

.link-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* 注册页：邀请信息 */

.invite-card .state-panel {
  padding: 26px 12px;
  min-height: 0;
}

.invite-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.invite-lead {
  color: #1f2937;
  font-size: 14px;
  line-height: 1.75;
  word-break: break-word;
}

.invite-lead strong {
  font-weight: 600;
  color: var(--primary-dark);
}

.invite-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
}

.invite-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 13px;
}

.invite-label {
  flex: none;
  width: 62px;
  color: var(--text-muted);
}

.invite-value {
  min-width: 0;
  color: var(--text);
  font-weight: 500;
  word-break: break-word;
}

.invite-invalid-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--danger);
  font-size: 15.5px;
  font-weight: 600;
}

/* ---------------------------------- 分段控件 ---------------------------------- */

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: #eef1f6;
  border-radius: 10px;
}

.segmented-item {
  padding: 7px 14px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.segmented-item:hover {
  color: var(--primary-dark);
}

.segmented-item.is-active {
  background: var(--surface);
  color: var(--primary-dark);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.12);
}

.segmented-item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

/* --------------------------------- 我的视频号 --------------------------------- */

.bindings-view,
.team-view,
.settings-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.bind-hero {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 18px 20px;
}

.bind-hero-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.bind-hero-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
}

.bind-hero-title {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
}

.bind-hero-desc {
  margin-top: 4px;
  max-width: 640px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.65;
}

.bind-stats {
  display: flex;
  gap: 12px;
  flex: none;
}

.bind-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 92px;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
}

.bind-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.bind-stat-label {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

.bind-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.bind-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.bind-field > label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.bind-textarea {
  width: 100%;
  min-height: 76px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  resize: vertical;
}

.bind-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.16);
}

.bind-hint {
  font-size: 12px;
  color: var(--text-faint);
}

.suggest-list {
  max-height: 260px;
  margin-top: 4px;
  padding: 5px;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-card);
}

.suggest-empty {
  padding: 10px 12px;
  color: var(--text-faint);
  font-size: 12.5px;
}

.suggest-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.suggest-item:hover,
.suggest-item:focus-visible {
  outline: none;
  background: #f2f7ff;
}

.suggest-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.suggest-name {
  color: #111827;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggest-id {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggest-meta {
  flex: none;
  color: var(--text-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pending-block {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.pending-label {
  font-size: 12.5px;
  color: var(--text-muted);
}

.pending-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pending-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: #1d4ed8;
  font-size: 12.5px;
  font-family: var(--mono);
}

.pending-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #3b6fd8;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.pending-remove:hover {
  background: #d7e4fd;
  color: #1e40af;
}

.bind-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.bind-actions-hint {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-faint);
}

.bind-error {
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: #b91c1c;
  font-size: 13px;
}

.bind-error strong {
  font-weight: 600;
}

.bind-error-list {
  margin: 6px 0 0;
  padding-left: 18px;
  line-height: 1.7;
  word-break: break-word;
}

.binding-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  max-width: 360px;
  white-space: normal;
}

.binding-tag {
  display: inline-flex;
  align-items: center;
  max-width: 170px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #f1f5fb;
  border: 1px solid var(--border-soft);
  color: #374151;
  font-size: 11.5px;
  line-height: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.binding-more {
  padding: 0 2px;
  color: var(--primary);
  font-size: 11.5px;
}

.binding-empty {
  color: var(--text-faint);
}

/* ---------------------------------- 团队管理 ---------------------------------- */

.team-hero {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 18px 20px;
}

.team-hero-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.team-hero-text {
  min-width: 0;
}

.team-picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
}

.team-picker label {
  color: var(--text-muted);
  font-size: 12.5px;
  white-space: nowrap;
}

.team-select {
  height: 34px;
  min-width: 150px;
  padding: 0 30px 0 10px;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.team-hero-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--primary-soft);
  color: var(--primary);
}

.team-name {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  word-break: break-word;
}

.team-sub {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12.5px;
}

.team-stats {
  display: flex;
  gap: 10px;
  flex: none;
}

.team-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 84px;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
}

.team-stat-value {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 23px;
  font-size: 19px;
  font-weight: 700;
  color: #111827;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.team-stat-label {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ------------------------------- 成员信息弹窗 ------------------------------- */

.member-detail {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.member-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}

.member-detail-label {
  flex: 0 0 84px;
  color: var(--text-muted);
  font-size: 13px;
  padding-top: 1px;
}

.member-detail-value {
  min-width: 0;
  font-size: 13.5px;
  color: var(--text);
  overflow-wrap: anywhere;
}

.member-account-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  padding: 10px 12px;
  margin-left: 98px;
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
}

.member-account-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.member-account-name {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}

.member-account-id {
  font-size: 12px;
  color: var(--text-muted);
}

.member-account-empty {
  margin-left: 98px;
  color: var(--text-faint);
  font-size: 13px;
}

.member-detail-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.member-stat-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
}

.member-stat-value {
  font-size: 17px;
  font-weight: 700;
  color: #111827;
  font-variant-numeric: tabular-nums;
}

.member-stat-label {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* ---------------------------------- 系统设置 ---------------------------------- */

.settings-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.settings-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.settings-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.toolbar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: #fcfdff;
  border-bottom: 1px solid var(--border-soft);
}

.toolbar-input {
  width: min(320px, 100%);
  height: 34px;
  padding: 0 12px;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13px;
}

.toolbar-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.16);
}

.toolbar-spacer {
  margin-left: auto;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.role-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ------------------------------- 弹窗扩展 ------------------------------- */

.modal-lg {
  width: min(560px, 100%);
}

.modal-wide {
  width: min(780px, 100%);
  max-height: min(86vh, 720px);
  overflow: auto;
}

.invite-dialog {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.invite-link-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.link-input {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  color: #374151;
  background: var(--surface-soft);
}

.invite-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
}

.info-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12.5px;
}

.info-item-label {
  color: var(--text-muted);
}

.info-item-value {
  color: var(--text);
  font-weight: 600;
}

.modal-hint {
  color: var(--text-faint);
  font-size: 12px;
  line-height: 1.65;
}

.modal-desc .icon {
  color: var(--text-faint);
}

.user-bindings-table {
  max-height: 46vh;
  overflow: auto;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
}

.user-bindings-table .table-wrap {
  max-height: none;
}

/* ------------------------------- 响应式 ------------------------------- */

@media (max-width: 899px) {
  .auth-page {
    justify-content: flex-start;
    padding: 30px 16px 40px;
  }

  .bind-stats,
  .team-stats {
    width: 100%;
  }

  .bind-stat,
  .team-stat {
    flex: 1;
  }

  .user-name {
    max-width: 96px;
  }

  .binding-tags {
    max-width: 240px;
  }
}

@media (max-width: 639px) {
  .segmented {
    width: 100%;
  }

  .segmented-item {
    flex: 1;
    text-align: center;
  }

  .toolbar-input {
    width: 100%;
  }

  .user-btn > .badge {
    display: none;
  }
}

/* ==========================================================================
   v2.3 佣金：总览佣金条 / 团队佣金 / 佣金设置
   ========================================================================== */

/* ------------------------------- 总览：佣金条 ------------------------------- */

.commission-bar {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: linear-gradient(135deg, #fffbeb 0%, #fff7ed 55%, #ffffff 100%);
  border: 1px solid #fde68a;
  border-left: 4px solid #d97706;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.revenue-bar {
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 55%, #ffffff 100%);
  border-color: #a7f3d0;
  border-left-color: #059669;
}

.revenue-bar .commission-icon {
  background: #d1fae5;
  color: #047857;
}

.revenue-bar .commission-rate {
  background: #a7f3d0;
  color: #065f46;
}

.revenue-bar .commission-sub {
  color: #047857;
}

.revenue-bar .commission-amount {
  color: #047857;
}

.commission-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.commission-icon {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #fef3c7;
  color: #b45309;
}

.commission-text {
  min-width: 0;
}

.commission-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #111827;
  font-size: 15px;
  font-weight: 600;
}

.commission-rate {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  background: #fde68a;
  color: #92400e;
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  font-variant-numeric: tabular-nums;
}

.commission-sub {
  margin-top: 3px;
  color: #92400e;
  font-size: 12.5px;
  line-height: 1.5;
  word-break: break-word;
}

.commission-amount-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  flex: none;
}

.commission-amount {
  color: #b45309;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.4px;
  font-variant-numeric: tabular-nums;
}

.commission-label {
  color: #a16207;
  font-size: 11.5px;
}

/* ------------------------------- 团队：佣金展示 ------------------------------ */

.team-stats {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.team-stat-money .team-stat-value {
  font-size: 17px;
}

.team-stat-commission .team-stat-value {
  color: #b45309;
}

.commission-cell {
  color: #374151;
  font-variant-numeric: tabular-nums;
}

.commission-cell-leader {
  color: #b45309;
  font-weight: 600;
}

/* ------------------------------- 佣金设置页 ------------------------------- */

.commission-settings {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.commission-defaults-body {
  padding: 16px;
  min-height: 0;
}

.commission-defaults {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.commission-default-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 180px));
  gap: 14px 20px;
}

.commission-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.commission-field-label {
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
}

.commission-default-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.commission-default-hint {
  margin-right: auto;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.commission-defaults-body .modal-error {
  margin: 0;
}

/* 数字输入 + % 后缀 */

.rate-input-wrap {
  display: inline-flex;
  align-items: center;
  width: 132px;
  height: 36px;
  padding-right: 12px;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.rate-input-wrap:hover {
  border-color: #b8c2d1;
}

.rate-input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.16);
}

.rate-input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0 6px 0 10px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

.rate-input:focus {
  outline: none;
}

.rate-input::-webkit-outer-spin-button,
.rate-input::-webkit-inner-spin-button {
  margin-left: 2px;
}

.rate-suffix {
  color: var(--text-muted);
  font-size: 13px;
}

/* 表格两行文本单元格 */

.cell-two-line {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.cell-sub {
  max-width: 160px;
  overflow: hidden;
  color: var(--text-faint);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 设置成员佣金弹窗提示 */

.commission-dialog-hint {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 11px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.5;
}

/* 团队表：列较多，压缩单元格内边距以在 1280px 内完整展示 */
.data-table.table-compact thead th,
.data-table.table-compact tbody td,
.data-table.table-compact tfoot td {
  padding-left: 8px;
  padding-right: 8px;
}

.data-table.table-compact thead th.is-sortable .th-sort {
  padding-left: 8px;
  padding-right: 8px;
}

/* ------------------------------- 佣金响应式 ------------------------------- */

@media (max-width: 1100px) {
  .commission-bar {
    align-items: flex-start;
  }

  .commission-amount-wrap {
    align-items: flex-start;
  }
}

/* ==========================================================================
   v2.4 佣金提现：余额卡片 / 申请表单 / 审核表格
   ========================================================================== */

/* 总览佣金条：去提现按钮 */

.commission-side {
  display: flex;
  flex: none;
  align-items: center;
  gap: 14px;
}

.commission-go {
  flex: none;
}

/* 状态徽章：待审核（橙） */

.badge-amber {
  background: #fef3c7;
  color: #b45309;
}

/* ---------------------------------- 提现页 ---------------------------------- */

.withdrawals-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.withdraw-balance {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 18px 20px;
  background: linear-gradient(135deg, #f0f7ff 0%, #f8fbff 55%, #ffffff 100%);
  border-color: #dbe7fb;
}

.wb-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.wb-icon {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--primary-soft);
  color: var(--primary);
}

.wb-main-text {
  min-width: 0;
}

.wb-label {
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
}

.wb-amount {
  margin-top: 2px;
  color: #111827;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}

.wb-sub {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12.5px;
}

.wb-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.wb-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 104px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
}

.wb-stat-value {
  color: #111827;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.wb-stat-label {
  color: var(--text-muted);
  font-size: 11.5px;
  white-space: nowrap;
}

.wb-stat-highlight .wb-stat-value {
  color: #b45309;
}

/* 申请提现表单 */

.withdraw-form-body {
  padding: 16px;
}

.withdraw-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.withdraw-form.is-disabled {
  opacity: 0.72;
}

.withdraw-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  max-width: 720px;
}

.withdraw-input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.withdraw-input:hover {
  border-color: #b8c2d1;
}

.withdraw-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.16);
}

.withdraw-input:disabled {
  background: var(--surface-soft);
  cursor: not-allowed;
}

.withdraw-form .modal-error {
  margin: 0;
  max-width: 720px;
}

.withdraw-form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.withdraw-form-hint {
  margin-right: auto;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.6;
}

/* 银行卡 / 用户两行单元格 */

.bank-cell {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.bank-name {
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bank-meta {
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.withdraw-empty {
  padding: 22px 16px;
  color: var(--text-faint);
  font-size: 13px;
  text-align: center;
}

.withdraw-admin-note {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
}

.withdraw-admin-note .panel-title {
  margin-bottom: 2px;
}

/* ------------------------------- 提现响应式 ------------------------------- */

@media (max-width: 899px) {
  .commission-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .commission-amount-wrap {
    align-items: flex-start;
  }

  .commission-default-grid {
    grid-template-columns: 1fr;
  }

  .withdraw-balance {
    flex-direction: column;
    align-items: stretch;
  }

  .wb-stats {
    justify-content: flex-start;
  }

  .withdraw-grid {
    grid-template-columns: 1fr;
  }
}


/* ==========================================================================
   v2.5 结算周期（T+N）：佣金设置下拉 / 团队结算周期 / 提现待结算展示
   ========================================================================== */

/* 佣金设置：结算周期下拉 */

.commission-select {
  width: 100%;
  max-width: 150px;
  height: 36px;
  padding: 0 28px 0 10px;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b7280' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.commission-select:hover {
  border-color: #b8c2d1;
}

.commission-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.16);
}

/* 团长单独设置表：结算周期单元格 */

.commission-cycle-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  width: 124px;
}

.commission-cycle-cell .commission-select {
  height: 32px;
  font-size: 12.5px;
}

.commission-cycle-cell .cell-sub {
  text-align: center;
}

/* 设置页说明文字 */

.commission-note {
  margin: 0;
  padding: 10px 16px 14px;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.6;
}

/* 提现余额卡片：结算周期说明 */

.wb-settlement {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.wb-settlement .icon {
  color: var(--text-faint);
}

/* 团队信息卡：结算周期 */

.team-stat-settlement .team-stat-value {
  color: var(--primary-dark);
}

/* 响应式：默认设置三列在窄屏收敛 */

@media (max-width: 1100px) {
  .commission-default-grid {
    grid-template-columns: repeat(2, minmax(0, 220px));
  }
}

@media (max-width: 899px) {
  .commission-default-grid {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------- 剧场设置 / 采集助手 ------------------------------ */

.theater-settings {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.collector-status-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.collector-status-line {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.collector-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  color: var(--text-muted);
  font-size: 12.5px;
}

.collector-token-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.collector-token {
  flex: 0 1 360px;
  min-width: 220px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}

.collector-command-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.collector-command {
  flex: 1 1 520px;
  min-width: 240px;
  padding: 8px 10px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11.5px;
  overflow-wrap: anywhere;
}

.collector-settings-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.collector-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 240px));
  gap: 14px 22px;
}

.collector-setting {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.collector-setting-label {
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
}

.collector-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.collector-lookback {
  width: 120px;
  min-width: 120px;
}

.collector-hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
}

.collector-settings-actions {
  display: flex;
  justify-content: flex-end;
}

.collector-error {
  display: block;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #b42318;
  font-size: 12px;
}

@media (max-width: 1099px) {
  .collector-settings-grid {
    grid-template-columns: repeat(2, minmax(180px, 240px));
  }
}

@media (max-width: 639px) {
  .collector-settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.collector-mode-note {
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 12px;
}
