:root {
    --ink: #173a43;
    --ink-soft: #47656b;
    --muted: #71878b;
    --surface: #ffffff;
    --surface-soft: #f3f6f6;
    --line: #d8e2e2;
    --brand: #167c78;
    --brand-dark: #0c5d5b;
    --accent: #d68645;
    --danger: #a84646;
    --success: #27785b;
    --shadow: 0 18px 50px rgba(23, 58, 67, .08);
    --radius: 7px;
}

* { box-sizing: border-box; }
/* 滚动条处理分两层：
   1) html 永久预留滚动条沟槽（scrollbar-gutter）：PJAX 换页时页面高矮不一、
      开合弹层锁定滚动时，内容区宽度都保持不变；
   2) body.scroll-locked（app.js 的 lockScroll 在锁定滚动时挂上）配合旧浏览器兜底：
      不支持 scrollbar-gutter 的浏览器里滚动条消失仍会撑宽内容区，JS 实测后补等宽
      padding。两层职责分离，互不重复补偿。 */
html { background: #edf2f1; scrollbar-gutter: stable; }
body.scroll-locked { overflow: hidden; }
body { margin: 0; color: var(--ink); background: #f8faf9; font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; }
a { color: var(--brand-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand); }
button, input, select, textarea { font: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(214, 134, 69, .45); outline-offset: 2px; }
/* 触控目标消除双击缩放延迟；文本输入框保留系统双击放字行为，不列入。 */
a, button, summary, .tag-choice, .checkbox-label { touch-action: manipulation; }
.shell { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 750; text-decoration: none; letter-spacing: .02em; }
/* 品牌名不允许折行：与导航互相挤压时曾折成「海鲜黑名/单」两行。 */
.brand span:last-child { white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 31px; height: 31px; color: white; background: var(--brand); border-radius: 6px; font-size: 15px; }
/* 自定义站点 LOGO：与默认徽标同尺寸同圆角，contain 保持任意比例不裁切。 */
.brand-logo { display: block; width: 31px; height: 31px; object-fit: contain; border-radius: 6px; }
/* flex-wrap：自定义导航链接最多 8 条，加固定入口后窄屏放不下时优雅折行而非溢出裁切。 */
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; font-size: 14px; }
.nav a { text-decoration: none; font-weight: 600; }
.nav-quiet { color: var(--muted); }
.inline-form { display: inline; }
.link-button { border: 0; padding: 0; color: var(--brand-dark); background: transparent; cursor: pointer; font-weight: 600; }
.link-button:hover { color: var(--brand); }
.main-content { min-height: calc(100vh - 210px); padding-top: 52px; padding-bottom: 72px; }
/* 跳转链接与 PJAX 换页会把焦点移到 main 容器本身；容器非交互控件，不绘制焦点环。 */
.main-content:focus { outline: none; }
.hero-strip { max-width: 720px; margin-bottom: 30px; }
.eyebrow, .section-kicker { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-size: 3.1rem; line-height: 1.14; letter-spacing: 0; text-wrap: balance; }
h2 { margin-bottom: 8px; font-size: 1.25rem; line-height: 1.25; text-wrap: balance; }
.hero-strip p, .page-heading p { max-width: 620px; color: var(--ink-soft); font-size: 18px; }
.tool-panel, .auth-panel, .install-panel, .detail-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.tool-panel { padding: 30px; }
.query-panel { margin-bottom: 38px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.form-grid { display: grid; gap: 16px; }
.five-columns { grid-template-columns: repeat(5, 1fr); }
.two-columns { grid-template-columns: repeat(2, 1fr); }
label { display: grid; gap: 6px; color: var(--ink-soft); font-size: 14px; font-weight: 650; }
label small, .form-note, .muted { color: var(--muted); font-size: 13px; font-weight: 400; }
input, select, textarea { width: 100%; min-height: 44px; padding: 9px 12px; color: var(--ink); border: 1px solid #c8d5d5; border-radius: 5px; background: #fff; }
textarea { resize: vertical; }
input:disabled, textarea:disabled { background: #f3f6f6; color: var(--muted); }
.query-actions { display: flex; align-items: center; gap: 12px; margin-top: 22px; }
.query-actions .form-note { margin: 0; }
/* 按钮统一 inline-flex 双轴居中：<a class="button"> 没有原生按钮的 text-align:center，
   拉伸/铺开后文字会偏左（插件卡「管理」按钮曾如此）；此规则让锚点按钮与原生按钮行为一致。
   nowrap：按钮文字不允许折行——窄表格单元格里按钮曾被压到 70px 宽而折成两行、高度翻倍；
   line-height:1.2：覆盖全局 1.65 行高，使各断点高度严格等于 min-height（44/38/36、小按钮 34/30/28）。 */
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 9px 18px; border: 1px solid transparent; border-radius: 5px; cursor: pointer; font-weight: 750; text-align: center; white-space: nowrap; line-height: 1.2; }
.button:disabled { cursor: not-allowed; opacity: .6; }
.button-primary { color: white; background: var(--brand); }
.button-primary:hover:not(:disabled) { background: var(--brand-dark); }
.button-secondary { color: var(--ink); border-color: var(--line); background: white; text-decoration: none; }
.button-secondary:hover:not(:disabled) { background: #f3f6f6; border-color: #c8d5d5; }
.button-full { width: 100%; margin-top: 8px; }
.form-note { margin: 18px 0 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
/* 键盘跳转链接：平时移出屏幕，获得焦点时落回视口左上角。 */
.skip-link { position: fixed; top: -100px; left: 14px; z-index: 200; padding: 10px 18px; color: white; background: var(--brand-dark); border-radius: 6px; font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 12px; }
.info-grid, .dashboard-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.info-grid { padding: 38px 4px 0; }
.info-grid > div { border-top: 2px solid var(--line); padding-top: 15px; }
.info-grid p { margin-bottom: 0; color: var(--ink-soft); font-size: 14px; }
.info-number { color: var(--accent); font: 800 13px/1 monospace; }
.site-footer { border-top: 1px solid var(--line); background: #edf2f1; }
.site-footer .shell { padding: 22px 0; }
.footer-bottom { display: flex; justify-content: center; align-items: center; gap: 8px 18px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.footer-bottom a { color: var(--muted); text-decoration: none; }
.footer-bottom a:hover { color: var(--brand-dark); }
.results-section { margin-bottom: 42px; }
.results-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.result-list { display: grid; gap: 12px; }
.result-card { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 22px 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.result-card h3 { margin: 0 0 6px; font-size: 1.08rem; line-height: 1.35; }
.result-card h3 a { text-decoration: none; }
.result-card p { max-width: 680px; margin: 0; color: var(--ink-soft); font-size: 14px; }
.result-meta { display: grid; justify-items: end; gap: 10px; min-width: 180px; color: var(--muted); font-size: 12px; text-align: right; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.result-meta .tag-list { justify-content: flex-end; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; color: #20535a; background: #e2f0ef; font-size: 12px; font-weight: 700; white-space: nowrap; max-width: 9em; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.tag-default { color: var(--muted); background: #edf1f1; }
.empty-state { padding: 28px; border: 1px dashed #bfd0d0; border-radius: var(--radius); color: var(--ink-soft); background: #fbfdfc; }
.empty-state strong { display: block; margin-bottom: 6px; color: var(--ink); }
.empty-state p { margin: 0; font-size: 14px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 22px; }
.page-current { display: grid; place-items: center; min-width: 34px; height: 34px; padding: 0 7px; border-radius: 4px; text-decoration: none; font-size: 14px; color: white; background: var(--brand); font-weight: 800; font-variant-numeric: tabular-nums; }
.notice { margin-bottom: 22px; padding: 12px 15px; border-left: 3px solid; border-radius: 3px; font-size: 14px; }
.notice-success { color: #205f48; border-color: var(--success); background: #edf8f2; }
.notice-error { color: #883b3b; border-color: var(--danger); background: #fdf0f0; }
.notice-info { color: var(--ink-soft); border-color: var(--brand); background: #eef7f6; }
/* ---- 全局轻提示（toast）：JS 挂载到 body 的 .toast-region；服务端种子 .toast-seed 默认隐藏，
   无 JS 环境由 layout 的 <noscript> 样式兜底显示为横条。z-index 高于弹窗/灯箱/进度条，低于键盘跳转链接。 ---- */
.toast-region { position: fixed; top: calc(80px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 150; display: flex; flex-direction: column; align-items: center; width: min(420px, calc(100% - 32px)); pointer-events: none; }
.toast { width: 100%; margin-bottom: 10px; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); box-shadow: 0 12px 32px rgba(23, 58, 67, .16); pointer-events: auto; transition: opacity .24s ease, transform .24s ease, height .24s ease, margin-bottom .24s ease; }
.toast-inner { display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px 11px 14px; border-left: 3px solid var(--line); }
.toast-error .toast-inner { border-left-color: var(--danger); }
.toast-success .toast-inner { border-left-color: var(--success); }
.toast-info .toast-inner { border-left-color: var(--brand); }
.toast-text { flex: 1; color: var(--ink); font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.toast-close { flex: 0 0 auto; border: 0; padding: 0 2px; background: transparent; color: var(--muted); font-size: 18px; line-height: 1.2; cursor: pointer; }
.toast-close:hover { color: var(--ink); }
/* 出现：自上方滑入并淡入（app.js 挂 is-entering 后强制回流再移除以触发过渡）；关闭：上浮淡出，高度与间距由 JS 收拢。 */
.toast.is-entering { opacity: 0; transform: translateY(-14px); }
.toast.is-closing { opacity: 0; transform: translateY(-10px); }
.toast-seed { display: none; }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }
.auth-wrap { display: grid; place-items: start center; }
.auth-panel { width: min(100%, 470px); padding: 34px; }
.auth-panel h1 { font-size: 2.2rem; }
.auth-panel form { display: grid; gap: 17px; margin-top: 24px; }
.auth-footer { margin: 24px 0 0; color: var(--muted); text-align: center; font-size: 14px; }
.captcha-row { display: flex; align-items: center; gap: 10px; }
.captcha-row input { flex: 1 1 auto; min-width: 0; }
.captcha-row .captcha-image { flex: 0 0 auto; width: 140px; height: 48px; display: block; border: 1px solid #c8d5d5; border-radius: 5px; background: #fff; cursor: pointer; }
.captcha-refresh { flex: 0 0 auto; min-height: 44px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--ink-soft); font-size: 13px; font-weight: 650; cursor: pointer; }
.captcha-refresh:hover { background: #f3f6f6; }
.field-error { color: var(--danger); font-size: 13px; }
.page-heading { margin-bottom: 28px; }
/* 详情页阅读列：页头与内容面板同宽居中，避免宽屏下整体偏左。 */
.detail-heading, .detail-panel, .back-link { max-width: 860px; margin-left: auto; margin-right: auto; }
.detail-heading h1 { font-size: 2.35rem; }
.detail-panel { padding: 30px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px 24px; padding-bottom: 18px; color: var(--muted); border-bottom: 1px solid var(--line); font-size: 13px; }
.detail-block { padding: 24px 0; border-bottom: 1px solid #edf1f1; }
.detail-block:last-child { padding-bottom: 0; border-bottom: 0; }
.detail-block h2 { margin-bottom: 12px; font-size: 1.05rem; }
.detail-description { margin: 0; color: var(--ink-soft); white-space: normal; }
.back-link { margin-top: 22px; }
/* 举报表单页与详情页同规则：阅读宽度居中。 */
.report-panel { max-width: 900px; margin-left: auto; margin-right: auto; }
.address-fieldset, .tag-fieldset, .upload-fieldset { margin: 0; padding: 20px; border: 1px solid var(--line); border-radius: 5px; }
.address-fieldset legend, .tag-fieldset legend, .upload-fieldset legend { padding: 0 7px; color: var(--ink-soft); font-size: 14px; font-weight: 700; }
.tag-choice-list { display: flex; flex-wrap: wrap; gap: 10px; }
.tag-choice { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; color: var(--ink); border: 1px solid color-mix(in srgb, var(--tag-color) 60%, var(--line)); border-radius: 999px; background: color-mix(in srgb, var(--tag-color) 35%, white); cursor: pointer; }
.tag-choice input { width: 17px; min-height: 17px; accent-color: var(--brand); }
.tag-choice:has(input:checked) { box-shadow: 0 0 0 2px rgba(22, 124, 120, .16); }
.report-actions { display: flex; align-items: center; gap: 14px; }
/* 举报提交按钮与旁边 13px 状态说明同排，沿用 44px 大按钮会显得突兀，单独收小一档。 */
.report-actions .button { min-height: 38px; padding: 7px 16px; font-size: 14px; }
.evidence-upload-list { display: grid; gap: 10px; margin-top: 16px; }
.evidence-item { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 5px; background: #fbfdfc; }
.evidence-item img { width: 78px; height: 58px; object-fit: cover; border-radius: 4px; background: #edf2f1; }
.evidence-item-info { display: grid; flex: 1; gap: 3px; min-width: 0; }
.evidence-item-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.upload-state { color: var(--muted); font-size: 13px; }
.upload-state[data-state="success"] { color: var(--success); }
.upload-state[data-state="error"] { color: var(--danger); }
.evidence-item progress { width: 100%; height: 8px; accent-color: var(--brand); }
.submission-confirmation { max-width: 760px; }
.dashboard-grid { margin-bottom: 28px; }
.metric { padding: 20px; border-top: 3px solid var(--brand); background: white; box-shadow: var(--shadow); }
.metric-link { display: block; color: inherit; text-decoration: none; }
.metric-link:hover { border-top-color: var(--accent); color: inherit; }
.metric-neutral { border-top-color: var(--line); }
.metric span, .metric small { display: block; color: var(--muted); font-size: 13px; }
.metric strong { display: block; margin: 6px 0; font-size: 1.35rem; }
.admin-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 28px; align-items: start; }
.admin-sidebar { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--line); background: #fff; position: sticky; top: 18px; }
.admin-sidebar-title { padding: 8px 10px 12px; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.admin-sidebar a { padding: 9px 10px; color: var(--ink-soft); border-left: 3px solid transparent; text-decoration: none; font-size: 14px; font-weight: 700; }
.admin-sidebar a:hover, .admin-sidebar a.is-active { color: var(--brand-dark); border-left-color: var(--brand); background: #eef7f6; }
.admin-content { min-width: 0; }
.admin-heading { margin-bottom: 22px; }
.admin-metrics { grid-template-columns: repeat(4, 1fr); }
.admin-overview-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.admin-quick-panel { box-shadow: none; }
.admin-actions, .admin-form-actions, .table-actions, .tag-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.admin-filter { display: flex; align-items: end; gap: 12px; margin-bottom: 18px; padding: 18px; box-shadow: none; }
.admin-filter label { flex: 1; }
.admin-table-wrap { overflow-x: auto; border: 1px solid var(--line); background: #fff; }
.admin-table { width: 100%; min-width: 860px; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td { padding: 13px 14px; border-bottom: 1px solid #edf1f1; text-align: left; vertical-align: top; }
.admin-table th { color: var(--muted); background: #f8faf9; font-size: 12px; font-weight: 800; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.table-note, .table-time { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.button-small { min-height: 34px; padding: 5px 10px; font-size: 12px; }
.button-danger { color: white; background: var(--danger); }
.button-danger:hover:not(:disabled) { background: #853737; }
.status-pill { display: inline-block; padding: 3px 8px; border-radius: 4px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.status-pending { color: #8d5c35; background: #fff3e5; }
.status-approved { color: #205f48; background: #edf8f2; }
.status-rejected { color: #883b3b; background: #fdf0f0; }
.settings-form, .admin-create-panel { display: grid; gap: 22px; }
.settings-form fieldset { margin: 0; padding: 18px; border: 1px solid var(--line); }
.settings-form legend { padding: 0 7px; color: var(--ink-soft); font-weight: 800; }
/* LOGO 字段：与 label 同风格（说明文字 + 控件 + 提示），跨满两列表单整行。 */
.logo-field { grid-column: 1 / -1; display: grid; gap: 6px; color: var(--ink-soft); font-size: 14px; font-weight: 650; }
.logo-field-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.logo-field-controls input[type="file"] { flex: 1 1 220px; min-width: 0; }
.logo-field .form-note { margin: 0; }
.logo-preview { flex: 0 0 auto; width: 48px; height: 48px; padding: 3px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
/* 导航栏自定义链接行：文字 1fr / 地址 2fr / 删除按钮 auto，窄屏改单列堆叠。 */
.nav-link-rows { display: grid; gap: 10px; margin-bottom: 12px; }
.nav-link-row { display: grid; grid-template-columns: 1fr 2fr auto; gap: 10px; align-items: center; }
.settings-checks { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 18px; }
.three-columns { grid-template-columns: repeat(3, 1fr); }
.inline-edit-form { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.inline-edit-form label { flex: 1 1 150px; }
.tag-admin-list { display: grid; gap: 12px; margin-top: 18px; }
.tag-admin-item { padding: 18px; box-shadow: none; }
.tag-admin-item.is-deleted { opacity: .7; }
.tag-preview { padding-top: 10px; border-top: 1px solid #edf1f1; }
.admin-report-panel, .admin-evidence-panel { margin-bottom: 18px; }
/* 审核操作面板（详情页底部）：驳回原因独占首行，通过/驳回两按钮同一行在其下（天然对齐），
   桌面/小屏同构，无需断点差异。两个按钮分属不同表单（各自携带 CSRF 与目标动作），
   form 用 display:contents 把内部控件提升为容器（.admin-actions 已是 flex-wrap）的
   flex item 实现跨表单排列——隐藏域 display:none 不占位，按钮的表单归属、
   data-unsaved-guard 的 closest() 命中与提交行为均不受影响（display:contents 只影响布局盒）。
   label 用 order:-1 排到最前并 flex-basis:100% 独占首行，两按钮自然落入第二行；
   单按钮状态（重新送审/删除记录）没有 label，按钮独占一行，无空行。
   按钮降一档 38px：面板内是行内操作而非主提交，与 .report-actions .button 同规格。 */
.admin-action-panel .admin-actions > form { display: contents; }
.admin-action-panel .reject-form label { order: -1; flex: 1 1 100%; min-width: 0; }
.admin-action-panel .button { min-height: 38px; padding: 7px 16px; font-size: 14px; }
.evidence-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.evidence-card { margin: 0; overflow: hidden; border: 1px solid var(--line); background: #fbfdfc; }
.evidence-card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #edf2f1; }
.evidence-card figcaption { padding: 8px; overflow-wrap: anywhere; font-size: 12px; }
.public-evidence-grid { max-width: 760px; }
.audit-filter label:first-child { flex: 0 1 220px; }
.audit-table { min-width: 1040px; }
.audit-code { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.audit-details { margin-top: 5px; }
.audit-details summary { color: var(--brand-dark); cursor: pointer; font-size: 12px; font-weight: 700; }
.audit-details pre, .audit-user-agent { max-width: 430px; margin: 7px 0 0; padding: 9px; overflow: auto; color: var(--ink-soft); background: var(--surface-soft); font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; white-space: pre-wrap; }
.audit-summary { display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; }
.audit-summary li { display: flex; gap: 8px; align-items: baseline; margin: 0; }
.audit-field { flex: 0 0 auto; color: var(--muted); font-size: 12px; font-weight: 700; }
.audit-value { min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
.audit-old { color: var(--muted); }
.audit-arrow { margin: 0 5px; color: var(--muted); }
.audit-new { font-weight: 800; }
.site-announcement { margin-bottom: 20px; }
.install-layout { max-width: 820px; margin: 0 auto; }
.install-panel { padding: 30px; }
.install-panel form { display: grid; gap: 18px; }
.install-panel h2 { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.install-panel h2:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.requirement-list { display: grid; gap: 8px; padding: 0; margin: 0 0 22px; list-style: none; }
.requirement-list li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #edf1f1; color: var(--ink-soft); font-size: 14px; }
.requirement-pass { color: var(--success); }
.requirement-fail { color: var(--danger); }
.checkbox-label { display: flex; align-items: center; gap: 8px; }
.checkbox-label input { width: 18px; min-height: 18px; }
.error-page { padding: 70px 0; text-align: center; }
.error-code { color: var(--accent); font: 800 15px monospace; letter-spacing: .12em; }
.error-page p { color: var(--ink-soft); }
@media (max-width: 900px) {
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar { position: static; display: flex; overflow-x: auto; gap: 2px; }
    .admin-sidebar-title { display: none; }
    .admin-sidebar a { white-space: nowrap; border-left: 0; border-bottom: 3px solid transparent; }
    .admin-sidebar a:hover, .admin-sidebar a.is-active { border-bottom-color: var(--brand); border-left-color: transparent; }
    .admin-metrics { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
    .shell { width: min(100% - 28px, 620px); }
    .main-content { padding-top: 34px; }
    /* wrap：窄屏品牌与导航放不下一行时各占一行，避免互相挤压导致品牌折行。 */
    .header-inner { min-height: 64px; flex-wrap: wrap; row-gap: 8px; }
    /* gap 简写为「行 列」：导航链接折行后行距收紧，列距不变。 */
    .nav { gap: 4px 13px; }
    /* 小屏整体降一档：按钮 44→38px、字号 16→14px；行内小按钮 34→30px。
       输入框保留 44px 触控高度不缩。 */
    .button { min-height: 38px; padding: 7px 14px; font-size: 14px; }
    .button-small { min-height: 30px; padding: 4px 9px; font-size: 12px; }
    /* 后台表格降密度：字号与单元格内距收紧，横向滚动阈值从 860px 降到 620px。 */
    .admin-table { min-width: 620px; font-size: 13px; }
    .admin-table th, .admin-table td { padding: 10px 11px; }
    .audit-table { min-width: 760px; }
    .five-columns, .info-grid, .dashboard-grid, .admin-overview-grid { grid-template-columns: 1fr 1fr; }
    .five-columns label:last-child { grid-column: span 2; }
    .tool-panel, .auth-panel, .install-panel, .detail-panel { padding: 22px; }
    .result-card { flex-direction: column; gap: 14px; padding: 18px 22px; }
    .result-meta { justify-items: start; min-width: 0; text-align: left; }
    .result-meta .tag-list { justify-content: flex-start; }
    .nav-link-row { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    /* 手机再降一档：按钮 36px、面板/卡片内距收紧，把宽度留给内容。 */
    .button { min-height: 36px; padding: 6px 12px; }
    .button-small { min-height: 28px; padding: 3px 8px; }
    .tool-panel, .auth-panel, .install-panel, .detail-panel { padding: 18px; }
    .result-card { padding: 14px 16px; }
    .admin-metrics, .three-columns { grid-template-columns: 1fr; }
    .admin-filter { align-items: stretch; flex-direction: column; }
    .admin-filter .button { width: 100%; }
    .inline-edit-form { align-items: stretch; flex-direction: column; }
    .inline-edit-form label { width: 100%; }
    .brand span:last-child { font-size: 14px; }
    .nav a:first-child { display: none; }
    .five-columns, .two-columns, .info-grid, .dashboard-grid { grid-template-columns: 1fr; }
    .five-columns label:last-child { grid-column: auto; }
    .query-actions { align-items: stretch; flex-direction: column; }
    .query-actions .button { width: 100%; }
    .pagination { gap: 6px; }
    .captcha-row { flex-wrap: wrap; }
    .captcha-row input { flex-basis: 100%; }
    .captcha-row .captcha-image { flex: 1 1 auto; width: auto; }
    .report-actions, .evidence-item { align-items: stretch; flex-direction: column; }
    .evidence-item .button { width: 100%; }
    h1 { font-size: 2.25rem; }
}

/* ============ 扩展管理：插件卡片（桌面横排，窄屏自动折行） ============ */
.ext-list { display: grid; gap: 16px; }
.ext-card { padding: 20px 22px; }
.ext-card-head { display: flex; align-items: flex-start; gap: 14px; }
.ext-avatar { flex: 0 0 auto; display: grid; place-items: center; width: 44px; height: 44px; color: var(--ink-soft); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 9px; font-size: 17px; font-weight: 800; }
.ext-card.is-enabled .ext-avatar { color: white; background: var(--brand); border-color: var(--brand); }
.ext-card-info { flex: 1 1 auto; min-width: 0; }
.ext-card-title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ext-card-title strong { font-size: 15px; font-weight: 800; }
.ext-card-meta { margin-top: 3px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.ext-card-desc { max-width: 900px; margin: 12px 0 0; color: var(--ink-soft); font-size: 14px; }
/* form 设为 contents：两枚操作按钮直接参与本行 flex，与桌面端右对齐、窄屏端等宽铺开共用一套 gap。 */
.ext-card-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.ext-card-actions form { display: contents; }
@media (max-width: 760px) {
    .ext-card-head { flex-wrap: wrap; }
    .ext-card-actions { width: 100%; }
    .ext-card-actions .button { flex: 1 1 auto; }
}
@media (max-width: 480px) {
    .ext-card { padding: 18px 16px; }
}

/* ============ 查询结果弹窗（无刷新查询） ============ */
.modal-overlay {
    position: fixed; inset: 0; z-index: 50;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    background: rgba(23, 58, 67, .45);
    animation: modal-fade .18s ease-out;
}
.modal-overlay[hidden] { display: none; }
/* 关闭动效：JS 挂 is-closing 反向播放（见 app.js closeModal），播完才置 hidden 真正隐藏。 */
.modal-overlay.is-closing { animation: modal-fade-out .16s ease-in forwards; }
.modal-overlay.is-closing .modal-sheet { animation: modal-drop .16s ease-in forwards; }
@keyframes modal-fade { from { opacity: 0; } }
@keyframes modal-fade-out { to { opacity: 0; } }
@keyframes modal-rise { from { opacity: 0; transform: translateY(14px) scale(.985); } }
@keyframes modal-drop { to { opacity: 0; transform: translateY(10px) scale(.985); } }

.modal-sheet {
    display: flex; flex-direction: column;
    width: min(720px, 100%); max-height: min(82vh, 720px);
    background: var(--surface); border-radius: var(--radius);
    box-shadow: 0 30px 80px rgba(23, 58, 67, .35);
    overflow: hidden;
    animation: modal-rise .22s ease-out;
}
.modal-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
    padding: 18px 32px 14px;
    border-bottom: 1px solid var(--line);
}
.modal-head h2 { margin: 4px 0 0; font-size: 1.35rem; line-height: 1.3; overflow-wrap: anywhere; }
.modal-close {
    flex: none; width: 34px; height: 34px;
    display: grid; place-items: center;
    color: var(--ink-soft); background: var(--surface-soft);
    border: 1px solid var(--line); border-radius: 6px;
    cursor: pointer; font-size: 15px; line-height: 1;
}
.modal-close:hover { color: var(--danger); background: #f7eeee; border-color: #e6caca; }

/* 32px 水平留白与站点面板规范一致：右侧被滚动条占据最多 15px 后仍有充足净空，地址与标签不再贴边。 */
.modal-body { padding: 18px 32px; overflow-y: auto; overscroll-behavior: contain; flex: 1; }
.modal-body[aria-busy="true"] { opacity: .55; }
/* 弹窗内结果卡与整页结果卡同为带边框圆角卡片（继承 .result-card 的 border），
   必须保留真实水平内边距，否则地址与标签会贴死卡片边框；间距沿用基础 .result-list 的 12px。 */
.modal-body .result-card { padding: 16px 22px; }
.modal-total { margin: 0 0 2px; font-size: 13px; color: var(--muted); }

.modal-pagination {
    display: flex; align-items: center; justify-content: center; gap: 14px;
    padding: 12px 32px 16px;
    border-top: 1px solid var(--line); background: var(--surface-soft);
}
.modal-pagination:empty { display: none; }
.modal-page-info { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* 小屏：弹窗改为底部抽屉。 */
@media (max-width: 640px) {
    .modal-overlay { padding: 0; align-items: flex-end; }
    .modal-sheet { width: 100%; max-height: 88vh; border-radius: var(--radius) var(--radius) 0 0; }
    .modal-head { padding: 14px 20px 12px; }
    .modal-body { padding: 12px 20px; }
    .modal-body .result-card { padding: 14px 18px; }
    .modal-pagination { padding: 10px 20px 14px; }
}

/* ============ 标签颜色可视化输入（原生 color 控件） ============ */
.color-input {
    width: 46px; height: 34px; padding: 2px;
    border: 1px solid var(--line); border-radius: 6px;
    background: var(--surface); cursor: pointer;
}
.color-input::-webkit-color-swatch-wrapper { padding: 0; }
.color-input::-webkit-color-swatch { border: none; border-radius: 4px; }
.color-input::-moz-color-swatch { border: none; border-radius: 4px; }

/* ============ 证据截图灯箱 ============ */
.lightbox-overlay {
    position: fixed; inset: 0; z-index: 80;
    display: flex; flex-direction: column;
    background: rgba(10, 30, 34, .92);
    animation: lightbox-fade .18s ease-out;
    overscroll-behavior: contain;
}
.lightbox-overlay[hidden] { display: none; }
@keyframes lightbox-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    .modal-overlay, .modal-sheet,
    .modal-overlay.is-closing, .modal-overlay.is-closing .modal-sheet { animation: none; }
    .lightbox-overlay { animation: none; }
    .lightbox-image { transition: none; }
}

.lightbox-stage {
    position: relative; flex: 1;
    display: grid; place-items: center;
    overflow: hidden;
    touch-action: none;
    cursor: zoom-in;
}
.lightbox-stage.is-pannable { cursor: grab; }
.lightbox-stage.is-pannable:active { cursor: grabbing; }

.lightbox-image {
    max-width: min(92vw, 1400px); max-height: 82vh;
    object-fit: contain;
    transition: transform .12s ease-out;
    box-shadow: 0 12px 60px rgba(0, 0, 0, .5);
    user-select: none;
    -webkit-user-drag: none;
}
.lightbox-image.is-loading { opacity: .3; }

.lightbox-close {
    position: absolute; top: calc(14px + env(safe-area-inset-top)); right: calc(16px + env(safe-area-inset-right)); z-index: 2;
    width: 40px; height: 40px;
    display: grid; place-items: center;
    color: #fff; font-size: 18px; line-height: 1;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .25); border-radius: 8px;
    cursor: pointer;
}
.lightbox-close:hover { background: rgba(255, 255, 255, .22); }

.lightbox-toolbar {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    padding: 12px 16px calc(18px + env(safe-area-inset-bottom));
    color: rgba(255, 255, 255, .85); font-size: 14px;
}
.lightbox-toolbar [hidden] { display: none; }
.lightbox-nav, .lightbox-zoom {
    width: 38px; height: 38px;
    display: grid; place-items: center;
    color: #fff; font-size: 20px; line-height: 1;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .25); border-radius: 8px;
    cursor: pointer;
}
.lightbox-nav:hover, .lightbox-zoom:hover { background: rgba(255, 255, 255, .22); }
.lightbox-counter { min-width: 56px; text-align: center; letter-spacing: .04em; }
.lightbox-scale { min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; }

@media (max-width: 640px) {
    .lightbox-image { max-width: 96vw; max-height: 76vh; }
    .lightbox-toolbar { gap: 8px; }
}

/* ============ PJAX 无刷新导航 ============ */
.pjax-progress {
    position: fixed; top: 0; left: 0; z-index: 100;
    width: 100%; height: 3px;
    background: var(--brand);
    transform: scaleX(0); transform-origin: 0 50%;
    opacity: 0;
    pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
    /* 仅主内容区参与过渡：页头/页脚静止，换页时内容轻微上移离场、上浮入场。 */
    #main { view-transition-name: main-content; }
    ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
    ::view-transition-old(main-content) { animation: pjax-leave .16s ease both; }
    ::view-transition-new(main-content) { animation: pjax-enter .26s ease both; }
}
@keyframes pjax-leave { to { opacity: 0; transform: translateY(-6px); } }
@keyframes pjax-enter { from { opacity: 0; transform: translateY(10px); } }
