/* ==========================================================================
   VPNPF — base.css
   设计令牌 / reset / 排版 / 按钮 / 头部导航 / 页脚 / 面板 / reveal
   主题「寻路台」:110+ 国家 / 250+ 线路被兑现为一张按地区归档的线路表。
   所有颜色、字体、圆角一律走 :root 令牌,组件内不写死设计值。
   ========================================================================== */

:root {
  /* ---- 基色与面板三级层次 ---- */
  --bg: #E4E6F4;
  --bg-panel: #F6F6FC;
  --bg-panel2: #D8DBEE;
  --border: #C9CCE3;

  /* ---- 强调色:黄铜金 ---- */
  --accent: #7A5A1E;
  --accent-dark: #5B4214;
  --accent-light: #C9A45A;

  /* ---- 文字 ---- */
  --text: #15141F;
  --text-muted: #5B5D72;

  /* ---- 语义色 ---- */
  --success: #2E7D5B;
  --warn: #B7791F;
  --error: #B3373F;

  /* ---- 墨黑(胶囊按钮 / 深墨窗口 chrome)---- */
  --ink: #15141F;
  --ink-2: #232233;
  --on-ink: #F6F6FC;
  --on-ink-muted: rgba(246, 246, 252, .62);
  --rule-ink: rgba(255, 255, 255, .08);
  --hl-ink: rgba(255, 255, 255, .14);
  --hl-panel: rgba(255, 255, 255, .65);

  /* ---- 虹彩渐变面(全站唯一高饱和区)---- */
  --iris-pink: #D9A6F2;
  --iris-lav: #B9B4F0;
  --iris-cyan: #A9E3F0;
  --iris-base-a: #CFC3F1;
  --iris-base-b: #E6BDF1;

  /* ---- 氛围层 ---- */
  --aurora-a: rgba(217, 166, 242, .07);
  --aurora-b: rgba(169, 227, 240, .06);
  --aurora-lift: rgba(255, 255, 255, .34);
  --access-tint: rgba(169, 227, 240, .22);

  /* ---- 带色柔影(靛紫,不是灰影)---- */
  --shadow-indigo: rgba(62, 58, 140, .10);
  --shadow-indigo-2: rgba(62, 58, 140, .16);
  --shadow-ink: rgba(21, 20, 31, .38);
  --shadow-brass: rgba(122, 90, 30, .12);

  /* ---- 内联 SVG 旗帜专用 ---- */
  --flag-red: #C8323C;
  --flag-blue: #2E4A8F;
  --flag-white: #FFFFFF;
  --flag-black: #1B1B1F;
  --flag-gold: #E2B13C;

  /* ---- 圆角体系 ---- */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 12px;
  --r-pill: 999px;

  /* ---- 字体栈 ---- */
  --font-display: 'Inter', 'Noto Sans SC', -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Noto Sans SC', -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;

  /* ---- 版式节奏 ---- */
  --wrap: 1280px;
  --gutter: 32px;
  --header-h: 72px;
  --sec-y: 76px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ==========================  reset  ========================== */
* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
svg { display: block; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }
table { border-collapse: collapse; }

/* 键盘焦点可见(全站统一,不许 outline:none 不给替代) */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* 中文关键词防断词:只包 2~4 个汉字;窄屏允许折行 */
.no-break { white-space: nowrap; }

/* ==========================  排版  ========================== */
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--text); text-wrap: balance; }

h1 {
  font-weight: 400;
  font-size: clamp(40px, 5.6vw, 66px);
  line-height: 1.05;
  letter-spacing: -.03em;
}

h2 {
  font-weight: 400;
  font-size: clamp(26px, 3.2vw, 40px);
  line-height: 1.15;
  letter-spacing: -.02em;
}

h3 { font-weight: 500; font-size: 20px; line-height: 1.3; letter-spacing: -.01em; }
h4 { font-weight: 500; font-size: 16px; line-height: 1.35; }

p { margin: 0; }
p + p { margin-top: 12px; }

.lead { font-size: 17px; line-height: 1.65; color: var(--text-muted); max-width: 68ch; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--text-muted); }
.strong { font-weight: 500; color: var(--text); }

