/* 设计系统 v2：暖纸底 + 墨字 + 单一绿松强调；类型刻度/留白节奏/真实状态色/克制动效。 */
:root {
  --bg: #f5f4f0;
  --bg-2: #eceae4;
  --surface: #ffffff;
  --ink: #171b21;
  --ink-2: #3d444e;
  --dim: #757b85;
  --line: #e6e4dc;
  --line-2: #d5d2c8;
  --accent: #0e7a5f;
  --accent-2: #0a5d49;
  --accent-soft: #e4f1ec;
  --accent-ink: #0a5d49;
  --ok: #217a3c;
  --ok-bg: #e9f4ea;
  --warn: #9a6300;
  --warn-bg: #faf1dc;
  --fail: #bb3325;
  --fail-bg: #fbebe7;
  --mono: ui-monospace, 'Cascadia Mono', Consolas, 'Courier New', monospace;
  --sans: 'Segoe UI', system-ui, -apple-system, 'PingFang SC', 'HarmonyOS Sans SC', 'MiSans', 'Microsoft YaHei UI', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  --r-lg: 12px;
  --r-md: 9px;
  --r-sm: 6px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 36px; --sp-7: 56px;
  --dur: 170ms;
  --ease: cubic-bezier(0.2, 0.7, 0.25, 1);
  --shadow-pop: 0 10px 28px rgba(23, 27, 33, 0.14);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent-soft); color: var(--accent-2); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
main:focus, h1:focus { outline: none; }
a { color: var(--accent-ink); text-decoration: none; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
h1, h2, h3, h4 { letter-spacing: -0.01em; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 var(--sp-5); }
.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: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--surface);
  padding: 9px 14px; border-radius: var(--r-sm); border: 1px solid var(--accent);
  color: var(--accent-2); font-weight: 600;
}
.skip-link:focus { left: 10px; }
.noscript { padding: var(--sp-4); background: var(--fail-bg); color: var(--fail); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--dim); }
::-webkit-scrollbar-track { background: transparent; }

