/* flclash.is — 暖白纸色 + 墨色文字 + 单一橙红强调色，扁平、无渐变 */
:root {
  --bg: #f7f5f0;
  --bg-2: #efebe3;
  --card: #ffffff;
  --card-hover: #fffdf9;
  --border: #e2ddd2;
  --border-strong: #c9c2b4;
  --text: #1c1a17;
  --muted: #6b665d;
  --accent: #c2410c;
  --accent-hover: #9a3412;
  --accent-soft: #fbe9dd;
  --ok: #2f7d4f;
  --warn: #a16207;
  --code-bg: #efebe3;
  --pre-bg: #1c1a17;
  --pre-text: #ebe6dc;
  --radius: 8px;
  --maxw: 1160px;
  --font: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Courier New", monospace;
}
html[lang="zh-TW"] { --font: -apple-system, "PingFang TC", "Microsoft JhengHei", "Segoe UI", system-ui, sans-serif; }
html[lang="en"], html[lang="ru"] { --font: -apple-system, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif; }
html[lang="fa"] { --font: "Vazirmatn", Tahoma, "Segoe UI", system-ui, sans-serif; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img, svg { max-width: 100%; display: block; }
code, pre { font-family: var(--mono); }
code {
  background: var(--code-bg);
  color: #7c2d12;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: .88em;
}
pre {
  background: var(--pre-bg);
  border-radius: var(--radius);
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--pre-text);
}
pre code { background: none; padding: 0; color: inherit; }
pre .copy-btn { background: transparent; color: #cfc8ba; border-color: #4a463f; }
pre .copy-btn:hover { background: #2c2925; color: #fff; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- Top bar ---------- */
.topbar { background: var(--text); color: #ebe6dc; font-size: 14px; }
.topbar .container {
  display: flex; align-items: center; justify-content: center;
  gap: 14px; padding-top: 8px; padding-bottom: 8px; flex-wrap: wrap; text-align: center;
}
.topbar b { color: #fff; }
.topbar .btn { padding: 4px 14px; font-size: 13px; }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.header .container { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; color: var(--text); letter-spacing: -.01em; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 30px; height: 30px; display: block; flex: none; }
.header .container { gap: 12px; }
.nav { display: flex; align-items: center; gap: 2px; margin-inline-start: auto; }
.nav a {
  color: var(--muted); padding: 6px 12px; border-radius: 6px; font-size: 15px;
}
.nav a:hover { color: var(--text); text-decoration: none; background: var(--bg-2); }
.nav a.active { color: var(--text); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.nav .btn { margin-inline-start: 10px; color: #fff; }
.nav .btn:hover { color: #fff; background: var(--accent-hover); }
.menu-toggle {
  display: none; background: none; border: 1px solid var(--border-strong); color: var(--text);
  border-radius: 6px; width: 40px; height: 40px; font-size: 20px; cursor: pointer;
}
.header-tools { display: flex; align-items: center; gap: 8px; }

/* ---------- Language switcher ---------- */
.lang-switch { position: relative; background: none; border: 0; padding: 0; margin: 0; border-radius: 0; }
.lang-switch[open] { border: 0; }
.lang-switch summary {
  display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 10px;
  border: 1px solid var(--border-strong); border-radius: 6px; font-weight: 500; font-size: 14px;
  color: var(--text); background: var(--card); user-select: none;
}
.lang-switch summary::after { content: "▾"; font-size: 11px; color: var(--muted); font-family: inherit; }
.lang-switch[open] summary::after { content: "▴"; }
.lang-switch summary:hover { border-color: var(--text); }
.lang-switch svg { width: 16px; height: 16px; flex: none; }
.lang-menu {
  position: absolute; top: calc(100% + 6px); inset-inline-end: 0; z-index: 60; min-width: 168px;
  list-style: none; background: var(--card); border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 6px; box-shadow: 0 8px 24px rgba(28, 26, 23, .12);
}
.lang-menu a { display: flex; justify-content: space-between; gap: 12px; padding: 7px 10px; border-radius: 4px; color: var(--text); font-size: 14.5px; }
.lang-menu a small { color: var(--muted); font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; }
.lang-menu a:hover { background: var(--bg-2); text-decoration: none; }
.lang-menu a[aria-current] { color: var(--accent); font-weight: 600; }
.footer-langs { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 14px; }
.footer-langs a { display: inline; padding: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: 6px; font-weight: 600; font-size: 15px;
  border: 1px solid var(--accent); cursor: pointer; transition: background .15s, border-color .15s, color .15s;
  background: var(--accent); color: #fff;
  white-space: nowrap; font-family: inherit; line-height: 1.4;
}
.btn:hover { text-decoration: none; background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-lg { padding: 13px 28px; font-size: 16.5px; }
.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: var(--card); border-color: var(--text); color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 13.5px; }
.btn-accent { background: var(--ok); border-color: var(--ok); }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 64px; text-align: center; border-bottom: 1px solid var(--border); }
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border-strong);
  color: var(--muted); padding: 3px 12px; border-radius: 4px; font-size: 13px; margin-bottom: 22px;
  font-family: var(--mono);
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.hero h1 { font-size: clamp(32px, 5.4vw, 54px); line-height: 1.2; font-weight: 800; letter-spacing: -.02em; }
.grad { background: linear-gradient(transparent 62%, var(--accent-soft) 62%); padding: 0 4px; }
.hero p.lead { color: var(--muted); font-size: clamp(16px, 2vw, 18.5px); max-width: 640px; margin: 20px auto 32px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-meta { margin-top: 20px; color: var(--muted); font-size: 14px; }
.hero-meta span { margin: 0 8px; }
.hero-shot { margin: 52px auto 0; width: 100%; max-width: 960px; height: auto; border-radius: 10px; border: 1px solid var(--border-strong); }

.platforms { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 36px; }
.platform-chip {
  display: flex; align-items: center; gap: 8px; padding: 8px 16px;
  background: var(--card); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); font-size: 14px; font-weight: 500;
}
.platform-chip:hover { border-color: var(--text); text-decoration: none; }

/* ---------- OS logos ---------- */
.os-ico { display: inline-block; width: 18px; height: 18px; object-fit: contain; vertical-align: -3px; flex-shrink: 0; }
.os-ico-lg { width: 26px; height: 26px; vertical-align: -4px; margin-inline-end: 4px; }
.platform-chip .os-ico { width: 20px; height: 20px; }
.card .icon .os-ico { width: 22px; height: 22px; }

/* ---------- Figures ---------- */
.figure { margin: 18px 0 24px; }
.figure img { width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--border-strong); background: #1c1c1e; }
.figure figcaption { color: var(--muted); font-size: 13.5px; text-align: center; margin-top: 10px; }
.quick-steps .card { position: relative; }
.quick-steps img { width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--border); margin-bottom: 16px; }
.step-no {
  position: absolute; top: 12px; inset-inline-start: 12px; width: 30px; height: 30px; border-radius: 4px;
  display: grid; place-items: center; font-weight: 700; color: #fff; z-index: 1;
  background: var(--accent); font-family: var(--mono); font-size: 14px;
}

/* ---------- Sections ---------- */
.section { padding: 68px 0; }
.section-alt { background: var(--bg-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-title { margin-bottom: 36px; }
.section-title h2 { font-size: clamp(24px, 3.4vw, 32px); font-weight: 800; letter-spacing: -.01em; }
.section-title p { color: var(--muted); margin-top: 6px; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; transition: border-color .15s;
}
.card:hover { border-color: var(--border-strong); }
.card h3 { font-size: 17.5px; margin-bottom: 6px; }
.card p { color: var(--muted); font-size: 14.5px; }
.card .icon {
  width: 40px; height: 40px; border-radius: 6px; display: grid; place-items: center;
  margin-bottom: 14px; background: var(--bg-2);
}
a.card { display: block; color: inherit; }
a.card:hover { text-decoration: none; border-color: var(--text); }
a.card:hover h3 { color: var(--accent); }
.card .more { color: var(--accent); font-size: 14px; margin-top: 12px; display: inline-block; font-weight: 600; }

/* 功能列表：编号代替图标 */
.features { counter-reset: feat; }
.features .card { position: relative; padding-top: 52px; }
.features .card::before {
  counter-increment: feat; content: counter(feat, decimal-leading-zero);
  position: absolute; top: 20px; inset-inline-start: 24px; font-family: var(--mono); font-size: 13px;
  color: var(--accent); font-weight: 700; letter-spacing: .04em;
}

/* 数字条 */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--border); }
.stats div { padding: 26px 20px; text-align: center; border-inline-start: 1px solid var(--border); }
.stats div:first-child { border-inline-start: 0; }
.stats b { display: block; font-size: 28px; font-weight: 800; font-family: var(--mono); letter-spacing: -.02em; }
.stats span { color: var(--muted); font-size: 14px; }

/* 协议列表 */
.proto-list { display: flex; flex-wrap: wrap; gap: 10px; }
.proto-list span {
  padding: 8px 14px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--card);
  font-family: var(--mono); font-size: 14px; font-weight: 600;
}
.proto-note { color: var(--muted); font-size: 14px; margin-top: 16px; }

/* 对比表 */
.compare td:first-child { font-weight: 600; white-space: nowrap; }
.compare th.hl, .compare td.hl { background: var(--accent-soft); }
.compare th.hl { color: var(--accent); }
.yes { color: var(--ok); font-weight: 600; }
.no { color: #991b1b; }

/* 首页 FAQ 摘要 */
.faq-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.faq-grid .card h3 { font-size: 16px; }

/* 更新日志 */
.changelog { list-style: none; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.changelog li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.changelog li:first-child { border-top: 0; }
.changelog .ver { font-family: var(--mono); font-weight: 700; }
.changelog .date { color: var(--muted); font-size: 13.5px; font-family: var(--mono); }
.changelog .latest { font-size: 11.5px; padding: 1px 7px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); font-weight: 600; margin-inline-start: 8px; }

/* 编号步骤 */
.num-steps { counter-reset: st; list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.num-steps li { counter-increment: st; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; }
.num-steps li::before { content: counter(st, decimal-leading-zero); display: block; font-family: var(--mono); color: var(--accent); font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.num-steps h3 { font-size: 16.5px; margin-bottom: 4px; }
.num-steps p { color: var(--muted); font-size: 14.5px; }
.sub-h { font-size: 22px; margin: 0 0 14px; }

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--text); color: #ebe6dc;
  border-radius: var(--radius); padding: 44px; text-align: center;
}
.cta-band h2 { font-size: 28px; margin-bottom: 8px; color: #fff; }
.cta-band p { color: #b8b1a4; margin-bottom: 22px; }
.cta-band b { color: #fff; }

/* ---------- Page header ---------- */
.page-head { padding: 52px 0 32px; border-bottom: 1px solid var(--border); }
.page-head h1 { font-size: clamp(28px, 4.4vw, 40px); font-weight: 800; letter-spacing: -.015em; }
.page-head h1 .os-ico-lg { width: 34px; height: 34px; vertical-align: -5px; }
.page-head p { color: var(--muted); margin-top: 8px; max-width: 760px; }
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.breadcrumb a { color: var(--muted); }

/* ---------- Download page ---------- */
.recommend {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--border); border-inline-start: 4px solid var(--accent);
  border-radius: var(--radius); padding: 24px 28px; margin: 36px 0 28px;
}
.recommend h2 { font-size: 21px; }
.recommend p { color: var(--muted); font-size: 14.5px; }
.version-tag {
  display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 13px;
  background: var(--accent-soft); color: var(--accent); font-family: var(--mono);
  font-weight: 600; margin-inline-start: 8px; vertical-align: middle;
}
.tabs { display: flex; gap: 0; flex-wrap: wrap; margin-bottom: 22px; border-bottom: 1px solid var(--border); }
.tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  color: var(--muted); font-weight: 600; cursor: pointer; font-size: 15px; font-family: inherit;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.muted-line { color: var(--muted); font-size: 14.5px; margin-bottom: 14px; }
.dl-panel { display: none; }
.dl-panel.active { display: block; }
.dl-list { display: grid; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.dl-item {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 16px 20px; border-top: 1px solid var(--border);
}
.dl-item:first-child { border-top: 0; }
.dl-item:hover { background: var(--card-hover); }
.dl-item .info h4 { font-size: 15.5px; }
.dl-item .info p { color: var(--muted); font-size: 13px; font-family: var(--mono); }
.dl-item .tag {
  font-size: 11.5px; padding: 1px 7px; border-radius: 4px; margin-inline-start: 6px; vertical-align: middle;
  background: var(--accent-soft); color: var(--accent); font-weight: 600;
}
.dl-item .actions { display: flex; gap: 10px; align-items: center; }
.size { color: var(--muted); font-size: 13px; font-family: var(--mono); }

.note {
  background: #fdf6e3; border: 1px solid #ecd9a6;
  border-radius: var(--radius); padding: 14px 18px; color: #5c4813; font-size: 14.5px;
}
.note.info { background: var(--card); border-color: var(--border); border-inline-start: 3px solid var(--text); color: var(--text); }

table { width: 100%; border-collapse: collapse; font-size: 14.5px; background: var(--card); }
th, td { text-align: start; padding: 11px 14px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: 0; }
th { color: var(--muted); font-weight: 600; background: var(--bg-2); font-size: 13.5px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }

/* ---------- Tutorials ---------- */
.doc-layout { display: grid; grid-template-columns: 230px 1fr; gap: 44px; padding-top: 40px; padding-bottom: 70px; }
.doc { min-width: 0; }
.doc-nav { position: sticky; top: 82px; align-self: start; }
.doc-nav h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 18px 0 6px; font-weight: 600; }
.doc-nav a { display: block; color: var(--muted); font-size: 14.5px; padding: 5px 12px; border-inline-start: 2px solid var(--border); }
.doc-nav a:hover { color: var(--text); text-decoration: none; border-inline-start-color: var(--border-strong); }
.doc-nav a.active { color: var(--text); font-weight: 600; border-inline-start-color: var(--accent); }
.doc article { padding-bottom: 36px; margin-bottom: 36px; border-bottom: 1px solid var(--border); scroll-margin-top: 90px; }
.doc article:last-of-type { border-bottom: none; }
.doc h2 { font-size: 24px; margin: 8px 0 12px; letter-spacing: -.01em; }
.doc h3 { font-size: 17.5px; margin: 22px 0 8px; }
.doc p, .doc li { color: #3a3631; font-size: 15.5px; }
.doc p { margin-bottom: 12px; }
.doc ol, .doc ul { padding-inline-start: 22px; margin-bottom: 14px; }
.doc .updated { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.doc li { margin-bottom: 6px; }
.doc li::marker { color: var(--accent); }
.doc pre { margin: 12px 0 16px; }
.cta-inline { margin: 10px 0 28px; padding: 30px 24px; }
.cta-inline h2 { font-size: 21px; margin-top: 0; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pager a {
  display: block; padding: 14px 18px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card); color: var(--text); font-weight: 600;
}
.pager a:hover { border-color: var(--text); text-decoration: none; }
.pager small { display: block; color: var(--muted); font-weight: 400; font-size: 12.5px; margin-bottom: 2px; }
.pager-next { text-align: end; }
.hub-group { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 36px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.hub-group:first-child { margin-top: 0; }
.hub-cards .card { display: flex; flex-direction: column; }
.hub-cards .more { margin-top: auto; padding-top: 12px; }
.hub-thumb { width: 100%; height: 150px; object-fit: cover; object-position: top; border-radius: 6px; border: 1px solid var(--border); margin-bottom: 16px; background: #1c1c1e; }

/* FAQ */
details {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 10px;
}
details[open] { border-color: var(--border-strong); }
details summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; color: var(--accent); font-size: 20px; line-height: 1; font-family: var(--mono); }
details[open] summary::after { content: "−"; }
details p { color: var(--muted); margin-top: 10px; font-size: 14.5px; }

/* ---------- Tools ---------- */
.tool { scroll-margin-top: 90px; }
.tool h3 { font-size: 19px; }
.field { margin: 14px 0; }
.field label { display: block; font-size: 13.5px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
input[type=text], input[type=number], input[type=url], textarea, select {
  width: 100%; background: var(--bg); border: 1px solid var(--border-strong); color: var(--text);
  border-radius: 6px; padding: 10px 12px; font-size: 14.5px; font-family: inherit; outline: none;
}
textarea { font-family: var(--mono); font-size: 13.5px; min-height: 130px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--text); background: #fff; box-shadow: 0 0 0 3px var(--accent-soft); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1; min-width: 160px; }
.result {
  margin-top: 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  padding: 12px 14px; font-family: var(--mono); font-size: 13.5px; white-space: pre-wrap; word-break: break-all;
  color: var(--text); min-height: 46px;
}
.result.ok { border-inline-start: 3px solid var(--ok); }
.result.err { border-inline-start: 3px solid #b91c1c; color: #991b1b; }
.tool-tip { margin-top: 12px; font-size: 13px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 14px; font-size: 14.5px; }
.kv dt { color: var(--muted); }
.kv dd { font-family: var(--mono); word-break: break-all; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); background: var(--bg-2); padding: 48px 0 28px; color: var(--muted); font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; }
.footer h5 { color: var(--text); font-size: 14px; margin-bottom: 10px; }
.footer a { color: var(--muted); display: block; padding: 3px 0; }
.footer a:hover { color: var(--text); }
.footer .logo { color: var(--text); }
.footer-bottom { border-top: 1px solid var(--border); margin-top: 34px; padding-top: 18px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 13px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(16px);
  background: var(--text); color: #fff; padding: 9px 18px;
  border-radius: 6px; opacity: 0; transition: all .2s; pointer-events: none; z-index: 100; font-size: 14px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- RTL (فارسی) ---------- */
[dir="rtl"] pre, [dir="rtl"] .result, [dir="rtl"] .fname, [dir="rtl"] .kv dd,
[dir="rtl"] input, [dir="rtl"] textarea { direction: ltr; text-align: left; }
[dir="rtl"] code { unicode-bidi: isolate; direction: ltr; }
[dir="rtl"] .hero h1, [dir="rtl"] .page-head h1, [dir="rtl"] .section-title h2 { letter-spacing: 0; }
[dir="rtl"] .doc-nav a:first-child { direction: rtl; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .doc-layout { grid-template-columns: 1fr; gap: 28px; }
  .doc-nav { position: static; display: flex; flex-wrap: wrap; gap: 4px 6px; }
  .doc-nav h4 { width: 100%; margin: 6px 0 0; }
  .doc-nav a { border: 1px solid var(--border); border-radius: 4px; padding: 3px 10px; font-size: 14px; }
  .doc-nav a.active { border-color: var(--accent); color: var(--accent); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .num-steps { grid-template-columns: 1fr; }
  .nav a { padding: 6px 9px; font-size: 14.5px; }
}
@media (max-width: 720px) {
  .menu-toggle { display: block; }
  .nav {
    display: none; position: absolute; top: 62px; left: 0; right: 0; flex-direction: column;
    align-items: stretch; background: var(--bg); border-bottom: 1px solid var(--border); padding: 10px 16px;
  }
  .nav.open { display: flex; }
  .nav a.active { box-shadow: none; color: var(--accent); }
  .nav .btn { margin: 6px 0 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .container { padding: 0 16px; }
  .hero { padding: 52px 0 46px; }
  .cta-band { padding: 30px 20px; }
  .kv { grid-template-columns: 1fr; }
  .dl-item .actions { width: 100%; }
  .dl-item .actions .btn { flex: 1; }
  .pager { grid-template-columns: 1fr; }
  .pager-next { text-align: start; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats div:nth-child(3) { border-inline-start: 0; }
  .stats div:nth-child(n+3) { border-top: 1px solid var(--border); }
  .faq-grid { grid-template-columns: 1fr; }
  .lang-switch summary span { display: none; }
  .header-tools { margin-inline-start: auto; }
  .header .container { gap: 8px; }
}

.dl-help h3 { font-size: 16px; }

/* ---------- 博客 ---------- */
.post-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.post-card { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 20px; padding: 16px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); }
.post-card:hover { border-color: var(--text); text-decoration: none; }
.post-card img { width: 210px; height: 140px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.post-card h3 { font-size: 18px; line-height: 1.4; margin: 3px 0 4px; }
.post-card p { color: var(--muted); font-size: 14.5px; line-height: 1.6; }
.post-tag { font-size: 13px; color: var(--accent); font-weight: 600; }
.post { max-width: 860px; padding-top: 28px; padding-bottom: 64px; }
.post-meta { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.post-meta .post-tag { margin-inline-end: 10px; }
.post-cover img { width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--border-strong); }
.post-points { margin: 24px 0 8px; padding: 18px 22px; background: var(--accent-soft); border-radius: var(--radius); }
.post-points ul { margin: 6px 0 0; padding-inline-start: 20px; }
.post .doc h2 { margin-top: 40px; }
.post-more { margin: 48px 0 18px; font-size: 22px; }
.figure.tall { text-align: center; }
.figure.tall img { width: auto; max-width: 320px; margin-inline: auto; }
.figure figcaption small a { color: inherit; text-decoration: underline; }
.cols { display: flex; align-items: flex-end; justify-content: space-around; gap: 10px; list-style: none; margin: 0; padding: 22px 18px 16px; background: var(--card); border: 1px solid var(--border-strong); border-radius: var(--radius); }
.doc .cols { padding-inline: 18px; }
.cols li { flex: 1; min-width: 0; margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 13px; line-height: 1.35; }
.cols b { font-family: var(--mono); font-size: 14px; }
.cols i { width: 100%; max-width: 72px; background: var(--accent); border-radius: 4px 4px 0 0; }
.cols span { color: var(--muted); overflow-wrap: anywhere; }
@media (max-width: 960px) { .post-list { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .post-card { grid-template-columns: minmax(0, 1fr); gap: 10px; } .post-card img { width: 100%; height: auto; } .cols li { font-size: 11.5px; } .cols b { font-size: 11.5px; } }

/* 页头广告：.kite-top 为电脑端，.kite-card 为手机端，.kite-dock 为手机底部条 */
.kite-top, .kite-card { background: var(--accent); color: #fff; }
.kite-top .container { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 30px; min-height: 92px; padding-block: 14px; }
.kite-meta { margin: 0; line-height: 1.35; }
.kite-meta b { display: block; font-size: 20px; }
.kite-meta span { display: inline-block; margin-top: 4px; font-size: 12px; line-height: 1.5; border: 1px solid rgba(255, 255, 255, .7); border-radius: 4px; padding: 0 7px; }
.kite-main { border-inline-start: 2px dashed rgba(255, 255, 255, .6); padding-inline-start: 30px; }
.kite-title { margin: 0; font-size: 25px; font-weight: 800; line-height: 1.35; }
.kite-title em { font-style: normal; font-size: 1.2em; background: #fff; color: var(--accent); border-radius: 5px; padding: 0 .32em; margin-inline: .12em; white-space: nowrap; }
.kite-fine { margin: 4px 0 0; font-size: 15px; }
.kite-cta { display: inline-flex; align-items: center; justify-content: center; background: var(--text); color: #fff; font-weight: 700; font-size: 17px; border-radius: 6px; padding: 15px 28px; white-space: nowrap; }
.kite-cta:hover { background: #fff; color: var(--text); text-decoration: none; }
.kite-cta:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.kite-card, .kite-dock { display: none; }
@media (max-width: 960px) { .kite-top .container { gap: 18px; } .kite-main { padding-inline-start: 18px; } .kite-title { font-size: 21px; } .kite-cta { padding: 13px 18px; font-size: 16px; } }
@media (max-width: 720px) {
  .kite-top { display: none; }
  .kite-card { display: block; padding: 14px 16px 16px; }
  .kite-card .kite-meta { display: flex; align-items: center; justify-content: space-between; }
  .kite-card .kite-meta b { font-size: 16px; }
  .kite-card .kite-meta span { margin: 0; }
  .kite-card .kite-title { margin: 6px 0 2px; font-size: 24px; }
  .kite-card .kite-fine { font-size: 13.5px; line-height: 1.55; margin: 0; }
  .kite-card .kite-cta { display: flex; min-height: 48px; margin-top: 12px; padding: 10px 14px; white-space: normal; text-align: center; }
  .kite-dock { position: fixed; inset-inline: 0; bottom: 0; z-index: 60; display: flex; align-items: center; gap: 10px; padding: 9px 6px calc(9px + env(safe-area-inset-bottom)) 16px; background: var(--text); color: #fff; }
  [dir=rtl] .kite-dock { padding-left: 6px; padding-right: 16px; }
  .kite-dock[hidden] { display: none; }
  .kite-dock div { flex: 1; min-width: 0; line-height: 1.35; }
  .kite-dock small { display: block; font-size: 11.5px; color: #cfc8bb; }
  .kite-dock strong { display: block; font-size: 15px; }
  .kite-dock .btn { flex: none; min-height: 44px; display: flex; align-items: center; padding: 0 16px; }
  .kite-dock button { flex: none; width: 44px; height: 44px; border: 0; background: none; color: #fff; font-size: 24px; line-height: 1; cursor: pointer; }
  body.has-kite-dock { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
}
@media (min-width: 721px) and (max-width: 880px) { .lang-switch summary > span { display: none; } .nav { gap: 0; } .nav a { padding: 6px 7px; font-size: 14px; } }

/* 点一下才播放的动图 */
.clip { text-align: center; }
.clip-go { position: relative; display: block; width: 100%; max-width: 300px; margin-inline: auto; }
.figure.clip img { display: block; }
.clip-go span { position: absolute; inset-inline: 12px; bottom: 14px; padding: 10px 12px; border-radius: var(--radius); background: var(--accent); color: #fff; font-weight: 600; font-size: 15px; line-height: 1.4; }
.clip-go:hover { text-decoration: none; }
.clip-go:hover span { background: var(--accent-hover); }
.clip-go.on span { background: rgba(28, 26, 23, .82); inset-inline: auto; left: 50%; transform: translateX(-50%); padding: 4px 14px; font-size: 13px; bottom: 8px; }