/* 行内代码:超长订阅串 / 安装包文件名必须能断,否则撑破 375px */
code, kbd, samp {
  font-family: var(--font-mono);
  font-size: .92em;
  overflow-wrap: anywhere;
  word-break: break-word;
}
pre {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px 18px;
  overflow-x: auto;
  max-width: 100%;
}
pre code { overflow-wrap: normal; }

blockquote {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 18px;
  color: var(--text-muted);
}

/* ==========================  布局  ========================== */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* 区块节奏:只声明纵向,禁止 padding 简写(版心常与区块类同元素) */
.section { padding-top: var(--sec-y); padding-bottom: var(--sec-y); }
.section-tight { padding-top: 48px; padding-bottom: 48px; }

.rule { height: 1px; background: var(--border); border: 0; }

.head-block { max-width: 760px; }
.head-block h2 { margin-top: 10px; }
.head-block .lead { margin-top: 14px; }

.kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em;
  color: var(--accent-dark); text-transform: uppercase;
}

/* ==========================  按钮  ========================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 22px;
  border: 1px solid transparent; border-radius: var(--r-pill);
  font-family: var(--font-body); font-size: 15px; font-weight: 500; line-height: 1.2;
  text-align: center; white-space: nowrap; flex-shrink: 0;
  transition: background .18s, color .18s, border-color .18s, transform .18s;
}

.btn-primary {
  min-height: 52px; padding: 0 30px;
  background: var(--ink); color: var(--on-ink); font-size: 16px;
  box-shadow: inset 0 1px 0 var(--hl-ink), 0 12px 24px -8px var(--shadow-ink);
}
.btn-primary:hover { background: var(--ink-2); transform: translateY(-1px); }

.btn-secondary {
  background: var(--bg-panel); color: var(--text);
  border-color: var(--border);
  box-shadow: 0 2px 8px var(--shadow-indigo);
}
.btn-secondary:hover { background: var(--bg-panel2); border-color: var(--text-muted); }

.btn-sm { min-height: 38px; padding: 0 16px; font-size: 13.5px; }

.btn-link {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; font-size: 16px; color: var(--text); line-height: 1.2;
  border-bottom: 1.5px solid var(--text); padding-bottom: 2px;
  transition: opacity .18s;
}
.btn-link:hover { opacity: .7; }
.btn-link svg { width: 14px; height: 14px; flex-shrink: 0; }

.arrow-link {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 32px; font-size: 14px; color: var(--text);
  border-bottom: 1px solid var(--border); padding-bottom: 2px;
  transition: border-color .18s, gap .18s;
}
.arrow-link:hover { border-bottom-color: var(--text); gap: 11px; }
.arrow-link svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ==========================  胶囊 / 徽章 / 标签  ========================== */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 28px; padding: 4px 12px 4px 10px;
  border-radius: var(--r-pill); background: var(--bg-panel); border: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted); letter-spacing: .01em;
}
.eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--success); flex-shrink: 0;
  box-shadow: 0 0 0 3px var(--bg-panel2);
}
.eyebrow .mono { font-size: 11.5px; color: var(--text); }

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 34px; padding: 6px 14px;
  border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--bg-panel);
  font-size: 13px; color: var(--text-muted);
  max-width: 100%; overflow: hidden;
}
.chip svg { width: 13px; height: 13px; flex-shrink: 0; color: var(--text); }

.chip-brass {
  border-color: var(--accent); color: var(--accent-dark); background: transparent;
}
.chip-brass b { font-family: var(--font-mono); font-weight: 500; margin-right: 3px; }

.tag {
  display: inline-flex; align-items: center;
  min-height: 24px; padding: 2px 10px;
  border-radius: var(--r-sm); border: 1px solid var(--border);
  background: var(--bg-panel); font-size: 12px; color: var(--text-muted);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tag-brass { border-color: var(--accent); color: var(--accent-dark); }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 24px; padding: 2px 10px; border-radius: var(--r-pill);
  background: var(--ink); color: var(--on-ink);
  font-size: 11.5px; letter-spacing: .02em;
  max-width: 100%; overflow: hidden;
}

