/* Clash 教程 —— 线路图风格：三种颜色对应 Clash 的三种出口（代理 / 直连 / 拒绝） */
:root {
  --bg: #fbfcfe;
  --surface: #ffffff;
  --sunk: #f0f3f9;
  --ink: #121a30;
  --muted: #566078;
  --line: #d8deea;
  --proxy: #2350d6;
  --direct: #14855a;
  --reject: #cc3d29;
  --code-bg: #111a30;
  --code-ink: #e4e9f5;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", Menlo, monospace;
  --measure: 44rem;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1220;
    --surface: #131a2d;
    --sunk: #182039;
    --ink: #e7ebf6;
    --muted: #9ba5bd;
    --line: #2a3450;
    --proxy: #7d9cff;
    --direct: #4fc796;
    --reject: #ff8370;
    --code-bg: #080c18;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.8 var(--sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--proxy); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--proxy); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { line-height: 1.3; font-weight: 800; letter-spacing: -.01em; text-wrap: balance; }
img, svg { max-width: 100%; height: auto; }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--bg); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: .5rem; top: .5rem; }

/* 顶栏：下边那条三色线就是站点的标志 */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.site-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px;
  background: linear-gradient(90deg, var(--proxy) 0 33.34%, var(--direct) 33.34% 66.67%, var(--reject) 66.67%);
}
.bar {
  max-width: 88rem; margin: 0 auto; padding: 0 1.25rem;
  display: flex; align-items: center; gap: 1.5rem; min-height: 3.5rem;
}
.brand {
  display: inline-flex; align-items: center; gap: .5rem; flex: none;
  color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.125rem;
}
.top-nav { display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; margin-left: auto; }
.top-nav::-webkit-scrollbar { display: none; }
.top-nav a {
  flex: none; padding: .9rem .7rem; color: var(--muted); text-decoration: none;
  font-size: .95rem; font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.top-nav a:hover { color: var(--ink); }
.top-nav a[aria-current] { color: var(--ink); border-bottom-color: var(--ink); }

/* 教程页：左目录 / 正文 / 右侧本页内容 */
.shell {
  max-width: 88rem; margin: 0 auto; padding: 0 1.25rem;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 3rem;
}
.side, .toc { display: none; }
.doc { padding: 2rem 0 4rem; min-width: 0; }
.doc > * { max-width: var(--measure); }

@media (min-width: 60rem) {
  .shell { grid-template-columns: 13rem minmax(0, 1fr); }
  .side { display: block; }
}
@media (min-width: 80rem) {
  .shell { grid-template-columns: 13rem minmax(0, 1fr) 14rem; }
  .toc { display: block; }
  .toc-inline { display: none; }
}
.side nav, .toc {
  position: sticky; top: 4rem; max-height: calc(100vh - 4rem); overflow-y: auto;
  padding: 2rem 0; font-size: .925rem;
}
.side h2 { font-size: .8125rem; font-weight: 700; color: var(--muted); margin: 1.5rem 0 .4rem; letter-spacing: 0; }
.side h2:first-child { margin-top: 0; }
.side ul, .toc ul { list-style: none; margin: 0; padding: 0; }
.side a {
  display: block; padding: .28rem .75rem; margin-left: -.75rem; border-left: 3px solid transparent;
  color: var(--ink); text-decoration: none; line-height: 1.5;
}
.side a:hover { border-left-color: var(--line); }
.side a[aria-current] { border-left-color: var(--proxy); color: var(--proxy); font-weight: 700; }
.toc p { margin: 0 0 .5rem; font-weight: 700; font-size: .8125rem; color: var(--muted); }
.toc a { display: block; padding: .2rem 0; color: var(--muted); text-decoration: none; line-height: 1.5; }
.toc a:hover { color: var(--ink); }
.toc ul ul { padding-left: .9rem; font-size: .875rem; }

.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; margin: 0 0 1.25rem; padding: 0; font-size: .875rem; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin: 0 .5rem; color: var(--line); }
.crumbs a { color: var(--muted); }

