/* ============================================================
   V2Ray for Windows — 基础样式
   设计令牌 / Reset / 排版 / 按钮 / 头部导航 / 页脚 / 通用面板 / Reveal
   ============================================================ */

/* ---------- 设计令牌 ---------- */
:root {
  /* 色彩 */
  --bg: #F5F8F7;
  --bg-panel: #FFFFFF;
  --bg-panel-2: #EDF4F1;
  --bg-hover: #F1F6F4;
  --border: #E1EAE6;
  --border-strong: #C8D6D0;
  --accent: #0B7A45;
  --accent-dark: #075C33;
  --accent-soft: #E3F1EA;
  --text: #18271F;
  --text-muted: #5C6E66;
  --text-faint: #8A9A93;
  --success: #0E9384;
  --warn: #D97706;
  --error: #D64545;
  --white: #FFFFFF;

  /* 字体 */
  --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;

  /* 圆角 */
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --radius-pill: 999px;

  /* 投影 */
  --shadow-card: 0 24px 64px -24px rgba(24, 39, 31, 0.16), 0 6px 18px -8px rgba(24, 39, 31, 0.08);
  --shadow-float: 0 16px 40px -16px rgba(24, 39, 31, 0.18), 0 4px 12px -6px rgba(24, 39, 31, 0.08);
  --shadow-soft: 0 10px 30px -18px rgba(24, 39, 31, 0.12);
  --shadow-btn: 0 14px 30px -12px rgba(11, 122, 69, 0.5);

  /* 布局 */
  --gutter: 24px;
  --wrap-max: 1128px;
  --wrap-wide: 1280px;
  --header-h: 72px;
  --transition: 0.18s ease;
}

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

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

html.nav-open {
  overflow: hidden;
}

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

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;
  color: inherit;
}

/* 行内代码：超长不可断串防溢出 */
code,
kbd,
samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
  overflow-wrap: anywhere;
  word-break: break-word;
}

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

pre code {
  overflow-wrap: normal;
  word-break: normal;
  white-space: pre;
}

/* ---------- 排版 ---------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text);
  overflow-wrap: break-word;
}

/* 标题元素禁止 flex/grid，编号用 ::before 行内盒 */
h1::before,
h2::before,
h3::before,
h4::before,
h5::before,
h6::before {
  display: inline;
}

h1 {
  font-size: clamp(34px, 3.2vw, 46px);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h2 {
  font-size: clamp(26px, 2.4vw, 34px);
  font-weight: 700;
  line-height: 1.2;
}

h3 {
  font-size: clamp(20px, 1.6vw, 24px);
  font-weight: 600;
}

h4 {
  font-size: 18px;
  font-weight: 600;
}

p {
  line-height: 1.65;
  color: var(--text-muted);
}

strong {
  color: var(--text);
  font-weight: 600;
}

/* 中文关键词组不折行保护 */
.nowrap {
  white-space: nowrap;
}

/* ---------- 版心 ---------- */
.wrap {
  width: 100%;
  max-width: var(--wrap-max);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

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

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  border-radius: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition),
    color var(--transition), box-shadow var(--transition), transform var(--transition);
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--accent);
  color: var(--white);
  box-shadow: var(--shadow-btn);
}

.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-panel);
  color: var(--text);
  border-color: var(--border);
  box-shadow: var(--shadow-soft);
}

.btn-secondary:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.btn-lg {
  padding: 16px 32px;
  font-size: 16px;
}

.btn-sm {
  padding: 9px 18px;
  font-size: 14px;
  border-radius: 10px;
}

.btn-block {
  width: 100%;
}

/* ---------- 头部导航 ---------- */
.site-header {
  position: relative;
  z-index: 100;
  background: rgba(245, 248, 247, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-wrap {
  width: 100%;
  max-width: min(100%, calc(var(--wrap-wide) + var(--gutter) * 2));
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 40px;
}

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

.header-logo {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.header-brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap;
}

.header-brand-name em {
  font-style: normal;
  color: var(--accent);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 auto;
}

.header-nav a {
  position: relative;
  display: inline-block;
  padding: 10px 14px 16px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: color var(--transition);
  white-space: nowrap;
}

.header-nav a:hover {
  color: var(--text);
}

.header-nav a.is-active {
  color: var(--text);
  font-weight: 600;
}

.header-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 6px;
  height: 3px;
  border-radius: var(--radius-pill);
  background: var(--accent);
}

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

/* 语言切换 */
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 14px;
  color: var(--text-muted);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-soft);
  transition: border-color var(--transition), color var(--transition);
  white-space: nowrap;
  max-width: none;
  overflow: visible;
}

