/* ===================================================================
   PayMethod Guide — 全局共享样式
   适用：所有页面（首页 + 子页面）
   =================================================================== */

/* ----- 设计令牌 ----- */
:root {
  /* 品牌色 */
  --hero-blue: #0639C7;
  --hero-navy: #071F5E;
  --hero-violet: #5D24D6;
  --gold: #F5C344;
  --gold-hover: #FFD66B;
  --cyan: #11B9CC;
  --teal: #0AA7A7;
  /* 表面色 */
  --canvas: #F5F8FF;
  --surface: #FFFFFF;
  /* 文字色 */
  --text: #10213B;
  --muted: #5D6B82;
  /* 边框 & 装饰 */
  --border: #DCE6F5;
  --success: #23B68A;
  /* 阴影 & 圆角 */
  --shadow-card: 0 22px 60px rgba(7, 31, 94, 0.18);
  --shadow-sm: 0 8px 24px rgba(7, 31, 94, 0.07);
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 30px;
  /* 布局 */
  --page-width: 1240px;
  --section-space-y: 72px;
  --prose-section-gap: 64px;
  --h2-content-gap: 24px;
}

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

img, video, iframe {
  max-width: 100%;
  height: auto;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: var(--canvas);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* 全局背景纹理 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 12% 18%, rgba(93, 36, 214, 0.04), transparent 22%),
    radial-gradient(circle at 88% 10%, rgba(6, 57, 199, 0.05), transparent 24%),
    linear-gradient(#FFFFFF, #F5F8FF 520px);
  pointer-events: none;
}

/* ----- 链接 & 跳过导航 ----- */
a {
  color: var(--hero-blue);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--hero-navy);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 1000;
  background: var(--surface);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-weight: 700;
}

.skip-link:focus {
  top: 16px;
}

/* ----- 排版 ----- */
h1, h2, h3 {
  line-height: 1.17;
  letter-spacing: -0.01em;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

h1 { margin: 8px 0 14px; font-size: clamp(2rem, 3.8vw, 2.8rem); font-weight: 800; max-width: 820px; }
h2 { margin: 0 0 var(--h2-content-gap); font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 800; text-align: center; }
h3 { margin: 0 0 10px; font-size: 1.2rem; font-weight: 700; }

/* ===================================================================
   导航栏 (Header)
   =================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(90deg, var(--hero-navy), var(--hero-blue) 58%, var(--hero-navy));
  color: #FFFFFF;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 4px 24px rgba(7, 31, 94, 0.22);
}

/* 顶部提示条（子页面用） */
.topbar {
  display: none;
  background: rgba(0, 0, 0, 0.15);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
}

.topbar .topbar-inner {
  width: min(var(--page-width), calc(100% - 40px));
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
}

/* 导航容器 */
.nav-inner,
.container {
  width: min(var(--page-width), calc(100% - 40px));
  margin: 0 auto;
}

.nav-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* Logo */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #FFFFFF;
  text-decoration: none;
  font-weight: 800;
}

.logo span:last-child {
  display: grid;
  gap: 2px;
}

.logo small {
  font-size: 11px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}

.logo-mark {
  width: 42px;
  height: 42px;
  display: block;
  flex: 0 0 42px;
}

.logo-mark img {
  display: block;
  width: 42px;
  height: 42px;
  object-fit: contain;
}

/* 移动端菜单按钮 */
.nav-toggle {
  display: none;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-sm);
  background: transparent;
  color: #FFFFFF;
  font-size: 22px;
  cursor: pointer;
}

.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* 主导航 */
.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-drawer-header,
.nav-drawer-cta {
  display: none;
}

.nav-drawer-content {
  display: contents;
}

.site-nav a {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  transition: color 0.15s ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"],
.site-nav a[aria-current="location"] {
  color: #FFFFFF;
}

/* 导航 CTA */
.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 20px;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--gold-hover), var(--gold));
  color: var(--hero-navy);
  text-decoration: none;
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 4px 16px rgba(245, 195, 68, 0.28);
  transition: filter 0.15s ease;
}

.nav-cta:hover {
  filter: brightness(1.06);
}

