/* ============ 基础变量 ============ */
:root {
  --bg: #f3f5fa;
  --panel: #ffffff;
  --panel-soft: #fafbfe;
  --border: #e5e9f2;
  --border-strong: #d5dbe8;
  --text: #101828;
  --text-2: #344054;
  --muted: #7a8798;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-weak: #eef1ff;
  --danger: #dc2626;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 28px -16px rgba(16, 24, 40, .18);
  --radius: 16px;
  --lv0: #e11d48;
  --lv1: #ea580c;
  --lv2: #d97706;
  --lv3: #0284c7;
}

[data-theme="dark"] {
  --bg: #0b0f16;
  --panel: #141a23;
  --panel-soft: #111823;
  --border: #222c3a;
  --border-strong: #2f3b4d;
  --text: #e8eef6;
  --text-2: #c3cede;
  --muted: #8b9aae;
  --primary: #7c7bf5;
  --primary-hover: #8f8ff8;
  --primary-weak: #1e2340;
  --danger: #f87171;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 32px -20px rgba(0, 0, 0, .8);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  transition: background .2s, color .2s;
}

h1, h2, h3, h4, p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
::selection { background: rgba(79, 70, 229, .18); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(120, 135, 155, .28); border-radius: 9px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(120, 135, 155, .45); background-clip: content-box; }

.hidden { display: none !important; }

/* ============ 顶栏 ============ */
.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 24px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }

.logo {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #4338ca);
  box-shadow: 0 4px 12px -4px rgba(79, 70, 229, .7);
}

.brand-text h1 { font-size: 15px; font-weight: 700; letter-spacing: .2px; }
.brand-text p { font-size: 11px; color: var(--muted); margin-top: 1px; letter-spacing: .3px; }

.tabs {
  display: flex;
  gap: 2px;
  padding: 4px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 11px;
}

.tab {
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  padding: 7px 15px;
  border-radius: 8px;
  transition: all .16s;
  white-space: nowrap;
}
.tab:hover { color: var(--text); background: color-mix(in srgb, var(--primary) 6%, transparent); }
.tab.active {
  background: var(--panel);
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .1);
}

.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.local-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; color: #059669;
  background: rgba(5, 150, 105, .1);
  border: 1px solid rgba(5, 150, 105, .2);
  padding: 4px 9px; border-radius: 999px;
}

.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-2);
  transition: all .16s;
}
.icon-btn:hover { border-color: var(--border-strong); color: var(--primary); }
.icon-btn.sm { width: 28px; height: 28px; border: 0; background: transparent; }

.ico-moon { display: none; }
[data-theme="dark"] .ico-moon { display: block; }
[data-theme="dark"] .ico-sun { display: none; }

/* ============ 布局 ============ */
main { padding: 20px 24px 28px; max-width: 1680px; margin: 0 auto; }

.view { display: none; }
.view.active { display: block; animation: fade .22s ease; }

@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.panel-head.tight { padding: 11px 16px; }
.panel-head h2 { font-size: 13.5px; font-weight: 650; letter-spacing: .2px; }
.head-right { display: flex; align-items: center; gap: 10px; }

/* ============ 按钮 / 表单 ============ */
.btn {
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  transition: all .16s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.btn.primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px -6px rgba(79, 70, 229, .9);
}
.btn.primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn.ghost { background: var(--panel); border-color: var(--border); color: var(--text-2); }
.btn.ghost:hover { border-color: var(--border-strong); color: var(--text); background: var(--panel-soft); }
.btn.ghost.danger { color: var(--danger); }
.btn.ghost.danger:hover { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 7%, transparent); }
.btn.tiny { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }
.btn-col { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

kbd {
  font-family: inherit;
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .22);
  border: 1px solid rgba(255, 255, 255, .18);
  line-height: 1.5;
}

.seg {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 9px;
}
.seg button {
  border: 0; background: transparent; color: var(--muted);
  font-size: 12.5px; padding: 5px 12px; border-radius: 6px; transition: all .16s;
}
.seg button.active { background: var(--panel); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(16,24,40,.1); }

.select, .input {
  height: 34px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: 9px;
  padding: 0 10px;
  font-size: 12.5px;
  outline: none;
  font-family: inherit;
  transition: border-color .16s, box-shadow .16s;
}
.select { padding-right: 26px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a8798' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 7px center; background-size: 14px; }
.select:focus, .input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); }
.select-sm { height: 30px; font-size: 12px; max-width: 190px; }

.switch { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 12px; color: var(--muted); user-select: none; }
.switch input { display: none; }
.switch .track {
  width: 32px; height: 18px; border-radius: 999px;
  background: var(--border-strong); position: relative; transition: background .18s; flex-shrink: 0;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; transition: transform .18s; box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(14px); }
