/* ============================================================
 * 投票小程序 · PC 管理后台（第 ⑮ 条）
 *
 * 配色沿用小程序的 Ember 赤陶橙 —— 后台和前台是同一套产品，
 * 打开后台看着像另一个产品，说明品牌已经断了。
 * 侧边栏用墨色（--ink-1）压住，主色只出现在「当前所在」和「要你点」的地方。
 * ============================================================ */

:root {
  --primary: #D4410F;
  --primary-ink: #8A2A08;
  --primary-soft: #FFF4EF;
  --accent: #FF7A45;
  --ink-1: #14181F;
  --ink-2: #4B5158;
  --ink-3: #6B7280;
  --ink-4: #A2A9B3;
  --line: #E8EAED;
  --surface: #F7F8FA;
  --card: #FFFFFF;
  --ok: #0E9F6E;
  --ok-soft: #E7F7F1;
  --warn: #B26A00;
  --warn-soft: #FFF6E5;
  --danger: #E5484D;
  --danger-soft: #FDEEEE;
  --gold: #F5A623;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --shadow-1: 0 1px 2px rgba(20, 24, 31, .05), 0 1px 3px rgba(20, 24, 31, .04);
  --shadow-2: 0 4px 12px rgba(20, 24, 31, .08);
  --side-w: 232px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--surface);
  color: var(--ink-1);
  font-size: 14px;
  line-height: 1.55;
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-ink); text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