/* ===== 页头 ===== */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(1.1) blur(6px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; gap: var(--sp-4); min-height: 60px; flex-wrap: wrap; padding: var(--sp-2) 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 36px; height: 36px; border-radius: var(--r-md);
  background: var(--ink); color: #fff; font-family: var(--mono);
  font-weight: 700; font-size: 13.5px; letter-spacing: 0.06em;
  display: inline-flex; align-items: center; justify-content: center;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-text strong { font-weight: 700; letter-spacing: 0.01em; }
.brand-text span { color: var(--dim); font-size: 11.5px; letter-spacing: 0.02em; }
.site-nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.site-nav a, .nav-drop-btn {
  position: relative; padding: 9px 13px; border-radius: var(--r-sm); color: var(--ink-2);
  font-size: 14px; border: 0; background: none; cursor: pointer; font-weight: 500;
}
.site-nav a:hover, .nav-drop-btn:hover { background: var(--bg-2); color: var(--ink); text-decoration: none; }
.site-nav a::after {
  content: ''; position: absolute; left: 13px; right: 13px; bottom: 5px; height: 2px;
  background: var(--accent); border-radius: 2px; transform: scaleX(0); transform-origin: left;
  transition: transform var(--dur) var(--ease);
}
.site-nav a.is-active { color: var(--accent-2); background: none; }
.site-nav a.is-active::after { transform: scaleX(1); }
.caret { font-size: 10px; }
.nav-drop { position: relative; }
.nav-drop-menu {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 168px; z-index: 50;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow-pop); padding: 5px; display: flex; flex-direction: column;
  animation: popIn 140ms var(--ease) both;
}
@keyframes popIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.nav-drop-menu a { padding: 8px 11px; border-radius: var(--r-sm); border-bottom: 0; font-size: 13.5px; }
.nav-drop-menu a:hover { background: var(--accent-soft); color: var(--accent-2); }
.header-meta { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.data-updated { color: var(--dim); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.strategy-chip {
  cursor: pointer; background: var(--accent-soft); color: var(--accent-2); font-weight: 600;
  border: 0; border-radius: 999px; padding: 4px 13px; font-size: 12.5px;
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.strategy-chip:hover { box-shadow: 0 2px 10px rgba(14, 122, 95, 0.25); }

/* ===== 页面骨架 ===== */
.view-root { min-height: 62vh; padding: var(--sp-6) 0 120px; }
main .view { display: flex; flex-direction: column; gap: var(--sp-4); max-width: 1200px; margin: 0 auto; padding: 0 var(--sp-5); }
.view section { min-width: 0; }
.page-head { padding: var(--sp-1) 0 var(--sp-1); }
h1 { font-size: clamp(22px, 1.6vw + 14px, 30px); margin: 0; font-weight: 750; line-height: 1.22; }
.view-compare h1, .view-replay h1 { letter-spacing: -0.02em; }
.page-sub { color: var(--dim); margin: 6px 0 0; font-size: 13.5px; max-width: 72ch; }
.section-title { font-size: 15px; margin: var(--sp-5) 0 var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--line); letter-spacing: 0.01em; }
.view section { min-width: 0; }
.crumbs { color: var(--dim); font-size: 13px; display: flex; gap: 7px; align-items: center; }
.dim { color: var(--dim); }
.btn-row { display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; }

/* ===== 控件 ===== */
.btn, .btn-small, .btn-ghost, .btn-ghost-btn, .chip-btn, .tray-x, .fav-btn {
  font: inherit; cursor: pointer; border-radius: var(--r-md); border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); text-decoration: none;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease), background var(--dur) var(--ease), transform 90ms var(--ease), box-shadow var(--dur) var(--ease);
}
.btn { padding: 9px 16px; font-weight: 650; }
.btn:hover { border-color: var(--accent); color: var(--accent-2); box-shadow: 0 1px 6px rgba(14, 122, 95, 0.14); }
.btn:active, .chip-btn:active, .btn-small:active { transform: translateY(1px); }
.btn-small { padding: 5px 12px; font-size: 13px; font-weight: 550; }
.btn-small.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-ghost { padding: 5px 11px; font-size: 13px; color: var(--dim); border-color: transparent; }
.btn-ghost:hover { color: var(--ink); background: var(--bg-2); }
.btn-ghost-btn { padding: 3px 10px; font-size: 12.5px; border-style: dashed; color: var(--dim); }
.btn-ghost-btn:hover { color: var(--accent-2); border-color: var(--accent); }
.btn-small.disabled { opacity: 0.45; pointer-events: none; }
.chip-btn { padding: 4px 13px; font-size: 12.5px; border-radius: 999px; font-weight: 500; }
.chip-btn.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip-btn.on:hover { background: var(--ink-2); }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.fav-btn { border: 0; background: none; font-size: 15px; color: var(--line-2); padding: 3px 6px; }
.fav-btn:hover { color: #b7791f; }
.fav-btn.on { color: #b7791f; animation: favPop 240ms var(--ease); }
@keyframes favPop { 40% { transform: scale(1.35); } 100% { transform: none; } }

.badge {
  display: inline-block; padding: 1.5px 9px; border-radius: 999px; font-size: 11.5px; line-height: 1.8;
  background: var(--bg-2); color: var(--dim); font-weight: 550;
}
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-fail { background: var(--fail-bg); color: var(--fail); }
.chip { display: inline-block; font-size: 11.5px; padding: 1px 9px; border-radius: 999px; background: var(--bg-2); color: var(--ink-2); font-weight: 500; }
.traits { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.flag-row { display: flex; gap: 6px; flex-wrap: wrap; }

/* ===== 策略条 / 状态带 ===== */
.strategy-bar {
  display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: var(--sp-3) var(--sp-4); font-size: 13.5px;
}
.strategy-bar.dim-bar { color: var(--dim); }
.strategy-name { font-weight: 650; }
.str-fit { display: inline-flex; align-items: center; gap: 8px; min-width: 210px; flex: 1 1 260px; }
.str-fitbar {
  display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--bg-2);
  flex: 1 1 160px; max-width: 320px;
}
.str-fitbar span { height: 100%; transition: flex-grow var(--ease) var(--dur); }
.str-fitbar .f-ok { background: var(--ok); }
.str-fitbar .f-cond { background: var(--warn); }
.str-fitbar .f-un { background: var(--fail); }
.str-fitbar .f-cf { background: var(--line-2); }
.str-fit-legend { font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
.summary-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
}
.sum-item { background: var(--surface); padding: var(--sp-3) var(--sp-4); display: flex; flex-direction: column; gap: 3px; }
.sum-label { font-size: 11.5px; color: var(--dim); letter-spacing: 0.03em; }
.sum-value { font-size: 16px; font-weight: 680; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* ===== 工具条 ===== */
.compare-toolbar { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.search-input {
  flex: 1 1 240px; min-width: 190px; padding: 10px 13px; border: 1px solid var(--line-2);
  border-radius: var(--r-md); font: inherit; background: var(--surface);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.view-toggle { display: flex; gap: 5px; margin-left: auto; }
.sort-select span { font-size: 12.5px; color: var(--dim); }
.filter-select { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); }
select {
  appearance: none; padding: 7px 30px 7px 11px; border-radius: var(--r-sm); border: 1px solid var(--line-2);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23757b85' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center;
  font: inherit; font-size: 13px; color: var(--ink); cursor: pointer;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ===== 筛选面板 ===== */
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--sp-4) var(--sp-4) var(--sp-3); }
.filters-title-row { display: flex; justify-content: space-between; align-items: center; }
.filters-title-row h2 { margin: 0; font-size: 14.5px; }
.filters-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: var(--sp-3) var(--sp-4); margin-top: var(--sp-3); }
.filter-group { border: 0; margin: 0; padding: 0; display: flex; gap: 5px; flex-direction: column; }
.filter-group legend, .filter-rules-title { font-size: 11.5px; color: var(--dim); padding: 0; margin-bottom: 5px; letter-spacing: 0.05em; font-weight: 600; }
.filter-group .check { margin: 2px 0; }
.filter-rules { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); grid-column: 1 / -1; gap: 8px 12px; }
.filter-quick { grid-column: 1 / -1; }
.filter-pair { display: flex; gap: 10px; align-items: end; }
.filter-num { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; }
.filter-num span { color: var(--dim); }
.filter-num input { padding: 7px 10px; border: 1px solid var(--line-2); border-radius: var(--r-sm); width: 118px; font-variant-numeric: tabular-nums; }
.filter-num input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.filter-note { color: var(--dim); font-size: 12px; margin: var(--sp-3) 0 0; border-top: 1px dashed var(--line); padding-top: var(--sp-2); }
.check { display: inline-flex; gap: 7px; align-items: center; font-size: 13.5px; cursor: pointer; user-select: none; }
.check input { accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer; }
.quick-chips { display: flex; gap: 6px; flex-wrap: wrap; }

/* ===== 对比表 ===== */
.table-wrap {
  overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  max-height: 88vh; scroll-padding-top: 4px;
}
.compare-table, .vs-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 900px; }
.compare-table caption, .vs-table caption { text-align: left; color: var(--dim); font-size: 12px; padding: var(--sp-2) var(--sp-3) 4px; }
.compare-table th, .compare-table td, .vs-table th, .vs-table td {
  padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; white-space: nowrap;
}
.compare-table thead th, .vs-table thead th {
  background: var(--bg-2); color: var(--ink-2); font-weight: 650; font-size: 11.5px;
  letter-spacing: 0.05em; position: sticky; top: 0; z-index: 3;
}
.th-sort-btn { border: 0; background: none; padding: 0; color: inherit; font-size: inherit; font-weight: inherit; cursor: pointer; }
.th-sort-btn:hover { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }
.dir-mark { font-variant-numeric: normal; }
.compare-table tbody tr { animation: rowIn 300ms var(--ease) both; animation-delay: calc(var(--i, 0) * 16ms); }
@keyframes rowIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.compare-table tbody tr:hover > td { background: #faf9f5; }
.compare-table td:first-child, .vs-table .vs-label:first-child {
  position: sticky; left: 0; z-index: 2; background: var(--surface);
  box-shadow: 1px 0 0 var(--line);
}
.compare-table tbody tr:hover > td:first-child { background: #faf9f5; }
.price-cell b, .card-price strong, .sum-value { font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.td-actions { display: flex; gap: 6px; flex-wrap: nowrap; white-space: nowrap; }
.compare-table th:last-child, .compare-table td:last-child { min-width: 150px; }
.firm-link { font-weight: 650; color: var(--ink); }
a.firm-link:hover { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }
.plan-name { display: block; font-size: 12px; color: var(--dim); margin-top: 2px; text-decoration: none; }
.plan-name:hover { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }
.result-count { margin: 2px 4px 0; font-size: 12.5px; }
.load-more-row { display: flex; justify-content: center; padding: var(--sp-2) 0; }

/* ===== 卡片 ===== */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(295px, 1fr)); gap: var(--sp-3); }
.plan-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-4) var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-2);
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  animation: rowIn 340ms var(--ease) both; animation-delay: calc(var(--i, 0) * 26ms);
}
.plan-card:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(23, 27, 33, 0.08); }
.card-head { display: flex; flex-direction: column; gap: 3px; }
.card-price { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.card-price strong { font-size: 18px; font-weight: 700; }
.card-price .dim { font-size: 12.5px; }
.card-facts { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.card-facts li { color: var(--ink-2); display: flex; gap: 6px; }
.card-facts li b:first-child { color: var(--dim); font-weight: 500; }
.card-foot { display: flex; gap: 8px; align-items: center; margin-top: auto; padding-top: var(--sp-2); border-top: 1px dashed var(--line); }
.template-card .card-foot { margin-top: 10px; }
.entry-card { gap: 7px; }

/* ===== 空状态 ===== */
.empty-state {
  border: 1px dashed var(--line-2); background: var(--surface); border-radius: var(--r-lg);
  padding: var(--sp-7) var(--sp-5); text-align: center; display: flex; flex-direction: column; gap: 9px; align-items: center;
}
.empty-state p { margin: 0; max-width: 46ch; }

/* ===== 平台详情 ===== */
.firm-meta {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
}
.info-item { background: var(--surface); padding: 9px 13px; display: flex; gap: 10px; align-items: baseline; }
.info-label { color: var(--dim); font-size: 11.5px; min-width: 78px; letter-spacing: 0.02em; }
.info-value { font-size: 13.5px; min-width: 0; overflow-wrap: anywhere; }
.rules-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: var(--sp-3); }
.rule-details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 5px 6px; }
.rule-details summary { cursor: pointer; font-weight: 650; padding: 8px 10px; list-style: none; display: flex; align-items: center; gap: 8px; }
.rule-details summary::before {
  content: '+'; width: 18px; height: 18px; border-radius: 5px; background: var(--bg-2); color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease);
}
.rule-details[open] summary::before { content: '−'; background: var(--accent-soft); color: var(--accent-2); }
.rule-details summary:hover::before { background: var(--accent-soft); }
.rules-list { list-style: none; margin: 0; padding: 2px 10px 10px; display: flex; flex-direction: column; gap: 4px; }
.rules-list li { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; border-bottom: 1px dotted var(--line); padding: 4px 0; }
.rule-label { color: var(--dim); }
.rule-value { text-align: right; min-width: 0; overflow-wrap: anywhere; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 5px 12px; margin-bottom: 7px; }
.faq summary { cursor: pointer; font-size: 13.5px; font-weight: 550; }
.faq p { color: var(--dim); margin: 7px 0; font-size: 13px; }

