:root {
  --bg: #F6F7F9;
  --surface: #FFFFFF;
  --ink: #16191F;
  --muted: #5B6270;
  --line: #E3E6EB;
  --line-strong: #D3D7DE;
  --accent: #0F766E;
  --accent-ink: #0B5953;
  --nav: #16191F;
  --nav-item: #262A33;
  --nav-muted: #B4BAC5;
  --ok-bg: #E8F5EC; --ok: #166534;
  --wait-bg: #FDF3E2; --wait: #92400E;
  --info-bg: #E8EEFD; --info: #1E40AF;
  --bad-bg: #FCEAEA; --bad: #991B1B;
  --danger: #B91C1C;
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Hiragino Sans GB", system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 14px; }
a { color: var(--accent); }
a:hover { color: var(--accent-ink); }
button, input { font-family: inherit; font-size: 14px; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }

/* 布局 */
.shell { min-height: 100vh; display: flex; flex-wrap: wrap; align-items: stretch; }
.nav { flex: 1 1 220px; max-width: 100%; background: var(--nav); color: #E7E9ED; padding: 24px 16px; display: flex; flex-direction: column; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; font-weight: 700; font-size: 16px; color: #fff; }
.brand-mark { width: 28px; height: 28px; border-radius: 7px; background: var(--accent); display: flex; align-items: center; justify-content: center; }
.nav-links { display: flex; flex-direction: column; gap: 4px; }
.nav-links a { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 8px; color: var(--nav-muted); text-decoration: none; font-size: 14px; }
.nav-links a:hover { color: #fff; }
.nav-links a.active { background: var(--nav-item); color: #fff; font-weight: 500; }
.nav-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.ip-box { padding: 12px; border-radius: 8px; background: #20242C; font-size: 12px; color: var(--nav-muted); display: flex; flex-direction: column; gap: 4px; }
.ip-box .mono { color: #fff; font-size: 13px; }
.nav-foot button { background: none; border: 1px solid #333844; color: var(--nav-muted); border-radius: 8px; height: 38px; cursor: pointer; }
.nav-foot button:hover { color: #fff; }
#voice-toggle { display: flex; align-items: center; justify-content: center; gap: 8px; }
#voice-toggle.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #DC2626; color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.hidden { display: none !important; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.live i { width: 8px; height: 8px; border-radius: 50%; background: #9CA3AF; }
.live.on i { background: #16A34A; box-shadow: 0 0 0 3px #DCFCE7; }
tr.new td { animation: flash 2.5s ease-out; }
@keyframes flash { from { background: #FEF3C7; } to { background: transparent; } }
.toast.visit { background: var(--accent); }
.view { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.alert-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 18px; border-radius: 10px; background: #B91C1C; color: #fff; line-height: 1.6; }
.alert-bar .alert-text { flex: 1 1 320px; min-width: 0; }
.alert-bar b { font-size: 15px; }
.alert-bar .mono { font-weight: 500; }
.alert-bar button, .alert-bar a { height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid rgba(255,255,255,.55); background: transparent; color: #fff; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; text-decoration: none; }
.alert-bar button.solid { background: #fff; color: #B91C1C; border-color: #fff; font-weight: 500; }
.alert-bar.ringing { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { background: #7F1D1D; } }
@media (prefers-reduced-motion: reduce) { .alert-bar.ringing, tr.new td { animation: none; } }
.sub-reason { font-size: 12px; color: var(--danger); margin-top: 4px; white-space: normal; max-width: 320px; }
.toggle-row { display: flex; flex-direction: column; gap: 10px; }

/* 审核控制台：表格 ID | 用户已提交数据 | 操作 | 操作员 */
.rv-table { width: 100%; border-collapse: collapse; }
.rv-table td { vertical-align: middle; }
.rv-table tbody tr { animation: flash 2.5s ease-out; }
.rv-id { font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.rv-cells { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-start; }
.rv-cell { display: inline-flex; flex-direction: column; gap: 5px; max-width: 100%; }
.rv-k { color: var(--muted); font-size: 12px; font-family: var(--mono); }
.rv-v { font-weight: 700; font-variant-numeric: tabular-nums; word-break: break-all; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; }
.rv-sub { font-size: 11px; color: var(--muted); margin-top: 6px; }
.rv-tablebox { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.rv-tablebox .rv-table th:first-child, .rv-tablebox .rv-table td:first-child { padding-left: 16px; }
.rv-tablebox .rv-table th:last-child, .rv-tablebox .rv-table td:last-child { padding-right: 16px; }
.rv-opcell { white-space: nowrap; }
/* 操作：完成按钮 + 悬停/点击下拉 */
.op { position: relative; display: inline-block; }
.op-btns { display: flex; }
.opbtn.done { display: flex; flex-direction: column; align-items: center; width: 120px; padding: 7px 0; border: none; border-radius: 8px 0 0 8px; background: var(--accent); color: #fff; font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer; line-height: 1.2; }
.opbtn.done small { font-size: 11px; font-weight: 400; opacity: .85; margin-top: 2px; }
.opbtn.done:hover { background: var(--accent-ink); }
.opcaret { width: 30px; border: none; border-left: 1px solid rgba(255,255,255,.25); border-radius: 0 8px 8px 0; background: var(--accent); color: #fff; font-size: 13px; cursor: pointer; }
.opcaret:hover { background: var(--accent-ink); }
.op-pop { position: absolute; top: calc(100% + 6px); right: 0; min-width: 190px; background: var(--surface); border: 1px solid var(--line2); border-radius: 10px; box-shadow: 0 10px 30px rgba(16,25,40,.18); padding: 6px; display: none; z-index: 20; }
.op:hover .op-pop, .op.open .op-pop { display: block; }
.op-opt { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 9px 10px; border: none; background: none; border-radius: 7px; font-family: inherit; font-size: 14px; color: var(--ink); cursor: pointer; }
.op-opt small { color: var(--muted); font-size: 12px; margin-left: auto; }
.op-opt:hover { background: var(--bg); }
.op-reqbox { padding: 6px; }
.op-reason { width: 100%; height: 38px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--line2); background: var(--surface); color: var(--ink); font-family: inherit; font-size: 14px; }
.rv-operator { font-weight: 600; color: var(--danger); }
.rv-done { margin-top: 4px; }
.rv-done > summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--muted); padding: 6px 0; list-style-position: inside; }
.rv-done > summary:hover { color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .rv-table tbody tr { animation: none; } }
.main { flex: 999 1 560px; min-width: 0; padding: 32px 40px; display: flex; flex-direction: column; gap: 24px; }
@media (max-width: 700px) { .main { padding: 20px 16px; } }

.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.page-head h1 { margin: 0; font-size: 24px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

/* 按钮 */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 500; cursor: pointer; }
.btn:hover { border-color: #B9BEC8; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.sm { height: 36px; padding: 0 14px; font-size: 13px; font-weight: 400; }
.btn.xs { height: 32px; padding: 0 10px; font-size: 12px; font-weight: 400; border-radius: 6px; }
.btn.danger { color: var(--danger); border-color: #F0CACA; }
.btn:disabled { opacity: .5; cursor: default; }
.link-btn { background: none; border: none; height: 32px; padding: 0 10px; font-size: 13px; color: var(--accent); cursor: pointer; }
.link-btn.danger { color: var(--danger); }

/* 卡片 */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 24px; display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.split { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.theme-list { flex: 1 1 280px; display: flex; flex-direction: column; gap: 12px; }
.theme-detail { flex: 999 1 520px; }
.section-label { font-size: 13px; font-weight: 500; color: var(--muted); }
.theme-item { text-align: left; display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: inherit; cursor: pointer; width: 100%; }
.theme-item.active { border: 2px solid var(--accent); padding: 13px; }
.theme-thumb { width: 64px; height: 44px; border-radius: 6px; flex-shrink: 0; overflow: hidden; background: #DCE7E5; position: relative; }
.theme-item .t-name { font-size: 15px; font-weight: 500; }
.theme-item .t-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }

.detail-top { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.preview-frame { width: 240px; height: 150px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); flex-shrink: 0; position: relative; background: #fff; }
.preview-frame iframe { width: 1280px; height: 800px; border: 0; transform: scale(.1875); transform-origin: 0 0; pointer-events: none; }
.detail-info { flex: 1 1 240px; display: flex; flex-direction: column; gap: 8px; }
.detail-info h2 { margin: 0; font-size: 20px; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.check { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

h3 { margin: 0; font-size: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 280px; }
.field label { font-size: 13px; color: var(--muted); }
.input { height: 44px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-strong); color: var(--ink); background: #fff; width: 100%; }
.input:focus, .btn:focus-visible, .theme-item:focus-visible, .link-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.form-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.hint { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 8px; background: #EEF5F4; font-size: 13px; color: #1F3F3C; line-height: 1.6; }

/* 表格 */
.table-box { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; }
th { background: var(--bg); text-align: left; color: var(--muted); font-size: 12px; font-weight: 500; padding: 10px 16px; white-space: nowrap; }
td { padding: 14px 16px; border-top: 1px solid var(--line); white-space: nowrap; }
td.right, th.right { text-align: right; }
.empty { padding: 32px 16px; text-align: center; color: var(--muted); }

.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.wait { background: var(--wait-bg); color: var(--wait); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.primary-tag { font-size: 12px; font-weight: 500; color: var(--accent); }

/* 统计 */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.stat span:first-child { font-size: 13px; color: var(--muted); }
.stat b { font-size: 28px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: #fff; color: var(--ink); cursor: pointer; font-size: 13px; }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* 弹窗 */
dialog { border: none; border-radius: 14px; padding: 0; width: min(480px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(22,25,31,.5); }
.dialog-body { padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.dialog-body h2 { margin: 0; font-size: 20px; }
.drop { border: 2px dashed var(--line-strong); border-radius: 10px; padding: 28px 16px; text-align: center; color: var(--muted); cursor: pointer; line-height: 1.7; }
.drop.over { border-color: var(--accent); background: #EEF5F4; }
.drop b { color: var(--ink); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* 提示条 */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 14px; z-index: 100; max-width: calc(100vw - 32px); }
.toast.err { background: var(--danger); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 登录页 */
.login-page { min-height: 100vh; background: var(--nav); display: flex; align-items: center; justify-content: center; padding: 48px 16px; }
.login-wrap { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 24px; }
.login-wrap .brand { justify-content: center; font-size: 18px; }
.login-card { background: #fff; border-radius: 14px; padding: 32px; display: flex; flex-direction: column; gap: 18px; }
.login-card h1 { margin: 0; font-size: 22px; }
.login-card .field { flex: none; }
.login-err { color: var(--danger); font-size: 13px; min-height: 18px; }