.dot-status { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.dot-ok { background: var(--success); }
.dot-warn { background: var(--warn); }
.dot-err { background: var(--error); }

/* ==========================  面板 / 卡片  ========================== */
.panel-soft {
  background: var(--bg-panel);
  border-radius: var(--r-lg);
  box-shadow: inset 0 0 0 1px var(--hl-panel), 0 24px 44px -18px var(--shadow-indigo-2), 0 2px 8px var(--shadow-indigo);
  padding: 24px 26px;
}
.panel-sunk {
  background: var(--bg-panel2);
  border-radius: var(--r-md);
  padding: 18px 20px;
}

/* ==========================  表格(宽表一律包 .table-scroll)  ========================== */
.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-panel);
}
.table-scroll table { width: 100%; min-width: 640px; }
.table-scroll th, .table-scroll td { word-break: keep-all; }

/* servers.js 线路状态组件:文档流占位 + 夹住自身,不许绝对定位/负 margin */
#server-status {
  display: block;
  position: static;
  max-width: 100%;
  overflow: hidden;
  margin: 0 0 32px;
}
#server-status > * { min-width: 0; }

/* ==========================  头部导航  ========================== */
#site-header { position: relative; z-index: 60; }

.topbar { height: var(--header-h); display: flex; align-items: center; position: relative; z-index: 60; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; }

/* 品牌位:logo 与导航同高居中,左缘与版心留白对齐(用户返工点) */
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  flex-shrink: 0; min-height: 44px;
}
.brand img {
  display: block; height: 28px; width: auto; max-width: 100%;
  object-fit: contain;
}
.brand-name { font-size: 17px; font-weight: 600; letter-spacing: -.01em; color: var(--text); white-space: nowrap; }

