/* 直播会员分销系统 V1.0 前端样式 */
/* 与 theme.css 同名的 --bg / --radius / --shadow 不再重复定义（R2-5 清理）：
   所有直播页面先引本文件、再引 theme.css，同名变量最终取 theme.css 的值；
   真源在 theme.css，改这里不会生效反而制造「改了没变化」的假象。 */
:root {
  --primary: #6c5ce7;
  --primary-dark: #5546d6;
  --card: #ffffff;
  --text: #2d3436;
  --muted: #8a8f99;
  --red: #e74c3c;
  --green: #00b578;
  --orange: #ff8f1f;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }

/* 顶部导航 */
.nav {
  background: #fff;
  box-shadow: var(--shadow);
  position: sticky; top: 0; z-index: 100;
}
.nav-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 20px;
  height: 56px; display: flex; align-items: center; gap: 24px;
}
.nav-logo { font-weight: 700; font-size: 17px; color: var(--primary); display: flex; align-items: center; gap: 8px; }
.nav-links { display: flex; gap: 20px; flex: 1; }
.nav-links a { color: var(--text); font-size: 14px; padding: 4px 2px; border-bottom: 2px solid transparent; }
.nav-links a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.nav-user { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 10px; }

.container { max-width: 1080px; margin: 0 auto; padding: 24px 20px 60px; }
.page-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.page-sub { font-size: 13px; color: var(--muted); margin-bottom: 20px; }

