/* =============================================================================
   adminweb 设计系统 v1  ——  方案 D：专业数据蓝（Ant Design Pro 风格）
   -----------------------------------------------------------------------------
   使用约定：
   1. 所有页面必须 <link rel="stylesheet" href="static/admin.css">，禁止再写内联 <style>；
      确实需要特殊样式时，写在页面专属的 CSS 文件里，且只能用下面的变量。
   2. 颜色 / 圆角 / 间距 / 行高一律用变量，禁止裸写 #xxx。
   3. 新增页面直接复制 _template.html。
   详见 UI-GUIDE.md
   ============================================================================= */

/* ---------------------------------------------------------------- 1. 设计令牌 */
:root {
  /* 中性色 */
  --bg:            #f0f2f5;   /* 页面底色 */
  --surface:       #ffffff;   /* 卡片 / 弹层 */
  --surface-2:     #f7f9fc;   /* 卡片内浅底：表头、弹层底栏、上传位 */
  --surface-3:     #eef2f7;   /* 中性标签底 */
  --surface-hover: #f2f8ff;   /* 表格行 hover */
  --border:        #e1e6ed;   /* 常规分隔线 */
  --border-strong: #c9d2de;   /* 控件边框（输入框、按钮描边） */

  /* 文字 */
  --text:          #0f1729;   /* 标题、表头、强调数字 */
  --text-2:        #4a5568;   /* 正文 */
  --text-3:        #8492a6;   /* 辅助文字、占位符 */

  /* 主色 */
  --brand:         #1677ff;
  --brand-hover:   #4096ff;
  --brand-active:  #0958d9;
  --brand-weak:    #e8f2ff;
  --brand-fg:      #ffffff;

  /* 语义色 */
  --ok:            #18a058;
  --ok-weak:       #e8f6ee;
  --warn:          #d98b0a;
  --warn-weak:     #fdf5e3;
  --danger:        #d03050;
  --danger-weak:   #fdecef;
  --info:          #1677ff;
  --info-weak:     #e8f2ff;

  /* 侧边导航（深色） */
  --nav-bg:        #1d2939;
  --nav-bg-2:      #18222f;
  --nav-fg:        #b6c2d1;
  --nav-fg-hover:  #ffffff;
  --nav-active-bg: #1677ff;
  --nav-active-fg: #ffffff;
  --nav-line:      rgba(255,255,255,.08);

  /* 形状 */
  --radius:        8px;   /* 卡片 */
  --radius-sm:     6px;   /* 控件、按钮 */
  --radius-lg:     12px;  /* 弹层 */

  /* 阴影 */
  --shadow:        0 1px 2px rgba(15,23,41,.06);
  --shadow-md:     0 4px 12px rgba(15,23,41,.08);
  --shadow-lg:     0 12px 32px rgba(15,23,41,.16);

  /* 尺寸 / 密度（后台以"看得更多"为第一优先，故整体偏紧凑） */
  --fs:            12.5px;  /* 正文字号 */
  --fs-sm:         12px;    /* 表头、按钮 */
  --fs-xs:         11.5px;  /* 辅助说明 */
  --row-h:         38px;    /* 表格行高 */
  --ctl-h:         30px;    /* 控件高度 */
  --ctl-h-lg:      34px;    /* 弹层内控件高度 */
  --gap:           12px;    /* 区块间距 */
  --pad:           16px;    /* 卡片内边距 */

  /* 图表 */
  --chart-1:       #1677ff;
  --chart-2:       #bcdcff;

  /* 字体 */
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
          "Helvetica Neue", "Segoe UI", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;
}