/* ===================================================================
   导航下拉子菜单
   =================================================================== */
/* 有子菜单的导航项容器 */
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
}

/* 展开/收起按钮（桌面端隐藏，移动端显示） */
.nav-expand {
  display: none;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
}

.nav-expand:hover {
  color: #FFFFFF;
}

/* 下拉菜单面板 — 桌面 Mega Menu */
.nav-sub {
  position: absolute;
  top: 100%;
  left: 50%;
  width: min(740px, calc(100vw - 40px));
  min-width: 0;
  max-width: none;
  margin: 6px 0 0;
  padding: 16px 20px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -4px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  z-index: 60;
}

.nav-sub-mega {
  width: min(1120px, calc(100vw - 32px));
  max-height: min(72vh, 640px);
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.nav-sub-mega .nav-sub-group {
  min-width: 0;
}

.nav-sub-mega a {
  width: 100%;
  white-space: normal;
  line-height: 1.3;
}

.nav-sub-compact {
  width: 380px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 8px;
}

.nav-sub-group,
.nav-sub-group ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-sub-title {
  display: block;
  margin: 0 0 6px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* 桌面 hover 展开 */
@media (hover: hover) and (min-width: 961px) {
  .nav-item:hover .nav-sub,
  .nav-item:focus-within .nav-sub {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
  }
}

/* 子菜单链接 — 桌面横向排列 */
.nav-sub a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 10px;
  color: var(--text) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 4px;
}

.nav-sub a:hover {
  color: var(--hero-blue) !important;
}

/* ===================================================================
  移动端导航 — 遮罩层 & 滚动锁定
   =================================================================== */
.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 44;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.nav-backdrop.is-visible {
  opacity: 1;
  visibility: visible;
}

body.nav-open {
  overflow: hidden;
}

body.nav-open .site-header .logo {
  pointer-events: none;
}

/* ===================================================================
   页脚 (Footer)
   =================================================================== */
.site-footer {
  background: linear-gradient(90deg, var(--hero-navy), var(--hero-blue));
  color: rgba(255, 255, 255, 0.85);
  padding: 42px 0 16px;
}

.footer-grid {
  width: min(var(--page-width), calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.25fr repeat(4, 1fr);
  gap: 28px;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.82);
  display: block;
  margin: 6px 0;
  text-decoration: none;
  font-size: 14px;
}

.site-footer a:hover {
  text-decoration: underline;
  color: #FFFFFF;
}

.footer-note {
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  line-height: 1.5;
}

.legal-line {
  width: min(var(--page-width), calc(100% - 40px));
  margin: 28px auto 0;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  text-align: center;
  line-height: 1.6;
}

/* ===================================================================
   通用按钮
   =================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: linear-gradient(180deg, var(--gold-hover), var(--gold));
  color: var(--hero-navy);
  box-shadow: 0 4px 18px rgba(245, 195, 68, 0.32);
}
.btn-primary:hover { color: var(--hero-navy); filter: brightness(1.05); }

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.5);
}
.btn-secondary:hover { background: #FFFFFF; color: var(--hero-blue); }

.btn-outline {
  background: var(--surface);
  color: var(--hero-blue);
  border-color: var(--border);
}
.btn-outline:hover { border-color: var(--hero-blue); color: var(--hero-navy); }

/* ===================================================================
   Hero 基础（子页面共用）
   =================================================================== */
.hero {
  color: #FFFFFF;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--hero-blue), var(--hero-violet));
}

/* 子页面 hero 光晕 */
.hero::after {
  content: "";
  position: absolute;
  right: -8%;
  top: -18%;
  width: 62%;
  height: 130%;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 55% 48%, rgba(93, 36, 214, 0.28), transparent 58%),
    radial-gradient(ellipse at 45% 40%, rgba(17, 185, 204, 0.12), transparent 48%);
  opacity: 0.85;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: min(var(--page-width), calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  align-items: center;
}

.breadcrumbs {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
}

.breadcrumbs a {
  color: #FFFFFF;
  text-decoration: none;
  font-weight: 600;
}

.breadcrumbs span::before {
  content: "›";
  margin-right: 10px;
  color: var(--gold);
}

.kicker {
  display: inline-flex;
  width: fit-content;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hero p {
  color: rgba(255, 255, 255, 0.88);
  max-width: 600px;
  font-size: 15px;
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 700;
}

.trust-strip li::before {
  content: "◆";
  margin-right: 8px;
  color: var(--success);
}

/* ===================================================================
   Verdict Card（子页面右侧面板）
   =================================================================== */
.verdict-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-card);
  color: var(--text);
}

