/* ============================================================
   TextDiffHub — "The Proof Desk" 校对台风 / 浅色超宽
   设计隐喻：diff = 校对 galley proof。删除是红笔删除号，
   插入是绿色插入符，折叠带是编辑的"略号"。
   字体：Newsreader（编辑衬线）+ Archivo（正文）+ JetBrains Mono（校样行）。
   ============================================================ */

:root {
  --paper: #f6f3ec;
  --paper-2: #ede9de;
  --card: #fffdf7;
  --card-2: #f4f0e5;

  --ink: #22262b;
  --ink-soft: #5a6470;
  --ink-faint: #8b94a0;

  --red: #b3372b;            /* 校对红 */
  --red-deep: #8f2b21;
  --red-soft: rgba(179, 55, 43, .07);
  --red-line: rgba(179, 55, 43, .22);
  --red-strong: rgba(179, 55, 43, .20);

  --green: #1e7a4f;          /* 批注绿 */
  --green-deep: #15603c;
  --green-soft: rgba(30, 122, 79, .07);
  --green-line: rgba(30, 122, 79, .22);
  --green-strong: rgba(30, 122, 79, .20);

  --amber: #a07319;
  --amber-soft: rgba(160, 115, 25, .10);

  --line: #ddd6c6;
  --line-2: #c8bfa9;

  --radius: 14px;
  --radius-sm: 9px;
  --max-width: 1560px;
  --mono: "JetBrains Mono", "SF Mono", Consolas, monospace;
  --sans: "Archivo", "PingFang SC", "Microsoft YaHei", -apple-system, "Segoe UI", sans-serif;
  --display: "Newsreader", Georgia, serif;

  --shadow-sm: 0 1px 2px rgba(34, 38, 43, .05), 0 4px 12px rgba(34, 38, 43, .05);
  --shadow-md: 0 2px 6px rgba(34, 38, 43, .06), 0 18px 44px rgba(34, 38, 43, .10);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--ink);
  line-height: 1.7;
  font-size: 16px;
  background: var(--paper);
}

/* 纸张横纹 + 轻渐晕 */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(34, 38, 43, .013) 3px 4px),
    radial-gradient(1400px 640px at 50% -8%, rgba(255, 253, 247, .65), transparent 60%);
}

main, .site-header, .site-footer { position: relative; z-index: 1; }

::selection { background: var(--red-soft); }

.inner { max-width: var(--max-width); margin: 0 auto; padding: 0 28px; }

/* ============ Header ============ */

.site-header {
  background: rgba(246, 243, 236, .93);
  backdrop-filter: blur(8px);
  border-bottom: 1.5px solid var(--line-2);
  position: sticky; top: 0; z-index: 50;
}
.site-header .inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 11px; font-family: var(--display); font-weight: 600; font-size: 1.18rem; letter-spacing: -.01em; color: var(--ink); text-decoration: none; }
.logo:hover { color: var(--red-deep); }
.logo-img { width: 38px; height: 38px; display: block; }
.logo .td-tag {
  font-family: var(--mono); font-size: .6rem; font-weight: 600; letter-spacing: .1em;
  color: var(--red-deep); background: var(--red-soft);
  border: 1px solid var(--red-line); border-radius: 5px; padding: 2px 7px;
  transform: translateY(-2px);
}
.nav-links { display: flex; gap: 2px; list-style: none; }
.nav-links a {
  text-decoration: none; color: var(--ink-soft); font-weight: 600; font-size: .9rem;
  padding: 8px 14px; border-radius: 8px; transition: all .18s;
}
.nav-links a:hover { color: var(--red-deep); background: var(--red-soft); }