/* ------------------------------------------------------------------ 2. 基础重置 */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: var(--fs);
  line-height: 1.6;
  color: var(--text-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5 { color: var(--text); font-weight: 600; line-height: 1.4; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }
img { display: block; max-width: 100%; }
button, input, select, textarea { font-family: inherit; font-size: var(--fs-sm); color: var(--text); }
::selection { background: var(--brand-weak); }

/* 数字统一等宽，表格里竖向能对齐 */
.num, .mono, td.mono, .amount, .card .value {
  font-variant-numeric: tabular-nums;
}

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #aab6c6; }
::-webkit-scrollbar-track { background: transparent; }

/* -------------------------------------------------------------- 3. 页面骨架 */
.page { padding: var(--pad); min-height: 100%; }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: var(--gap);
}
.page-head h1 { font-size: 18px; font-weight: 650; letter-spacing: .2px; }
.page-head .desc { font-size: var(--fs-xs); color: var(--text-3); margin-top: 2px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* 标题（旧页面里的 <h3>，保留兼容） */
body > h3:first-child { font-size: 18px; margin-bottom: var(--gap); }

/* -------------------------------------------------------------- 4. 卡片 / 面板 */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel + .panel { margin-top: var(--gap); }

.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 12px var(--pad);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.panel-head h2, .panel-head h3 { font-size: 13.5px; font-weight: 640; }
.panel-head .desc { font-size: var(--fs-xs); color: var(--text-3); margin-top: 1px; }
.panel-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.panel-body { padding: var(--pad); }
.panel-body.flush { padding: 0; }

/* 统计卡 */
.stat-grid {
  display: grid; gap: var(--gap); margin-bottom: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
}
.card .label {
  font-size: var(--fs-sm); color: var(--text-3);
  display: flex; align-items: center; gap: 6px;
}
.card .label .dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.card .value {
  font-size: 24px; font-weight: 680; color: var(--text);
  letter-spacing: -.4px; line-height: 1.25; margin-top: 6px;
}
.card .value small { font-size: 14px; font-weight: 600; color: var(--text-2); margin-right: 1px; }
.card .sub { font-size: var(--fs-xs); color: var(--text-3); margin-top: 4px; }
/* 卡片色调：dot 颜色由 JS 加 .t-xxx 决定 */
.card .label .dot { background: var(--brand); }
.card.t-brand .dot { background: var(--brand); }
.card.t-ok    .dot { background: var(--ok); }
.card.t-warn  .dot { background: var(--warn); }
.card.t-info  .dot { background: var(--info); }
.card.t-danger .dot { background: var(--danger); }

/* ------------------------------------------------------------------ 5. 标签页 */
.tabs {
  display: flex; align-items: center; gap: 4px;
  padding: 0 var(--pad);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  overflow-x: auto;
}
.tabs::-webkit-scrollbar { height: 0; }
.tabs .t {
  position: relative;
  padding: 10px 12px;
  font-size: var(--fs);
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s;
}
.tabs .t:hover { color: var(--brand); }
.tabs .t.on { color: var(--brand); font-weight: 600; border-bottom-color: var(--brand); }
.tabs .t .n {
  display: inline-block; margin-left: 5px; padding: 0 5px;
  font-size: 10.5px; line-height: 16px; border-radius: 9px;
  background: var(--surface-3); color: var(--text-2); font-weight: 500;
}
.tabs .t.on .n { background: var(--brand-weak); color: var(--brand); }

/* 页内分段导航：赛事三页（match-tabs.js 统一渲染）与 enrolls 页内 tab 共用 */
.nav {
  display: inline-flex; padding: 2px;
  background: var(--surface-3); border-radius: var(--radius-sm);
  margin-bottom: var(--gap);
}
.nav .n {
  padding: 5px 16px; font-size: var(--fs); color: var(--text-2);
  cursor: pointer; border-radius: 4px; transition: .15s; white-space: nowrap;
}
.nav .n:hover { color: var(--text); }
.nav .n.on { background: var(--surface); color: var(--brand); font-weight: 600; box-shadow: var(--shadow); }

/* 标签页内容区（enrolls 用；其他页沿用 style.display 控制） */
.tabpane { display: none; }
.tabpane.on { display: block; }

/* ------------------------------------------------------------------ 6. 工具栏 */
.bar, .toolbar {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; margin-bottom: var(--gap);
}
.bar .spacer, .toolbar .spacer { flex: 1; }
.bar > label, .toolbar > label { font-size: var(--fs-sm); color: var(--text-2); }

/* ------------------------------------------------------------------ 7. 表单控件 */
input:not([type=checkbox]):not([type=radio]):not([type=file]),
select, textarea {
  height: var(--ctl-h);
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-sm);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: 7px 10px; line-height: 1.65; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--text-3); }

input:not([type=checkbox]):not([type=radio]):not([type=file]):hover,
select:hover, textarea:hover { border-color: var(--brand-hover); }