/* ===== 一对多 ===== */
.vs-toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
.vs-label { color: var(--dim); font-weight: 500; width: 168px; font-size: 12.5px; }
.vs-group-row th { background: var(--accent-soft); color: var(--accent-2); font-weight: 700; text-align: left; letter-spacing: 0.04em; font-size: 12px; }
.vs-col-head { display: flex; flex-direction: column; gap: 5px; }
.vs-col-head select { max-width: 190px; }
.v-yes { color: var(--ok); font-weight: 650; }
.v-no { color: var(--fail); font-weight: 650; }
.v-cond { color: var(--warn); font-weight: 650; }
.v-unknown { color: var(--dim); font-style: normal; }

/* ===== 静态页 ===== */
.view-static section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--sp-3) var(--sp-5) var(--sp-4); }
.view-static h2 { font-size: 15px; margin: var(--sp-2) 0 4px; }
.view-static p { margin: 7px 0; font-size: 13.5px; max-width: 78ch; }
.glossary { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: var(--sp-3); }
.gloss-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--sp-3) var(--sp-4); }
.gloss-item dt { font-weight: 650; margin-bottom: 4px; }
.gloss-item dd { margin: 0; color: var(--dim); font-size: 13px; }

/* ===== 实验室 ===== */
.lab-state-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--sp-4) var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-2); }
.lab-entries { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--sp-3); }
.dropzone {
  border: 1.5px dashed var(--line-2); border-radius: var(--r-lg); background: var(--surface);
  padding: var(--sp-6) var(--sp-5); text-align: center; cursor: pointer; display: flex; flex-direction: column; gap: 7px;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.dropzone p { margin: 0; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input[type='file'] { display: none; }
.paste-row { display: flex; flex-direction: column; gap: var(--sp-2); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--sp-4) var(--sp-5); }
.paste-box {
  width: 100%; font-family: var(--mono); font-size: 12.5px; padding: 10px 12px;
  border: 1px solid var(--line-2); border-radius: var(--r-md); resize: vertical; background: var(--bg);
}
.paste-box:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
.preview-card, .import-preview section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--sp-3) var(--sp-4); }
.issue-list { margin: 7px 0; padding-left: 18px; color: var(--warn); font-size: 13px; }
.issue-list li { margin-bottom: 3px; }
.manual-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--sp-4) var(--sp-5); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: var(--sp-3) var(--sp-4); }
.form-field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; }
.form-field span { color: var(--dim); }
.form-field input, .form-field select { padding: 8px 10px; border: 1px solid var(--line-2); border-radius: var(--r-sm); font: inherit; font-variant-numeric: tabular-nums; }
.form-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.traits-group { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 6px 0; border: 0; }
.traits-group legend { color: var(--dim); font-size: 12px; width: 100%; letter-spacing: 0.04em; }