.switch em { font-style: normal; }

/* ============ 检测工作台 ============ */
.check-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
  gap: 16px;
  height: calc(100vh - 64px - 48px);
  min-height: 560px;
}

.editor-body { flex: 1; min-height: 0; position: relative; }

#input {
  width: 100%; height: 100%;
  border: 0; outline: none; resize: none;
  background: transparent;
  color: var(--text);
  padding: 18px 20px;
  font-size: 14.5px;
  line-height: 1.95;
  font-family: inherit;
}
#input::placeholder { color: var(--muted); opacity: .75; }

.preview-pane {
  height: 100%;
  overflow-y: auto;
  padding: 18px 20px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14.5px;
  line-height: 1.95;
}

mark.mk {
  background: transparent;
  color: inherit;
  border-radius: 3px;
  padding: 1px 0;
  border-bottom: 2px solid currentColor;
  cursor: pointer;
  transition: background .15s;
}
mark.mk.lv0 { background: rgba(225, 29, 72, .13); color: var(--lv0); }
mark.mk.lv1 { background: rgba(234, 88, 12, .13); color: var(--lv1); }
mark.mk.lv2 { background: rgba(217, 119, 6, .15); color: var(--lv2); }
mark.mk.lv3 { background: rgba(2, 132, 199, .12); color: var(--lv3); }
mark.mk.active { outline: 2px solid currentColor; outline-offset: 1px; }

.editor-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--panel-soft);
  flex-shrink: 0;
}
.meta { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.dot { width: 3px; height: 3px; border-radius: 50%; background: var(--border-strong); }
.btns { display: flex; align-items: center; gap: 8px; }

/* ============ 结果区 ============ */
.results-body { flex: 1; overflow-y: auto; padding: 16px; }

.empty { text-align: center; padding: 42px 22px; margin: auto; max-width: 380px; }
.empty-ring { position: relative; display: inline-grid; place-items: center; color: var(--primary); margin-bottom: 6px; }
.empty-ring svg { animation: spinSlow 26s linear infinite; }
.empty-ring span {
  position: absolute; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 1px;
}
@keyframes spinSlow { to { transform: rotate(360deg); } }
.empty h3 { font-size: 15px; margin: 10px 0 8px; font-weight: 650; }
.empty p { font-size: 12.5px; color: var(--muted); line-height: 1.85; }
.empty-tips { list-style: none; padding: 0; margin: 18px 0 0; text-align: left; display: inline-block; }
.empty-tips li {
  font-size: 12px; color: var(--text-2); padding-left: 18px; position: relative; line-height: 2;
}
.empty-tips li::before {
  content: ""; position: absolute; left: 4px; top: 9px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--primary); opacity: .5;
}

.score-card {
  display: flex; gap: 18px; align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 5%, var(--panel)), var(--panel) 60%);
}
.gauge { flex-shrink: 0; width: 108px; height: 108px; position: relative; }
.gauge svg { display: block; }
.gauge .g-score {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 27px; font-weight: 750; letter-spacing: -.5px;
  font-variant-numeric: tabular-nums;
}
.gauge .g-score i { font-style: normal; font-size: 11px; color: var(--muted); font-weight: 500; display: block; text-align: center; margin-top: -2px; }

.score-info { min-width: 0; flex: 1; }
.grade-line { display: flex; align-items: center; gap: 10px; }
.grade-badge {
  font-size: 12px; font-weight: 650; padding: 4px 10px; border-radius: 999px;
  border: 1px solid currentColor;
}
.score-num { font-size: 13px; color: var(--muted); }
.score-num b { font-size: 19px; color: var(--text); margin-right: 1px; font-variant-numeric: tabular-nums; }
.score-num i { font-style: normal; }
.grade-desc { font-size: 12px; color: var(--muted); line-height: 1.7; margin-top: 7px; }
.quick-stats { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 9px; }
.qs { font-size: 11.5px; color: var(--muted); }
.qs b { font-size: 13px; color: var(--text); margin-right: 2px; font-variant-numeric: tabular-nums; }
.qs.danger b { color: var(--lv0); }

.cat-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 14px 0 4px; }
.cat-chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-2);
  font-size: 11.5px; padding: 4px 9px; border-radius: 999px;
  cursor: pointer; transition: all .15s;
}
.cat-chip:hover { border-color: var(--border-strong); }
.cat-chip.active { background: var(--primary-weak); border-color: color-mix(in srgb, var(--primary) 40%, transparent); color: var(--primary); }
.cat-chip .dotc { width: 6px; height: 6px; border-radius: 50%; }
.cat-chip .num { font-variant-numeric: tabular-nums; opacity: .7; }