input:not([type=checkbox]):not([type=radio]):not([type=file]):focus,
select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-weak);
}
input:disabled, select:disabled, textarea:disabled {
  background: var(--surface-2); color: var(--text-3); cursor: not-allowed;
}

select {
  cursor: pointer;
  padding-right: 26px;
  appearance: none; -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-3) 50%),
    linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 14px) 13px, calc(100% - 10px) 13px;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}

input[type=checkbox], input[type=radio] {
  width: 14px; height: 14px; accent-color: var(--brand);
  cursor: pointer; vertical-align: -2px; margin: 0;
}
input[type=checkbox] + label, input[type=radio] + label { cursor: pointer; }

/* 表单行（弹层内） */
.form-row { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.form-row > label {
  width: 92px; flex-shrink: 0; font-size: var(--fs-sm); color: var(--text-2);
  line-height: var(--ctl-h-lg); font-weight: 500; text-align: right;
}
.form-row > label i { color: var(--danger); font-style: normal; margin-left: 2px; }
.form-row input:not([type=checkbox]):not([type=radio]):not([type=file]),
.form-row select, .form-row textarea { flex: 1; height: var(--ctl-h-lg); min-width: 0; }
.form-row textarea { height: 76px; }
.form-row > span { align-self: center; font-size: var(--fs-xs); color: var(--text-3); }
.form-row .checks { flex: 1; }
.form-row.modal-row { align-items: center; }

/* 字段（纵向排布，用于非弹层表单） */
.field { margin-bottom: 14px; }
.field > label {
  display: block; font-size: var(--fs-sm); color: var(--text-2);
  font-weight: 500; margin-bottom: 6px;
}
.field > label i { color: var(--danger); font-style: normal; margin-left: 2px; }
.field input:not([type=checkbox]):not([type=radio]):not([type=file]),
.field select, .field textarea { width: 100%; height: var(--ctl-h-lg); }
.field textarea { height: 84px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

.checks { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; font-size: var(--fs); min-height: var(--ctl-h-lg); }
.checks label { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); cursor: pointer; }
.checks > span { font-size: var(--fs-xs); color: var(--text-3); }

.switch-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px 12px; font-size: var(--fs);
}
.switch-grid label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--text-2); }

.hint { font-size: var(--fs-xs); color: var(--text-3); }
.sub-title { font-size: var(--fs); font-weight: 600; color: var(--text); margin: 18px 0 10px; }

/* 图片上传 */
.img-list { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.img-list img {
  width: 76px; height: 76px; object-fit: cover;
  border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer;
}
.upload-btn {
  width: 76px; height: 76px; flex-shrink: 0;
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-xs); cursor: pointer; transition: .15s;
}
.upload-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-weak); }
.upload-tip {
  display: inline-flex; align-items: center; gap: 4px;
  margin-left: 8px; font-size: var(--fs-xs); color: var(--warn);
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
.upload-tip::before { content: "ⓘ"; font-size: var(--fs-xs); line-height: 1; }

/* 在 .form-row 中独占整行：用于富文本上方提示（编辑器需跨满整行） */
.form-row-full {
  margin-left: 104px;        /* 与 .form-row > label (92px) + gap (12px) 对齐 */
  margin-bottom: 12px;
}

/* -------------------------------------------------------------------- 8. 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--ctl-h); padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font-size: var(--fs-sm); font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:hover { color: var(--brand); border-color: var(--brand); }
.btn:active { transform: translateY(.5px); }
.btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.9;
           stroke-linecap: round; stroke-linejoin: round; }

.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-fg); }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--brand-fg); }
.btn.green { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.green:hover { background: #36b978; border-color: #36b978; color: #fff; }
.btn.red { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.red:hover { background: #de3a5c; border-color: #de3a5c; color: #fff; }
.btn.gray { background: var(--surface); border-color: var(--border-strong); color: var(--text-2); }
.btn.gray:hover { color: var(--text); border-color: var(--text-3); }
.btn.gold { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn.gold:hover { background: #e59d20; border-color: #e59d20; color: #fff; }
.btn.pass { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.pass:hover { background: #36b978; border-color: #36b978; color: #fff; }
.btn.reject { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.reject:hover { background: #de3a5c; border-color: #de3a5c; color: #fff; }

/* 表格内的操作按钮降级成文字链：避免满屏色块，行高也更稳 */
td .btn, .btn.link {
  height: 22px; padding: 0 2px; margin-right: 10px;
  border: 0; background: none; font-size: var(--fs-sm); font-weight: 400;
}
td .btn:last-child, .btn.link:last-child { margin-right: 0; }
td .btn:hover, .btn.link:hover { background: none; text-decoration: underline; }
td .btn.primary, .btn.link.primary { background: none; color: var(--brand); }
td .btn.green,   .btn.link.green,
td .btn.pass,    .btn.link.pass   { background: none; color: var(--ok); }
td .btn.red,     .btn.link.red,
td .btn.reject,  .btn.link.reject { background: none; color: var(--danger); }
td .btn.gray,    .btn.link.gray   { background: none; color: var(--text-3); }
td .btn.gold,    .btn.link.gold   { background: none; color: var(--warn); }
td .btn:disabled { color: var(--text-3); text-decoration: none; }

/* -------------------------------------------------------------------- 9. 表格 */
table { width: 100%; border-collapse: collapse; font-size: var(--fs); }
thead th {
  height: 36px; padding: 0 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  color: var(--text-2); font-size: var(--fs-sm); font-weight: 600;
  text-align: left; white-space: nowrap; letter-spacing: .2px;
}
tbody td {
  height: var(--row-h); padding: 6px 12px;
  border-bottom: 1px solid var(--surface-3);
  color: var(--text-2); vertical-align: middle; word-break: break-word;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-hover); }
