:root {
  --paper: #e9f5ef;
  --ink: #12352b;
  --ink-soft: #3a6253;
  --accent: #ff8a3d;
  --accent-wash: #ffe8d8;
  --line: #b7d6c6;
  --card: #ffffff;
  --mint-deep: #cfe8db;
  --r-lg: 14px;
  --r-sm: 8px;
  --latin: "Trebuchet MS", "Segoe UI", sans-serif;
  --cjk: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --measure: 38em;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--cjk);
  font-size: 16px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--ink); text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 4px; }

.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff; padding: 10px 14px; z-index: 10; }
.skip:focus { left: 12px; top: 12px; }

.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; }

/* —— 页头 —— */
.masthead { border-bottom: 1px solid var(--line); background: var(--paper); }
.masthead-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.mark { display: block; height: 30px; width: auto; }
.mark-stub { fill: var(--ink); }
.mark-perf { stroke: var(--paper); stroke-width: 1.6; stroke-dasharray: 2 2.4; fill: none; }
.mark-dot { fill: var(--accent); }
.mark-word { font-family: var(--latin); font-size: 23px; font-weight: 700; fill: var(--ink); letter-spacing: .5px; }
.topnav { display: flex; gap: 2px; flex-wrap: wrap; }
.topnav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; text-decoration: none; border-radius: var(--r-sm); font-size: 15px; }
.topnav a:hover { background: var(--mint-deep); }
.topnav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--accent); border-radius: var(--r-sm) var(--r-sm) 0 0; }

/* —— 首页首屏 —— */
.front {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  grid-template-areas: "intro stub" "pick stub" "signup signup";
  column-gap: 56px;
  row-gap: 22px;
  padding-top: 40px;
  padding-bottom: 36px;
  align-items: start;
}
.front-intro { grid-area: intro; }
.front .stub { grid-area: stub; }
.front-pick { grid-area: pick; }
.front-signup { grid-area: signup; }
.h1-tail { display: block; }
.front h1 { font-size: 48px; line-height: 1.25; margin: 0 0 14px; letter-spacing: -.5px; font-weight: 800; }
.lead { font-size: 18px; color: var(--ink-soft); margin: 0; max-width: 32em; }

