.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: max(700px,calc(100vh - var(--nav-h) - 60px));
  min-height: max(700px,calc(100svh - var(--nav-h) - 60px));
  display: grid;
  place-items: center;
  align-content: center;
  padding: 48px 24px;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(var(--grid) 1px,var(--clear) 1px),linear-gradient(90deg,var(--grid) 1px,var(--clear) 1px);
  color: var(--text);
  background-size: 64px 64px;
  background-position: center;
  -webkit-mask-image: radial-gradient(ellipse 62% 70% at 50% 50%,var(--mask-solid) 34%,var(--clear) 100%);
  mask-image: radial-gradient(ellipse 62% 70% at 50% 50%,var(--mask-solid) 34%,var(--clear) 100%);
}
.frame {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: 1360px;
  height: 720px;
  transform: translate(-50%,-50%) scale(var(--frame-scale));
  pointer-events: none;
}
.trail {
  position: absolute;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  -webkit-mask-image: radial-gradient(ellipse 480px 300px at 50% 50%,var(--mask-faint) 0%,var(--mask-faint) 58%,var(--mask-solid) 100%);
  mask-image: radial-gradient(ellipse 480px 300px at 50% 50%,var(--mask-faint) 0%,var(--mask-faint) 58%,var(--mask-solid) 100%);
}
.trail path { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 5 8; stroke-linecap: round; opacity: .62; }
.comet { position: absolute; left: 62px; top: 667px; width: 90px; height: 9px; transform: rotate(-17deg); }
.comet::before {
  content: "";
  position: absolute;
  inset: 3.5px 6px auto 0;
  height: 2px;
  border-radius: var(--r-line);
  background: linear-gradient(90deg,var(--clear),var(--accent));
  color: var(--text);
}
.comet::after {
  content: "";
  position: absolute;
  right: 0;
  width: 9px; height: 9px;
  border-radius: var(--r-round);
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 0 0 4px var(--accent-ring);
}
.tiles { position: absolute; inset: 0; z-index: 2; }
.tile {
  position: absolute;
  width: 64px; height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-tile);
  box-shadow: var(--shadow-tile);
  pointer-events: auto;
  transition: transform .25s var(--ease),box-shadow .25s var(--ease),border-color .25s var(--ease);
}
.tile:hover,.tile:focus-visible { transform: translateY(-4px); box-shadow: var(--shadow-tile-hover); border-color: var(--accent-line); }
.tile svg { width: 22px; height: 22px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tile-ic { display: grid; place-items: center; flex-shrink: 0; width: 30px; height: 30px; border-radius: var(--r-round); }
.tile-ic svg { width: 18px; height: 18px; }
.tile-ic--green,.stage--green { background: var(--soft-green); color: var(--accent-dark); }
.tile-ic--pink,.stage--pink { background: var(--soft-pink); color: var(--text); }
.tile-ic--yellow,.stage--yellow { background: var(--soft-yellow); color: var(--text); }
.tile-ic--blue,.stage--blue { background: var(--soft-blue); color: var(--text); }
.tile-lb { font-size: 9.5px; font-weight: 650; line-height: 1.05; letter-spacing: .01em; text-align: center; color: var(--muted); }
.t-verge { left: 70px; top: 96px; }
.t-sub { left: 300px; top: 30px; }
.t-rules { left: 196px; top: 250px; }
.t-mihomo { left: 48px; top: 404px; }
.t-tun { left: 118px; top: 622px; }
.t-yaml { left: 241px; top: 576px; }
.t-geoip { left: 1175px; top: 70px; }
.t-flclash { left: 1040px; top: 146px; }
.t-strategy { left: 1250px; top: 268px; }
.t-dns { left: 1078px; top: 372px; }
.t-cmfa { left: 1262px; top: 470px; }
.t-fakeip { left: 1120px; top: 600px; }
.hero-copy {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  max-width: 720px;
}
.badge,.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--panel-2);
  color: var(--muted);
  font-size: var(--size-small);
  font-weight: 600;
  overflow-wrap: anywhere;
}
.hero .badge {
  gap: 10px;
  min-height: 32px;
  margin-bottom: 26px;
  padding: 0 15px 0 12px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}