tbody td strong { color: var(--text); font-weight: 600; }
tbody td.nowrap, thead th.nowrap { white-space: nowrap; }
tbody td.right, thead th.right { text-align: right; }
tbody td.center, thead th.center { text-align: center; }

.mono { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-3); }
.amount { color: var(--danger); font-weight: 600; }
.detail { color: var(--brand); cursor: pointer; }
.detail:hover { text-decoration: underline; }

/* 空数据行 */
.empty-row td {
  height: 96px; text-align: center; color: var(--text-3);
  font-size: var(--fs-sm); border-bottom: 0;
}
.empty-row:hover td { background: none; }

/* 会员/用户单元格 */
.user-cell { display: flex; align-items: center; gap: 8px; }
.user-cell .avatar {
  width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%;
  background: var(--brand-weak); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 700;
}
.user-cell .name { color: var(--text); font-weight: 600; }
.user-cell .meta { font-size: var(--fs-xs); color: var(--text-3); }

/* 状态标签 */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px; border-radius: 11px;
  font-size: var(--fs-xs); font-weight: 600;
  background: var(--surface-3); color: var(--text-2); white-space: nowrap;
}
.tag .pt { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.tag.ok   { background: var(--ok-weak);     color: var(--ok); }
.tag.warn { background: var(--warn-weak);   color: var(--warn); }
.tag.dgr  { background: var(--danger-weak); color: var(--danger); }
.tag.info { background: var(--info-weak);   color: var(--info); }

/* 分页 */
.pager {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 12px var(--pad);
  border-top: 1px solid var(--border);
  font-size: var(--fs-sm); color: var(--text-3);
}
.pager .pages { display: flex; gap: 4px; align-items: center; }
.pager button {
  min-width: 28px; height: 28px; padding: 0 10px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-2);
  font-size: var(--fs-sm); cursor: pointer; transition: .15s;
}
.pager button:hover:not(:disabled) { color: var(--brand); border-color: var(--brand); }
.pager button.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.pager button:disabled { opacity: .45; cursor: not-allowed; }

/* ------------------------------------------------------------------ 10. 弹层 */
.modal-mask {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15,23,41,.45);
  z-index: 1000; overflow-y: auto;
}
.modal {
  width: 640px; max-width: calc(100vw - 32px);
  margin: 40px auto;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal.sm { width: 440px; }
.modal.md { width: 640px; }
.modal.lg { width: 880px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
}
.modal-head h4 { font-size: 14px; font-weight: 640; }
.modal-close {
  width: 26px; height: 26px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); color: var(--text-3); cursor: pointer;
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-body { padding: 20px; max-height: calc(100vh - 220px); overflow-y: auto; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2);
}
/* 旧弹层结构兼容：没有 .modal-head/.modal-body 时，h4 当标题、padding 当内边距 */
.modal > h4 {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  font-size: 14px; font-weight: 640;
}
.modal > h4 ~ *:not(.modal-foot) { padding-left: 20px; padding-right: 20px; }
.modal > .modal-foot ~ * { padding-left: 0; padding-right: 0; }