.verdict-head {
  margin-bottom: 16px;
}

.verdict-head strong {
  display: block;
  font-size: 16px;
  color: var(--text);
}

.verdict-head .muted {
  font-size: 13px;
  color: var(--muted);
}

.score-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.score-box {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--canvas);
  text-align: center;
}

.score-box strong {
  display: block;
  color: var(--hero-blue);
  font-size: 14px;
}

.score-box span {
  font-size: 12px;
  color: var(--muted);
}

.verdict-note {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

/* ===================================================================
   通用区块 & 布局
   =================================================================== */
.section {
  padding: var(--section-space-y) 0;
}

.section.compact {
  padding-top: 32px;
}

.section.alt {
  background: var(--surface);
}

.narrow-head {
  max-width: 760px;
  text-align: center;
}

.narrow-head p {
  color: var(--muted);
  margin: 0 0 24px;
  font-size: 17px;
}

/* 网格 */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ===================================================================
   通用卡片
   =================================================================== */
.card,
.review-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.card p { color: var(--muted); margin-top: 8px; }

/* ===================================================================
   徽章
   =================================================================== */
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.badge {
  display: inline-flex;
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(6, 57, 199, 0.06);
  color: var(--hero-blue);
  font-size: 13px;
  font-weight: 700;
}

.badge.good {
  background: rgba(35, 182, 138, 0.08);
  color: #158b65;
}

.badge.warn {
  background: rgba(245, 195, 68, 0.1);
  color: #8a6d14;
}

/* ===================================================================
   表格
   =================================================================== */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

/* 仅 .table-wrap 内的宽表格保持最小宽度（允许局部滚动） */
.table-wrap table {
  min-width: 760px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  background: #EDF4FC;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  font-weight: 700;
}

tr:last-child td { border-bottom: 0; }

.name-cell {
  font-weight: 800;
  color: var(--text);
}

/* ===================================================================
   文章布局（详情子页面）
   =================================================================== */
.article-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 28px;
}

.sidebar {
  position: sticky;
  top: 104px;
  align-self: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
}

.sidebar a {
  display: block;
  margin: 8px 0;
  font-weight: 700;
  text-decoration: none;
  font-size: 15px;
  color: var(--hero-blue);
}

.sidebar a:hover { color: var(--hero-navy); }

.prose {
  max-width: 860px;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}

.prose section {
  margin-bottom: 0;
}

.prose section + section {
  margin-top: var(--prose-section-gap);
}

.prose p,
.prose li {
  color: var(--muted);
}

/* ===================================================================
   Callout / 责任说明
   =================================================================== */
.callout,
.responsible-note {
  border-left: 5px solid var(--success);
  background: rgba(35, 182, 138, 0.05);
  border-radius: var(--radius-sm);
  padding: 20px;
}

.callout.warning,
.responsible-note {
  border-left-color: #C7900A;
  background: rgba(245, 195, 68, 0.06);
}

/* ===================================================================
   回到顶部
   =================================================================== */
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--hero-blue);
  font-weight: 900;
  font-size: 18px;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.back-to-top:hover { background: var(--canvas); box-shadow: 0 8px 28px rgba(7, 31, 94, 0.22); }
.back-to-top.is-visible { opacity: 1; pointer-events: auto; }

/* ===================================================================
   FAQ 手风琴（首页 + 支付页面共用）
   =================================================================== */
.faq { padding-top: 28px; }

.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

