/* ==========================================================================
   V2Ray测评 — base.css
   设计令牌 / Reset / 排版 / 按钮 / 头部导航 / 页脚 / 通用卡片 / Reveal
   ========================================================================== */

:root {
  /* 背景与面板 */
  --bg: #FFFFFF;
  --bg-panel: #F7F7F5;
  --bg-panel2: #FCFBF9;
  --border: #E9E8E3;

  /* 文字与强调 */
  --ink: #1B1B18;
  --ink-deep: #000000;
  --text: #17181A;
  --text-muted: #6B6E76;

  /* 语义色 */
  --success: #22A06B;
  --warn: #D98E04;
  --error: #D64550;

  /* 高亮与淡彩 */
  --honey: #FFC53D;
  --tint-honey: #FFF4D9;
  --tint-mint: #E8F6EE;
  --tint-sky: #E9F2FC;
  --tint-lilac: #F0EBFA;
  --tint-apricot: #FCEDE4;

  /* 字体 */
  --font-display: 'Inter', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-body: 'Inter', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, 'Courier New', monospace;

  /* 圆角 */
  --r-xl: 28px;
  --r-lg: 24px;
  --r-md: 20px;
  --r-sm: 12px;
  --r-pill: 999px;

  /* 投影 */
  --shadow-card: 0 24px 48px -20px rgba(27, 27, 24, 0.16), 0 3px 8px rgba(27, 27, 24, 0.04);
  --shadow-card-hover: 0 30px 56px -20px rgba(27, 27, 24, 0.20), 0 4px 10px rgba(27, 27, 24, 0.05);
  --shadow-btn: 0 14px 28px -12px rgba(27, 27, 24, 0.35);

  /* 布局 */
  --gutter: 24px;
  --gutter-sm: 16px;
  --wrap-max: 1160px;
  --head-max: min(100%, calc(1280px + var(--gutter) * 2));
}

/* ==========================================================================
   Reset
   ========================================================================== */

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

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

html.nav-open {
  overflow: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

input,
select,
textarea {
  font: inherit;
}

code,
kbd,
pre {
  font-family: var(--font-mono);
}

code {
  overflow-wrap: anywhere;
}

pre {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ==========================================================================
   版心
   ========================================================================== */

.wrap {
  max-width: var(--wrap-max);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

@media (max-width: 640px) {
  .wrap {
    padding-inline: var(--gutter-sm);
  }
}

/* ==========================================================================
   排版
   ========================================================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--ink);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(34px, 3.4vw, 48px);
  font-weight: 900;
  letter-spacing: -0.015em;
  line-height: 1.22;
}

h2 {
  font-size: clamp(26px, 2.4vw, 34px);
}

h3 {
  font-size: clamp(18px, 1.6vw, 21px);
}

p {
  line-height: 1.7;
}

/* 正文排版容器 */
.prose {
  font-size: 16px;
  line-height: 1.85;
  color: var(--text);
}

.prose h2 {
  margin-top: 2.4em;
  margin-bottom: 0.8em;
}

.prose h3 {
  margin-top: 1.8em;
  margin-bottom: 0.6em;
}

.prose p {
  margin-bottom: 1.2em;
}

.prose ul,
.prose ol {
  margin-bottom: 1.2em;
  padding-left: 1.4em;
}

.prose ul {
  list-style: disc;
}

.prose ol {
  list-style: decimal;
}

.prose li {
  margin-bottom: 0.4em;
}

.prose a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--honey);
  text-underline-offset: 3px;
}

.prose a:hover {
  text-decoration-color: var(--ink);
}

.prose blockquote {
  margin: 1.4em 0;
  padding: 0.8em 1.2em;
  border-left: 3px solid var(--honey);
  background: var(--bg-panel2);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

.prose code {
  padding: 0.15em 0.4em;
  border-radius: 5px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  font-size: 0.9em;
}

.prose pre {
  margin: 1.4em 0;
  padding: 1.2em 1.4em;
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--r-md);
  font-size: 13.5px;
  line-height: 1.8;
}

.prose pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
}

/* 中文标题防词中折行 */
h1 span,
h2 span,
h3 span {
  white-space: nowrap;
}

@media (max-width: 768px) {
  h1 {
    font-size: clamp(24px, 7.4vw, 30px);
  }
}

/* ==========================================================================
   按钮
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 14px 30px;
  border-radius: var(--r-pill);
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.btn--primary {
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow-btn);
}

.btn--primary:hover {
  background: var(--ink-deep);
  transform: translateY(-2px);
}

.btn--primary:disabled,
.btn--primary[aria-disabled="true"] {
  background: var(--border);
  color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.btn--ghost {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.btn--ghost:hover {
  border-color: var(--text-muted);
  transform: translateY(-2px);
}

.btn--sm {
  padding: 10px 20px;
  font-size: 14px;
}

.btn--primary svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ==========================================================================
   头部导航
   ========================================================================== */

.site-head {
  position: relative;
  z-index: 30;
  background: var(--bg);
}