/* 详情键值对 */
.kv { display: flex; gap: 12px; font-size: var(--fs); padding: 7px 0; border-bottom: 1px dashed var(--border); }
.kv:last-child { border-bottom: 0; }
.kv .k { width: 120px; flex-shrink: 0; color: var(--text-3); }
.kv .v { flex: 1; color: var(--text); word-break: break-all; }

/* 列表行（核销员等可增删的短列表） */
.vrow {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 7px 0; border-bottom: 1px dashed var(--border);
}
.vrow:last-child { border-bottom: 0; }
.vrow .uid { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text); word-break: break-all; }

/* 核销卡 */
.verify-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; max-width: 480px; margin-top: var(--gap);
}
.verify-card .row { display: flex; padding: 6px 0; font-size: var(--fs); }
.verify-card .k { width: 92px; flex-shrink: 0; color: var(--text-3); }
.verify-card .players {
  margin: 8px 0 8px 92px; padding: 10px 14px;
  background: var(--surface-2); border-radius: var(--radius-sm); font-size: var(--fs-sm);
}
details.plist summary { cursor: pointer; color: var(--brand); list-style: none; }
details.plist summary::-webkit-details-marker { display: none; }
details.plist summary::before { content: "▸ "; color: var(--text-3); }
details.plist[open] summary::before { content: "▾ "; }
.prow { padding: 3px 0 3px 14px; color: var(--text-2); }

/* ------------------------------------------------------- 11. 富文本容器（wangEditor） */
.editor-wrap {
  flex: 1; min-width: 0;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  overflow: hidden; background: var(--surface);
}
.w-e-bar { border-bottom: 1px solid var(--border) !important; }
.w-e-scroll { background: var(--surface); }
.w-e-text-container { background: var(--surface) !important; }
.w-e-text-container [data-slate-editor] { padding: 0 12px; }

/* ------------------------------------------------------------------ 12. 图表 */
.chart { width: 100%; height: 220px; display: block; }
.legend { display: flex; gap: 16px; font-size: var(--fs-xs); color: var(--text-3); margin-top: 8px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }

/* ------------------------------------------------------------------ 13. 工具类 */
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.mt { margin-top: var(--gap); }
.mt-sm { margin-top: 8px; }
.mb { margin-bottom: var(--gap); }
.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* ------------------------------------------------------------ 14. 地图选点弹层 */
/* 叠在编辑弹层（z-index:1000）之上 */
.modal-mask.mp-mask { z-index: 1100; }
.mp-modal .modal-body { padding: 16px 20px; }
.mp-search { position: relative; }
.mp-search input { width: 100%; height: var(--ctl-h-lg); }
.mp-suggest {
  display: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); max-height: 240px; overflow-y: auto; z-index: 20;
}
.mp-suggest.show { display: block; }
.mp-suggest .item { padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--border); }
.mp-suggest .item:last-child { border-bottom: 0; }
.mp-suggest .item:hover { background: var(--surface-hover); }
.mp-suggest .item .t { font-size: var(--fs); color: var(--text); }
.mp-suggest .item .a { font-size: var(--fs-xs); color: var(--text-3); margin-top: 2px; }
.mp-suggest .mp-empty { padding: 10px 12px; font-size: var(--fs-sm); color: var(--text-3); }
.mp-canvas {
  width: 100%; height: 420px; margin-top: 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.mp-coord { margin-top: 10px; font-size: var(--fs-sm); color: var(--text-2); word-break: break-all; }
.center { text-align: center; }
.hide { display: none !important; }
.scroll-x { overflow-x: auto; }

.text-ok     { color: var(--ok); }
.text-warn   { color: var(--warn); }
.text-danger { color: var(--danger); }
.text-brand  { color: var(--brand); }

/* ------------------------------------------------- 15. 抽签揭晓动画层（投屏/内嵌两用） */
/* 这一层是对外的「展示面」，可能全屏投给现场，故沿用大屏式深色，不随后台浅色主题；
   颜色只在 .draw-anim 作用域里的局部变量定义一次，不散落裸值。
   DOM 由 draw-anim.js 动态创建，样式集中在此。 */
.draw-anim {
  --da-bg:    #141d2b;
  --da-panel: #1c2738;
  --da-back:  #26344a;
  --da-line:  rgba(255, 255, 255, .10);
  --da-fg:    #f2f6fc;
  --da-fg-2:  #93a3ba;
  --da-mark:  #4a9bff;

  position: fixed; inset: 0; z-index: 3000;
  display: flex; flex-direction: column;
  background: var(--da-bg); color: var(--da-fg);
  font-family: var(--font);
  opacity: 0; transition: opacity .28s ease;
}
.draw-anim.show { opacity: 1; }

.da-head { padding: 30px 32px 6px; text-align: center; }
.da-title { font-size: 22px; font-weight: 600; letter-spacing: .04em; }
.da-sub { margin-top: 6px; font-size: 13px; color: var(--da-fg-2); }

.da-stage {
  flex: 1; min-height: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  padding: 20px 32px;
}
.da-grid {
  display: grid; gap: 14px;
  width: 100%; max-width: 1216px;
}

.da-card { perspective: 900px; aspect-ratio: 1 / .68; }
.da-inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform .55s cubic-bezier(.4, .15, .2, 1);
}
.da-card.flip .da-inner { transform: rotateY(180deg); }