/* 卡片与网格 */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.video-card { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); cursor: pointer; transition: transform .15s; display: block; color: var(--text); }
.video-card:hover { transform: translateY(-3px); }
.video-cover {
  height: 132px; display: flex; align-items: center; justify-content: center;
  font-size: 40px; color: #fff; position: relative;
  background: linear-gradient(135deg, #a29bfe, #6c5ce7);
}
.video-cover.replay { background: linear-gradient(135deg, #74b9ff, #0984e3); }
.video-info { padding: 12px 14px; }
.video-info h3 { font-size: 14px; font-weight: 600; line-height: 1.4; height: 40px; overflow: hidden; }
.video-meta { font-size: 12px; color: var(--muted); margin-top: 6px; display: flex; justify-content: space-between; }

/* 徽章 */
.badge { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 20px; font-weight: 600; }
.badge-live { background: var(--red); color: #fff; }
.badge-pending { background: #fff3e0; color: var(--orange); }
.badge-end { background: #eee; color: #888; }
.badge-trial { background: #edeaff; color: var(--primary); }
.badge-member { background: #e0f7f0; color: var(--green); }
.badge-vod { background: #edeaff; color: var(--primary); }

/* 按钮 */
.btn {
  display: inline-block; border: none; cursor: pointer; font-size: 14px;
  padding: 9px 20px; border-radius: 8px; background: var(--primary); color: #fff;
  transition: opacity .15s;
}
.btn:hover { opacity: .88; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-ghost { background: #fff; color: var(--text); border: 1px solid #ddd; }
.btn-danger { background: var(--red); }
.btn-success { background: var(--green); }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 6px; }

/* 表单 */
input, select, textarea {
  border: 1px solid #ddd; border-radius: 8px; padding: 9px 12px;
  font-size: 14px; outline: none; background: #fff; color: var(--text);
}
input:focus, select:focus { border-color: var(--primary); }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.form-row input, .form-row select { width: 100%; }

/* 密码框小眼睛 */
.pwd-wrap { position: relative; }
.pwd-wrap input { width: 100%; padding-right: 40px; }
.pwd-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border: none; background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; line-height: 1; color: var(--muted); border-radius: 6px;
}
.pwd-eye:hover { color: var(--primary); background: rgba(108, 92, 231, 0.08); }

/* 播放器 */
.player-wrap { background: #000; border-radius: var(--radius); overflow: hidden; position: relative; }
.player-wrap video { width: 100%; display: block; max-height: 520px; }
.player-bar { display: flex; align-items: center; gap: 12px; padding: 12px 0; flex-wrap: wrap; }
.trial-tip { background: #fff8e6; color: #b26a00; font-size: 13px; padding: 8px 12px; border-radius: 8px; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.66); z-index: 999;
  display: flex; align-items: center; justify-content: center;
}
.modal {
  background: #fff; border-radius: 14px; padding: 26px; width: 340px;
  text-align: center; animation: pop .18s;
}
@keyframes pop { from { transform: scale(.92); opacity: 0; } }
.modal h3 { font-size: 17px; margin-bottom: 8px; }
.modal p { font-size: 13px; color: var(--muted); margin-bottom: 18px; line-height: 1.6; }
.modal .btn { width: 100%; margin-bottom: 10px; }

/* 扫码支付二维码 */
.qr-box {
  display: inline-block; padding: 10px; border-radius: 10px;
  background: #fff; border: 1px solid #eee; box-shadow: var(--shadow);
}
.qr-box canvas { display: block; width: 220px; height: 220px; }
.qr-loading {
  width: 220px; height: 220px; display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--muted); background: #fafafa; border-radius: 6px;
}

/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 8px; text-align: left; border-bottom: 1px solid #f0f0f5; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
tr:hover td { background: #fafafe; }

/* 会员卡片 */
.plan-card { text-align: center; padding: 26px 16px; border: 2px solid transparent; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); cursor: pointer; }
.plan-card.selected { border-color: var(--primary); background: #f7f5ff; }
.plan-card.current { border-color: var(--green); background: #f2fbf5; }
.plan-card .price { font-size: 30px; font-weight: 800; color: var(--primary); margin: 8px 0 4px; }
.plan-card .price small { font-size: 14px; }
.plan-card .tag { font-size: 12px; color: var(--muted); }
.plan-card .tag-current { color: var(--green); font-weight: 700; }
.plan-card .tag-current-tip { font-size: 11px; color: var(--green); margin-top: 6px; }

/* 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; text-align: center; }
.stat .num { font-size: 24px; font-weight: 800; color: var(--primary); }
.stat .label { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Tab */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.tabs button {
  border: none; background: #fff; padding: 8px 18px; border-radius: 20px;
  font-size: 13px; cursor: pointer; box-shadow: var(--shadow); color: var(--text);
}
.tabs button.active { background: var(--primary); color: #fff; }

/* 分类筛选 chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.chips .chip {
  border: 1px solid #ddd; background: #fff; padding: 6px 14px; border-radius: 20px;
  font-size: 12px; cursor: pointer; color: var(--text);
}
.chips .chip.active { background: #edeaff; border-color: var(--primary); color: var(--primary); font-weight: 600; }

.empty { text-align: center; color: var(--muted); padding: 50px 0; font-size: 14px; }
.toast {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
  background: rgba(45,52,54,.92); color: #fff; font-size: 13px;
  padding: 10px 22px; border-radius: 30px; z-index: 1001; animation: pop .2s;
}
.mt { margin-top: 16px; }
.flex { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.right { text-align: right; }
.link-text { color: var(--primary); cursor: pointer; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* 宽表格滚动容器（由 js/app.js 自动包裹，窄屏横向滚动不撑破页面） */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.nav-toggle {
  display: none; border: none; background: none; cursor: pointer;
  font-size: 20px; line-height: 1; color: var(--text); padding: 6px 8px; border-radius: 8px;
}
.nav-toggle:hover { background: rgba(108,92,231,.08); color: var(--primary); }

/* ===============================================================
   自适应：手机（≤560）/ 平板（≤860）/ 小笔电（≤1080）
   =============================================================== */
@media (max-width: 1080px) {
  .container { padding: 20px 16px 48px; }
  .nav-inner { padding: 0 16px; gap: 16px; }
}

@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .nav-inner { height: auto; min-height: 56px; flex-wrap: wrap; padding: 8px 14px; gap: 10px; }
  .nav-logo { font-size: 15px; }
  .nav-toggle { display: inline-flex; margin-left: auto; order: 2; }
  .nav-user { order: 3; font-size: 12.5px; gap: 8px; }
  .nav-links {
    order: 4; flex-basis: 100%; flex-direction: column; gap: 0;
    display: none; padding: 4px 0 8px; border-top: 1px solid #f0f0f5; margin-top: 6px;
  }
  .nav-inner.open .nav-links { display: flex; }
  .nav-links a { padding: 12px 2px; font-size: 15px; border-bottom: 1px solid #f7f7fb; }
  .nav-links a:last-child { border-bottom: none; }
  .nav-links a.active { border-bottom-color: transparent; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
  .card { padding: 16px; }
  .page-title { font-size: 18px; }
  .player-wrap video { max-height: 42vh; }
}

@media (max-width: 560px) {
  .container { padding: 16px 12px 40px; }
  .nav-logo { font-size: 14px; }
  .grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat .num { font-size: 20px; }
  .card { padding: 14px 12px; border-radius: 10px; }
  .modal { width: calc(100vw - 32px); max-width: 340px; padding: 20px 18px; }
  .qr-box canvas, .qr-loading { width: 176px; height: 176px; }
  .plan-card { padding: 20px 14px; }
  .plan-card .price { font-size: 26px; }
  .video-cover { height: 116px; }
  .flex { gap: 8px; }
  .btn { padding: 9px 16px; }
  .table-scroll table { min-width: max-content; }
  .tabs button, .chips .chip { padding: 7px 13px; font-size: 12.5px; }
}

/* ===== 批量选择（内容列表统一模式，见 js/batch-ui.js） ===== */
.batchbar {
  background: rgba(108,92,231,.06); border: 1px solid var(--line, #e6e6ee); border-radius: 11px;
  padding: 10px 14px; margin-bottom: 12px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 13px;
}
.batchbar .selall { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; font-weight: 600; }
.batchbar-count { color: var(--muted, #777); font-variant-numeric: tabular-nums; }
.batchbar .fhint { margin-left: auto; }
.batch-chk { width: 15px; height: 15px; cursor: pointer; }
th.col-chk, td.col-chk { width: 40px; text-align: center; }
@media (max-width: 640px) {
  .batchbar { gap: 8px; font-size: 12.5px; padding: 9px 11px; }
  .batchbar .fhint { margin-left: 0; flex-basis: 100%; }
}