.lang-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.lang-btn .caret {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.lang-btn .lang-full {
  display: inline;
}

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

.lang-menu {
  position: absolute;
  top: calc(var(--header-h) - 4px);
  right: var(--gutter);
  min-width: 180px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-float);
  padding: 8px;
  z-index: 110;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
}

.lang-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.lang-menu a {
  display: block;
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}

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

.lang-menu a.is-current {
  color: var(--accent);
  font-weight: 600;
}

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

.menu-toggle:hover {
  background: var(--bg-hover);
}

.menu-toggle .menu-bar {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform var(--transition), opacity var(--transition);
}

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

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

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

/* 移动端抽屉 */
.mobile-menu {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-panel);
  padding: 24px var(--gutter) 40px;
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 105;
}

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

.mobile-menu .mobile-nav-list a {
  display: block;
  width: 100%;
  padding: 14px 4px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  min-height: 44px;
}

.mobile-menu .mobile-nav-list a.is-active {
  color: var(--accent);
}

.mobile-menu .mobile-lang-label {
  margin-top: 28px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.mobile-menu .mobile-lang-list a {
  display: block;
  width: 100%;
  padding: 12px 4px;
  font-size: 15px;
  color: var(--text-muted);
  min-height: 44px;
}

.mobile-menu .mobile-lang-list a.is-current {
  color: var(--accent);
  font-weight: 600;
}

/* ---------- 页脚 ---------- */
.site-footer {
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
  margin-top: 80px;
}

.footer-wrap {
  width: 100%;
  max-width: var(--wrap-max);
  margin: 0 auto;
  padding: 56px var(--gutter) 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 40px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.footer-logo {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.footer-brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
}

.footer-brand-name em {
  font-style: normal;
  color: var(--accent);
}

.footer-desc {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 32em;
}

.footer-col h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}

.footer-col ul li {
  margin-bottom: 10px;
}

.footer-col ul a {
  font-size: 14px;
  color: var(--text-muted);
  transition: color var(--transition);
}

.footer-col ul a:hover {
  color: var(--accent);
}

.footer-hot {
  border-top: 1px solid var(--border);
  padding-top: 28px;
  margin-bottom: 32px;
}

.footer-hot-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
}

.footer-hot-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-hot-list a {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: border-color var(--transition), color var(--transition);
}

.footer-hot-list a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

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

.footer-copyright {
  font-size: 13px;
  color: var(--text-muted);
}

.footer-legal {
  display: flex;
  gap: 20px;
}

.footer-legal a {
  font-size: 13px;
  color: var(--text-muted);
  transition: color var(--transition);
}

.footer-legal a:hover {
  color: var(--accent);
}

/* ---------- 通用卡片/面板 ---------- */
.card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

.card-pad {
  padding: 28px;
}

.card-hover {
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}

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

.card-lg {
  border-radius: var(--radius-lg);
}

/* ---------- 徽章/胶囊 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  line-height: 1.4;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-primary {
  background: var(--accent);
  color: var(--white);
}

.badge-soft {
  background: var(--accent-soft);
  color: var(--accent-dark);
  border: 1px solid var(--border);
}

.badge-warn {
  background: #FEF3E2;
  color: var(--warn);
  border: 1px solid #F3E0C3;
}

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

/* ---------- 事实胶囊行 ---------- */
.fact-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.fact-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-soft);
}

.fact-chip svg {
  width: 15px;
  height: 15px;
  color: var(--accent);
  flex-shrink: 0;
}

/* ---------- Reveal 滚动淡入 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* 装饰性微倾斜：窄屏一律归零 */
.tilt {
  transform: rotate(-0.45deg);
}

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --gutter: 16px;
  }

  h1 {
    font-size: clamp(24px, 6vw, 30px);
  }

  h2 {
    font-size: clamp(22px, 5vw, 26px);
  }

  .header-wrap {
    gap: 16px;
  }

  .header-nav {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .lang-btn .lang-full {
    display: none;
  }

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

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .tilt {
    transform: none;
  }
}

@media (max-width: 640px) {
  .card-pad {
    padding: 20px;
  }

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

  .btn-lg {
    padding: 14px 24px;
    font-size: 15px;
  }

  .fact-chip {
    padding: 7px 12px;
    font-size: 13px;
  }
}

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

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