/* ============ BH6SVA SSTV 认证中心 ============ */
/* 主题变量：默认(浅色) + data-theme="dark" 强制深色 + prefers-color-scheme 系统自适应。
   优先级（写顺序保证）：:root(浅) < 媒体查询(系统深) < [data-theme=dark] < [data-theme=light] */
:root {
  color-scheme: light dark;
  --bg: #f4f5f7;
  --bg-2: #f8fafc;          /* 表头/次级底 */
  --bg-soft: #fafafa;       /* 拖拽区、卡片浅底 */
  --hover: #fafafa;
  --panel: #ffffff;
  --input: #ffffff;
  --img-bg: #ffffff;
  --ink: #111827;
  --muted: #6b7280;
  --tag-ink: #374151;
  --line: #e5e7eb;
  --line-soft: #f1f2f4;
  --border: #e2e8f0;
  --accent: #ea580c;
  --accent-deep: #c2410c;
  --accent-bg: #fff7ed;
  --navy: #0f172a;
  --ok: #16a34a;
  --ok-bg: #f0fdf4;
  --ok-ink: #15803d;
  --ok-line: #bbf7d0;
  --bad: #dc2626;
  --bad-bg: #fef2f2;
  --bad-ink: #b91c1c;
  --bad-line: #fecaca;
  --warn-bg: #fffbeb;
  --warn-ink: #92400e;
  --warn-line: #f59e0b;
  --shadow: 0 4px 18px rgba(15, 23, 42, .08);
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0d1117;
    --bg-2: #151b23;
    --bg-soft: #1a212a;
    --hover: #212a35;
    --panel: #161c24;
    --input: #1c242e;
    --img-bg: #0e1319;
    --ink: #e6ebf2;
    --muted: #94a3b8;
    --tag-ink: #cbd5e1;
    --line: #2a333f;
    --line-soft: #232b36;
    --border: #2f3947;
    --accent: #f97316;
    --accent-deep: #ea580c;
    --accent-bg: #2b1a0e;
    --navy: #111a2a;
    --ok: #22c55e;
    --ok-bg: #0d2417;
    --ok-ink: #4ade80;
    --ok-line: #1e4d35;
    --bad: #f87171;
    --bad-bg: #2b1419;
    --bad-ink: #fca5a5;
    --bad-line: #6b1f28;
    --warn-bg: #2b2110;
    --warn-ink: #fbbf24;
    --warn-line: #a16207;
    --shadow: 0 4px 18px rgba(0, 0, 0, .45);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1117;
  --bg-2: #151b23;
  --bg-soft: #1a212a;
  --hover: #212a35;
  --panel: #161c24;
  --input: #1c242e;
  --img-bg: #0e1319;
  --ink: #e6ebf2;
  --muted: #94a3b8;
  --tag-ink: #cbd5e1;
  --line: #2a333f;
  --line-soft: #232b36;
  --border: #2f3947;
  --accent: #f97316;
  --accent-deep: #ea580c;
  --accent-bg: #2b1a0e;
  --navy: #111a2a;
  --ok: #22c55e;
  --ok-bg: #0d2417;
  --ok-ink: #4ade80;
  --ok-line: #1e4d35;
  --bad: #f87171;
  --bad-bg: #2b1419;
  --bad-ink: #fca5a5;
  --bad-line: #6b1f28;
  --warn-bg: #2b2110;
  --warn-ink: #fbbf24;
  --warn-line: #a16207;
  --shadow: 0 4px 18px rgba(0, 0, 0, .45);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f5f7;
  --bg-2: #f8fafc;
  --bg-soft: #fafafa;
  --hover: #fafafa;
  --panel: #ffffff;
  --input: #ffffff;
  --img-bg: #ffffff;
  --ink: #111827;
  --muted: #6b7280;
  --tag-ink: #374151;
  --line: #e5e7eb;
  --line-soft: #f1f2f4;
  --border: #e2e8f0;
  --accent: #ea580c;
  --accent-deep: #c2410c;
  --accent-bg: #fff7ed;
  --navy: #0f172a;
  --ok: #16a34a;
  --ok-bg: #f0fdf4;
  --ok-ink: #15803d;
  --ok-line: #bbf7d0;
  --bad: #dc2626;
  --bad-bg: #fef2f2;
  --bad-ink: #b91c1c;
  --bad-line: #fecaca;
  --warn-bg: #fffbeb;
  --warn-ink: #92400e;
  --warn-line: #f59e0b;
  --shadow: 0 4px 18px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

.wrap { max-width: 1000px; margin: 0 auto; padding: 0 20px; }
.dim { color: var(--muted); font-size: 13px; }
.mono { font-family: var(--mono); }

/* ---------- 顶栏 ---------- */
.head { background: var(--navy); color: #fff; }
.head-in { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; font-size: 18px; }
.brand svg { color: var(--accent); flex: none; }
.brand-sub { font-family: var(--mono); font-size: 12px; color: #94a3b8; border: 1px solid #334155; border-radius: 6px; padding: 2px 8px; letter-spacing: 1px; }

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

/* 右上角主题切换 */
.theme-switch { position: relative; }
.theme-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: transparent; border: 1px solid #334155; color: #e2e8f0;
  padding: 8px 12px; border-radius: 10px; font-size: 13.5px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: background .15s;
}
.theme-btn:hover { background: #1e293b; }
.theme-btn svg { flex: none; }
.theme-btn .ic-sun { display: block; }
.theme-btn .ic-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .ic-sun { display: none; }
  :root:not([data-theme="light"]) .theme-btn .ic-moon { display: block; }
}
:root[data-theme="light"] .theme-btn .ic-sun { display: block; }
:root[data-theme="light"] .theme-btn .ic-moon { display: none; }
:root[data-theme="dark"] .theme-btn .ic-sun { display: none; }
:root[data-theme="dark"] .theme-btn .ic-moon { display: block; }

.theme-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 100;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 6px; min-width: 172px; box-shadow: 0 10px 30px rgba(0,0,0,.22);
  display: none;
}
.theme-menu.open { display: block; }
.theme-menu button {
  display: flex; align-items: center; gap: 9px; width: 100%;
  background: none; border: none; padding: 9px 10px; border-radius: 8px;
  font-size: 13.5px; color: var(--ink); cursor: pointer; font-family: inherit;
  text-align: left; white-space: nowrap;
}
.theme-menu button:hover { background: var(--hover); }
.theme-menu button.on { color: var(--accent); font-weight: 700; }
.theme-menu button svg { flex: none; opacity: .85; }
.theme-menu .tick { margin-left: auto; opacity: 0; }
.theme-menu button.on .tick { opacity: 1; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  padding: 8px 16px; border-radius: 10px; font-size: 14px; font-weight: 600;
  cursor: pointer; text-decoration: none; transition: all .15s; font-family: inherit;
}
.btn:hover { border-color: var(--muted); background: var(--hover); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-deep); }
.btn.ghost { background: transparent; border-color: #334155; color: #e2e8f0; }
.btn.ghost:hover { background: #1e293b; }
.btn.big { width: 100%; padding: 12px 20px; font-size: 15px; margin-top: 18px; }
.btn.mini { padding: 4px 12px; font-size: 12px; border-radius: 8px; }
.btn:disabled { opacity: .6; cursor: wait; }

/* ---------- 首页 Hero ---------- */
.hero { text-align: center; padding: 62px 0 36px; }
.kicker {
  font-family: var(--mono); font-size: 12px; letter-spacing: .35em;
  color: var(--accent); text-transform: uppercase; margin: 0 0 18px;
}
.hero h1 { font-size: 42px; line-height: 1.15; letter-spacing: -.5px; margin: 0 0 18px; }
.hero-sub { color: var(--muted); font-size: 16px; max-width: 580px; margin: 0 auto; }
.hero-note {
  margin-top: 14px; font-size: 12px; color: var(--muted);
  font-family: var(--mono); letter-spacing: .03em;
}
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 44px auto 0; max-width: 780px; text-align: left; }
.step { display: flex; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.step-n {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: var(--navy); color: #fff; display: flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: 15px;
}
.step strong { display: block; margin-bottom: 4px; }
.step p { margin: 0; font-size: 13px; color: var(--muted); }

/* ---------- 面板 / 表单 ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px; margin-bottom: 24px; }
.panel h2 { margin: 0 0 16px; font-size: 17px; }
.panel h2:not(:first-child) { margin-top: 26px; }
.upload-panel h2 { margin-bottom: 18px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--tag-ink); }
.field input, .field select, .field textarea {
  font: inherit; font-weight: 400; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--input); color: var(--ink);
  width: 100%;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(234, 88, 12, .12);
}
.checks { display: flex; flex-direction: column; gap: 8px; padding: 8px 0; font-weight: 400; font-size: 14px; }
.checks label { display: flex; align-items: center; gap: 8px; }

/* ---------- 上传拖拽区 ---------- */
.drop {
  border: 2px dashed var(--line); border-radius: 14px; padding: 44px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  cursor: pointer; transition: all .15s; background: var(--bg-soft); text-align: center; margin-bottom: 20px;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-bg); }
.drop svg { color: var(--muted); }
.drop #dropText { font-weight: 600; font-size: 15px; }
.drop-hint { font-size: 13px; color: var(--muted); }
.md5-hint { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; color: var(--ok-ink, #1a7f37); word-break: break-all; padding: 6px 12px 0; display: block; }

/* 提交界面的防滥用提示 */
.warn-note {
  margin: 14px 0; padding: 10px 14px; font-size: 13px; line-height: 1.6;
  color: var(--warn-ink); background: var(--warn-bg); border: 1px dashed var(--warn-line); border-radius: 10px;
}

/* ---------- 提示 / 结果 ---------- */
.alert { padding: 14px 16px; border-radius: 12px; font-size: 14px; margin-bottom: 20px; border: 1px solid; line-height: 1.6; }
.alert.error, .alert.bad { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad-ink); }
.alert.ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-ink); }
.alert.warn { background: var(--warn-bg, #fff8e1); border-color: var(--warn-line, #f0d48a); color: var(--warn-ink, #7a5b00); }

.simline { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 10px 0 6px; }
.simline span { display: block; height: 100%; background: linear-gradient(90deg, #34d399, #16a34a); }

.cert-wrap { margin: 16px 0 6px; }
.cert-img { max-width: 100%; border-radius: 12px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.save-hint {
  display: inline-block; margin: 12px 0 8px; padding: 7px 12px;
  font-size: 13px; color: var(--warn-ink); background: var(--warn-bg);
  border: 1px dashed var(--warn-line); border-radius: 8px;
}
.cert-wrap .btn.mini { margin-right: 8px; }

/* ---------- 奖状滑块（多张奖状左右滑动切换） ---------- */
.cert-swiper { position: relative; margin: 14px 0 10px; }
.cert-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.cert-track::-webkit-scrollbar { display: none; }
.cert-slide {
  flex: 0 0 100%; min-width: 0; box-sizing: border-box;
  scroll-snap-align: start; padding: 0 4px; text-align: center;
}
.cert-slide .cert-img { max-width: 100%; border-radius: 12px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.cert-match { margin: 4px 0 6px; font-size: 14px; color: var(--ink); }
.cert-no-line { margin: 0 0 6px; font-size: 13px; }
.swipe-btn {
  position: absolute; top: 38%; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--bg-soft);
  color: var(--ink); font-size: 20px; line-height: 1;
  cursor: pointer; z-index: 2; box-shadow: var(--shadow);
}
.swipe-btn.prev { left: 6px; }
.swipe-btn.next { right: 6px; }
.swipe-btn:hover { background: var(--line); }
.swipe-dots { display: flex; justify-content: center; gap: 7px; margin: 10px 0 4px; }
.swipe-dot {
  width: 8px; height: 8px; border-radius: 50%; padding: 0;
  border: none; background: var(--line); cursor: pointer;
}
.swipe-dot.on { background: var(--accent); width: 20px; border-radius: 4px; transition: all .2s ease; }
.swipe-hint { margin: 0 0 8px; text-align: center; font-size: 12px; }
.mail-actions { margin: 10px 0 4px; }
.mail-actions .btn.mini { margin-right: 8px; }

/* ---------- 管理后台 ---------- */
.admin { display: grid; grid-template-columns: 220px 1fr; gap: 28px; padding: 36px 0; }
.admin h1 { margin: 0 0 22px; font-size: 24px; letter-spacing: -.3px; }
.admin-main h2 { font-size: 16px; margin: 26px 0 12px; }

.admin-nav { display: flex; flex-direction: column; gap: 6px; }
.admin-nav a { padding: 11px 14px; border-radius: 10px; color: var(--tag-ink); text-decoration: none; font-weight: 600; font-size: 14px; }
.admin-nav a:hover { background: var(--panel); }
.admin-nav a.on { background: var(--navy); color: #fff; }
.admin-nav .logout { margin-top: 16px; color: var(--bad-ink); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 4px; }
.stat-n { font-size: 30px; font-weight: 800; letter-spacing: -.5px; }
.stat-l { font-size: 13px; color: var(--muted); }
.stat.bad .stat-n { color: var(--bad); }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); }
.table tr:hover td { background: var(--hover); }
.ops { white-space: nowrap; }
.ops .btn + .btn { margin-left: 6px; }

.tag { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--bg-soft); color: var(--tag-ink); white-space: nowrap; }
.tag.ok { background: var(--ok-bg); color: var(--ok-ink); }
.tag.bad { background: var(--bad-bg); color: var(--bad-ink); }

/* ---------- 证书排版预览 ---------- */
.base-wrap { position: relative; display: inline-block; max-width: 100%; margin: 4px 0 16px; }
.base-wrap img { display: block; max-width: 100%; cursor: crosshair; border: 1px solid var(--line); border-radius: 10px; }
.marker {
  position: absolute; width: 20px; height: 20px; border: 2px solid var(--accent);
  border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none;
  box-shadow: 0 0 0 2px #fff, 0 0 6px rgba(0,0,0,.35);
}
.marker::before, .marker::after {
  content: ''; position: absolute; background: var(--accent);
}
.marker::before { left: 50%; top: -7px; bottom: -7px; width: 1.5px; transform: translateX(-50%); }
.marker::after { top: 50%; left: -7px; right: -7px; height: 1.5px; transform: translateY(-50%); }

.preview-img { max-width: 100%; border: 1px solid var(--line); border-radius: 10px; margin-top: 16px; display: block; }
.thumb { max-height: 150px; border-radius: 10px; border: 1px solid var(--line); margin: 10px 0 14px; display: block; }

/* ---------- 登录 ---------- */
.login-wrap { max-width: 420px; margin: 70px auto; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 36px; }
.login-title { margin: 0 0 20px; font-size: 22px; }
.login-wrap .btn { margin-top: 18px; width: 100%; }
.login-tip { margin-top: 14px; }

/* ---------- 页脚 ---------- */
.foot { border-top: 1px solid var(--line); padding: 26px 0; margin-top: 64px; text-align: center; font-size: 13px; color: var(--muted); }
.foot p { margin: 4px 0; }
.foot .icp { font-size: 12px; margin-top: 6px; }
.foot .icp a { color: var(--muted); text-decoration: none; }
.foot .icp a:hover { color: var(--accent); text-decoration: underline; }
.foot-links { margin: 12px 0 6px; }
.foot-links span { margin-right: 2px; }
.foot-links a { display: inline-block; margin: 3px 9px; color: var(--muted); text-decoration: none; }
.foot-links a:hover { color: var(--accent); text-decoration: underline; }

/* ---------- 首页友情链接板块（邮件查询下方） ---------- */
.links-panel { text-align: center; padding-top: 22px; padding-bottom: 22px; }
.links-panel .links-title { font-size: 15px; font-weight: 600; color: var(--muted); letter-spacing: 3px; margin: 0 0 14px; }
.links-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 28px; max-width: 100%; }
.links-item { display: inline-block; max-width: 100%; text-align: left; }
.links-item a { font-size: 16px; color: var(--accent); text-decoration: none; white-space: normal; }
.links-item a:hover { text-decoration: underline; }
.links-desc { font-size: 13px; color: var(--muted); margin-left: 8px; }

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .admin { grid-template-columns: 1fr; padding-top: 24px; }
  .hero h1 { font-size: 31px; }
  .hero { padding-top: 44px; }

  /* ---- 移动端增强：留白收敛、按钮全宽、表格横向滚动 ---- */
  .wrap { padding: 0 12px; }
  .panel { padding: 16px 14px; border-radius: 12px; margin-bottom: 16px; }
  .head-in { gap: 8px; }
  .brand-sub { display: none; }
  .btn.big { padding: 13px 16px; }
  .ops { flex-wrap: wrap; gap: 6px; }
  .ops .btn + .btn { margin-left: 0; }
  .tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .cap-box { padding: 18px 14px; }
  .dropzone, .drop { padding: 16px 12px; }
  .prize-opt { padding: 12px; }
  .status-form { flex-direction: column; align-items: stretch; }
  .status-form .btn { width: 100%; }
  input, select, textarea { font-size: 16px; }  /* 防 iOS 聚焦缩放 */
  .field { font-size: 14px; }
  .foot { margin-top: 40px; padding: 20px 12px; }
}

/* ---------- 记录删除工具栏 ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.toolbar input[type=checkbox], .table input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; vertical-align: middle; }
.sel-count { font-size: 12px; color: var(--muted); margin-left: auto; }
.btn.danger { background: var(--panel); border-color: var(--bad-line); color: var(--bad-ink); }
.btn.danger:hover { background: var(--bad-bg); }
.clear-form { margin-top: 14px; text-align: right; }

/* ---------- 允许上传时间段 ---------- */
.win-banner { text-align: center; }

/* ---------- 公告 ---------- */
.announcement {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--warn-bg); border: 1px solid var(--warn-line); border-left: 4px solid var(--warn-line);
  border-radius: 12px; padding: 14px 18px; margin: 0 0 24px;
}
.announcement-badge {
  flex: none; font-size: 12px; font-weight: 700; color: #fff;
  background: #f59e0b; border-radius: 6px; padding: 3px 10px; margin-top: 2px;
  letter-spacing: 1px;
}
.announcement-text { font-size: 15px; line-height: 1.7; white-space: pre-wrap; color: var(--warn-ink); }
.announcement-time { font-size: 12px; color: var(--warn-line); margin-top: 6px; }
.win-table { margin: 12px 0; }
.win-table td { padding: 6px 8px; }
.win-table td:first-child { padding-left: 0; }
.win-table input[type=text], .win-table input[type=time] {
  font: inherit; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 8px; width: 100%; background: var(--input); color: var(--ink);
}
.win-table input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(234, 88, 12, .12); }