.menu-btn { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.menu-btn .bar { width: 20px; height: 2px; background: var(--ink); border-radius: 2px; transition: all .2s; }
.menu-btn[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============ 极简标题条（工具优先） ============ */

.title-strip { padding: 30px 0 18px; }
.title-row { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; }
.title-strip h1 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(1.7rem, 3vw, 2.3rem); line-height: 1.1; letter-spacing: -.012em;
}
.title-strip h1 em { font-style: italic; color: var(--red); }
.title-sub { font-size: .95rem; color: var(--ink-soft); max-width: 640px; }
.title-rule { height: 1px; background: linear-gradient(90deg, var(--line-2), transparent 70%); margin-top: 16px; }

/* ============ 校对台（工作区） ============ */

.tool-section { padding: 6px 0 30px; }
.desk {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 18px 20px 20px;
}
/* 印刷裁切角标 */
.desk::before, .desk::after {
  content: ""; position: absolute; width: 14px; height: 14px; pointer-events: none;
  border-color: var(--line-2); border-style: solid;
}
.desk::before { top: -7px; left: 18px; border-width: 1.5px 0 0 1.5px; }
.desk::after { bottom: -7px; right: 18px; border-width: 0 1.5px 1.5px 0; }

/* ---- 工具栏 ---- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.tb-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.seg { display: inline-flex; background: var(--paper-2); border: 1.5px solid var(--line-2); border-radius: 9px; padding: 3px; gap: 2px; }
.seg-btn {
  font-family: var(--mono); font-size: .74rem; font-weight: 600; letter-spacing: .04em;
  color: var(--ink-soft); background: none; border: none; border-radius: 6px;
  padding: 6px 13px; cursor: pointer; transition: all .15s;
}
.seg-btn:hover { color: var(--ink); }
.seg-btn.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }
.seg-label { font-family: var(--mono); font-size: .66rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); margin-right: -2px; }

.tgl {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-family: var(--mono); font-size: .72rem; font-weight: 600; letter-spacing: .03em;
  color: var(--ink-soft); background: var(--card);
  border: 1.5px solid var(--line-2); border-radius: 8px; padding: 7px 12px;
  transition: all .15s; user-select: none;
}
.tgl:hover { border-color: var(--ink); color: var(--ink); }
.tgl .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); transition: background .15s; }
.tgl.on { color: var(--green-deep); border-color: var(--green-line); background: var(--green-soft); }
.tgl.on .dot { background: var(--green); }

/* 印章式 Compare 按钮 */
.btn-compare {
  font-family: var(--mono); font-size: .8rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--red-deep);
  background: var(--card); border: 2px solid var(--red);
  border-radius: 8px; padding: 9px 22px; cursor: pointer;
  box-shadow: 2.5px 2.5px 0 var(--red-soft);
  transition: all .12s;
}
.btn-compare:hover { background: var(--red); color: var(--card); }
.btn-compare:active { transform: translate(2px, 2px); box-shadow: none; }

/* ---- 输入双栏 ---- */
.io-grid { display: grid; grid-template-columns: 1fr 44px 1fr; gap: 0; align-items: stretch; }
.pane { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.pane-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pane-label {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: .68rem; font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-soft);
}
.swatch { width: 9px; height: 9px; border-radius: 2.5px; }
.sw-a { background: var(--red); }
.sw-b { background: var(--green); }
.pane-tools { display: flex; gap: 6px; }
.mini-btn {
  font-family: var(--mono); font-size: .68rem; font-weight: 600; letter-spacing: .04em;
  color: var(--ink-soft); background: var(--card);
  border: 1.4px solid var(--line-2); border-radius: 7px; padding: 5px 11px;
  cursor: pointer; transition: all .15s;
}
.mini-btn:hover { color: var(--ink); border-color: var(--ink); }