.badge-dot { flex: none; width: 8px; height: 8px; border-radius: var(--r-round); background: var(--accent); color: var(--text); box-shadow: 0 0 0 4px var(--accent-ring); }
.hero h1 { font-size: var(--size-hero); line-height: 1.15; }
.hero h1 .hero-line { display: block; }
.lede { margin-top: 20px; max-width: 540px; font-size: 17px; line-height: 1.72; color: var(--muted); }
.lede strong { color: var(--text); font-weight: 650; }
.dlbar {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(640px,100%);
  margin-top: 32px;
  padding: 6px 6px 6px 10px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-md);
}
.dlbar-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; text-align: left; }
.dlbar-ic { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-round); background: var(--soft-green); color: var(--accent-dark); }
.dlbar-ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dlbar-text { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }
.btn-primary { flex: none; min-height: 52px; padding: 0 26px; border: 0; background: var(--accent); color: var(--on-accent); font-size: 16px; letter-spacing: .01em; }
.btn-primary:hover { background: var(--accent-dark); color: var(--on-accent); }
.arr { display: inline-block; flex: none; transition: transform var(--fast) var(--ease); }
.btn-primary:hover .arr,.sublink:hover .arr,.more:hover .arr { transform: translateX(3px); }
.sublink,.more { display: inline-flex; align-items: center; gap: 6px; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; font-weight: 600; }
.sublink { margin-top: 16px; color: var(--accent-dark); font-size: 14.5px; text-decoration-color: var(--accent-line); }
.sublink:hover { text-decoration-color: var(--accent-dark); }
.more { margin-top: 20px; color: var(--text); font-size: 15px; }
.platforms,.chips { display: flex; flex-wrap: wrap; justify-content: center; }
.platforms { gap: 8px 26px; margin-top: 30px; }
.pf { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; color: var(--muted); }
.pf svg { width: 16px; height: 16px; }
.pf:hover { color: var(--text); }
.chips { gap: 8px; margin-top: 18px; }

.features { position: relative; padding-inline: var(--gutter); padding-bottom: clamp(80px,9vw,120px); }
.bento { max-width: var(--wide-width); margin-inline: auto; display: grid; grid-template-columns: repeat(12,minmax(0,1fr)); gap: 24px; }
.bento .card { grid-column: span 7; display: flex; flex-direction: column; }
.bento .card--5 { grid-column: span 5; }
.stage { position: relative; height: 300px; overflow: hidden; border-radius: var(--r-stage); }
.card-body { padding: 28px 20px 20px; }
.card h3 { margin-top: 10px; }
.desc { margin-top: 12px; font-size: 15.5px; line-height: 1.8; color: var(--muted); }
.ui {
  position: absolute;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-ui);
  box-shadow: var(--shadow-float);
  font-size: var(--size-small);
}
.ui-bar { display: flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 14px; border-bottom: 1px solid var(--border); font-size: 12.5px; font-weight: 650; }
.ui-bar i { flex: none; width: 8px; height: 8px; border-radius: var(--r-round); background: var(--border); color: var(--text); }
.ui-bar span { margin-inline-start: 8px; }
.ui-body { display: grid; gap: 12px; padding: 14px 16px 16px; }
.ui-label { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.ui-input,.seg,.log-row { background: var(--panel-2); color: var(--text); border-radius: var(--r-field); }
.ui-input { display: flex; align-items: center; min-height: 38px; padding: 4px 12px; border: 1px solid var(--border); font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.ui-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ui-row--line { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.ui-row--line:last-child { border-bottom: 0; }
.ui-select,.ui-btn { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 10px; border: 1px solid var(--border); border-radius: var(--r-small); font-size: 12px; font-weight: 650; }
.ui-select { background: var(--panel); color: var(--text); }
.ui-btn { background: var(--accent-dark); color: var(--on-accent); border-color: var(--accent-dark); }
.ui-actions { display: flex; justify-content: flex-end; }
.sw { position: relative; flex: none; width: 34px; height: 20px; border-radius: var(--r-pill); background: var(--border); color: var(--text); }
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: var(--r-round); background: var(--panel); color: var(--text); box-shadow: var(--shadow-xs); }
.sw.is-on { background: var(--accent); color: var(--on-accent); }
.sw.is-on::after { transform: translateX(14px); }
.seg { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); padding: 4px; border: 1px solid var(--border); }
.seg span { padding: 7px 0; border-radius: var(--r-small); text-align: center; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.seg .on { background: var(--panel); color: var(--text); box-shadow: var(--shadow-xs); }
.log-row { padding: 8px 10px; font-family: var(--font-mono); font-size: 11.5px; overflow-wrap: anywhere; }
.ui--main { left: clamp(16px,4vw,56px); top: 38px; width: min(440px,calc(100% - 2 * clamp(16px,4vw,56px))); }
.ui--float { right: 25px; bottom: 24px; width: min(245px,calc(100% - 42px)); transform: rotate(1.2deg); }
.ui--float .ui-row { padding: 12px; }
.stage--pink .ui--float { right: -14px; bottom: 22px; transform: rotate(-1.4deg); }
.stage--blue .ui--float { width: 150px; }
.hero-window {
  left: 837px;
  top: 570px;
  width: 218px;
  box-shadow: var(--shadow-md);
  transform: rotate(-2deg);
}
.hero-window .ui-body { padding: 8px 12px 10px; }

[role="tablist"] { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; background: var(--panel-2); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-ui); }
[role="tab"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap-size);
  max-width: 100%;
  padding: 6px 14px;
  border: 1px solid var(--clear);
  border-radius: var(--r-field);
  background: var(--clear);
  color: var(--muted);
  text-align: center;
}
[role="tab"]:hover { color: var(--accent-dark); }
[role="tab"][aria-selected="true"] { border-color: var(--border); background: var(--panel); color: var(--accent-dark); font-weight: 700; box-shadow: var(--shadow-xs); }
[role="tabpanel"] { min-width: 0; margin-top: 14px; }
.toc-tabs {
  position: sticky;
  top: var(--nav-h);
  z-index: 10;
  display: flex;
  gap: 6px;
  max-width: 100%;
  overflow-x: auto;
  padding: 6px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-ui);
  box-shadow: var(--shadow-tile);
}
.toc-tabs.is-static { position: static; }
.toc-tabs a { display: inline-flex; flex: none; align-items: center; justify-content: center; min-height: var(--tap-size); padding-inline: 12px; border-radius: var(--r-pill); white-space: nowrap; }
.toc-tabs a:hover,.toc-tabs a[aria-current] { background: var(--soft-green); color: var(--accent-dark); }
.toc-tabs ~ section[id] { scroll-margin-top: 70px; }