.da-face {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  padding: 8px; text-align: center;
  border: 1px solid var(--da-line); border-radius: var(--radius-lg);
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
}
.da-back { background: var(--da-back); color: var(--da-mark); font-size: 28px; font-weight: 600; }
.da-front { background: var(--da-panel); color: var(--da-fg); transform: rotateY(180deg); }
.da-p { font-size: var(--da-fs, 15px); font-weight: 600; line-height: 1.35; word-break: break-all; }
.da-vs { font-size: 10px; letter-spacing: .12em; color: var(--da-fg-2); }

.draw-anim.pre .da-card { animation: da-shake .4s ease-in-out 2 both; }
@keyframes da-shake {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  30%      { transform: translateY(-7px) rotate(-1.6deg); }
  70%      { transform: translateY(3px) rotate(1.6deg); }
}

.da-foot {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 10px 32px 26px;
}
.da-progress { position: absolute; left: 32px; font-size: 13px; color: var(--da-fg-2); }
.da-btn {
  height: 32px; padding: 0 18px; cursor: pointer;
  border: 1px solid var(--da-line); border-radius: var(--radius-sm);
  background: transparent; color: var(--da-fg); font-size: var(--fs-sm);
}
.da-btn:hover { background: rgba(255, 255, 255, .08); }
.da-btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-fg); }
.da-btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }

/* ===== 权限门禁（admin-guard.js）===== */
/* 操作级：没有该项高危权限的按钮置灰点不动，留着位置好让人知道「有这功能，但你没权限」 */
.perm-off {
  pointer-events: none !important;
  opacity: .38;
  filter: grayscale(.5);
}
/* 页面级：整个页面没权限时盖住内容 */
#perm-denied {
  position: fixed; inset: 0; z-index: 900;
  background: var(--bg, #f5f6f8);
  display: flex; align-items: center; justify-content: center;
}
.perm-denied-card {
  width: 360px; padding: 34px 28px; text-align: center;
  background: var(--surface, #fff); border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius, 10px);
}
.perm-denied-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 58px; height: 58px; margin-bottom: 16px;
  border-radius: 50%; background: var(--brand-weak, #eef4ff); color: var(--brand, #1677ff);
}
.perm-denied-card h3 { margin: 0 0 8px; font-size: 16px; font-weight: 640; color: var(--text, #1f2329); }
.perm-denied-card p { margin: 0 0 20px; font-size: 13px; line-height: 1.7; color: var(--text-3, #8a9099); }

/* 弹层里的勾选网格必须显式撑满：.switch-grid 用的是 auto-fill，
   不给 flex:1 的话宽度按 shrink-to-fit 算，auto-fill 会退化成一整列 */
.form-row > .switch-grid { flex: 1; min-width: 0; }