textarea.ta {
  width: 100%; min-height: 230px; resize: vertical;
  font-family: var(--mono); font-size: .84rem; line-height: 1.65;
  color: var(--ink); background: var(--card);
  border: 1.6px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 13px 15px; outline: none; transition: border-color .16s, box-shadow .16s;
}
textarea.ta:focus { border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.counts { font-family: var(--mono); font-size: .68rem; color: var(--ink-faint); letter-spacing: .03em; }

.swap-btn {
  align-self: center; justify-self: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--card); border: 1.6px solid var(--line-2);
  color: var(--ink-soft); font-size: 1.05rem; cursor: pointer;
  transition: all .15s; display: flex; align-items: center; justify-content: center;
}
.swap-btn:hover { border-color: var(--red); color: var(--red); transform: rotate(180deg); }

/* ---- 统计条 ---- */
.stats-strip { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 16px 0 14px; }
.stats-label { font-family: var(--mono); font-size: .66rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); margin-right: 4px; }
.stat-badge {
  font-family: var(--mono); font-size: .72rem; font-weight: 700; letter-spacing: .03em;
  border-radius: 7px; padding: 4px 11px; border: 1.5px solid;
}
.sb-add { color: var(--green-deep); background: var(--green-soft); border-color: var(--green-line); }
.sb-del { color: var(--red-deep); background: var(--red-soft); border-color: var(--red-line); }
.sb-mod { color: #7a5a12; background: var(--amber-soft); border-color: rgba(160, 115, 25, .3); }
.sb-info { color: var(--ink-soft); background: var(--paper-2); border-color: var(--line-2); font-weight: 600; }

/* ---- Diff 输出 ---- */
.diff-out {
  border: 1.6px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--card); overflow: hidden;
}
.diff-empty {
  padding: 34px 20px; text-align: center;
  font-family: var(--mono); font-size: .78rem; color: var(--ink-faint); line-height: 1.9;
}
.identical-banner {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 14px; padding: 12px 16px;
  background: var(--green-soft); border: 1.5px solid var(--green-line);
  border-radius: var(--radius-sm); color: var(--green-deep); font-weight: 600; font-size: .9rem;
}
.warn-banner {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 14px; padding: 12px 16px;
  background: var(--amber-soft); border: 1.5px solid rgba(160, 115, 25, .3);
  border-radius: var(--radius-sm); color: #7a5a12; font-size: .88rem;
}

.diff-cols { display: grid; grid-template-columns: 1fr 1fr; }
.diff-cols.uni { grid-template-columns: 1fr; }
.dc {
  font-family: var(--mono); font-size: .66rem; font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-faint);
  padding: 9px 14px; background: var(--paper-2);
  border-bottom: 1.5px solid var(--line);
}
.dc-a { border-right: 1.5px solid var(--line); }
.dc-name { display: inline-flex; align-items: center; gap: 8px; }
.dc-name::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--red); }
.dc-b .dc-name::before { background: var(--green); }

.diff-scroll { overflow-x: auto; max-height: 640px; overflow-y: auto; }

/* 行网格：split 双栏 / unified 单栏 */
.drow { display: grid; align-items: stretch; width: max-content; min-width: 100%; }
.diff-body.split .drow { grid-template-columns: 3.4em minmax(24vw, 1fr) 3.4em minmax(24vw, 1fr); }
.diff-body.uni .drow { grid-template-columns: 3.4em 3.4em 2em 1fr; }

.ln {
  font-family: var(--mono); font-size: .7rem; color: var(--ink-faint);
  text-align: right; padding: 1px 8px 1px 4px; user-select: none;
  background: var(--paper-2); border-right: 1px solid var(--line);
  display: flex; align-items: center; justify-content: flex-end;
  min-height: 1.65em;
}
.code {
  font-family: var(--mono); font-size: .8rem; line-height: 1.65;
  white-space: pre; padding: 0 12px; min-height: 1.65em;
  display: flex; align-items: center;
}
.code.side-a { border-right: 1.5px solid var(--line); }

/* 空位（对侧无行）：斜纹填充 */
.code.gap {
  background: repeating-linear-gradient(-45deg, transparent 0 5px, rgba(34, 38, 43, .028) 5px 6px);
  min-height: 1.65em;
}

