:root {
  --paper: #f7f2e8;
  --paper-deep: #efe7d8;
  --card: #fffdf9;
  --ink: #24211d;
  --ink-2: #575046;
  --ink-3: #6e6559;
  --line: #e4dac9;
  --line-soft: #efe7d8;
  --red: #af3a2b;
  --red-bg: #fbeeeb;
  --orange: #b96b30;
  --orange-bg: #fbf0e4;
  --yellow: #96762a;
  --yellow-bg: #f8f2df;
  --green: #4c7451;
  --green-bg: #eef3ec;
  --seal: #a8332a;
  --dai: #2e5559;
  --shadow: 0 1px 2px rgba(60, 45, 25, .05), 0 10px 26px -18px rgba(60, 45, 25, .35);
  --serif: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "SimSun", serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 10% -10%, #fffaf0 0%, transparent 60%),
    radial-gradient(900px 500px at 100% 0%, #f3ede0 0%, transparent 55%),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 249, .82);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }

.brand-mark {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1;
  color: #fff6ec;
  background: linear-gradient(160deg, #b8433a, #8f2b24);
  box-shadow:
    0 0 0 1px rgba(168, 132, 63, .45),
    0 0 0 3px rgba(255, 253, 249, .9),
    0 0 0 4px rgba(168, 132, 63, .18),
    0 10px 18px -12px rgba(140, 40, 30, .65),
    inset 0 1px 0 rgba(255, 255, 255, .22),
    inset 0 0 0 1px rgba(255, 246, 236, .28);
}

.brand-text h1 {
  font-family: var(--serif);
  font-size: 24px;
  letter-spacing: .14em;
  margin: 0;
  line-height: 1.2;
}

.brand-text p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: .02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-meta { display: flex; gap: 8px; flex: none; }

.badge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge.ghost { color: var(--ink-2); border: 1px solid var(--line); background: #fffdf8; }

/* ---------- 布局 ---------- */
.workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr);
  gap: 18px;
  padding: 18px 28px;
  max-width: 1560px;
  width: 100%;
  margin: 0 auto;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-head {
  padding: 16px 20px 10px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.panel-head h2 {
  font-family: var(--serif);
  font-size: 16px;
  margin: 0;
  letter-spacing: .06em;
}

.hint { font-size: 12px; color: var(--ink-3); }

.field { padding: 0 20px 10px; }

.field-label {
  display: block;
  font-size: 12px;
  color: var(--ink-3);
  margin-bottom: 6px;
  letter-spacing: .06em;
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  border: 1px solid var(--line);
  background: #fffdf8;
  color: var(--ink-2);
  border-radius: 999px;
  padding: 3px 11px;
  font-size: 12.5px;
  cursor: pointer;
  font-family: inherit;
  transition: all .16s ease;
}
.chip:hover { border-color: #cdbfa6; color: var(--ink); }
.chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fdf8ee;
}

/* ---------- 编辑器 ---------- */
.editor-wrap {
  margin: 4px 20px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffefb;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 240px;
  position: relative;
  transition: border-color .18s, box-shadow .18s;
}
.editor-wrap:focus-within { border-color: #c9b89c; box-shadow: 0 0 0 3px rgba(168, 132, 63, .1); }

#editor {
  flex: 1;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  padding: 16px 18px;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.9;
  color: var(--ink);
  min-height: 200px;
}
#editor::placeholder { color: #b5aa99; }

.editor-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  color: var(--ink-3);
}

.editor-actions { display: flex; gap: 8px; align-items: center; }

.btn {
  font-family: inherit;
  font-size: 13px;
  border-radius: 8px;
  padding: 7px 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .16s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--seal); color: #fff8ef; box-shadow: 0 6px 14px -10px rgba(168, 51, 42, .9); }
.btn.primary:hover { background: #922b23; }
.btn.ink { background: var(--ink); color: #fbf6ea; }
.btn.ink:hover { background: #3a352e; }
.btn.ghost-btn { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn.ghost-btn:hover { border-color: #c9b89c; color: var(--ink); }
.btn kbd {
  font-family: var(--sans);
  font-size: 11px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 4px;
  padding: 0 4px;
  opacity: .8;
}
.btn.wide { padding: 5px 10px; font-size: 12.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

:focus-visible {
  outline: 2px solid var(--seal);
  outline-offset: 2px;
  border-radius: 4px;
}
.chip:focus-visible, .btn:focus-visible, .tab:focus-visible { outline-offset: 3px; }

.popover {
  position: absolute;
  right: 12px;
  bottom: 46px;
  width: min(340px, calc(100% - 24px));
  max-height: min(320px, calc(100% - 52px));
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffdf7;
  padding: 6px;
  display: grid;
  gap: 2px;
  align-content: start;
  z-index: 30;
  box-shadow: 0 18px 40px -22px rgba(60, 45, 25, .55), 0 2px 6px rgba(60, 45, 25, .06);
}
.popover[hidden] { display: none; }
.popover { scrollbar-width: thin; scrollbar-color: #ded2bd transparent; }
.popover::-webkit-scrollbar { width: 8px; }
.popover::-webkit-scrollbar-thumb { background: #ded2bd; border-radius: 4px; }
.popover button {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 8px;
  padding: 5px 9px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--ink-2);
  white-space: nowrap;
}
.popover button:hover,
.popover button:focus-visible { background: var(--paper); color: var(--ink); }
.popover .s-title { overflow: hidden; text-overflow: ellipsis; }
.popover .s-meta { flex: none; font-size: 11px; color: var(--ink-3); }

.tips {
  margin: 16px 20px 18px;
  padding: 0;
  border: 0;
  font-size: 12.5px;
  color: var(--ink-3);
}
.tips strong { font-family: var(--serif); letter-spacing: .08em; color: var(--ink-2); }
.tips ul { margin: 6px 0 0; padding-left: 16px; display: grid; gap: 3px; }

/* ---------- 结果区 ---------- */
.score-block {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, #fffdf8, #fdfaf2);
}

.ring-wrap { position: relative; width: 118px; height: 118px; flex: none; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: #ece3d3; stroke-width: 9; }
.ring-fg {
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 314;
  stroke-dashoffset: 314;
  transition: stroke-dashoffset .6s cubic-bezier(.22, .8, .28, 1), stroke .3s;
}
.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 1px;
}
.score-num {
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  align-self: center;
  letter-spacing: -.02em;
}
.score-unit { font-size: 12px; color: var(--ink-3); align-self: center; margin-top: 14px; }

.score-info { min-width: 0; flex: 1; }
.grade {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: .04em;
  margin-bottom: 6px;
}
.grade[data-tone="green"] { color: var(--green); }
.grade[data-tone="amber"] { color: var(--yellow); }
.grade[data-tone="orange"] { color: var(--orange); }
.grade[data-tone="red"] { color: var(--red); }

.pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.pill {
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.pill.red { color: var(--red); background: var(--red-bg); }
.pill.orange { color: var(--orange); background: var(--orange-bg); }
.pill.yellow { color: var(--yellow); background: var(--yellow-bg); }
.pill.green { color: var(--green); background: var(--green-bg); }

.checklist { display: grid; gap: 2px; font-size: 12.5px; color: var(--ink-2); }
.checklist div::before { content: "·"; margin-right: 6px; color: var(--ink-3); }

.result-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }

.tabs {
  display: flex;
  gap: 4px;
  padding: 10px 16px 0;
  border-bottom: 1px solid var(--line-soft);
  overflow-x: auto;
}
.tab {
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink-3);
  padding: 6px 10px 9px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tab span {
  font-size: 11px;
  background: var(--paper-deep);
  border-radius: 999px;
  padding: 0 6px;
  margin-left: 2px;
}
.tab.active { color: var(--ink); border-bottom-color: var(--seal); font-weight: 600; }

.tab-panes { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 16px 16px; }
.pane { display: none; }
.pane.active { display: block; }

/* 问题卡片 */
.findings { display: grid; gap: 10px; }

.finding {
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--ink-3);
  border-radius: 10px;
  padding: 11px 13px;
  background: #fffefa;
  cursor: pointer;
  transition: box-shadow .16s, border-color .16s, background .16s;
}
.finding:hover { box-shadow: 0 6px 18px -14px rgba(60, 45, 25, .6); }
.finding.active { background: #fffdf5; border-color: #dbc9a8; box-shadow: 0 0 0 1px #e3d2b2; }
.finding[data-sev="red"] { border-left-color: var(--red); }
.finding[data-sev="orange"] { border-left-color: var(--orange); }
.finding[data-sev="yellow"] { border-left-color: var(--yellow); }

.f-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sev {
  font-size: 11.5px;
  padding: 1px 7px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: .04em;
}
.sev.red { color: #fff; background: var(--red); }
.sev.orange { color: #fff; background: var(--orange); }
.sev.yellow { color: #fff; background: var(--yellow); }
.f-title { font-weight: 600; font-size: 13.5px; }
.f-id { margin-left: auto; font-size: 11px; color: var(--ink-3); font-family: ui-monospace, monospace; }

.f-quote {
  margin: 7px 0 4px;
  font-size: 13px;
  color: var(--ink);
  background: linear-gradient(transparent 58%, #f6e6b8 58%);
  display: inline-block;
  padding: 0 2px;
}
.f-context { font-size: 12px; color: var(--ink-3); margin-bottom: 6px; }
.f-basis { font-size: 12px; color: var(--ink-2); }
.f-basis b { font-weight: 600; color: var(--ink); }
.f-advice { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; }
.f-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line-soft);
  flex-wrap: wrap;
}
.f-status {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 4px;
  color: var(--green);
  background: var(--green-bg);
}
.f-fix { font-size: 12px; color: var(--green); background: var(--green-bg); padding: 1px 7px; border-radius: 4px; }

.empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--ink-3);
  font-size: 13px;
}
.empty b { display: block; font-family: var(--serif); font-size: 15px; color: var(--ink-2); margin-bottom: 4px; }

/* 事实核验表 */
.evidence table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.evidence th {
  text-align: left;
  font-weight: 600;
  color: var(--ink-2);
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  background: #fcf8ef;
}
.evidence td { padding: 8px; border-bottom: 1px solid var(--line-soft); vertical-align: top; color: var(--ink-2); }
.evidence td:first-child { color: var(--ink); font-weight: 600; white-space: nowrap; }
.evidence .need { white-space: nowrap; }
.evidence .need[data-need="必须删除"] { color: var(--red); }

/* 命中视图 */
.marked {
  white-space: pre-wrap;
  font-size: 14.5px;
  line-height: 2;
  color: var(--ink);
  padding: 4px 2px;
}
.marked mark {
  background: transparent;
  color: inherit;
  border-radius: 4px;
  padding: 1px 3px;
  cursor: pointer;
  font-weight: 500;
  box-decoration-break: clone;
}
.marked mark.red { background: #f6d3cb; box-shadow: inset 0 -2px 0 var(--red), 0 0 0 1px #efc3ba; }
.marked mark.orange { background: #f8e2ca; box-shadow: inset 0 -2px 0 var(--orange), 0 0 0 1px #eed3b4; }
.marked mark.yellow { background: #f5ebc4; box-shadow: inset 0 -2px 0 var(--yellow), 0 0 0 1px #e8dba8; }
.marked mark.active { outline: 2px solid var(--ink); outline-offset: 2px; }

/* 法规依据 */
.basis { display: grid; gap: 8px; }
.basis-item {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fffefa;
}
.basis-cat { font-size: 13px; font-weight: 600; display: flex; justify-content: space-between; }
.basis-cat span { font-weight: 400; color: var(--ink-3); font-size: 11.5px; }
.basis-list { margin: 5px 0 0; padding-left: 16px; font-size: 12px; color: var(--ink-2); display: grid; gap: 2px; }

/* 结果页脚 */
.result-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 16px;
  border-top: 1px solid var(--line-soft);
  background: #fdfaf3;
  font-size: 12px;
  color: var(--ink-3);
}
.note { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.engine-meta {
  flex: none;
  font-size: 11.5px;
  color: var(--ink-2);
  background: #f4ecdc;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 9px;
  max-width: 46%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.engine-meta:empty { display: none; }
.consent {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-3);
  cursor: pointer;
}
.consent[hidden] { display: none; }
.consent input { accent-color: var(--seal); }
.foot-actions { display: flex; gap: 8px; flex: none; }

/* 页脚 */
.page-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 28px 12px;
  font-size: 11.5px;
  color: var(--ink-3);
  flex-wrap: wrap;
}

/* 提示条 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fbf6ea;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 12px 30px -16px rgba(0, 0, 0, .6);
  z-index: 50;
  animation: rise .22s ease;
}
.toast[hidden] { display: none; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* 滚动条 */
.tab-panes::-webkit-scrollbar, #editor::-webkit-scrollbar { width: 8px; }
.tab-panes::-webkit-scrollbar-thumb, #editor::-webkit-scrollbar-thumb {
  background: #e0d5c2;
  border-radius: 4px;
}

/* 响应式 */
@media (max-width: 1080px) {
  .workspace { grid-template-columns: 1fr; padding: 14px 16px; }
  .topbar { padding: 12px 16px; }
  .brand-text p { display: none; }
  .page-foot { padding: 6px 16px 10px; }
  .panel { min-height: 420px; }
  .result-panel { min-height: 560px; }
}
@media (max-width: 560px) {
  .score-block { flex-direction: row; gap: 12px; }
  .ring-wrap { width: 92px; height: 92px; }
  .score-num { font-size: 30px; }
  .grade { font-size: 18px; }
  .top-meta .badge:first-child { display: none; }
  .editor-actions .btn.ghost-btn { display: none; }
}

/* ================= 介绍页 ================= */
body:not(.app-mode) .topbar,
body:not(.app-mode) .workspace,
body:not(.app-mode) .page-foot { display: none; }
body.app-mode .intro { display: none; }

.intro {
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 1080px;
  margin: 0 auto;
  padding: 36px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 34px;
}

.intro-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: .02em;
}
.intro-badge {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--ink-2);
}

.intro-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px 0 6px;
}
.intro-seal {
  width: 62px;
  height: 62px;
  border-radius: 14px;
  background: var(--seal);
  color: #fff8ef;
  font-family: var(--serif);
  font-size: 34px;
  line-height: 62px;
  margin-bottom: 14px;
  box-shadow: 0 14px 30px -18px rgba(168, 51, 42, .9);
}
.intro-hero h1 {
  font-family: var(--serif);
  font-size: 64px;
  letter-spacing: .16em;
  margin: 0;
  line-height: 1.1;
  text-indent: .16em;
}
.intro-sub {
  margin: 10px 0 0;
  font-size: 17px;
  color: var(--ink-2);
  letter-spacing: .02em;
}
.intro-lead {
  margin: 18px 0 0;
  max-width: 620px;
  font-size: 15px;
  line-height: 1.9;
  color: var(--ink-2);
}

.intro-stats {
  display: flex;
  justify-content: center;
  gap: 46px;
  margin: 28px 0 4px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  width: min(680px, 100%);
}
.intro-stats div { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.intro-stats strong { font-family: var(--serif); font-size: 30px; letter-spacing: .02em; }
.intro-stats span { font-size: 12px; color: var(--ink-3); }

.intro-cta { display: flex; align-items: center; gap: 14px; margin-top: 26px; flex-wrap: wrap; justify-content: center; }
.intro-enter {
  font-size: 17px;
  padding: 14px 46px;
  border-radius: 12px;
  box-shadow: 0 14px 30px -18px rgba(168, 51, 42, .9);
}
.intro-hint { font-size: 12px; color: var(--ink-3); }
.intro-hint a { color: var(--seal); text-decoration: none; border-bottom: 1px dashed currentColor; }

.intro-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.intro-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}
.intro-card h3 { margin: 0 0 6px; font-size: 14.5px; }
.intro-card p { margin: 0; font-size: 12.5px; line-height: 1.7; color: var(--ink-3); }

.intro-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.intro-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border: 1px dashed var(--line);
  border-radius: 12px;
}
.intro-step span {
  flex: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--paper-deep);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  display: grid;
  place-items: center;
}
.intro-step strong { font-size: 14px; }
.intro-step p { margin: 3px 0 0; font-size: 12.5px; color: var(--ink-3); line-height: 1.65; }

.intro-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--ink-3);
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

@media (max-width: 900px) {
  .intro-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .intro-steps { grid-template-columns: 1fr; }
  .intro-hero h1 { font-size: 48px; }
  .intro-stats { gap: 28px; }
}
@media (max-width: 560px) {
  .intro { padding: 20px 16px 18px; gap: 22px; }
  .intro-hero h1 { font-size: 40px; }
  .intro-sub { font-size: 15px; }
  .intro-lead { font-size: 14px; }
  .intro-stats { gap: 16px; flex-wrap: wrap; }
  .intro-stats strong { font-size: 24px; }
  .intro-enter { width: 100%; padding: 14px 0; }
  .intro-hint { width: 100%; text-align: center; }
  .intro-grid { grid-template-columns: 1fr; }
}
/* ===== 载入案例：行业分区 ===== */
.popover .sample-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 4px 8px;
  margin-bottom: 6px;
  border-bottom: 1px dashed var(--line-soft);
  font-size: 12px;
  color: var(--ink-3);
}
.popover .sample-back {
  border: 0;
  background: transparent;
  color: var(--seal);
  font: inherit;
  font-size: 12.5px;
  padding: 2px 2px;
  cursor: pointer;
}
.popover .sample-cats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.popover .sample-cat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  min-height: 38px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefb;
  font: inherit;
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
  text-align: left;
}
.popover .sample-cat em {
  flex: none;
  font-style: normal;
  font-size: 10.5px;
  color: var(--ink-3);
  background: var(--paper-deep);
  border-radius: 999px;
  padding: 0 5px;
}
.popover .sample-cat:hover,
.popover .sample-cat.current { border-color: #cdbfa6; color: var(--ink); background: #fffdf5; }
.popover .sample-list { display: grid; gap: 2px; }
/* ===== 使用说明引导 ===== */
.tour { position: fixed; inset: 0; z-index: 80; }
.tour[hidden] { display: none; }
.tour-blocker { position: absolute; inset: 0; background: transparent; }
.tour-spot {
  position: absolute;
  border: 2px dashed var(--seal);
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(30, 26, 20, .52);
  pointer-events: none;
  transition: left .2s ease, top .2s ease, width .2s ease, height .2s ease;
}
.tour-line {
  position: absolute;
  height: 0;
  border-top: 1.5px dashed var(--seal);
  transform-origin: 0 0;
  pointer-events: none;
}
.tour-card {
  position: absolute;
  width: 302px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--seal);
  border-radius: 12px;
  padding: 12px 16px 14px;
  box-shadow: 0 26px 50px -26px rgba(40, 30, 15, .65);
}
.tour-count { font-size: 11px; color: var(--ink-3); letter-spacing: .1em; }
.tour-card h3 { margin: 4px 0 6px; font-size: 16px; letter-spacing: .02em; }
.tour-card p { margin: 0; font-size: 13px; line-height: 1.75; color: var(--ink-2); }
.tour-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.tour-actions .btn { min-height: 32px; padding: 5px 12px; font-size: 12.5px; }
.tour-actions .btn:disabled { opacity: .4; }
button.badge { font: inherit; cursor: pointer; }
/* ================= 介绍页 · 质感升级 ================= */
.intro {
  position: relative;
  overflow: hidden;
}
.intro::before {
  content: "";
  position: absolute;
  inset: -10% -20% auto;
  height: 70%;
  background:
    radial-gradient(600px 260px at 18% 0%, rgba(168, 132, 63, .16), transparent 70%),
    radial-gradient(520px 240px at 82% 6%, rgba(168, 51, 42, .12), transparent 70%);
  pointer-events: none;
}
.intro::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(140, 120, 90, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140, 120, 90, .05) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(70% 60% at 50% 30%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(70% 60% at 50% 30%, #000 30%, transparent 100%);
  pointer-events: none;
}
.intro > * { position: relative; z-index: 1; }

.intro-top { letter-spacing: .04em; }
.intro-kicker { font-weight: 500; color: var(--ink-2); }
.intro-badge {
  border-color: rgba(168, 132, 63, .35);
  background: rgba(255, 253, 249, .8);
  color: #8a6b34;
  letter-spacing: .06em;
}

.intro-orn {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  color: var(--gold, #a8843f);
}
.intro-orn span { width: 64px; height: 1px; background: linear-gradient(90deg, transparent, rgba(168, 132, 63, .6)); }
.intro-orn span:last-child { background: linear-gradient(90deg, rgba(168, 132, 63, .6), transparent); }
.intro-orn i {
  font-style: normal;
  font-size: 11.5px;
  letter-spacing: .32em;
  color: #8a6b34;
  text-indent: .32em;
}

.intro-seal {
  width: 70px;
  height: 70px;
  line-height: 70px;
  font-size: 38px;
  border-radius: 16px;
  box-shadow:
    0 0 0 1px rgba(255, 248, 239, .5) inset,
    0 18px 34px -20px rgba(168, 51, 42, .95);
}
.intro-hero h1 {
  font-size: 72px;
  letter-spacing: .2em;
  text-indent: .2em;
  color: #211d19;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .7), 0 18px 40px rgba(60, 45, 25, .08);
}
.intro-sub {
  margin-top: 12px;
  font-size: 18px;
  letter-spacing: .18em;
  color: var(--ink-2);
  text-indent: .18em;
}
.intro-sub::before,
.intro-sub::after { content: "·"; margin: 0 12px; color: rgba(168, 132, 63, .7); }
.intro-lead {
  max-width: 660px;
  font-size: 15px;
  line-height: 2;
  color: var(--ink-2);
}

.intro-stats {
  gap: 12px;
  border: 0;
  padding: 0;
  width: min(720px, 100%);
  margin: 30px 0 2px;
}
.intro-stats div {
  flex: 1;
  min-width: 0;
  padding: 14px 10px 12px;
  background: rgba(255, 253, 249, .78);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.intro-stats div:hover {
  transform: translateY(-3px);
  border-color: rgba(168, 132, 63, .45);
  box-shadow: 0 18px 30px -24px rgba(60, 45, 25, .5);
}
.intro-stats strong { font-size: 34px; color: #8a5a2b; }
.intro-stats span { letter-spacing: .08em; }

.intro-cta { margin-top: 28px; gap: 12px; }
.intro-enter {
  padding: 15px 48px;
  font-size: 17px;
  letter-spacing: .12em;
  text-indent: .12em;
  border-radius: 12px;
  background: linear-gradient(180deg, #b8433a, #9b3028);
  transition: transform .16s ease, box-shadow .16s ease;
}
.intro-enter:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 40px -22px rgba(168, 51, 42, 1);
}
.intro-demo {
  min-height: 46px;
  padding: 0 18px;
  border-color: rgba(168, 132, 63, .5);
  color: #8a5a2b;
  background: rgba(255, 253, 249, .8);
}
.intro-demo:hover { border-color: #a8843f; color: #6f4620; }
.intro-hint { width: 100%; margin-top: 4px; letter-spacing: .04em; }

.intro-grid { gap: 14px; }
.intro-card {
  position: relative;
  padding: 18px 18px 16px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 253, 249, .95), rgba(255, 251, 243, .95));
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.intro-card:hover {
  transform: translateY(-4px);
  border-color: rgba(168, 132, 63, .45);
  box-shadow: 0 26px 40px -30px rgba(60, 45, 25, .6);
}
.intro-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  margin-bottom: 12px;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 18px;
  color: #fff8ef;
  background: linear-gradient(160deg, #b8433a, #8f2b24);
  box-shadow: 0 10px 18px -14px rgba(168, 51, 42, .9);
}
.intro-card h3 { margin-bottom: 8px; font-size: 15.5px; letter-spacing: .04em; }
.intro-card p { font-size: 12.5px; line-height: 1.8; }

.intro-steps { position: relative; gap: 16px; }
.intro-step {
  position: relative;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 249, .7);
}
.intro-step span {
  width: 30px;
  height: 30px;
  background: rgba(168, 132, 63, .14);
  color: #8a5a2b;
  font-family: var(--serif);
  font-size: 15px;
}
.intro-step strong { font-size: 14.5px; letter-spacing: .06em; }

.intro-foot {
  border-top: 1px solid rgba(228, 218, 201, .9);
  letter-spacing: .02em;
}

@media (prefers-reduced-motion: no-preference) {
  .intro-hero, .intro-grid, .intro-steps { animation: intro-rise .5s cubic-bezier(.22, .8, .28, 1) both; }
  .intro-grid { animation-delay: .06s; }
  .intro-steps { animation-delay: .12s; }
  @keyframes intro-rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
  }
}

@media (max-width: 900px) {
  .intro-hero h1 { font-size: 52px; }
  .intro-stats { gap: 8px; }
  .intro-stats strong { font-size: 26px; }
}
@media (max-width: 560px) {
  .intro-orn { margin-bottom: 12px; }
  .intro-hero h1 { font-size: 42px; }
  .intro-sub { font-size: 15px; letter-spacing: .08em; }
  .intro-sub::before, .intro-sub::after { margin: 0 6px; }
  .intro-stats { display: grid; grid-template-columns: 1fr 1fr; }
  .intro-enter, .intro-demo { width: 100%; }
}
/* 去掉介绍页网格叠加，避免遮罩边缘出现硬边 */
.intro::after { display: none; }


/* 装饰光斑在部分窗口尺寸下会露出矩形边缘，改用 body 自带渐变 */
.intro::before { display: none; }


.intro-seal { box-shadow: 0 0 0 1px rgba(168,132,63,.45), 0 0 0 4px rgba(255,253,249,.9), 0 0 0 5px rgba(168,132,63,.16), 0 18px 34px -20px rgba(168,51,42,.9), inset 0 1px 0 rgba(255,255,255,.22), inset 0 0 0 1px rgba(255,246,236,.28); }


/* ================= 工具界面 · 质感升级 ================= */
:root { --gold: #a8843f; }

.topbar {
  border-bottom-color: rgba(228, 218, 201, .9);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .6), 0 10px 30px -28px rgba(60, 45, 25, .5);
}
.brand-text h1 { letter-spacing: .16em; text-indent: .16em; }
.brand-text p { letter-spacing: .04em; }

.panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 252, .9), rgba(255, 253, 247, .9));
  border-color: rgba(228, 218, 201, .95);
}
.panel-head { position: relative; }
.panel-head h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 15px;
  border-radius: 2px;
  margin-right: 9px;
  vertical-align: -2px;
  background: linear-gradient(180deg, #c0503f, #8f2b24);
}
.hint { letter-spacing: .02em; }

.editor-wrap {
  background: linear-gradient(180deg, #fffefa, #fffdf7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}
.editor-foot { background: rgba(252, 248, 240, .55); }

.tips {
  position: relative;
  padding-left: 14px;
  border-left: 2px solid rgba(168, 132, 63, .45);
  margin-left: 20px;
  border-radius: 0;
}
.tips strong { color: #8a5a2b; }

.score-block {
  background: linear-gradient(180deg, #fffdf8, #fbf6ea);
  box-shadow: inset 0 -1px 0 rgba(228, 218, 201, .55);
}
.grade { letter-spacing: .06em; }
.pill { border: 1px solid rgba(0, 0, 0, .03); }

.tabs { background: linear-gradient(180deg, rgba(253, 250, 243, .9), rgba(250, 246, 236, .6)); }
.tab { border-radius: 7px 7px 0 0; transition: color .15s ease, background .15s ease; }
.tab:hover { color: var(--ink); background: rgba(255, 253, 247, .7); }
.tab.active { border-bottom-width: 2px; background: rgba(255, 253, 247, .9); }

.finding {
  background: linear-gradient(180deg, #fffefa, #fffcf5);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.finding:hover { transform: translateY(-1px); box-shadow: 0 14px 26px -22px rgba(60, 45, 25, .75); }
.finding.active { box-shadow: 0 0 0 1px #e3d2b2, 0 16px 28px -24px rgba(60, 45, 25, .7); }

.btn.primary {
  background: linear-gradient(180deg, #b8433a, #9b3028);
  border-color: #9b3028;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 16px 26px -20px rgba(168, 51, 42, 1); }
.btn.ink { transition: transform .15s ease, box-shadow .15s ease; }
.btn.ink:hover { transform: translateY(-1px); box-shadow: 0 16px 26px -20px rgba(36, 33, 29, .9); }
.btn.ghost-btn { transition: border-color .15s ease, color .15s ease, background .15s ease; }
.btn.ghost-btn:hover { background: rgba(255, 253, 247, .9); }

.result-foot {
  background: linear-gradient(180deg, #fdfaf3, #faf5ea);
  border-top-color: rgba(228, 218, 201, .9);
}
.page-foot {
  border-top: 1px solid rgba(228, 218, 201, .9);
  margin: 0 28px;
  padding: 10px 0 12px;
  letter-spacing: .02em;
}

.sample-cat.current { box-shadow: 0 0 0 1px rgba(168, 132, 63, .35) inset; }

.empty b { letter-spacing: .06em; }
.empty { background: linear-gradient(180deg, rgba(255, 255, 252, .6), rgba(253, 249, 241, .6)); }

@media (prefers-reduced-motion: reduce) {
  .finding, .btn, .tab { transition: none; }
}
/* ===== 介绍页 · 研判依据 ===== */
.intro-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  font-size: 11.5px;
  letter-spacing: .2em;
  color: var(--ink-3);
}
.intro-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}
.intro-basis-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.intro-basis-item {
  position: relative;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}
.intro-basis-item > span {
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--gold, #a8843f);
}
.intro-basis-item h3 { margin: 6px 0 7px; font-size: 14.5px; letter-spacing: .02em; }
.intro-basis-item p { margin: 0; font-size: 12.5px; line-height: 1.8; color: var(--ink-3); }
@media (max-width: 900px) {
  .intro-basis-grid { grid-template-columns: 1fr; }
}
.intro-top-right { display: flex; align-items: center; gap: 10px; }


/* 主题开关只在现代版出现 */
.theme-toggle { display: none; }


.intro-marquee { display: none; }


.hero-orbit { display: none; }


/* ===== 可点开的说明面板 ===== */
.intro-stat { cursor: pointer; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.intro-stat:hover { transform: translateY(-4px); border-color: rgba(168, 132, 63, .45); }
.intro-stat:focus-visible { outline: 2px solid var(--seal); outline-offset: 3px; }
.orbit-chip { cursor: pointer; }
.orbit-chip:hover { transform: translateY(-2px); }

.info-modal { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 24px; }
.info-modal[hidden] { display: none; }
.info-backdrop { position: absolute; inset: 0; background: rgba(30, 26, 20, .42); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.info-panel {
  position: relative; width: min(780px, 100%); max-height: min(82vh, 780px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 40px 80px -40px rgba(40, 30, 15, .55);
}
.info-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 22px 12px; border-bottom: 1px solid var(--line-soft); }
.info-kicker { margin: 0 0 4px; font-size: 11px; letter-spacing: .18em; color: var(--ink-3); }
.info-head h3 { margin: 0; font-size: 18px; letter-spacing: .02em; }
.info-close { border: 0; background: transparent; font-size: 22px; line-height: 1; color: var(--ink-3); cursor: pointer; padding: 2px 6px; border-radius: 8px; }
.info-close:hover { background: var(--line-soft); color: var(--ink); }
.info-body { overflow-y: auto; padding: 14px 22px 22px; }
.info-body h4 { margin: 18px 0 8px; font-size: 13px; letter-spacing: .06em; color: var(--ink-2); }
.info-body h4:first-child { margin-top: 2px; }
.info-row {
  display: grid; grid-template-columns: 86px 1fr auto; gap: 10px; align-items: baseline;
  padding: 9px 10px; border-radius: 10px; border: 1px solid transparent;
}
.info-row + .info-row { margin-top: 2px; }
.info-row-click { cursor: pointer; }
.info-row-click:hover { background: var(--line-soft); border-color: var(--line); }
.info-row .id { font-family: var(--mono, ui-monospace, monospace); font-size: 11.5px; color: var(--ink-3); letter-spacing: .02em; }
.info-row .t { font-size: 13.5px; }
.info-row .m { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.info-basis { grid-column: 1 / -1; margin: 6px 0 0; font-size: 12px; line-height: 1.7; color: var(--ink-2); display: none; }
.info-row.open .info-basis { display: block; }
.info-row.open { background: var(--line-soft); }
.sev-pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; line-height: 1.5; }
.sev-pill.red { background: var(--red-bg); color: var(--red); }
.sev-pill.orange { background: var(--orange-bg); color: var(--orange); }
.sev-pill.yellow { background: var(--yellow-bg); color: var(--yellow); }
.sev-pill.green { background: var(--green-bg); color: var(--green); }
.info-note { margin: 0 0 10px; font-size: 12px; line-height: 1.7; color: var(--ink-3); }
.info-kv { display: grid; grid-template-columns: 108px 1fr; gap: 8px 14px; font-size: 13px; }
.info-kv dt { color: var(--ink-3); }
.info-kv dd { margin: 0; }
.info-empty { padding: 14px 4px; font-size: 13px; color: var(--ink-3); }
@media (max-width: 560px) {
  .info-modal { padding: 12px; }
  .info-row { grid-template-columns: 1fr auto; }
  .info-row .id { grid-column: 1 / -1; }
}



/* ===== 老浏览器提示 ===== */
.legacy-tip {
  position: fixed;
  left: 16px;
  right: 16px;
  top: 16px;
  z-index: 999;
  padding: 14px 18px;
  border-radius: 12px;
  background: #fff4e5;
  border: 1px solid #e3b26a;
  color: #6b4a16;
  font-size: 14px;
  line-height: 1.65;
  box-shadow: 0 12px 30px -18px rgba(60, 45, 25, .5);
}
.legacy-tip strong { display: block; margin-bottom: 4px; font-size: 15px; }
.legacy-tip p { margin: 0; }
.legacy-tip[hidden] { display: none; }
html.legacy .legacy-tip { display: block !important; }
html.legacy .intro, html.legacy .workspace { filter: none; }

/* 输入面板内容超出时内部滚动（避免按钮压边框、风险提示被裁掉） */
.input-panel { overflow-y: auto; overscroll-behavior: contain; }
.input-panel::-webkit-scrollbar { width: 8px; }
.input-panel::-webkit-scrollbar-thumb { background: rgba(176, 141, 87, .28); border-radius: 4px; }
.editor-wrap { flex: 0 0 auto; min-height: 300px; }
#editor { min-height: 220px; }
.editor-foot { flex: none; position: relative; z-index: 2; }

/* 介绍页：允许整页滚动，避免矮窗口下被裁 */
body:not(.app-mode) { height: auto; min-height: 100%; overflow-y: auto; overflow-x: hidden; }
body:not(.app-mode) .intro { max-width: 100%; overflow: visible; }