/* ----- 卡片容器 ----- */
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(7, 31, 94, 0.03);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.faq details:hover {
  border-color: rgba(6, 57, 199, 0.25);
  box-shadow: 0 4px 20px rgba(7, 31, 94, 0.07);
}
.faq details[open] {
  border-color: rgba(6, 57, 199, 0.28);
  box-shadow: 0 6px 28px rgba(7, 31, 94, 0.1);
  background: linear-gradient(180deg, var(--surface) 0%, rgba(245, 248, 255, 0.55) 100%);
}

/* ----- 问题行 ----- */
.faq summary {
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 56px 18px 20px;
  position: relative;
  list-style: none;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.45;
  transition: color 0.2s ease;
  user-select: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--hero-blue); }
.faq details[open] summary {
  color: var(--hero-blue);
  padding-bottom: 12px;
}

/* Q 编号徽章 */
.faq summary::before {
  content: "Q";
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(6, 57, 199, 0.08), rgba(93, 36, 214, 0.06));
  color: var(--hero-blue);
  font-size: 13px;
  font-weight: 800;
  display: grid;
  place-items: center;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}
.faq details[open] summary::before {
  background: linear-gradient(135deg, var(--hero-blue), var(--hero-violet));
  color: #FFFFFF;
  transform: scale(1.08);
}