/* ===== 回放页 ===== */
.replay-options { display: flex; gap: var(--sp-4); align-items: center; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--sp-3) var(--sp-4); }
.metrics-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.m-item { background: var(--surface); padding: var(--sp-3) var(--sp-3); display: flex; flex-direction: column; }
.m-label { color: var(--dim); font-size: 11.5px; letter-spacing: 0.03em; }
.m-value { font-size: 15px; font-weight: 680; font-variant-numeric: tabular-nums; }
.health-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--sp-3); }
.health-col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--sp-3) var(--sp-4); }
.health-col h3 { margin: 3px 0 10px; font-size: 13.5px; }
.health-list, .blocked-list, .unknown-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.health-item, .blocked-list li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.unknown-list li { border-bottom: 1px dotted var(--line); padding-bottom: 5px; }
.stress-section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--sp-3) var(--sp-4); }
.replay-details { display: flex; flex-direction: column; gap: 8px; }
.replay-detail { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 5px 7px; }
.replay-detail summary { cursor: pointer; display: flex; gap: 10px; align-items: center; padding: 9px 10px; flex-wrap: wrap; list-style: none; }
.replay-detail summary::before {
  content: '+'; width: 18px; height: 18px; border-radius: 5px; background: var(--bg-2); color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
}
.replay-detail[open] summary::before { content: '−'; background: var(--accent-soft); color: var(--accent-2); }
.replay-block { padding: 6px 10px; }
.replay-block h4 { margin: 5px 0; font-size: 12.5px; color: var(--dim); letter-spacing: 0.04em; }
.replay-rules { list-style: none; margin: 0 0 7px; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.replay-rule { display: flex; gap: 9px; align-items: baseline; font-size: 13px; border-bottom: 1px dotted var(--line); padding: 5px 0; flex-wrap: wrap; }
.replay-rule-label { font-weight: 620; }
.replay-rule-detail { color: var(--dim); flex: 1 1 240px; font-variant-numeric: tabular-nums; }
.export-row { margin-top: 5px; }

/* ===== 工具页 ===== */
.tool-panel { display: flex; flex-direction: column; gap: var(--sp-3); }
.tool-out { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--sp-2) var(--sp-4); }
.out-row { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px dotted var(--line); font-size: 13.5px; align-items: baseline; }
.out-row:last-child { border-bottom: 0; }
.out-label { color: var(--dim); }
.out-row strong, .out-row span:last-child { font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere; }