.faq-item { min-width: 0; border: 1px solid var(--border); border-radius: var(--r-tile); background: var(--panel); color: var(--text); box-shadow: var(--shadow-xs); }
.faq-item + .faq-item { margin-top: 10px; }
.faq-item summary { display: flex; justify-content: space-between; align-items: center; min-height: var(--tap-size); gap: 12px; padding: 12px 16px; font-weight: 700; list-style: none; cursor: pointer; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; flex: none; color: var(--accent-dark); }
.faq-item[open] summary::after { content: "−"; }
.faq-answer { padding: 0 16px 16px; color: var(--muted); }

.term-card,.client-card,.post-card { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: clamp(16px,3vw,26px); }
.term-key,.post-meta,.client-version { font-family: var(--font-mono); font-size: var(--size-small); color: var(--muted); }
.client-version:empty { display: none; }
.post-card h3 a:hover { color: var(--accent-dark); text-decoration: underline; text-underline-offset: .2em; }
.post-card .more,.client-card .client-actions { margin-top: auto; padding-top: 8px; }
.badge--first { background: var(--soft-green); color: var(--accent-dark); }
.badge--recommended { background: var(--soft-blue); color: var(--text); }
.badge--retired { background: var(--soft-yellow); color: var(--text); }
.chip--topic { background: var(--soft-pink); color: var(--text); }
.callout,.article-download {
  padding: 16px clamp(14px,3vw,26px);
  border: 1px solid var(--border);
  border-inline-start: 4px solid var(--accent);
  border-radius: var(--r-tile);
  background: var(--soft-green);
  color: var(--text);
}
.callout--note { background: var(--soft-blue); color: var(--text); }
.callout--warn { background: var(--soft-yellow); color: var(--text); border-inline-start-color: var(--warn); }
.article-download { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.article-download > div { min-width: 0; }
.dl-fab {
  position: fixed;
  z-index: 30;
  right: max(16px,env(safe-area-inset-right));
  bottom: max(16px,env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: calc(100% - 40px);
  min-height: var(--tap-size);
  padding: 8px 16px;
  border: 1px solid var(--accent-line);
  border-radius: var(--r-pill);
  background: var(--panel);
  color: var(--accent-dark);
  box-shadow: var(--shadow-float);
  font-weight: 700;
}
.dl-fab:hover { background: var(--soft-green); color: var(--accent-dark); }
.dl-fab svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.has-dl-fab .site-footer { padding-bottom: 70px; }

.table-wrap { max-width: 100%; min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--r-ui); }
.data-table,:where(.prose,.article-body,.doc-body) table { width: 100%; border-collapse: collapse; background: var(--panel); color: var(--text); }
.prose table,.article-body table,.doc-body table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; min-width: 0; }
.table-wrap > table { display: table; overflow: visible; }
.data-table th,.data-table td,:where(.prose,.article-body,.doc-body) table :is(th,td) {
  min-width: 7em;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  text-align: start;
  vertical-align: top;
  overflow-wrap: normal;
  word-break: normal;
}
.data-table th,:where(.prose,.article-body,.doc-body) table th { background: var(--panel-2); color: var(--text); }
.data-table tbody tr:last-child td { border-bottom: 0; }