.front-pick {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px 22px 22px;
  position: relative;
}
.pick-label { margin: 0 0 4px; font-size: 14px; color: var(--ink-soft); }
.pick-label::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: 1px; }
.pick-title { margin: 0 0 8px; font-size: 22px; line-height: 1.45; }
.pick-title a { text-decoration: none; }
.pick-title a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.pick-why { margin: 0 0 14px; color: var(--ink-soft); font-size: 15px; }
.pick-go {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
  border: 2px solid var(--ink); border-radius: var(--r-sm); text-decoration: none; font-weight: 700;
}
.pick-go:hover { background: var(--ink); color: #fff; }

/* 码卡 */
.stub {
  position: relative;
  background:
    radial-gradient(circle at 30px 0, var(--paper) 11px, transparent 11.5px),
    radial-gradient(circle at 30px 100%, var(--paper) 11px, transparent 11.5px),
    var(--card);
  border-radius: var(--r-lg);
  padding: 0 22px 20px 52px;
  box-shadow: 0 1px 0 var(--line), 0 10px 24px -18px rgba(18, 53, 43, .55);
}
.stub::before {
  content: "";
  position: absolute;
  left: 27px; top: 16px; bottom: 16px;
  width: 6px;
  background: radial-gradient(circle, var(--paper) 2.6px, transparent 3px) 0 0 / 6px 12px repeat-y;
}
.stub-head {
  margin: 0 -22px 0 -52px;
  padding: 14px 22px 12px 52px;
  background: var(--accent);
  color: var(--ink);
  font-weight: 700;
  font-size: 15px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.stub-body { padding-top: 14px; }
.stub-code { margin: 0; }
.code-text {
  white-space: nowrap;
  font-family: var(--latin);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: 3px;
  line-height: 1.2;
  user-select: all;
}
.copy-btn {
  margin: 10px 0 12px;
  min-height: 44px;
  min-width: 112px;
  padding: 0 20px;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: var(--ink);
  border: 0;
  border-radius: var(--r-sm);
  cursor: pointer;
}
.copy-btn:hover { background: #0b2820; }
.copy-btn.is-done { background: var(--accent); color: var(--ink); }
.stub-gain { margin: 0 0 8px; font-size: 16px; line-height: 1.6; }
.star { text-decoration: none; font-weight: 700; padding: 0 2px; }
.stub-note { margin: 10px 0 0; font-size: 13px; line-height: 1.6; color: var(--ink-soft); border-top: 1px dashed var(--line); padding-top: 10px; }
.stub-go {
  display: flex; align-items: center; justify-content: center;
  min-height: 48px; margin: 12px 0 6px; padding: 0 16px;
  background: var(--accent); color: var(--ink); font-weight: 800;
  border-radius: var(--r-sm); text-decoration: none;
}
.stub-go:hover { background: #ff9d5c; }
.stub-disclose { margin: 0; font-size: 13px; line-height: 1.6; color: var(--ink-soft); }
.front-signup span { display: block; font-size: 13px; color: var(--ink-soft); }

/* —— 首页下半部分 —— */
.home-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 56px; padding-bottom: 56px; }
.home-prose { max-width: var(--measure); }
.home-prose h2 { font-size: 22px; margin: 34px 0 10px; line-height: 1.45; }
.home-prose h2:first-child { margin-top: 8px; }
.home-prose p, .home-prose li { font-size: 16px; }
.home-prose ul { padding-left: 1.2em; }
.home-list h2 { font-size: 18px; margin: 8px 0 12px; }
.post-list { list-style: none; margin: 0; padding: 0; }
.post-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 16px 18px; margin-bottom: 12px; }
.post-link { font-weight: 700; font-size: 17px; line-height: 1.5; text-decoration: none; display: block; }
.post-link:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.post-sum { margin: 6px 0 4px; font-size: 15px; color: var(--ink-soft); line-height: 1.7; }
.post-date { margin: 0; font-size: 13px; color: var(--ink-soft); font-family: var(--latin), var(--cjk); }
.home-more { font-size: 15px; }

/* —— 面包屑 —— */
.crumb { font-size: 14px; color: var(--ink-soft); padding: 6px 0 0; }
.crumb a { color: var(--ink-soft); display: inline-block; min-height: 44px; padding: 12px 2px; box-sizing: border-box; }
.crumb-sep { margin: 0 8px; color: var(--line); }

/* —— 文章页 —— */
.art { padding-bottom: 48px; }
.art-head { max-width: 860px; }
.art-head h1 { font-size: 40px; line-height: 1.3; margin: 10px 0 10px; font-weight: 800; }
.byline { margin: 0 0 22px; color: var(--ink-soft); font-size: 14px; }
.cover { margin: 0 0 30px; max-width: 900px; }
.cover img { border-radius: var(--r-lg); border: 1px solid var(--line); }
.cover figcaption, .shot figcaption { font-size: 13px; color: var(--ink-soft); margin-top: 8px; line-height: 1.6; }

.art-grid { display: grid; grid-template-columns: minmax(0, var(--measure)) 260px; gap: 56px; align-items: start; }
.toc { grid-column: 2; grid-row: 1; position: sticky; top: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; font-size: 14px; }
.prose { grid-column: 1; grid-row: 1; min-width: 0; }
.toc-title { margin: 0 0 6px; font-weight: 700; }
.toc ol { margin: 0; padding-left: 1.4em; }
.toc li { padding: 5px 0; line-height: 1.55; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.toc nav { display: block; }

.prose { counter-reset: stop; font-size: 17px; }
.prose > p, .prose li { line-height: 1.85; }
.prose h2 {
  counter-increment: stop;
  font-size: 25px;
  line-height: 1.45;
  margin: 48px 0 14px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex; gap: 12px; align-items: baseline;
  scroll-margin-top: 16px;
}
.prose h2::before {
  content: counter(stop);
  flex: 0 0 auto;
  font-family: var(--latin);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--ink);
  min-width: 30px; height: 30px;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  transform: translateY(-3px);
}
.prose h3 { font-size: 19px; margin: 30px 0 8px; line-height: 1.5; scroll-margin-top: 16px; }
.prose ol, .prose ul { padding-left: 1.4em; }
.prose li { margin: 4px 0; }
.prose li::marker { color: var(--ink-soft); font-family: var(--latin); font-weight: 700; }
.prose code { font-family: var(--latin), var(--cjk); background: var(--mint-deep); padding: 1px 6px; border-radius: 5px; font-size: .92em; overflow-wrap: anywhere; }
.prose strong { font-weight: 700; background: linear-gradient(transparent 62%, var(--accent-wash) 62%); }
.prose blockquote { margin: 18px 0; padding: 10px 16px; border-left: 4px solid var(--line); color: var(--ink-soft); }

/* 「到这里停一下」：站台停车牌 */
.stop {
  background: var(--card);
  border-left: 5px solid var(--accent);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: 12px 16px;
  margin: 22px 0;
  font-size: 16px;
}
.aside-note { font-size: 15px; color: var(--ink-soft); background: var(--mint-deep); border-radius: var(--r-sm); padding: 12px 16px; }

.shot { margin: 24px 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px 10px 12px; }
.shot img { border-radius: var(--r-sm); margin: 0 auto; }
.shot-narrow img { max-width: 360px; width: 100%; }
.shot figcaption { padding: 0 4px; }

.stub-slot { margin: 26px 0; max-width: 420px; }

.tbl { overflow-x: auto; margin: 20px 0; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card); }
.tbl table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 15px; }
.tbl th, .tbl td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); line-height: 1.65; }
.tbl th { background: var(--mint-deep); font-weight: 700; }
.tbl tr:last-child td { border-bottom: 0; }
.al-center { text-align: center; }
.al-right { text-align: right; }

