/* v2rayN 教程 —— 操作手册风格：宋体标题、青绿主色、琥珀色标记步骤和「当前选中」 */
:root {
  --paper: #f5f7f4;
  --card: #ffffff;
  --ink: #15231f;
  --soft: #51615c;
  --rule: #cfd9d3;
  --teal: #0a6a5c;
  --teal-ink: #ffffff;
  --amber: #e0a100;
  --amber-bg: #fff3cf;
  --bad: #b3261e;
  --code-bg: #10201c;
  --code-ink: #dfeae6;
  --serif: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif CN", STSong, SimSun, "Noto Serif", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, Menlo, monospace;
  --wide: 76rem;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1a17; --card: #15231f; --ink: #e6eeea; --soft: #9fb0aa; --rule: #2b3d37;
    --teal: #5fd1bd; --teal-ink: #0b1714; --amber: #f0bf4a; --amber-bg: #3a3112; --bad: #ff8a80;
    --code-bg: #0a1310;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1.5rem; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.85 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--teal); text-decoration-thickness: 1px; text-underline-offset: .22em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 900; line-height: 1.35; text-wrap: balance; margin: 0; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: .5rem 1rem; z-index: 9; }
.skip:focus { left: .5rem; top: .5rem; }

/* 报头 */
.mast { border-bottom: 3px solid var(--ink); background: var(--paper); }
.mast-in { max-width: var(--wide); margin: 0 auto; padding: .9rem 1.25rem 0; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 2rem; }
.brand { font: 900 1.375rem var(--serif); color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: .55rem; padding-bottom: .7rem; }
.brand-mark { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; background: var(--teal); color: var(--teal-ink); font: 800 1.05rem var(--sans); border-bottom: 3px solid var(--amber); }
.mast-nav { display: flex; overflow-x: auto; scrollbar-width: none; margin-left: auto; max-width: 100%; }
.mast-nav::-webkit-scrollbar { display: none; }
.mast-nav a { flex: none; padding: .35rem .8rem .7rem; color: var(--soft); text-decoration: none; font-size: .95rem; font-weight: 600; }
.mast-nav a:hover { color: var(--ink); }
.mast-nav a[aria-current] { color: var(--paper); background: var(--ink); }

/* 文章页 */
.page { max-width: var(--wide); margin: 0 auto; padding: 0 1.25rem 4rem; }
.page-head { padding: 2.25rem 0 2rem; border-bottom: 1px solid var(--rule); max-width: 54rem; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; margin: 0 0 1rem; padding: 0; font-size: .875rem; color: var(--soft); }
.crumbs li + li::before { content: "›"; margin: 0 .5rem; }
.crumbs a { color: var(--soft); }
.page-head h1 { font-size: clamp(1.8rem, 1.2rem + 2.4vw, 2.75rem); margin-bottom: 1rem; }
.lead { font-size: 1.125rem; color: var(--soft); margin: 0; }
.stamp { font-size: .875rem; color: var(--soft); margin: .9rem 0 0; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 3.5rem; padding-top: 2rem; }
.body { min-width: 0; max-width: 46rem; }
.toc { font-size: .95rem; margin-bottom: 1.5rem; }
.toc details { border: 1px solid var(--rule); background: var(--card); padding: .7rem 1rem; }
.toc summary { font-weight: 700; cursor: pointer; }
.toc ol { margin: .6rem 0 .2rem; padding-left: 1.4rem; }
.toc li { margin: .25rem 0; line-height: 1.5; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--teal); text-decoration: underline; }
@media (min-width: 62rem) {
  .cols { grid-template-columns: 15rem minmax(0, 1fr); }
  .toc { position: sticky; top: 1.5rem; align-self: start; max-height: calc(100vh - 3rem); overflow-y: auto; }
  .toc details { border: 0; border-top: 3px solid var(--teal); background: none; padding: .8rem 0 0; }
  .toc summary { list-style: none; cursor: default; pointer-events: none; font-family: var(--serif); font-size: 1.05rem; }
  .toc summary::-webkit-details-marker { display: none; }
}