/* ---------- 证书排版：目标切换 ---------- */
.target-tabs { display: flex; gap: 20px; margin: 4px 0 14px; font-size: 14px; }
.target-tabs label { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.target-tabs input { width: 15px; height: 15px; accent-color: var(--accent); }

/* ---------- 首页奖状验证 ---------- */
.verify-panel h2 { margin-bottom: 8px; }
.verify-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.scanner-box { margin-top: 16px; }
.scanner-box video {
  display: block; width: 100%; max-width: 420px; border-radius: 12px;
  background: #000; border: 1px solid var(--line);
}
.scanner-box .btn { margin-top: 10px; }
#verifyResult { margin-top: 16px; }
#verifyResult .alert { margin-bottom: 0; }
.big-mono { font-size: 22px; font-weight: 800; letter-spacing: .04em; }

/* ---------- 标准图库（管理后台） ---------- */
.std-count { font-size: 14px; font-weight: 700; color: var(--ok-ink, #1a7f37); vertical-align: middle; margin-left: 6px; }
.std-progress { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 12px 0 18px; }
.std-progress-bar { height: 100%; border-radius: 4px; background: linear-gradient(90deg, #1a7f37, #3fb95e); transition: width .3s; }
.std-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 4px 0 14px; }
.std-toolbar .sel-all { font-size: 13px; margin-right: 10px; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.std-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 16px; margin: 4px 0 18px; }
.std-card { position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg-soft); transition: transform .15s, box-shadow .15s, border-color .15s; }
.std-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.std-card.sel { border-color: var(--ok-ink, #1a7f37); box-shadow: 0 0 0 2px rgba(26,127,55,.25); }
.std-card img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: contain; background: var(--img-bg); cursor: zoom-in; }
.std-missing {
  width: 100%; aspect-ratio: 4/3; display: flex; align-items: center;
  justify-content: center; color: var(--bad-ink); font-size: 13px; background: var(--bad-bg);
}
.std-sel-wrap { position: absolute; top: 8px; left: 8px; z-index: 2; background: rgba(255,255,255,.85); border-radius: 6px; padding: 2px; }
.std-sel-wrap input { width: 17px; height: 17px; accent-color: var(--ok-ink, #1a7f37); cursor: pointer; display: block; }
.std-meta { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px 2px; }
.std-meta .mono { font-size: 12px; font-weight: 700; }
.std-card form { padding: 6px 10px 10px; }
.std-card .btn { width: 100%; }

/* 拖拽上传区 */
.dropzone { position: relative; border: 2px dashed var(--line); border-radius: 14px; padding: 28px 18px 22px; text-align: center; cursor: pointer; background: var(--bg-soft); transition: border-color .2s, background .2s; }
.dropzone.drag { border-color: var(--ok-ink, #1a7f37); background: var(--ok-bg); }
.dropzone .dz-title { margin: 0 0 6px; }
.dropzone input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.dropzone-files { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.dropzone-file { display: inline-flex; align-items: center; gap: 7px; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 5px 12px; font-size: 12px; max-width: 240px; }
.dropzone-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropzone-file button { border: none; background: none; color: var(--bad-ink); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; }
.dropzone .btn { margin-top: 16px; }

/* 大图预览（lightbox） */
.lightbox { display: none; position: fixed; inset: 0; background: rgba(10,10,12,.85); z-index: 999; align-items: center; justify-content: center; flex-direction: column; cursor: zoom-out; }
.lightbox.show { display: flex; }
.lightbox img { max-width: 88vw; max-height: 76vh; border-radius: 8px; box-shadow: 0 12px 48px rgba(0,0,0,.55); background: var(--img-bg); }
.lightbox-cap { color: #dfe3e8; margin-top: 14px; font-size: 14px; letter-spacing: .05em; }
.lightbox-close { position: absolute; top: 16px; right: 26px; color: #fff; font-size: 42px; line-height: 1; cursor: pointer; opacity: .85; }
.lightbox-close:hover { opacity: 1; }

/* ===== 奖品兑换 ===== */
.prize-upload { margin-top: 14px; }
.prize-upload .drop {
  display: flex; align-items: center; justify-content: center;
  min-height: 64px; padding: 14px; border: 2px dashed var(--line);
  border-radius: 10px; color: var(--muted); cursor: pointer;
  text-align: center; font-size: 14px; background: var(--bg-soft);
  transition: border-color .2s, background .2s;
}
.prize-upload .drop:hover { border-color: var(--accent); background: var(--panel); }
.prize-preview { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.prize-thumb {
  width: 96px; height: 96px; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--line);
}
#prizeVerifyBtn { margin-bottom: 10px; }
#prizeForm { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }

/* ===== 奖品多选 ===== */
.prize-list { display: grid; gap: 10px; margin: 14px 0 6px; }
.prize-opt {
  display: flex; align-items: flex-start; gap: 10px;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; cursor: pointer; background: var(--bg-soft);
  transition: border-color .2s, box-shadow .2s;
}
.prize-opt:hover { border-color: var(--accent); }
.prize-opt input[type="radio"] { margin-top: 4px; }
.prize-opt:has(input:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  background: var(--panel);
}
.prize-opt-body { display: flex; flex-direction: column; gap: 3px; }
.prize-opt-body b { font-size: 15px; }
.bad-text { color: var(--bad-ink); }
#prizeReq { margin: 8px 0 2px; font-size: 14px; }
.prize-item-row {
  border: 1px dashed var(--line); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 12px; background: var(--bg-soft);
}

/* iOS 26 文件选择器兼容：WebKit 26 拒绝 programmatic click() 与 label 转发，
   必须让用户手势直接命中 input 本体。方案：input 透明铺满触发区。 */
.drop { position: relative; }
.vh-cover {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; z-index: 3; font-size: 0; margin: 0; padding: 0;
}
.photo-wrap { position: relative; display: inline-block; }

/* ---------- 证书排版：放置对象提示 / 字段高亮 / 预览摘要 ---------- */
.place-hint { font-size: 13px; color: var(--warn-ink); margin: -6px 0 12px; min-height: 18px; }
@keyframes justPlaced { 0% { background: var(--warn-bg); box-shadow: 0 0 0 2px var(--warn-line); } 100% { background: transparent; box-shadow: none; } }
.just-placed { animation: justPlaced 1.2s ease; border-radius: 6px; }
.preview-sum { margin-top: 10px; font-size: 13px; color: var(--muted); background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; line-height: 1.6; }

/* ===== 场次分组（标准图库） ===== */
.group-create-row { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin:10px 0 4px; }
.group-create-row input[type=text] { flex:1 1 240px; padding:8px 12px; border:1px solid var(--line); border-radius:8px; font-size:14px; background: var(--input); color: var(--ink); }
.group-list { display:flex; flex-direction:column; gap:10px; margin-top:12px; }
.group-item { border:1px solid var(--line); border-radius:12px; padding:10px 14px; background: var(--bg-soft); }
.group-head { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.group-ops { margin-left:auto; display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.group-rename-form { display:inline-flex; gap:6px; align-items:center; }
.group-rename-form input[type=text] { padding:5px 8px; border:1px solid var(--line); border-radius:6px; font-size:13px; width:110px; background: var(--input); color: var(--ink); }
.group-items { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.chip { display:inline-flex; align-items:center; gap:6px; border:1px solid var(--line); background: var(--panel); border-radius:999px; padding:3px 10px; font-size:12.5px; font-family:var(--mono); }
.link-btn { background:none; border:none; color:var(--accent); cursor:pointer; font-size:12px; padding:0; text-decoration:underline; }
.std-group-tag { display:inline-block; margin-top:4px; font-size:11.5px; color:var(--warn-ink); background:rgba(251,191,36,.12); border-radius:999px; padding:1px 8px; }
.std-group-tag.off { color:var(--muted); background:var(--bg-soft); }
.mini-select { padding:5px 8px; border:1px solid var(--line); border-radius:7px; font-size:13px; background: var(--input); color: var(--ink); }
.std-toolbar-ops { display:inline-flex; gap:6px; align-items:center; flex-wrap:wrap; }
@media (max-width:640px) { .group-ops { margin-left:0; } .std-toolbar-ops { margin-top:6px; } }

/* ===== 移动端滚动稳定（防止动态更新时被顶回顶部） ===== */
html { overflow-anchor: auto; }
.batch-box { min-height: 64px; }
.batch-results { min-height: 28px; }
#prizeVerifyResult { min-height: 2px; }

/* ===== 管理接管：锁主弹窗 + 被占用页申请区 ===== */
/* 注意：modal-mask 必须默认 display:none，用 .show 类显隐。
   若写成 display:flex 会覆盖 HTML 的 hidden 属性 → 弹窗永远可见（曾因此误报"有人申请接管"）。 */
.modal-mask { position: fixed; inset: 0; background: rgba(8, 12, 20, .55); z-index: 200;
  display: none; align-items: center; justify-content: center; padding: 16px; }
.modal-mask.show { display: flex; }
/* 全局保险：任何带 hidden 属性的元素优先隐藏，防止被其他 display 规则覆盖 */
[hidden] { display: none !important; }
.modal { width: min(460px, 100%); background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 24px; box-shadow: 0 18px 50px rgba(0,0,0,.35); }
.modal h3 { margin: 0 0 6px; font-size: 17px; }
.tk-info { margin: 12px 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.tk-info > div { display: flex; padding: 8px 12px; font-size: 13.5px; border-bottom: 1px solid var(--line-soft); }
.tk-info > div:last-child { border-bottom: none; }
.tk-info span { width: 90px; color: var(--muted); font-size: 12.5px; }
.tk-msg { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--bg-soft);
  font-size: 13.5px; border-left: 3px solid var(--accent); word-break: break-word; }
.modal textarea, .takeover-box textarea, .takeover-box input[type=text] {
  width: 100%; box-sizing: border-box; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 14px; background: var(--input); color: var(--ink);
  font-family: inherit; resize: vertical; }
.modal textarea:focus, .takeover-box textarea:focus, .takeover-box input[type=text]:focus {
  outline: none; border-color: var(--accent); }
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.tk-hint { margin: 12px 0 0; font-size: 13.5px; }
.takeover-box { margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 14px; }
.takeover-box .toast-err { margin: 8px 0 0; font-size: 13px; }
.ok-text { margin: 8px 0 0; font-size: 13.5px; color: var(--ok-ink); background: var(--ok-bg);
  border: 1px solid var(--ok-line); border-radius: 10px; padding: 9px 12px; }