.nav {
  display: flex; align-items: center; gap: 26px;
  list-style: none; margin: 0; padding: 0;
}
.nav li { list-style: none; }
.nav a {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 14px; color: var(--text-muted); white-space: nowrap;
  padding: 6px 0; border-bottom: 1.5px solid transparent;
  transition: color .18s;
}
.nav a svg { width: 15px; height: 15px; flex-shrink: 0; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"] { border-bottom-color: var(--text); }

.top-tools { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }

.lang-wrap { position: relative; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 44px; padding: 0 10px;
  border-radius: var(--r-pill); border: 1px solid transparent;
  font-size: 13px; color: var(--text-muted); white-space: nowrap;
  transition: color .18s, border-color .18s;
}
.lang-btn:hover { color: var(--text); border-color: var(--border); }
.lang-btn svg { width: 12px; height: 12px; flex-shrink: 0; }

.lang-menu {
  position: absolute; right: 0; top: calc(100% + 6px);
  min-width: 156px; padding: 6px; z-index: 70;
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: 0 18px 36px -12px var(--shadow-indigo-2);
  display: none;
}
.lang-wrap.is-open .lang-menu { display: block; }
.lang-menu a {
  display: flex; align-items: center; min-height: 38px; padding: 0 12px;
  border-radius: var(--r-sm); font-size: 13.5px; color: var(--text);
}
.lang-menu a:hover { background: var(--bg-panel2); }
.lang-menu a[aria-current="true"] { color: var(--accent-dark); font-weight: 500; }

/* 登录按钮:主转化入口,按钮态与导航项区分 */
.btn-login {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 0 18px;
  border-radius: var(--r-pill); font-size: 14px; color: var(--text);
  background: var(--bg-panel); border: 1px solid var(--border);
  box-shadow: 0 2px 6px var(--shadow-indigo); white-space: nowrap;
  transition: background .18s, border-color .18s;
}
.btn-login:hover { background: var(--bg-panel2); border-color: var(--text-muted); }

.burger {
  display: none; width: 44px; height: 44px;
  align-items: center; justify-content: center;
  border-radius: var(--r-md); border: 1px solid var(--border); background: var(--bg-panel);
  color: var(--text);
}
.burger svg { width: 22px; height: 22px; }

/* 移动端抽屉:实色底、整行可点、独立于工具区 */
.veil {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(21, 20, 31, .42);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.drawer {
  position: fixed; left: 0; right: 0; top: 0; z-index: 50;
  max-height: 100dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg-panel);
  padding: calc(var(--header-h) + 8px) var(--gutter) 28px;
  box-shadow: 0 24px 48px -16px var(--shadow-indigo-2);
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
html.nav-open { overflow: hidden; }
html.nav-open .veil { opacity: 1; pointer-events: auto; }
html.nav-open .drawer { opacity: 1; visibility: visible; transform: none; }

.drawer ul { list-style: none; margin: 0; padding: 0; }
.drawer a {
  display: flex; width: 100%; align-items: center; gap: 10px;
  min-height: 48px; padding: 10px 4px;
  font-size: 15px; color: var(--text);
  border-bottom: 1px solid var(--border);
}
.drawer a svg { width: 17px; height: 17px; flex-shrink: 0; color: var(--text-muted); }
.drawer a[aria-current="page"] { color: var(--accent-dark); }
.drawer .drawer-sep {
  margin: 18px 0 8px; font-size: 12px; letter-spacing: .08em; color: var(--text-muted);
}

/* ==========================  页脚  ========================== */
.site-footer {
  margin-top: var(--sec-y);
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
  padding-top: 56px;
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 32px;
}
.foot-brand { min-width: 0; }
.foot-brand .brand { min-height: 32px; }
.foot-brand p { margin-top: 14px; font-size: 13.5px; color: var(--text-muted); max-width: 34ch; }
.foot-col { min-width: 0; }
.foot-col-title {
  font-size: 12px; letter-spacing: .08em; color: var(--text-muted);
  margin-bottom: 14px;
}
.foot-col ul { display: flex; flex-direction: column; gap: 10px; }
.foot-col a { font-size: 13.5px; color: var(--text); }
.foot-col a:hover { color: var(--accent-dark); }
.foot-col .kw { font-size: 13.5px; color: var(--text-muted); }
.foot-col .kw:hover { color: var(--text); }

.foot-bottom {
  margin-top: 40px; padding-top: 18px; padding-bottom: 28px;
  border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 24px;
  font-size: 12.5px; color: var(--text-muted);
}
.foot-legal { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot-legal a { color: var(--text-muted); }
.foot-legal a:hover { color: var(--text); }

/* ==========================  reveal 滚动淡入  ========================== */
/* 默认可见:隐藏态只由 .pending 承担,由 reveal.js 运行时添加 */
.reveal { transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.pending { opacity: 0; transform: translateY(16px); }
.reveal.shown { opacity: 1; transform: none; }

/* ==========================  响应式  ========================== */
@media (max-width: 1100px) {
  .nav { gap: 16px; }
  .nav a span { display: none; }
  .nav a svg { width: 18px; height: 18px; }
  h1 { font-size: 56px; }
  .foot-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}

@media (max-width: 860px) {
  .nav { display: none; }
  .lang-wrap { display: none; }
  .burger { display: inline-flex; }
  .top-tools { margin-left: auto; }
}

@media (max-width: 768px) {
  :root { --header-h: 60px; --sec-y: 52px; }
  .topbar { height: var(--header-h); }
  .brand img { height: 24px; }
  .brand-name { font-size: 16px; }
  h1 { font-size: 40px; }
  h2 { font-size: 26px; }
  .lead { font-size: 16px; }
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .foot-brand { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  :root { --gutter: 20px; }
  /* 窄屏允许折行:长 no-break 会撑破 375px */
  .no-break { white-space: normal; }
  .eyebrow { white-space: normal; min-height: 0; padding: 6px 12px; }
  .chip { white-space: normal; min-height: 0; padding: 7px 12px; }
  .btn { white-space: normal; }
  .btn-link { white-space: normal; }
  .foot-grid { grid-template-columns: 1fr; }
  .foot-bottom { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 420px) {
  h1 { font-size: 34px; }
  .btn-primary { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .reveal.pending { opacity: 1; transform: none; transition: none; }
  .btn-primary:hover { transform: none; }
}

/* lh:local-harden:start */
:is(h1,h2,h3,h4){text-wrap:balance}
:is(p,li,dd,dt,figcaption,blockquote,td,th){text-wrap:pretty}
html[lang|="ko"] body{word-break:keep-all;overflow-wrap:break-word}
html[lang|="ja"] :is(h1,h2,h3,h4){word-break:auto-phrase}
.lh-tscroll{overflow-x:auto;max-width:100%;-webkit-overflow-scrolling:touch}
@media (max-width:640px){.lh-tscroll :is(th,td){min-width:5.5em}}
@supports (animation-timeline:scroll()){
  .float-cta{animation:lh-fab-in linear both;animation-timeline:scroll(root);animation-range:0 70vh}
}
@keyframes lh-fab-in{0%,45%{opacity:0;visibility:hidden}100%{opacity:1;visibility:visible}}
/* lh:local-harden:end */