/* ===== 托盘 / 提示 ===== */
.compare-tray {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(6px) saturate(1.05);
  border-top: 1px solid var(--line-2); box-shadow: 0 -6px 22px rgba(23, 27, 33, 0.1);
  animation: trayUp 240ms var(--ease) both;
}
@keyframes trayUp { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.tray-inner { max-width: 1200px; margin: 0 auto; padding: 11px var(--sp-5); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tray-title { font-weight: 700; font-size: 13px; letter-spacing: 0.02em; }
.tray-chip {
  background: var(--bg); border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 6px 3px 13px; font-size: 12.5px; display: inline-flex; gap: 7px; align-items: center;
}
.tray-x { border: 0; background: none; cursor: pointer; color: var(--dim); padding: 0 7px; border-radius: 999px; }
.tray-x:hover { color: var(--fail); background: var(--fail-bg); }
.toast {
  position: fixed; left: 50%; bottom: 74px; transform: translateX(-50%);
  background: #20242b; color: #fff; padding: 10px 19px; border-radius: var(--r-md);
  z-index: 95; font-size: 13.5px; box-shadow: var(--shadow-pop);
  animation: toastIn 220ms var(--ease) both;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.toast.ok { background: var(--ok); }
.toast.fail { background: var(--fail); }

#debug-panel {
  max-width: 470px; max-height: 45vh; overflow: auto; position: fixed; right: 10px; bottom: 10px; z-index: 85;
  background: #191c22; color: #ccd1da; font-size: 11px; padding: 9px 11px; border-radius: var(--r-md);
  white-space: pre-wrap; font-family: var(--mono);
}

/* ===== 页脚 ===== */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: var(--sp-6); }
.site-footer .wrap { padding-top: var(--sp-5); padding-bottom: var(--sp-5); display: flex; flex-direction: column; gap: 7px; }
.footer-notice { margin: 0; color: var(--dim); font-size: 12.5px; }
.footer-para { margin: 0; font-size: 12.5px; color: var(--dim); }
.footer-para a { color: var(--accent-2); }

/* ===== 响应式 / 打印 / 动效偏好 ===== */
@media (max-width: 900px) {
  .header-row { gap: 10px; }
  .site-nav { order: 3; width: 100%; overflow-x: auto; padding-bottom: 4px; }
  .header-meta { margin-left: auto; }
  .vs-label { width: auto; }
}
@media (max-width: 640px) {
  .info-item, .rules-list li, .out-row { flex-direction: column; gap: 3px; align-items: flex-start; }
  .rule-value, .out-row strong { text-align: left; }
  .filter-num input { width: 100%; }
  .filter-pair { flex-direction: column; align-items: stretch; }
  .str-fit { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
@media print {
  .site-header, .compare-tray, .compare-toolbar, .filters, .replay-options, .tool-tabs, .tool-panel form, .btn-row, .load-more-row, .skip-link, #debug-panel, .toast { display: none !important; }
  body { background: #fff; }
  .view-root { padding: 0; }
  .table-wrap { max-height: none; overflow: visible; }
  .table-wrap, .plan-card, .rule-details, .health-col, .m-item, .view-static section, .tool-out { border-color: #ccc; box-shadow: none; }
  .compare-table tbody tr, .plan-card { animation: none; }
  .metrics-grid, .firm-meta, .summary-strip { background: #fff; }
  a { color: inherit; }
}