.hit-list-head { display: flex; align-items: center; justify-content: space-between; margin: 16px 0 10px; gap: 10px; }
.hit-list-head h3 { font-size: 13px; font-weight: 650; }
.hit-list-head h3 span { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 2px; }
.hit-filter { display: flex; gap: 3px; }
.chip-mini {
  border: 1px solid transparent; background: transparent; color: var(--muted);
  font-size: 11.5px; padding: 3px 8px; border-radius: 6px; transition: all .15s;
}
.chip-mini:hover { color: var(--text); }
.chip-mini.active { background: var(--panel-soft); border-color: var(--border); color: var(--text); font-weight: 600; }

.hit-list { display: flex; flex-direction: column; gap: 9px; }

.hit-item {
  border: 1px solid var(--border);
  border-left: 3px solid var(--lv-color, var(--muted));
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--panel-soft);
  transition: box-shadow .16s, border-color .16s;
}
.hit-item:hover { box-shadow: 0 6px 18px -12px rgba(16,24,40,.5); }
.hit-item.flash { animation: flash 1.1s ease; }
@keyframes flash { 0%, 100% { background: var(--panel-soft); } 30% { background: color-mix(in srgb, var(--primary) 12%, transparent); } }

.hit-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.hit-word { font-size: 14px; font-weight: 700; color: var(--text); letter-spacing: .2px; }
.badge {
  font-size: 10.5px; padding: 2px 7px; border-radius: 999px; font-weight: 600;
  border: 1px solid currentColor; line-height: 1.5;
}
.badge.cat { color: var(--muted); border-color: var(--border); background: var(--panel); font-weight: 500; }
.hit-pos { margin-left: auto; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

.hit-context {
  font-size: 12.5px; line-height: 1.75; color: var(--text-2);
  margin: 7px 0 0; word-break: break-word;
}
.hit-context b { background: rgba(225, 29, 72, .1); color: var(--lv0); border-radius: 3px; padding: 0 2px; font-weight: 650; }

.hit-advice {
  margin-top: 7px; font-size: 12.5px; line-height: 1.7;
  background: color-mix(in srgb, var(--primary) 5%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--primary) 14%, var(--border));
  color: var(--text-2);
  border-radius: 7px; padding: 6px 9px;
  display: flex; gap: 6px;
}
.hit-advice .tag { color: var(--primary); font-weight: 600; flex-shrink: 0; }

.hit-meta { margin-top: 7px; font-size: 11px; color: var(--muted); line-height: 1.6; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hit-actions { display: flex; gap: 6px; margin-top: 8px; }
.hit-actions button {
  font-size: 11.5px; padding: 3px 9px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--panel); color: var(--text-2);
  transition: all .15s;
}
.hit-actions button:hover { border-color: var(--primary); color: var(--primary); }
.hit-actions button.solid { background: var(--primary); border-color: var(--primary); color: #fff; }
.hit-actions button.solid:hover { background: var(--primary-hover); color: #fff; }

.hit-empty { text-align: center; color: var(--muted); font-size: 12.5px; padding: 24px 0; }

/* ============ 通用标题 ============ */
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.section-head h2 { font-size: 19px; font-weight: 700; letter-spacing: -.2px; }
.section-head p { font-size: 12.5px; color: var(--muted); margin-top: 5px; max-width: 720px; line-height: 1.7; }

.toolbar {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.toolbar .spacer { flex: 1; }
.toolbar-hint { font-size: 12px; color: var(--muted); }
.search-box { position: relative; display: flex; align-items: center; }
.search-box svg { position: absolute; left: 10px; color: var(--muted); pointer-events: none; }
.search-box .input { padding-left: 32px; width: 260px; }

/* ============ 表格 ============ */
.table-wrap { padding: 0; overflow: auto; max-height: calc(100vh - 260px); }
.table { width: 100%; border-collapse: collapse; font-size: 12.8px; }
.table thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--panel-soft);
  color: var(--muted); font-weight: 600; font-size: 11.5px; letter-spacing: .3px;
  text-align: left; padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td { padding: 9px 14px; border-bottom: 1px solid var(--border); color: var(--text-2); vertical-align: middle; }
.table tbody tr:hover td { background: var(--panel-soft); }
.table tbody tr:last-child td { border-bottom: 0; }
.table td.w { font-weight: 650; color: var(--text); font-size: 13.5px; }
.table td.advice { color: var(--muted); max-width: 420px; }
.table .t-center { text-align: center; }
.table .t-right { text-align: right; }
.table .mini-src { font-size: 11px; color: var(--muted); }
.table .mini-src.custom { color: var(--primary); font-weight: 600; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.row-actions button {
  width: 26px; height: 26px; display: grid; place-items: center;
  border: 1px solid var(--border); background: var(--panel); color: var(--muted);
  border-radius: 6px; transition: all .15s;
}
.row-actions button:hover { color: var(--primary); border-color: var(--primary); }
.row-actions button.del:hover { color: var(--danger); border-color: var(--danger); }

.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 12px; color: var(--muted); }

/* ============ 历史 ============ */
.history-list { display: flex; flex-direction: column; gap: 10px; }
.history-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 16px; box-shadow: var(--shadow);
}
.h-score {
  width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 17px; font-weight: 750;
  background: var(--panel-soft); border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.h-main { flex: 1; min-width: 0; }
.h-title { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-sub { font-size: 11.5px; color: var(--muted); margin-top: 4px; display: flex; gap: 10px; flex-wrap: wrap; }
.h-actions { display: flex; gap: 6px; }

/* ============ 设置 ============ */
.settings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.setting-card { padding: 18px; gap: 12px; display: flex; flex-direction: column; }
.setting-card.wide { grid-column: 1 / -1; }
.setting-card h3 { font-size: 14px; font-weight: 650; }
.setting-card .hint { font-size: 12px; color: var(--muted); line-height: 1.7; margin-top: -4px; }

.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 10px 0; border-top: 1px dashed var(--border); cursor: pointer;
}
.setting-row:first-of-type { border-top: 0; }
.setting-row b { display: block; font-size: 12.8px; font-weight: 600; color: var(--text); }
.setting-row span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.6; }

.textarea-sm {
  width: 100%; min-height: 116px; resize: vertical;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--panel-soft); color: var(--text);
  padding: 10px 12px; font-size: 12.5px; line-height: 1.8; outline: none;
  font-family: inherit;
}
.textarea-sm:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }

.doc p { font-size: 12.5px; color: var(--text-2); line-height: 1.95; margin-bottom: 8px; }
.doc p:last-child { margin-bottom: 0; }
.doc b { color: var(--text); }

/* ============ 弹窗 ============ */
.modal-mask {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(16, 24, 40, .45);
  backdrop-filter: blur(3px);
  display: grid; place-items: center;
  padding: 20px;
  animation: fade .16s ease;
}
.modal {
  width: 100%; max-width: 460px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: 0 24px 60px -20px rgba(0,0,0,.4);
  overflow: hidden;
  animation: pop .18s ease;
}
@keyframes pop { from { transform: scale(.97) translateY(6px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 14.5px; font-weight: 650; }
.modal-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; max-height: 62vh; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--panel-soft); }

.field label { display: block; font-size: 12px; color: var(--text-2); font-weight: 600; margin-bottom: 5px; }
.field .input, .field .select, .field textarea { width: 100%; }
.field textarea {
  min-height: 64px; resize: vertical; border: 1px solid var(--border); border-radius: 9px;
  background: var(--panel-soft); color: var(--text); padding: 8px 10px; font-size: 12.5px;
  font-family: inherit; outline: none; line-height: 1.7;
}
.field textarea:focus { border-color: var(--primary); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-hint { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.6; }

/* ============ Toast ============ */
.toast-wrap { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: rgba(17, 24, 39, .94); color: #fff;
  font-size: 12.5px; padding: 9px 16px; border-radius: 9px;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.6);
  animation: toastIn .2s ease;
  max-width: 80vw;
}
.toast.ok { background: rgba(5, 150, 105, .95); }
.toast.err { background: rgba(220, 38, 38, .95); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============ 响应式 ============ */
@media (max-width: 1240px) {
  .tab { padding: 7px 11px; }
  .brand-text p { display: none; }
  .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
  .check-grid { grid-template-columns: 1fr; height: auto; }
  .editor { min-height: 420px; }
  .results { min-height: 520px; }
  .topbar { gap: 14px; padding: 0 16px; }
  main { padding: 16px; }
  .local-badge { display: none; }
}

@media (max-width: 760px) {
  .topbar { height: auto; flex-wrap: wrap; padding: 10px 14px; gap: 10px; }
  .tabs { order: 3; width: 100%; overflow-x: auto; }
  .tab { flex: 1; padding: 7px 6px; font-size: 12.5px; }
  .brand-text h1 { font-size: 14px; }
  .top-actions { margin-left: auto; }
  .settings-grid { grid-template-columns: 1fr; }
  .search-box .input { width: 100%; }
  .search-box { flex: 1; min-width: 160px; }
  .check-grid { height: auto; min-height: 0; }
  .editor { min-height: 360px; }
  .editor-foot { flex-wrap: wrap; }
  .score-card { flex-direction: column; align-items: flex-start; }
  .gauge { align-self: center; }
  .table-wrap { max-height: none; }
  .section-head { align-items: flex-start; }
}