.faq { max-width: var(--measure); margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--line); }
.faq h2 { font-size: 23px; margin: 0 0 8px; }
.qa { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px 18px; margin: 14px 0; }
.qa h3 { font-size: 17px; margin: 0 0 6px; line-height: 1.55; }
.qa p { margin: 0; font-size: 16px; }

.art-end { max-width: var(--measure); margin-top: 36px; }
.tagstrip { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.tagstrip-label { font-size: 14px; color: var(--ink-soft); }
.tag { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; background: var(--card); text-decoration: none; }
.tag-plain { background: var(--mint-deep); border-color: transparent; color: var(--ink-soft); }
.art-next p { font-size: 15px; color: var(--ink-soft); }

/* —— 列表页 / 站务页 / 搜索 —— */
.listing, .desk, .finder { padding-bottom: 56px; }
.list-head { max-width: var(--measure); }
.list-head h1, .desk h1, .finder h1 { font-size: 36px; line-height: 1.3; margin: 10px 0 12px; }
.pg-no { font-size: 18px; margin-left: 12px; color: var(--ink-soft); font-weight: 400; }
.list-intro p { margin: 0 0 10px; }
.list-count { font-size: 14px; color: var(--ink-soft); }
.listing .post-list { max-width: var(--measure); }
.pager { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; max-width: var(--measure); }
.pager a { display: inline-flex; min-height: 44px; align-items: center; }
.term-list { list-style: none; padding: 0; max-width: var(--measure); }
.term-list li { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.syn { font-size: 14px; color: var(--ink-soft); }

.desk-prose { max-width: var(--measure); }
.desk-prose h2 { font-size: 21px; margin: 32px 0 8px; display: block; padding-top: 0; border-top: 0; }
.desk-prose h2::before { content: none; }
.desk-date { font-size: 14px; color: var(--ink-soft); margin-top: 32px; }
.lost ul { padding-left: 1.2em; }
.lost li { margin: 8px 0; }

.finder .prose { max-width: var(--measure); font-size: 16px; }
.finder-form { max-width: var(--measure); margin: 18px 0 8px; }
.finder-form label { display: block; font-weight: 700; margin-bottom: 6px; }
.finder-row { display: flex; gap: 8px; }
.finder-row input {
  flex: 1 1 auto; min-width: 0; min-height: 48px; padding: 0 14px;
  font: inherit; color: var(--ink); background: var(--card);
  border: 2px solid var(--line); border-radius: var(--r-sm);
}
.finder-row input:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px var(--accent-wash); }
.finder-row button { min-height: 48px; padding: 0 20px; font: inherit; font-weight: 700; color: #fff; background: var(--ink); border: 0; border-radius: var(--r-sm); cursor: pointer; }
.finder-state { color: var(--ink-soft); font-size: 15px; }
.finder-out { list-style: none; padding: 0; max-width: var(--measure); }
.finder-out li { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px 16px; margin-bottom: 10px; }
.finder-out a { font-weight: 700; }
.finder-out p { margin: 4px 0 0; font-size: 15px; color: var(--ink-soft); }

/* —— 页脚 —— */
.colophon { background: var(--ink); color: #e3f1ea; margin-top: 24px; }
.colophon a { color: #ffffff; text-decoration-color: var(--accent); }
.colophon-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 40px; padding-top: 36px; padding-bottom: 20px; }
.colophon-about p { font-size: 14px; line-height: 1.8; margin: 10px 0 0; max-width: 36em; }
.brand-foot .mark-stub { fill: #e9f5ef; }
.brand-foot .mark-perf { stroke: var(--ink); }
.brand-foot .mark-word { fill: #e9f5ef; }
.colophon-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; align-content: start; }
.colophon-links a { display: flex; align-items: center; min-height: 44px; font-size: 15px; border-bottom: 1px solid rgba(233, 245, 239, .16); }
.colophon-base { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 28px; font-size: 13px; color: #bcd9cb; }
.colophon-base p { margin: 0; }

/* —— 窄屏 —— */
@media (max-width: 1023px) {
  .art-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { grid-column: 1; grid-row: 1; position: static; margin-bottom: 8px; }
  .prose { grid-column: 1; grid-row: 2; }
  .home-body { grid-template-columns: minmax(0, 1fr); gap: 24px; }
}

@media (max-width: 760px) {
  .masthead-row { min-height: 56px; padding-top: 4px; padding-bottom: 4px; }
  .mark { height: 26px; }
  .masthead-row { flex-wrap: nowrap; gap: 6px; }
  .topnav { flex-wrap: nowrap; gap: 0; }
  .topnav a { padding: 0 7px; font-size: 15px; white-space: nowrap; }
  .front {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "intro" "stub" "signup" "pick";
    padding-top: 18px; row-gap: 16px;
  }
  .front h1 { font-size: 32px; margin-bottom: 8px; }
  .lead { font-size: 15px; line-height: 1.7; }
  .stub { padding: 0 16px 14px 46px; }
  .stub::before { left: 24px; }
  .stub-head { margin: 0 -16px 0 -46px; padding: 10px 16px 9px 46px; font-size: 14px; }
  .stub-body { padding-top: 8px; display: grid; grid-template-columns: auto auto; align-items: center; column-gap: 12px; justify-content: start; }
  .stub-code, .stub-gain, .stub-note, .stub-go, .stub-disclose { grid-column: 1 / -1; }
  .stub-code { grid-column: 1; }
  .copy-btn { grid-column: 2; margin: 0; min-width: 88px; }
  .code-text { font-size: 28px; letter-spacing: 1px; }
  .stub-gain { margin: 6px 0 0; font-size: 15px; }
  .stub-note { margin-top: 6px; padding-top: 6px; font-size: 13.5px; }
  .front-pick { padding: 16px; }
  .pick-title { font-size: 18px; }
  .pick-why { font-size: 14.5px; margin-bottom: 10px; }
  .art-head h1 { font-size: 30px; }
  .prose { font-size: 16px; }
  .prose h2 { font-size: 21px; margin-top: 38px; }
  .list-head h1, .desk h1, .finder h1 { font-size: 28px; }
  .colophon-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}

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