.showcase-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,230px),1fr)); gap: 14px; }
.swatches { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,145px),1fr)); gap: 10px; }
.swatch { min-width: 0; padding: 8px; border: 1px solid var(--border); border-radius: var(--r-ui); background: var(--panel); color: var(--text); }
.swatch::before { content: ""; display: block; height: 40px; margin-bottom: 4px; border: 1px solid var(--border); border-radius: var(--r-small); }
.swatch--bg::before { background: var(--bg); color: var(--text); }
.swatch--panel::before { background: var(--panel); color: var(--text); }
.swatch--panel-2::before { background: var(--panel-2); color: var(--text); }
.swatch--border::before { background: var(--border); color: var(--text); }
.swatch--grid::before { background: var(--grid); color: var(--text); }
.swatch--accent::before { background: var(--accent); color: var(--on-accent); }
.swatch--accent-dark::before { background: var(--accent-dark); color: var(--on-accent); }
.swatch--text::before { background: var(--text); color: var(--on-accent); }
.swatch--muted::before { background: var(--muted); color: var(--on-accent); }
.swatch--success::before { background: var(--success); color: var(--on-accent); }
.swatch--warn::before { background: var(--warn); color: var(--text); }
.swatch--error::before { background: var(--error); color: var(--on-accent); }
.swatch--soft-green::before { background: var(--soft-green); color: var(--text); }
.swatch--soft-pink::before { background: var(--soft-pink); color: var(--text); }
.swatch--soft-yellow::before { background: var(--soft-yellow); color: var(--text); }
.swatch--soft-blue::before { background: var(--soft-blue); color: var(--text); }
.swatch--on-accent::before { background: var(--on-accent); color: var(--text); }
.swatch--glass::before { background: var(--glass); color: var(--text); }
.swatch--accent-ring::before { background: var(--accent-ring); color: var(--text); }
.swatch--accent-line::before { background: var(--accent-line); color: var(--text); }
.swatch--veil::before { background: var(--veil); color: var(--text); }
.swatch--mask-solid::before { background: var(--mask-solid); color: var(--on-accent); }
.swatch--mask-faint::before { background: var(--mask-faint); color: var(--text); }
.swatch--clear::before { background: var(--clear); color: var(--text); }

@media (max-width: 1400px) { :root { --frame-scale: .94; } }
@media (max-width: 1280px) { :root { --frame-scale: .86; } }
@media (max-width: 1120px) {
  :root { --frame-scale: .78; }
  .t-sub,.t-rules,.t-yaml,.t-flclash,.t-dns,.t-fakeip { display: none; }
}
@media (max-width: 960px) {
  :root { --frame-scale: .6; }
  .t-mihomo,.t-cmfa,.hero-window { display: none; }
  .bento { grid-template-columns: minmax(0,1fr); }
  .bento .card,.bento .card--5 { grid-column: auto; }
}
@media (max-width: 768px) {
  :root { --size-hero: 28px; }
  .hero { min-height: auto; padding: 92px 20px 96px; }
  .frame { inset: 0; width: auto; height: auto; transform: none; }
  .trail,.comet,.t-strategy { display: none; }
  .tile { width: 52px; height: 52px; border-radius: var(--r-ui); gap: 4px; }
  .tile-ic { width: 26px; height: 26px; }
  .tile svg { width: 18px; height: 18px; }
  .tile-ic svg { width: 15px; height: 15px; }
  .tile-lb { font-size: 8.5px; }
  .t-verge { left: 16px; top: 22px; }
  .t-geoip { left: auto; right: 16px; top: 22px; }
  .t-tun { left: 16px; top: auto; bottom: 24px; }
  .t-cmfa { display: flex; left: auto; right: 16px; top: auto; bottom: 24px; }
  .lede { font-size: 15.5px; }
  .dlbar { flex-direction: column; padding: 14px; border-radius: var(--r-bar); }
  .dlbar-info { justify-content: center; }
  .dlbar-text { text-align: center; }
  .dlbar .btn-primary { width: 100%; }
  .platforms { gap: 10px 18px; }
}
@media (max-width: 640px) {
  .stage .ui--float { transform: none; }
  .card-body { padding-inline: 12px; }
}