/* 版权收入管理平台样式 */
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, #eef2ff 0%, #fdf4ff 50%, #f0f9ff 100%);
  color: #1e293b;
}
.bg-blob {
  position: fixed; border-radius: 50%; filter: blur(80px); opacity: .45; z-index: 0; pointer-events: none;
}
.bg-blob.a { width: 420px; height: 420px; background: #c7d2fe; top: -80px; left: -80px; }
.bg-blob.b { width: 360px; height: 360px; background: #fbcfe8; bottom: -60px; right: -60px; }
.wrap { position: relative; z-index: 1; }
.header {
  background: rgba(255,255,255,.75); backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(99,102,241,.12); padding: 20px 40px;
  box-shadow: 0 2px 20px rgba(99,102,241,.08);
}
.header-inner {
  max-width: 1400px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
}
.title { font-size: 24px; font-weight: 900; letter-spacing: -.5px; margin: 0 0 3px; }
.subtitle { font-size: 13px; color: #94a3b8; font-weight: 500; margin: 0; }
.badge {
  background: linear-gradient(135deg, rgba(99,102,241,.1), rgba(139,92,246,.1));
  border-radius: 12px; padding: 8px 18px; font-size: 13px; font-weight: 600;
  color: #6366f1; border: 1px solid rgba(99,102,241,.2);
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.main { max-width: 1400px; margin: 0 auto; padding: 28px 40px; }
.card {
  background: rgba(255,255,255,.72); backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,.9);
  box-shadow: 0 4px 24px rgba(99,102,241,.08), 0 1px 4px rgba(0,0,0,.04);
  border-radius: 20px; margin-bottom: 20px;
}
.card-pad { padding: 20px 24px; }
.alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-size: 13px; font-weight: 600; }
.alert-ok { background: rgba(16,185,129,.1); color: #059669; border: 1px solid rgba(16,185,129,.25); }
.alert-err { background: rgba(239,68,68,.08); color: #dc2626; border: 1px solid rgba(239,68,68,.25); }
.platform-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.platform-btn {
  padding: 16px 18px; border-radius: 14px; cursor: pointer; text-align: left;
  background: rgba(255,255,255,.85); transition: all .15s; text-decoration: none; display: block; color: inherit;
}
.platform-btn.active { box-shadow: 0 4px 14px rgba(99,102,241,.2); }
.platform-btn .pl { font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.platform-btn .pv { font-size: 22px; font-weight: 900; color: #1e293b; }
.platform-btn .ps { font-size: 11px; color: #94a3b8; margin-top: 4px; }
.filters { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.field label { display: block; font-size: 11px; font-weight: 700; color: #94a3b8; margin-bottom: 6px; text-transform: uppercase; }
.field-label-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.field-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  color: #6366f1;
  background: rgba(99,102,241,.12);
  border: 1px solid rgba(99,102,241,.25);
  cursor: help;
  position: relative;
  text-transform: none;
  flex-shrink: 0;
}
.field-hint::before {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  min-width: 200px;
  max-width: 260px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #1e293b;
  color: #f8fafc;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  box-shadow: 0 8px 24px rgba(15,23,42,.25);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .15s ease, visibility .15s ease;
  z-index: 20;
}
.field-hint::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: calc(100% + 2px);
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1e293b;
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s ease, visibility .15s ease;
  z-index: 20;
}
.field-hint:hover::before,
.field-hint:hover::after,
.field-hint:focus::before,
.field-hint:focus::after {
  opacity: 1;
  visibility: visible;
}
.field select {
  min-width: 160px; padding: 9px 12px; border-radius: 12px; border: 1.5px solid rgba(99,102,241,.15);
  background: rgba(255,255,255,.9); font-size: 13px; color: #334155;
}
.stats { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.stat {
  flex: 1; min-width: 160px; padding: 18px 20px; border-radius: 16px;
  background: rgba(255,255,255,.85); border: 1px solid rgba(255,255,255,.95);
  box-shadow: 0 2px 12px rgba(99,102,241,.06);
}
.stat .sl { font-size: 11px; font-weight: 700; color: #94a3b8; text-transform: uppercase; margin-bottom: 8px; }
.stat .sv { font-size: 24px; font-weight: 900; }
.tabs { display: flex; gap: 4px; margin-bottom: 20px; background: rgba(255,255,255,.7); border-radius: 16px; padding: 5px; width: fit-content; flex-wrap: wrap; }
.tab {
  padding: 9px 22px; border-radius: 12px; border: none; font-weight: 700; font-size: 13px;
  cursor: pointer; background: transparent; color: #64748b; text-decoration: none; display: inline-block;
}
.tab.active { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; box-shadow: 0 4px 14px rgba(99,102,241,.35); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  padding: 11px 16px; color: #94a3b8; font-weight: 700; font-size: 11px; text-transform: uppercase;
  background: rgba(99,102,241,.03); border-bottom: 2px solid rgba(99,102,241,.1); white-space: nowrap;
}
.data-table td { padding: 11px 16px; border-top: 1px solid rgba(99,102,241,.07); }
.data-table tr:nth-child(even) td { background: rgba(99,102,241,.02); }
.td-revenue { text-align: right; font-weight: 800; color: #6366f1; }
.td-num { text-align: right; color: #64748b; }
.td-en { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #64748b; font-weight: 600; }
.td-cn { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.pbadge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 700; }
.gbadge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.upload-zone {
  border: 2px dashed rgba(99,102,241,.25); border-radius: 14px; padding: 22px 20px; text-align: center;
  background: rgba(255,255,255,.4); cursor: pointer; flex: 1; min-width: 190px;
}
.upload-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.btn {
  padding: 10px 20px; border-radius: 12px; border: none; cursor: pointer; font-weight: 700; font-size: 13px;
}
.btn-ok { background: linear-gradient(135deg, #10b981, #059669); color: #fff; }
.btn-no { border: 1.5px solid rgba(239,68,68,.35); background: rgba(239,68,68,.07); color: #ef4444; }
.btn-clear { border: 1.5px solid rgba(239,68,68,.3); background: rgba(239,68,68,.07); color: #ef4444; padding: 9px 18px; border-radius: 12px; cursor: pointer; font-weight: 700; font-size: 13px; }
.preview { border: 2px solid rgba(99,102,241,.2); margin-top: 16px; overflow: hidden; }
.preview-head { padding: 18px 22px; background: rgba(99,102,241,.04); border-bottom: 1px solid rgba(99,102,241,.1); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.bar-wrap { height: 10px; background: rgba(99,102,241,.08); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; }
.footer { text-align: center; color: #cbd5e1; font-size: 11px; margin-top: 28px; }
.table-scroll { overflow-x: auto; }
.table-foot { padding: 12px 20px; color: #94a3b8; font-size: 12px; text-align: center; border-top: 1px solid rgba(99,102,241,.07); }
.hidden { display: none !important; }
.preview-badge {
  display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 99px;
  font-size: 11px; font-weight: 700; color: #d97706; background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.25);
}
.loading-overlay {
  position: fixed; inset: 0; z-index: 9999; background: rgba(15,23,42,.45);
  align-items: center; justify-content: center; backdrop-filter: blur(2px);
}
.loading-overlay:not(.hidden) {
  display: flex;
}
.loading-box {
  min-width: 280px; padding: 28px 32px; border-radius: 18px; background: rgba(255,255,255,.96);
  box-shadow: 0 20px 50px rgba(15,23,42,.2); text-align: center;
}
.loading-spinner {
  width: 42px; height: 42px; margin: 0 auto 16px; border-radius: 50%;
  border: 4px solid rgba(99,102,241,.15); border-top-color: #6366f1; animation: spin .8s linear infinite;
}
.loading-text { font-size: 15px; font-weight: 800; color: #334155; margin-bottom: 8px; }
.loading-timer { font-size: 13px; color: #64748b; font-weight: 600; }
body.is-loading { cursor: wait; }
@keyframes spin { to { transform: rotate(360deg); } }
.chart-bar { width: 100%; max-width: 70px; margin: 0 auto; display: flex; flex-direction: column; justify-content: flex-end; height: 220px; }
.chart-col { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1; min-width: 60px; }

/* 分类畅销：固定列宽 + 左两列冻结，表头与数据列对齐 */
.genre-table-wrap { overflow: auto; -webkit-overflow-scrolling: touch; }
.genre-table {
  table-layout: fixed;
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.genre-table .col-rank { width: 56px; min-width: 56px; }
.genre-table .col-series { width: 160px; min-width: 160px; max-width: 160px; }
.genre-table .col-amount { width: 96px; min-width: 96px; }
.genre-table .col-total { width: 108px; min-width: 108px; }
.genre-table th,
.genre-table td {
  vertical-align: middle;
  box-sizing: border-box;
}
.genre-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #f8f9ff;
}
.genre-table .col-rank {
  text-align: center;
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
}
.genre-table thead .col-rank { z-index: 5; background: #f8f9ff; }
.genre-table .col-series {
  text-align: left;
  position: sticky;
  left: 56px;
  z-index: 2;
  background: #fff;
  box-shadow: 2px 0 6px rgba(99,102,241,.06);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.genre-table thead .col-series { z-index: 5; background: #f8f9ff; }
.genre-table .col-amount,
.genre-table .col-total { text-align: right; white-space: nowrap; }
.genre-table .td-rank { font-weight: 800; color: #6366f1; }
.genre-table tr:nth-child(even) .col-rank,
.genre-table tr:nth-child(even) .col-series { background: #f6f7fe; }
.genre-table tr.genre-total-row .col-rank,
.genre-table tr.genre-total-row .col-series,
.genre-table tr.genre-total-row td { background: rgba(99,102,241,.06); font-weight: 800; }
.genre-table tr.genre-total-row .sticky-pair {
  position: sticky;
  left: 0;
  z-index: 2;
  text-align: left;
  box-shadow: 2px 0 6px rgba(99,102,241,.06);
}