/* ---------------- 布局 ---------------- */
.side {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--side-w);
  background: var(--ink-1);
  color: rgba(255, 255, 255, .6);
  display: flex;
  flex-direction: column;
  z-index: 20;
}
.side-brand {
  padding: 20px 20px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.side-logo {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 15px;
  flex: none;
}
.side-name { font-size: 15px; font-weight: 600; color: #fff; letter-spacing: .3px; }
.side-sub { font-size: 11px; color: rgba(255, 255, 255, .35); margin-top: 1px; }

.side-nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.side-group {
  font-size: 11px;
  color: rgba(255, 255, 255, .28);
  padding: 14px 12px 6px;
  letter-spacing: .6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-md);
  cursor: pointer;
  color: rgba(255, 255, 255, .62);
  font-size: 13.5px;
  margin-bottom: 2px;
  border-left: 2px solid transparent;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: rgba(255, 255, 255, .05); color: rgba(255, 255, 255, .9); }
.nav-item.on {
  background: rgba(255, 255, 255, .07);
  color: #fff;
  border-left-color: var(--accent);
  font-weight: 500;
}
.nav-ico { width: 16px; height: 16px; flex: none; opacity: .85; }
.nav-badge {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  min-width: 18px; height: 18px;
  border-radius: 9px;
  padding: 0 5px;
  line-height: 18px;
  text-align: center;
}
.side-foot {
  padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, .07);
  font-size: 11.5px;
  color: rgba(255, 255, 255, .32);
}
/* 第 ㊶ 条：与小程序客服浮窗同一个企微客服链接 */
.side-kf {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, .72);
  text-decoration: none;
}
.side-kf:hover { color: #fff; text-decoration: underline; }

.main { margin-left: var(--side-w); min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  height: 58px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.top-title { font-size: 16px; font-weight: 600; }
.top-sub { font-size: 12px; color: var(--ink-3); margin-left: 10px; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.who { font-size: 13px; color: var(--ink-2); }
.who b { color: var(--ink-1); font-weight: 600; }

.content { padding: 22px 24px 40px; flex: 1; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  padding: 18px 20px;
  margin-bottom: 18px;
}
.card-t {
  font-size: 14.5px;
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-s { font-size: 12.5px; color: var(--ink-3); margin-bottom: 14px; }
.card-head { display: flex; align-items: flex-start; margin-bottom: 14px; }
.card-head .card-s { margin-bottom: 0; }
.card-head-actions { margin-left: auto; display: flex; gap: 8px; }

/* ---------------- 统计卡 ---------------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  padding: 16px 18px;
}
.stat-l { font-size: 12.5px; color: var(--ink-3); }
.stat-v { font-size: 26px; font-weight: 650; letter-spacing: -.5px; margin-top: 2px; }
.stat-x { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.stat-x em { font-style: normal; color: var(--ok); font-weight: 600; }

/* ---------------- 表格 ---------------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
table.tbl th {
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.tbl td {
  padding: 11px 10px;
  border-bottom: 1px solid #F2F3F5;
  vertical-align: middle;
}
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tbody tr:hover { background: #FAFBFC; }
.t-main { font-weight: 500; }
.t-sub { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.t-num { font-variant-numeric: tabular-nums; }
.t-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

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

/* ---------------- 表单控件 ---------------- */
input.inp, select.inp, textarea.inp {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--r-md);
  padding: 7px 10px;
  outline: none;
  min-width: 0;
}
input.inp:focus, select.inp:focus, textarea.inp:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input.inp[disabled] { background: var(--surface); color: var(--ink-3); }
.sel { padding: 7px 10px; }

.btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--r-md);
  padding: 7px 13px;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.btn:hover { border-color: var(--ink-4); background: #FAFBFC; }
.btn.pri { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.pri:hover { background: var(--primary-ink); border-color: var(--primary-ink); }
.btn.danger { color: var(--danger); border-color: #F3C9CB; background: #fff; }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.sm { padding: 4px 9px; font-size: 12.5px; border-radius: var(--r-sm); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------------- 徽标 ---------------- */
.tag {
  display: inline-block;
  font-size: 11.5px;
  padding: 1px 7px;
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink-2);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.tag.ok { background: var(--ok-soft); color: var(--ok); border-color: #CDEDE1; }
.tag.warn { background: var(--warn-soft); color: var(--warn); border-color: #F5E2BC; }
.tag.danger { background: var(--danger-soft); color: var(--danger); border-color: #F7D2D3; }
.tag.pri { background: var(--primary-soft); color: var(--primary-ink); border-color: #F7D9CD; }
.tag.gold { background: #FFF8E8; color: #8A5A00; border-color: #F0DCAE; }

/* ---------------- 开关 ---------------- */
.sw {
  position: relative;
  display: inline-block;
  width: 42px; height: 23px;
  flex: none;
}
.sw input { display: none; }
.sw-track {
  position: absolute; inset: 0;
  background: #D3D7DC;
  border-radius: 12px;
  transition: background .16s;
}
.sw-track::after {
  content: '';
  position: absolute;
  left: 2px; top: 2px;
  width: 19px; height: 19px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .18);
  transition: transform .16s;
}
.sw input:checked + .sw-track { background: var(--primary); }
.sw input:checked + .sw-track::after { transform: translateX(19px); }
.sw input:disabled + .sw-track { opacity: .45; cursor: not-allowed; }
.sw-flag { cursor: pointer; display: inline-flex; align-items: center; }
.sw-flag.off { cursor: not-allowed; }

/* ---------------- 开关卡片（功能开关页） ---------------- */
.flag {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid #F2F3F5;
}
.flag:last-child { border-bottom: none; }
.flag-body { flex: 1; min-width: 0; }
.flag-t { font-weight: 500; }
.flag-d { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.flag-note {
  font-size: 12px;
  color: var(--warn);
  background: var(--warn-soft);
  border-radius: var(--r-sm);
  padding: 2px 8px;
  display: inline-block;
  margin-top: 6px;
}

/* ---------------- 权限勾选 ---------------- */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.perm {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
}
.perm.on { border-color: var(--primary); background: var(--primary-soft); }
.perm.lock { opacity: .55; cursor: not-allowed; }
.perm-b {
  width: 15px; height: 15px;
  border: 1.5px solid #C6CBD2;
  border-radius: 4px;
  flex: none;
  margin-top: 2px;
  position: relative;
}
.perm.on .perm-b { background: var(--primary); border-color: var(--primary); }
.perm.on .perm-b::after {
  content: '';
  position: absolute;
  left: 4px; top: 1px;
  width: 5px; height: 9px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(40deg);
}
.perm-t { font-size: 13.5px; font-weight: 500; }
.perm-d { font-size: 12px; color: var(--ink-3); }

/* ---------------- 复审卡片 ---------------- */
.rev {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  margin-bottom: 12px;
  background: #fff;
}
.rev-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.rev-body { font-size: 13.5px; color: var(--ink-2); word-break: break-all; }
.rev-meta { font-size: 12px; color: var(--ink-3); margin-top: 8px; }

/* ---------------- 轮播编辑 ---------------- */
.bn {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.bn-row { display: flex; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.bn-f { flex: 1; min-width: 160px; }
.bn-f label { display: block; font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }
.bn-f input, .bn-f select { width: 100%; }

/* ---------------- 空态与加载 ---------------- */
.empty { text-align: center; padding: 46px 20px; color: var(--ink-3); }
.empty-ico {
  width: 46px; height: 46px;
  margin: 0 auto 12px;
  border: 2px dashed var(--ink-4);
  border-radius: 50%;
}
.empty-t { font-size: 14px; color: var(--ink-2); }
.loading { text-align: center; padding: 40px; color: var(--ink-3); font-size: 13.5px; }

/* ---------------- 分页 ---------------- */
.pager { display: flex; align-items: center; gap: 10px; justify-content: flex-end; margin-top: 14px; }
.pager-x { font-size: 12.5px; color: var(--ink-3); }

/* ---------------- 登录 / 初始化 ---------------- */
.center-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, #1B2028 0%, #14181F 60%, #2A1A12 100%);
}
.auth-box {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
  padding: 32px 30px;
}
.auth-logo {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 19px;
  margin-bottom: 14px;
}
.auth-t { font-size: 19px; font-weight: 650; }
.auth-s { font-size: 13px; color: var(--ink-3); margin-bottom: 20px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12.5px; color: var(--ink-3); margin-bottom: 5px; }
.field input { width: 100%; }
.auth-btn {
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  padding: 11px;
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 6px;
}
.auth-btn:hover { background: var(--primary-ink); }
.auth-btn:disabled { opacity: .6; cursor: not-allowed; }
.auth-err {
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: var(--r-md);
  padding: 9px 12px;
  font-size: 13px;
  margin-bottom: 12px;
}
.auth-tip {
  margin-top: 16px;
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.7;
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 10px 12px;
}
.auth-tip code {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 4px;
  font-size: 11.5px;
}

/* ---------------- Toast ---------------- */
.toast-wrap {
  position: fixed;
  top: 18px; left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--ink-1);
  color: #fff;
  padding: 9px 18px;
  border-radius: 30px;
  font-size: 13.5px;
  box-shadow: var(--shadow-2);
  animation: toastIn .18s ease;
}
.toast.ok { background: #0E9F6E; }
.toast.err { background: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------------- 模态框 ---------------- */
.modal-wrap { position: relative; z-index: 150; }
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(20, 24, 31, .45);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fadeIn .14s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff;
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 460px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .22);
  overflow: hidden;
}
.modal-t { padding: 18px 22px 0; font-size: 15.5px; font-weight: 600; }
.modal-b { padding: 10px 22px 4px; font-size: 13.5px; color: var(--ink-2); }
.modal-f { padding: 16px 22px 18px; display: flex; gap: 8px; justify-content: flex-end; }
.modal-pad { padding: 16px 22px; }

/* 第 ㊿+3 条：背景音乐曲库底部的格式 / 版权说明 */
.bgm-tip {
  margin-top: 14px;
  padding: 11px 13px;
  border-radius: var(--r-sm);
  background: var(--primary-soft);
  border: 1px solid #D7ECF3;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--primary-ink);
}

/* 窄屏：侧边栏收成图标条 */
@media (max-width: 1080px) {
  :root { --side-w: 60px; }
  .side-name, .side-sub, .side-group, .nav-item span, .side-foot { display: none; }
  .nav-item { justify-content: center; padding: 11px 0; }
  .side-brand { justify-content: center; padding: 18px 0 14px; }
  .content { padding: 18px 14px 30px; }
}

/* ============================================================
 * 第 ㊿+10 条：活动详情（概览/设定/选手/记录/协作者）+ 数据大屏
 * ============================================================ */

.t-link {
  color: var(--ink-1); font-weight: 600; cursor: pointer;
  border-bottom: 1px dashed var(--line);
}
.t-link:hover { color: var(--primary-ink); border-bottom-color: var(--primary); }

.vstats {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line);
}
.vstats > div { display: flex; flex-direction: column; }
.vstats b { font-size: 20px; font-weight: 700; letter-spacing: -.3px; }
.vstats span { font-size: 12px; color: var(--ink-3); }

.vtabs { display: flex; gap: 2px; margin-top: 16px; border-bottom: 1px solid var(--line); }
.vtab {
  padding: 9px 14px; font-size: 13px; color: var(--ink-3); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.vtab:hover { color: var(--ink-1); }
.vtab.on { color: var(--primary-ink); border-bottom-color: var(--primary); font-weight: 600; }

table.kv { width: 100%; border-collapse: collapse; }
table.kv th {
  width: 148px; text-align: left; font-weight: 400; color: var(--ink-3);
  font-size: 12.5px; padding: 7px 0; vertical-align: top;
}
table.kv td { padding: 7px 0; }
.plain-ol { margin: 6px 0 0 18px; padding: 0; color: var(--ink-2); font-size: 13px; }
.plain-ol li { margin-bottom: 4px; }

.form2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form2 .field.wide { grid-column: 1 / -1; }
.chk { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.chk input { width: auto; }
textarea.inp { resize: vertical; line-height: 1.6; }

.grid2col {
  display: grid; grid-template-columns: 1.55fr 1fr;
  gap: 14px; margin-bottom: 14px; align-items: start;
}
.legend {
  margin-left: auto; display: flex; align-items: center;
  font-size: 12px; color: var(--ink-3); white-space: nowrap;
}
.lg { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin: 0 5px 0 10px; }
.lg-v { background: var(--primary); }
.lg-a { background: var(--gold); }

.sbar {
  display: grid; grid-template-columns: 58px 1fr 42px 40px;
  align-items: center; gap: 8px; margin-top: 10px;
  font-size: 12.5px; color: var(--ink-2);
}
.sbar-t { height: 8px; background: #F1F3F5; border-radius: 4px; overflow: hidden; }
.sbar-t i { display: block; height: 100%; background: var(--ink-4); border-radius: 4px; }
.sbar-t i.ok { background: var(--ok); }
.sbar-t i.danger { background: var(--danger); }
.sbar b { text-align: right; font-weight: 600; }
.sbar em { font-style: normal; color: var(--ink-4); text-align: right; }

.tbl.compact th, .tbl.compact td { padding: 8px 6px; }

@media (max-width: 1100px) {
  .grid2col { grid-template-columns: 1fr; }
  .vstats { grid-template-columns: repeat(3, 1fr); }
  .form2 { grid-template-columns: 1fr; }
}