.sign {
  font-family: var(--mono); font-size: .78rem; font-weight: 700;
  text-align: center; user-select: none; display: flex; align-items: center; justify-content: center;
  border-right: 1px solid var(--line); background: var(--paper-2);
}

/* 行状态色 */
.drow.t-del .code.side-a, .drow.t-del .code:not(.gap) { background: var(--red-soft); }
.drow.t-del .ln:first-child { background: var(--red-soft); color: var(--red); border-right-color: var(--red-line); }
.drow.t-del .sign { background: var(--red-soft); color: var(--red); border-right-color: var(--red-line); }

.drow.t-add .code:not(.gap) { background: var(--green-soft); }
.drow.t-add .ln:nth-child(2), .diff-body.uni .drow.t-add .ln:nth-child(2) { background: var(--green-soft); color: var(--green); border-right-color: var(--green-line); }
.drow.t-add .sign { background: var(--green-soft); color: var(--green); border-right-color: var(--green-line); }

/* split 模式下行状态：del 行左侧红、add 行右侧绿、mod 两侧同色系 */
.diff-body.split .drow.t-del .code.side-a { background: var(--red-soft); box-shadow: inset 3px 0 0 var(--red); }
.diff-body.split .drow.t-del .ln:first-child { background: var(--red-soft); color: var(--red); border-right-color: var(--red-line); }
.diff-body.split .drow.t-add .code.side-b { background: var(--green-soft); box-shadow: inset 3px 0 0 var(--green); }
.diff-body.split .drow.t-add .ln:nth-child(3) { background: var(--green-soft); color: var(--green); border-right-color: var(--green-line); }
.diff-body.split .drow.t-mod .code.side-a { background: var(--red-soft); box-shadow: inset 3px 0 0 var(--red); }
.diff-body.split .drow.t-mod .ln:first-child { background: var(--red-soft); color: var(--red); border-right-color: var(--red-line); }
.diff-body.split .drow.t-mod .code.side-b { background: var(--green-soft); box-shadow: inset 3px 0 0 var(--green); }
.diff-body.split .drow.t-mod .ln:nth-child(3) { background: var(--green-soft); color: var(--green); border-right-color: var(--green-line); }
.diff-body.split .drow.t-mod .code.side-a { border-right: 1.5px solid var(--line); }

/* 改动词内联高亮 */
.wchg { background: var(--red-strong); border-radius: 3px; padding: 1px 0; }
.drow.t-add .wchg, .diff-body.split .drow.t-mod .code.side-b .wchg { background: var(--green-strong); }

/* 折叠带 */
.fold-band {
  display: block; width: 100%;
  font-family: var(--mono); font-size: .7rem; font-weight: 600; letter-spacing: .06em;
  color: var(--ink-soft); background: var(--paper-2);
  border: none; border-top: 1.5px dashed var(--line-2); border-bottom: 1.5px dashed var(--line-2);
  padding: 7px 14px; cursor: pointer; text-align: center;
  transition: all .15s;
}
.fold-band:hover { color: var(--red-deep); background: var(--red-soft); }
.fold-band .fb-n { color: var(--red); font-weight: 700; }

/* ---- 词/字模式：修订视图 ---- */
.track-view {
  padding: 22px 26px;
  font-family: var(--sans); font-size: 1.02rem; line-height: 2;
  color: var(--ink);
}
.track-view .track-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.tk-d {
  background: var(--red-strong); color: var(--red-deep);
  text-decoration: line-through; text-decoration-thickness: 1.5px;
  border-radius: 3px; padding: 0 2px;
}
.tk-a {
  background: var(--green-strong); color: var(--green-deep);
  border-radius: 3px; padding: 0 2px; font-weight: 600;
}

/* ============ 内容区 ============ */