/* 正文 */
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 1.625rem; margin: 3rem 0 1rem; padding-left: .8rem; border-left: 6px solid var(--teal); }
.prose h3 { font-size: 1.2rem; margin: 2rem 0 .6rem; }
.prose p, .prose ul, .prose ol, .prose dl { margin: 0 0 1.2rem; }
.prose ul { padding-left: 1.4rem; }
.prose li { margin-bottom: .45rem; }
.prose li > ul, .prose li > ol { margin: .45rem 0 0; }
.prose strong { font-weight: 700; background: linear-gradient(transparent 62%, var(--amber-bg) 62%); }
/* 步骤：有序列表用琥珀色方块编号，因为内容确实是按顺序操作的 */
.prose ol { list-style: none; counter-reset: step; padding-left: 0; }
.prose ol > li { counter-increment: step; position: relative; padding-left: 2.6rem; margin-bottom: .8rem; }
.prose ol > li::before {
  content: counter(step); position: absolute; left: 0; top: .2rem; width: 1.75rem; height: 1.75rem;
  display: grid; place-items: center; background: var(--amber); color: #15231f; font: 800 .95rem/1 var(--sans);
}
.prose code { font: .875em/1.5 var(--mono); background: var(--card); border: 1px solid var(--rule); padding: .08em .35em; overflow-wrap: anywhere; }
.prose kbd { font: .85em var(--mono); background: var(--card); border: 1px solid var(--soft); border-bottom-width: 2px; border-radius: 3px; padding: .05em .4em; white-space: nowrap; }
.hl { position: relative; margin: 0 0 1.4rem; background: var(--code-bg); border-left: 6px solid var(--amber); }
.hl pre { margin: 0; padding: 1rem 1.2rem; 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: #86a199; }
.hl .nt, .hl .na, .hl .k, .hl .nb, .hl .nl { color: #7fdccb; }
.hl .s, .hl .s1, .hl .s2 { color: #f3cf7a; }
.hl .m, .hl .mi, .hl .kc { color: #f5a97f; }
.copy { position: absolute; top: .45rem; right: .45rem; font: 600 .75rem var(--sans); color: var(--code-ink); background: transparent; border: 1px solid #ffffff55; padding: .2rem .55rem; cursor: pointer; }
.copy:hover { background: #ffffff22; }
.table-wrap { overflow-x: auto; margin: 0 0 1.4rem; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; line-height: 1.6; background: var(--card); }
th, td { text-align: left; padding: .6rem .8rem; border: 1px solid var(--rule); vertical-align: top; }
thead th { background: var(--ink); color: var(--paper); border-color: var(--ink); font-weight: 700; white-space: nowrap; }
tbody th, .prose td:first-child { font-weight: 700; white-space: nowrap; }
.admonition { border: 1px solid var(--rule); border-top: 4px solid var(--teal); background: var(--card); padding: .9rem 1.1rem; margin: 0 0 1.4rem; }
.admonition > :last-child { margin-bottom: 0; }
.admonition-title { font-weight: 800; margin-bottom: .3rem !important; }
.admonition.tip { border-top-color: var(--amber); }
.admonition.warning { border-top-color: var(--bad); }
.prose dt { font-weight: 800; font-family: var(--serif); font-size: 1.1rem; margin-top: 1.2rem; }
.prose dd { margin: .2rem 0 0; }
.faq h3 { margin-top: 1.75rem; }
.faq h3::before { content: "问"; display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; margin-right: .5rem; background: var(--teal); color: var(--teal-ink); font: 700 .8rem var(--sans); vertical-align: .15em; }

.next { margin-top: 3.5rem; padding: 1.25rem 1.4rem .6rem; background: var(--card); border: 1px solid var(--rule); }
.next h2 { font-size: 1.15rem; margin-bottom: .6rem; }
.next ul { list-style: none; margin: 0; padding: 0; }
.next li { padding: .7rem 0; border-top: 1px dashed var(--rule); }
.next a { font-weight: 700; }
.next p { margin: .15rem 0 0; color: var(--soft); font-size: .925rem; line-height: 1.6; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2rem; }
.pager a { padding: .75rem 1rem; border-top: 3px solid var(--ink); text-decoration: none; font-weight: 700; line-height: 1.4; color: var(--ink); }
.pager a:hover { border-top-color: var(--teal); color: var(--teal); }
.pager small { display: block; font-weight: 400; color: var(--soft); font-size: .8125rem; }
.pager .fwd { text-align: right; }

/* 首页 */
.home { max-width: var(--wide); margin: 0 auto; padding: 0 1.25rem 4rem; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; padding: 3rem 0; align-items: start; }
.hero > * { min-width: 0; }
@media (min-width: 60rem) { .hero { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 3.5rem; padding: 4.5rem 0 4rem; } }
.hero h1 { font-size: clamp(2.1rem, 1.2rem + 3.6vw, 3.6rem); line-height: 1.25; margin-bottom: 1.25rem; }
.dl { list-style: none; display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.75rem 0 0; padding: 0; }
.btn { display: block; padding: .65rem 1.25rem; background: var(--teal); color: var(--teal-ink); border: 2px solid var(--teal); font-weight: 800; text-decoration: none; line-height: 1.4; box-shadow: 4px 4px 0 var(--amber); }
.btn:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--amber); }
.btn.alt { background: var(--card); color: var(--ink); border-color: var(--ink); }
.btn small { display: block; font-weight: 400; font-size: .78rem; opacity: .85; }
.dl-note { font-size: .925rem; color: var(--soft); margin: 1.25rem 0 0; line-height: 1.7; }
.win { margin: 0; border: 2px solid var(--ink); background: var(--card); box-shadow: 8px 8px 0 var(--rule); }
.win-bar { display: flex; gap: 1.25rem; align-items: baseline; padding: .45rem .8rem; background: var(--ink); color: var(--paper); font-size: .85rem; font-weight: 700; }
.win-menu { font-weight: 400; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win .table-wrap { margin: 0; }
.win table { font-size: .875rem; }
.win th, .win td { border-width: 0 0 1px; padding: .5rem .8rem; white-space: nowrap; }
.win thead th { background: var(--paper); color: var(--soft); border-color: var(--rule); }
.win td:last-child, .win th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.win tr.on td { background: var(--amber-bg); font-weight: 700; }
.win tr.on td:first-child { box-shadow: inset 5px 0 0 var(--amber); }
.win tr.bad td:last-child { color: var(--bad); }
.win-foot { display: flex; flex-wrap: wrap; gap: .3rem 1.25rem; padding: .45rem .8rem; font-size: .8rem; color: var(--soft); border-bottom: 1px solid var(--rule); }
.win figcaption { padding: .8rem; font-size: .9rem; color: var(--soft); line-height: 1.65; }
.strip { padding: 2.75rem 0; border-top: 1px solid var(--rule); }
.strip > h2 { font-size: 1.85rem; margin-bottom: 1.25rem; }
.path { list-style: none; counter-reset: p; margin: 0; padding: 0; display: grid; gap: 1.5rem; }
@media (min-width: 46rem) { .path { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 70rem) { .path { grid-template-columns: repeat(4, 1fr); } }
.path li { counter-increment: p; position: relative; padding-top: 3.4rem; }
.path li::before { content: counter(p); position: absolute; top: 0; left: 0; width: 2.5rem; height: 2.5rem; display: grid; place-items: center; background: var(--amber); color: #15231f; font: 900 1.3rem/1 var(--sans); }
.path li::after { content: ""; position: absolute; top: 1.2rem; left: 3rem; right: 0; border-top: 2px dashed var(--rule); }
.path h3 { font-size: 1.2rem; margin-bottom: .35rem; }
.path p { margin: 0; color: var(--soft); font-size: .975rem; }
.plat td a { font-weight: 700; white-space: nowrap; }
.home-prose > * { max-width: 46rem; }
.home-prose h2:first-child { border: 0; padding: 0; margin-top: 0; font-size: 1.85rem; }
.group { font-size: 1.1rem; margin: 1.75rem 0 .5rem; color: var(--teal); }
.index { margin: 0; display: grid; gap: 0 3rem; }
@media (min-width: 52rem) { .index { grid-template-columns: 1fr 1fr; } }
.index div { padding: .8rem 0; border-top: 1px dashed var(--rule); }
.index dt { font-weight: 700; }
.index dd { margin: .15rem 0 0; color: var(--soft); font-size: .925rem; line-height: 1.6; }

/* 页脚 */
.foot { background: var(--ink); color: #c9d6d1; font-size: .925rem; }
.foot-in { max-width: var(--wide); margin: 0 auto; padding: 2.5rem 1.25rem; }
.foot-nav { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); margin-bottom: 2rem; }
.foot-nav h2 { font: 700 .875rem var(--sans); color: #fff; margin-bottom: .5rem; }
.foot-nav ul { list-style: none; margin: 0; padding: 0; }
.foot-nav li { margin-bottom: .3rem; }
.foot a { color: #c9d6d1; text-decoration: none; }
.foot a:hover { color: #fff; text-decoration: underline; }
.legal { max-width: 52rem; margin: 0 0 .5rem; line-height: 1.7; opacity: .85; }
.legal a { text-decoration: underline; }
@media (prefers-color-scheme: dark) { .foot { background: #0a1310; } .mast-nav a[aria-current] { color: #0f1a17; } }
@media print { .mast, .toc, .foot, .pager, .copy { display: none; } }