/* +/- 圆形按钮 */
.faq summary::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 18px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background:
    linear-gradient(var(--muted), var(--muted)) center / 10px 2px no-repeat,
    linear-gradient(var(--muted), var(--muted)) center / 2px 10px no-repeat,
    var(--canvas);
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.faq details:hover summary::after {
  border-color: rgba(6, 57, 199, 0.35);
}
.faq details[open] summary::after {
  background:
    linear-gradient(#FFFFFF, #FFFFFF) center / 10px 2px no-repeat,
    var(--hero-blue);
  border-color: var(--hero-blue);
  transform: rotate(90deg);
}

/* ----- 答案区 ----- */
.faq p {
  margin: 0;
  padding: 0 20px 20px 64px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

@keyframes faq-fade-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.faq details[open] p {
  animation: faq-fade-in 0.35s ease-out;
}

/* 单列布局（支付页面 FAQ） */
.faq details + details { margin-top: 10px; }

/* ===================================================================
   无障碍
   =================================================================== */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===================================================================
   响应式：平板 (≤1040px)
   =================================================================== */
@media (max-width: 1040px) {
  .site-nav { gap: 16px; }
  .nav-cta { display: none; }
  .hero-inner { grid-template-columns: 1fr; }
  .verdict-card { max-width: 480px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .article-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}

/* 961–1040px 保留桌面结构，但隐藏 CTA 并收紧间距。 */
@media (min-width: 961px) and (max-width: 1040px) {
  .site-nav { gap: 14px; }
}

/* ===================================================================
   响应式：平板与手机 (≤960px)
   =================================================================== */
@media (max-width: 960px) {
  :root {
    --section-space-y: 48px;
    --prose-section-gap: 48px;
    --h2-content-gap: 18px;
  }

  body { font-size: 16px; }

  .nav-inner,
  .container,
  .hero-inner,
  .footer-grid,
  .legal-line {
    width: min(100% - 32px, var(--page-width));
  }

  .nav-inner { min-height: 64px; }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* ===================================================================
     移动端导航 — 右侧滑入抽屉
     =================================================================== */

  /* ---- 抽屉面板（隐藏态：在屏幕右侧外）---- */
  .site-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 360px;
    max-width: 88vw;
    height: 100vh;
    height: 100dvh;
    z-index: 70;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
    background: #fff;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: hidden;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    box-shadow: none;
  }

  /* ---- 打开态：滑入屏幕 ---- */
  .site-nav.is-open {
    transform: translateX(0);
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.18);
  }

  /* ---- 抽屉打开时所有文字强制深色 ---- */
  .site-nav.is-open,
  .site-nav.is-open a,
  .site-nav.is-open .nav-link,
  .site-nav.is-open .nav-sub a,
  .site-nav.is-open .nav-drawer-title {
    color: var(--text);
  }
  .site-nav.is-open .nav-sub a {
    color: var(--muted);
  }
  .site-nav.is-open a:hover,
  .site-nav.is-open .nav-link:hover,
  .site-nav.is-open .nav-sub a:hover {
    color: var(--hero-blue);
  }
  .site-nav.is-open a[aria-current="page"],
  .site-nav.is-open a[aria-current="location"],
  .site-nav.is-open .nav-sub a[aria-current="page"] {
    color: var(--hero-blue);
  }

  /* ---- 抽屉顶部栏（JS 注入）---- */
  .nav-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fff;
  }
  .nav-drawer-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
  }

  .nav-drawer-content {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
  }
  .nav-drawer-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--canvas);
    color: var(--muted);
    font-size: 18px;
    cursor: pointer;
    display: grid;
    place-items: center;
  }

  /* ---- 一级链接 ---- */
  .nav-drawer-content > a {
    display: flex;
    align-items: center;
    min-height: 52px;
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    flex-shrink: 0;
  }
  .nav-drawer-content > a:active {
    background: var(--canvas);
  }

  /* ---- 可展开菜单项 ---- */
  .nav-item {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }
  .nav-link {
    flex: 1;
    display: flex;
    align-items: center;
    min-height: 52px;
    padding: 0 20px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
  }

  /* 单一箭头展开按钮 */
  .nav-expand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    min-height: 52px;
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.18s ease, color 0.18s ease;
  }
  .nav-item.is-expanded .nav-expand {
    color: var(--hero-blue);
    transform: rotate(180deg);
  }

  /* ---- 子菜单 ---- */
  .site-nav .nav-sub {
    width: 100%;
    min-width: 0;
    max-width: none;
    display: none;
    position: static;
    left: auto;
    right: auto;
    opacity: 1;
    visibility: visible;
    transform: none;
    margin: 0;
    padding: 6px 0 10px;
    background: var(--canvas);
    box-shadow: none;
    border: none;
    border-radius: 0;
    border-top: 1px solid var(--border);
    max-height: min(46dvh, 420px);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
  }
  .nav-item.is-expanded .nav-sub {
    display: block;
  }
  .nav-sub-group {
    display: block;
  }
  .nav-sub-group + .nav-sub-group {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    margin-top: 4px;
    padding-top: 4px;
  }
  .nav-sub-title {
    margin: 0;
    padding: 10px 20px 4px;
    font-size: 10px;
  }
  .nav-sub a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 20px 0 36px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  }
  .nav-sub a:active {
    background: rgba(6, 57, 199, 0.04);
  }

  .nav-sub-featured a {
    color: var(--hero-blue) !important;
    font-weight: 700 !important;
  }

  .nav-drawer-cta {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    margin: 12px 16px 16px;
    padding: 0 18px;
    position: static;
    z-index: 2;
    border-radius: 8px;
    background: linear-gradient(180deg, var(--gold-hover), var(--gold));
    color: var(--hero-navy) !important;
    box-shadow: 0 8px 24px rgba(7, 31, 94, 0.2);
    font-size: 14px !important;
    font-weight: 800 !important;
    flex-shrink: 0;
  }

  /* 移动端隐藏 CTA */
  .nav-cta {
    display: none !important;
  }

  .hero-inner { padding: 22px 0 28px; }

  .hero::after {
    right: -50%;
    top: -10%;
    width: 110%;
    height: 130%;
    opacity: 0.4;
  }

  .hero p { font-size: 16px; }

  .hero-actions { display: grid; }

  .section { padding: var(--section-space-y) 0; }

  h1 { font-size: 2.2rem; }
  h2 { font-size: 1.7rem; }

  .grid-3,
  .grid-4,
  .article-layout,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .sidebar { position: static; }

  .faq-grid { grid-template-columns: 1fr; }
  .faq summary {
    padding: 16px 48px 16px 16px;
    font-size: 14px;
  }
  .faq summary::after { right: 10px; }
  .faq p {
    padding: 0 16px 16px 16px;
  }
}

/* ===================================================================
   响应式：小手机 (≤400px)
   =================================================================== */
@media (max-width: 400px) {
  .nav-inner,
  .container,
  .hero-inner,
  .footer-grid,
  .legal-line {
    width: min(100% - 24px, var(--page-width));
  }
}