.content-section { padding: 52px 0 6px; }
.sec-no {
  display: block; font-family: var(--mono); font-size: .66rem; font-weight: 600;
  letter-spacing: .2em; color: var(--red-deep); text-transform: uppercase; margin-bottom: 12px;
}
.content-section h2 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(1.65rem, 3vw, 2.2rem); line-height: 1.15; color: var(--ink);
  margin-bottom: 12px; letter-spacing: -.01em;
}
.sec-sub { color: var(--ink-soft); font-size: 1rem; max-width: 660px; margin-bottom: 30px; }

.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.feature {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 20px; box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--line-2); transition: all .2s;
}
.feature:hover { border-top-color: var(--red); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.f-icon {
  width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: var(--red-soft); color: var(--red-deep); margin-bottom: 14px;
}
.feature h3 { font-family: var(--display); font-weight: 600; font-size: 1.08rem; color: var(--ink); margin-bottom: 8px; }
.feature p { font-size: .87rem; color: var(--ink-soft); line-height: 1.62; }
.feature code { font-family: var(--mono); font-size: .82em; background: var(--paper-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 4px; color: var(--red-deep); }

/* 算法说明：三步流程 */
.algo-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 34px; align-items: start; }
.algo-steps { display: grid; gap: 14px; }
.algo-step {
  display: grid; grid-template-columns: 44px 1fr; gap: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 16px 18px;
}
.algo-no {
  font-family: var(--display); font-style: italic; font-size: 1.5rem; color: var(--red);
  border-right: 1.5px solid var(--line-2); display: flex; align-items: center; justify-content: center;
}
.algo-step h3 { font-family: var(--display); font-weight: 600; font-size: 1.02rem; margin-bottom: 5px; }
.algo-step p { font-size: .86rem; color: var(--ink-soft); line-height: 1.6; }
.algo-step code { font-family: var(--mono); font-size: .84em; background: var(--paper-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 4px; color: var(--red-deep); }
.algo-art { position: sticky; top: 90px; }
.algo-art svg { width: 100%; height: auto; display: block; }
.algo-caption { font-family: var(--mono); font-size: .68rem; color: var(--ink-faint); letter-spacing: .05em; margin-top: 10px; text-align: center; }

/* FAQ */
.faq-block { display: grid; gap: 12px; max-width: 860px; }
.faq-block details {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 4px 20px; transition: border-color .18s;
}
.faq-block details[open] { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.faq-block summary {
  cursor: pointer; list-style: none; font-weight: 700; font-size: .98rem; color: var(--ink);
  padding: 13px 0; display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.faq-block summary::-webkit-details-marker { display: none; }
.faq-block summary::after {
  content: "+"; font-family: var(--mono); font-size: 1.1rem; color: var(--red);
  flex: none; transition: transform .18s;
}
.faq-block details[open] summary::after { transform: rotate(45deg); }
.faq-block details p { color: var(--ink-soft); font-size: .92rem; padding: 0 0 16px; }
.faq-block code { font-family: var(--mono); font-size: .84em; background: var(--paper-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 4px; color: var(--red-deep); }

/* 文章占位 */
.article-list { display: grid; gap: 14px; }
.article-list a {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 16px 20px; text-decoration: none;
  transition: all .18s;
}
.article-list a:hover { transform: translateY(-2px); border-color: var(--red); box-shadow: var(--shadow-md); }
.article-list .article-title { font-weight: 700; font-size: 1.02rem; color: var(--ink); margin-bottom: 6px; line-height: 1.45; }
.article-list a:hover .article-title { color: var(--red-deep); }
.article-list .article-desc { font-size: .86rem; color: var(--ink-soft); line-height: 1.6; }

/* ============ 合规页/文章页 ============ */

.article-content { padding: 40px 0 50px; }
.article-content .inner { max-width: 800px; }
.article-content h1 { font-family: var(--display); font-weight: 600; font-size: clamp(1.8rem, 4vw, 2.4rem); line-height: 1.2; color: var(--ink); margin-bottom: 14px; }
.article-meta {
  font-family: var(--mono); font-size: .72rem; color: var(--ink-faint); letter-spacing: .05em;
  border-bottom: 1.5px solid var(--line-2); padding-bottom: 16px; margin-bottom: 26px;
}
.article-content h2 { font-family: var(--display); font-weight: 600; font-size: 1.45rem; color: var(--ink); margin: 38px 0 15px; }
.article-content h3 { font-weight: 700; font-size: 1.16rem; color: var(--ink); margin: 28px 0 12px; }
.article-content p { margin-bottom: 18px; color: #3d4437; font-size: 1.02rem; }
.article-content ul, .article-content ol { margin: 0 0 18px 26px; }
.article-content li { margin-bottom: 10px; color: #3d4437; font-size: 1.02rem; }
.article-content strong { color: var(--ink); }
.article-content code { font-family: var(--mono); font-size: .86em; background: var(--paper-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 5px; color: var(--red-deep); }
.article-content pre { background: var(--ink); color: #e9ede3; padding: 18px 20px; border-radius: 12px; overflow-x: auto; margin: 0 0 20px; font-family: var(--mono); font-size: .84rem; line-height: 1.7; }
.article-content pre code { background: none; border: none; color: inherit; padding: 0; }
.article-content blockquote { border-left: 4px solid var(--red); background: var(--red-soft); padding: 14px 20px; margin: 0 0 20px; color: var(--ink-soft); border-radius: 0 10px 10px 0; }
.article-content a { color: var(--red-deep); }

/* ============ Footer ============ */

.site-footer { margin-top: 70px; border-top: 1.5px solid var(--line-2); background: var(--paper-2); }
.site-footer .inner { padding: 34px 28px; }
.footer-links { display: flex; gap: 6px 22px; flex-wrap: wrap; margin-bottom: 16px; }
.footer-links a { color: var(--ink-soft); text-decoration: none; font-size: .86rem; font-weight: 600; }
.footer-links a:hover { color: var(--red-deep); }
.copyright { font-family: var(--mono); font-size: .72rem; color: var(--ink-faint); letter-spacing: .04em; }
.colophon { font-family: var(--display); font-style: italic; font-size: .88rem; color: var(--ink-faint); margin-top: 6px; }

/* ============ 响应式 ============ */

@media (max-width: 1160px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .algo-grid { grid-template-columns: 1fr; }
  .algo-art { position: static; max-width: 480px; }
}

@media (max-width: 860px) {
  .io-grid { grid-template-columns: 1fr; }
  .swap-btn { transform: rotate(90deg); margin: 8px auto; }
  .swap-btn:hover { transform: rotate(270deg); }
}

@media (max-width: 640px) {
  .inner { padding: 0 18px; }
  .menu-btn { display: flex; }
  .nav-links {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--card); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: all .2s;
  }
  .nav-links.open { opacity: 1; visibility: visible; transform: translateY(0); }
  .nav-links li { list-style: none; }
  .nav-links a { display: block; padding: 11px 14px; font-size: .88rem; }
  .feature-grid { grid-template-columns: 1fr; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .tb-group { justify-content: space-between; }
  .btn-compare { width: 100%; }
  .title-strip { padding-top: 20px; }
  .diff-scroll { max-height: 460px; }
}

/* 移动端导航保护：无 JS 汉堡按钮的页面（合规页）恢复可见压缩导航 */
@media (max-width: 640px) {
  .site-header .inner:not(:has(.menu-btn)) nav { display: block; }
  .site-header .inner:not(:has(.menu-btn)) .nav-links {
    position: static; opacity: 1; visibility: visible; transform: none;
    flex-direction: row; flex-wrap: wrap; gap: 0;
    background: none; border: none; box-shadow: none;
  }
  .site-header .inner:not(:has(.menu-btn)) .nav-links a { padding: 6px 9px; font-size: .8rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