.doc-head h1 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.5rem); margin: 0 0 1rem; }
.lead { font-size: 1.125rem; color: var(--muted); margin: 0 0 .75rem; }
.stamp { font-size: .875rem; color: var(--muted); margin: 0 0 2rem; }
.toc-inline { border: 1px solid var(--line); border-radius: 6px; padding: .6rem 1rem; margin-bottom: 2rem; font-size: .95rem; }
.toc-inline summary { cursor: pointer; font-weight: 700; }
.toc-inline ul { margin: .5rem 0 .25rem; padding-left: 1.1rem; }

/* 正文排版 */
.prose h2 { font-size: 1.5rem; margin: 3rem 0 1rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.prose h3 { font-size: 1.1875rem; margin: 2rem 0 .6rem; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.15rem; }
.prose ul, .prose ol { padding-left: 1.5rem; }
.prose li { margin-bottom: .4rem; }
.prose li > ul, .prose li > ol { margin: .4rem 0 0; }
.prose ol > li::marker { font-weight: 800; color: var(--proxy); }
.prose strong { font-weight: 700; }
.prose code {
  font: .875em/1.5 var(--mono); background: var(--sunk); border: 1px solid var(--line);
  border-radius: 4px; padding: .08em .35em; overflow-wrap: anywhere;
}
.prose kbd {
  font: .85em var(--mono); border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 4px; padding: .05em .4em; background: var(--surface);
}
.hl { position: relative; margin: 0 0 1.4rem; background: var(--code-bg); border-radius: 8px; }
.hl pre {
  margin: 0; padding: 1.1rem 1.25rem; overflow-x: auto; color: var(--code-ink);
  font: .875rem/1.7 var(--mono); tab-size: 2;
}
.hl code { all: unset; }
.hl .c1, .hl .c, .hl .cm { color: #8b96b3; }
.hl .nt, .hl .na, .hl .k, .hl .kn, .hl .nb { color: #8fb0ff; }
.hl .s, .hl .s1, .hl .s2, .hl .sx { color: #7fd8ab; }
.hl .m, .hl .mi, .hl .mf, .hl .no, .hl .kc { color: #ffb38a; }
.hl .nv, .hl .o { color: #d4b8ff; }
.copy {
  position: absolute; top: .5rem; right: .5rem; font: 600 .75rem var(--sans); color: var(--code-ink);
  background: rgb(255 255 255 / .1); border: 1px solid rgb(255 255 255 / .2);
  border-radius: 5px; padding: .25rem .6rem; cursor: pointer;
}
.copy:hover { background: rgb(255 255 255 / .2); }

.table-wrap { overflow-x: auto; margin: 0 0 1.4rem; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; line-height: 1.6; }
th, td { text-align: left; padding: .65rem .9rem .65rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: .8125rem; color: var(--muted); font-weight: 700; border-bottom: 2px solid var(--ink); white-space: nowrap; }
tbody th { font-weight: 700; white-space: nowrap; }

/* 提示块：颜色沿用三条线路的含义 —— 提示=直连绿，说明=代理蓝，警告=拒绝红 */
.admonition { border-left: 4px solid var(--proxy); background: var(--sunk); padding: .9rem 1.1rem; margin: 0 0 1.4rem; border-radius: 0 6px 6px 0; }
.admonition > :last-child { margin-bottom: 0; }
.admonition-title { font-weight: 800; margin-bottom: .3rem !important; }
.admonition.tip { border-left-color: var(--direct); }
.admonition.warning { border-left-color: var(--reject); }

.faq h3 { margin-top: 1.75rem; }

.related { margin-top: 3.5rem; border-top: 2px solid var(--ink); padding-top: 1.25rem; }
.related h2 { font-size: 1.125rem; margin: 0 0 .75rem; }
.related ul { list-style: none; margin: 0; padding: 0; }
.related li { padding: .7rem 0; border-bottom: 1px solid var(--line); }
.related a { font-weight: 700; display: block; }
.related span { display: block; color: var(--muted); font-size: .925rem; line-height: 1.6; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2.5rem; }
.pager a { border: 1px solid var(--line); border-radius: 8px; padding: .8rem 1rem; text-decoration: none; font-weight: 700; line-height: 1.4; background: var(--surface); }
.pager a:hover { border-color: var(--proxy); }
.pager small { display: block; font-weight: 400; color: var(--muted); font-size: .8125rem; margin-bottom: .15rem; }
.pager .next { text-align: right; }

/* 首页 */
.home { max-width: 72rem; margin: 0 auto; padding: 0 1.25rem 4rem; }
.hero { display: grid; gap: 2rem; align-items: center; padding: 3.5rem 0 2.5rem; }
@media (min-width: 58rem) { .hero { grid-template-columns: 1fr 1fr; gap: 3rem; padding: 5rem 0 4rem; } }
.hero h1 { font-size: clamp(2.25rem, 1.3rem + 4.2vw, 4rem); line-height: 1.15; margin: 0 0 1.25rem; letter-spacing: -.02em; }
.hero .lead { font-size: 1.1875rem; max-width: 32rem; }
.get { list-style: none; display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.75rem 0 0; padding: 0; }
.get .btn { padding: .6rem 1.1rem; line-height: 1.35; }
.get small { display: block; font-weight: 400; font-size: .75rem; opacity: .85; }
.get-more { font-size: .925rem; color: var(--muted); margin: 1rem 0 0; max-width: 32rem; line-height: 1.7; }
.btn {
  display: inline-block; padding: .7rem 1.3rem; border-radius: 8px; font-weight: 700; text-decoration: none;
  background: var(--proxy); color: #fff; border: 2px solid var(--proxy);
}
.btn:hover { filter: brightness(1.1); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
@media (prefers-color-scheme: dark) { .btn { color: #0d1220; } .btn.ghost { color: var(--ink); } }

.route { margin: 0; }
.route svg { display: block; width: 100%; }
.route-label text { font: 700 17px var(--sans); fill: var(--ink); }
.route-rule text { font: 14px var(--mono); fill: var(--muted); }
.route figcaption { font-size: .925rem; color: var(--muted); line-height: 1.6; margin-top: .5rem; max-width: 30rem; }
@media (prefers-reduced-motion: reduce) { .pulse { display: none; } }

.band { padding: 2.75rem 0; border-top: 1px solid var(--line); }
.band > h2 { font-size: 1.75rem; margin: 0 0 .75rem; }
.band-intro { color: var(--muted); max-width: var(--measure); margin: 0 0 1.5rem; }
.platforms td a { font-weight: 700; white-space: nowrap; }

.steps { list-style: none; counter-reset: step; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 1.75rem; }
@media (min-width: 52rem) { .steps { grid-template-columns: repeat(3, 1fr); gap: 2.5rem; } }
.steps li { counter-increment: step; border-top: 4px solid var(--ink); padding-top: 1rem; }
.steps li:nth-child(1) { border-top-color: var(--proxy); }
.steps li:nth-child(2) { border-top-color: var(--direct); }
.steps li:nth-child(3) { border-top-color: var(--reject); }
.steps h3 { margin: 0 0 .4rem; font-size: 1.25rem; }
.steps h3::before { content: counter(step) ". "; }
.steps p { margin: 0; color: var(--muted); }

.home-prose > * { max-width: var(--measure); }
.home-prose h2:first-child { border-top: 0; padding-top: 0; margin-top: 0; font-size: 1.75rem; }

.index { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); margin-top: 1.25rem; }
.index h3 { font-size: .875rem; color: var(--muted); font-weight: 700; margin: 0 0 .5rem; }
.index ul { list-style: none; margin: 0; padding: 0; }
.index li { margin-bottom: .45rem; line-height: 1.5; }

/* 页脚 */
.site-footer { border-top: 1px solid var(--line); background: var(--sunk); font-size: .925rem; }
.footer-inner { max-width: 88rem; margin: 0 auto; padding: 2.5rem 1.25rem; }
.footer-nav { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); margin-bottom: 2rem; }
.footer-nav h2 { font-size: .8125rem; color: var(--muted); font-weight: 700; margin: 0 0 .5rem; letter-spacing: 0; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; }
.footer-nav li { margin-bottom: .3rem; }
.footer-nav a { color: var(--ink); text-decoration: none; }
.footer-nav a:hover { text-decoration: underline; }
.legal { color: var(--muted); max-width: 52rem; margin: 0 0 .5rem; line-height: 1.7; }

@media print {
  .site-header, .side, .toc, .site-footer, .pager, .copy { display: none; }
}

.prose td:first-child { white-space: nowrap; }