.site-head__inner {
  max-width: var(--head-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 68px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand__mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}

.brand__mark img {
  width: 100%;
  height: 100%;
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.01em;
  color: var(--ink);
  white-space: nowrap;
}

.main-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.main-nav a {
  display: inline-block;
  padding: 8px 15px;
  border-radius: var(--r-pill);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.main-nav a:hover {
  color: var(--ink);
  background: var(--bg-panel);
}

.main-nav a[data-active] {
  color: var(--ink);
  font-weight: 700;
  background: var(--bg-panel);
}

.head-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* 语言切换 */
.lang-switch-wrap {
  position: relative;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.15s ease;
  min-height: 44px;
}

.lang-switch:hover {
  border-color: var(--text-muted);
}

.lang-switch__caret {
  font-size: 10px;
  color: var(--text-muted);
}

.lang-switch__label--short {
  display: none;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 168px;
  padding: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

.lang-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-menu a {
  display: block;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  font-size: 14px;
  color: var(--text);
  transition: background-color 0.12s ease;
}

.lang-menu a:hover {
  background: var(--bg-panel);
}

.lang-menu a.is-current {
  font-weight: 700;
  color: var(--ink);
  background: var(--bg-panel);
}

/* 汉堡按钮 */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  flex-shrink: 0;
}

.nav-toggle__bar {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 1px;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* 移动端抽屉 */
.mobile-nav {
  display: none;
  position: fixed;
  z-index: 40;
  top: 68px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px var(--gutter-sm) 32px;
}

.mobile-nav__links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mobile-nav__links a {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--r-md);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  min-height: 48px;
}

.mobile-nav__links a:hover {
  background: var(--bg-panel);
}

.mobile-nav__links a[data-active] {
  background: var(--bg-panel);
  color: var(--ink);
  font-weight: 700;
}

.mobile-nav__divider {
  margin: 16px 0 8px;
  padding: 0 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.mobile-nav__langs {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mobile-nav__langs a {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  min-height: 48px;
}

.mobile-nav__langs a:hover {
  background: var(--bg-panel);
}

.mobile-nav__langs a.is-current {
  font-weight: 700;
  color: var(--ink);
}

.mobile-nav.is-open {
  display: block;
}

@media (max-width: 1120px) {
  .main-nav {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }
}

@media (max-width: 768px) {
  .lang-switch__label--full {
    display: none;
  }

  .lang-switch__label--short {
    display: inline;
  }
}

/* ==========================================================================
   页脚
   ========================================================================== */

.site-foot {
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
  padding: 56px 0 32px;
}

.site-foot__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.8fr;
  gap: 40px;
  margin-bottom: 40px;
}

.site-foot__brand p {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 320px;
}

.site-foot__nav h3,
.site-foot__legal h3 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
  color: var(--ink);
}

.site-foot__nav li,
.site-foot__legal li {
  margin-bottom: 8px;
}

.site-foot__nav a,
.site-foot__legal a {
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.12s ease;
}

.site-foot__nav a:hover,
.site-foot__legal a:hover {
  color: var(--ink);
}

.site-foot__hot {
  margin-bottom: 40px;
}

.site-foot__hot h3,
.site-foot__langs h3 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
  color: var(--ink);
}

.site-foot__hot ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.site-foot__hot a {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg);
  font-size: 13px;
  color: var(--text-muted);
  transition: color 0.12s ease, border-color 0.12s ease, background-color 0.12s ease;
}

.site-foot__hot a:hover {
  color: var(--ink);
  border-color: var(--text-muted);
  background: var(--bg-panel2);
}

.site-foot__langs {
  margin-bottom: 40px;
}

.site-foot__lang-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.site-foot__lang-links a {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg);
  font-size: 13px;
  color: var(--text-muted);
  transition: color 0.12s ease, border-color 0.12s ease, background-color 0.12s ease;
}

.site-foot__lang-links a:hover {
  color: var(--ink);
  border-color: var(--text-muted);
  background: var(--bg-panel2);
}

.site-foot__lang-links a.is-current {
  color: var(--ink);
  font-weight: 700;
  border-color: var(--ink);
  background: var(--bg-panel2);
}

.site-foot__bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.site-foot__bottom p {
  font-size: 13px;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .site-foot__grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

/* ==========================================================================
   通用卡片
   ========================================================================== */

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  margin-bottom: 18px;
  flex-shrink: 0;
}

.card__icon svg {
  width: 20px;
  height: 20px;
}

.card__icon--mint {
  background: var(--tint-mint);
  color: var(--success);
}

.card__icon--sky {
  background: var(--tint-sky);
  color: var(--text);
}

.card__icon--lilac {
  background: var(--tint-lilac);
  color: var(--text);
}

.card__icon--apricot {
  background: var(--tint-apricot);
  color: var(--text);
}

.card h3 {
  font-size: 18px;
  margin-bottom: 10px;
}

.card p {
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--text-muted);
}

/* 徽章 */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.5;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
}

.badge--primary {
  background: var(--ink);
  color: var(--bg);
}

.badge--honey {
  background: var(--tint-honey);
  color: var(--ink);
}

.badge--mint {
  background: var(--tint-mint);
  color: var(--success);
}

.badge--gray {
  background: var(--bg-panel);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.badge--error {
  background: #FBE9EB;
  color: var(--error);
}

.badge--outline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* ==========================================================================
   Reveal 滚动淡入
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.shown {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ==========================================================================
   响应式微调
   ========================================================================== */

@media (max-width: 640px) {
  .btn {
    width: 100%;
  }

  .btn--sm {
    width: auto;
  }
}

/* 防溢出 */
.grid > *,
.ds-card-grid > * {
  min-width: 0;
}