/* =============================================
   WireGuard 安装指引 — 全局样式
   设计原则：手机优先，简洁扁平，中文排版
   ============================================= */

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

:root {
  --blue:        #2563eb;
  --blue-light:  #eff6ff;
  --blue-mid:    #bfdbfe;
  --gray-50:     #f9fafb;
  --gray-100:    #f3f4f6;
  --gray-200:    #e5e7eb;
  --gray-400:    #9ca3af;
  --gray-600:    #4b5563;
  --gray-800:    #1f2937;
  --gray-900:    #111827;
  --green:       #16a34a;
  --green-light: #f0fdf4;
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --shadow-md:   0 4px 12px rgba(0,0,0,.10);
  --max-w:       760px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", sans-serif;
  color: var(--gray-800);
  background: var(--gray-50);
  line-height: 1.7;
  min-height: 100vh;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; border-radius: var(--radius-md); }

/* ── 顶部导航 ── */
.site-nav {
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 1rem;
  color: var(--gray-900);
  text-decoration: none;
}
.nav-logo img { width: 28px; height: 28px; border-radius: 6px; }
.nav-logo span { font-size: 0.95rem; }

/* ── 页面容器 ── */
.page-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 24px 16px 60px;
}

/* ── Hero 区域（首页） ── */
.hero {
  text-align: center;
  padding: 48px 16px 40px;
}
.hero-badge {
  display: inline-block;
  background: var(--blue-light);
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 16px;
}
.hero h1 {
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 14px;
  line-height: 1.3;
}
.hero p {
  font-size: 1rem;
  color: var(--gray-600);
  max-width: 480px;
  margin: 0 auto 32px;
}
.section-label {
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 700;
  color: #000;
  margin-bottom: 20px;
  text-align: center;
}

/* ── 平台卡片（首页） ── */
.platform-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 16px 60px;
}
@media (min-width: 600px) {
  .platform-grid { grid-template-columns: repeat(3, 1fr); }
}
.platform-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: box-shadow .18s, border-color .18s, transform .12s;
  text-decoration: none;
  color: inherit;
}
@media (min-width: 600px) {
  .platform-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 28px 22px;
  }
}
.platform-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--blue-mid);
  transform: translateY(-2px);
}
.platform-card:active { transform: translateY(0); }
.platform-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}
.icon-apple  { background: #f0f0f5; }
.icon-android{ background: #e8f5e9; }
.icon-windows{ background: #e3f0fc; }
.platform-card h2 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 4px;
}
.platform-card p {
  font-size: 0.85rem;
  color: var(--gray-600);
  line-height: 1.5;
}
.card-arrow {
  margin-left: auto;
  color: var(--gray-400);
  font-size: 1.2rem;
}
@media (min-width: 600px) { .card-arrow { display: none; } }

/* ── 页面标题（指引页） ── */
.page-header {
  padding: 28px 0 20px;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 24px;
}
.page-header .back-link {
  font-size: 0.85rem;
  color: var(--gray-600);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
}
.page-header .back-link:hover { color: var(--blue); }
.page-header h1 {
  font-size: clamp(1.3rem, 4vw, 1.7rem);
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 6px;
}
.page-header p { font-size: 0.9rem; color: var(--gray-600); }

/* ── 下载按钮区 ── */
.download-section {
  background: var(--blue-light);
  border: 1px solid var(--blue-mid);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
@media (min-width: 520px) {
  .download-section { flex-direction: row; align-items: center; justify-content: space-between; }
}
.download-section h3 { font-size: 1rem; font-weight: 600; color: var(--gray-900); }
.download-section p  { font-size: 0.83rem; color: var(--gray-600); margin-top: 3px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity .15s;
}
.btn:hover { opacity: .88; text-decoration: none; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-secondary {
  background: #fff;
  color: var(--blue);
  border: 1px solid var(--blue-mid);
}

/* ── 平台 Tab（Apple页） ── */
.tab-bar {
  display: flex;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 24px;
  gap: 0;
}
.tab-btn {
  flex: 1;
  padding: 11px 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-600);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  margin-bottom: -2px;
}
.tab-btn.active { color: var(--blue); border-bottom-color: var(--blue); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── 步进器 ── */
.stepper-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.stepper-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray-900);
}
.stepper-count {
  font-size: 0.82rem;
  color: var(--gray-400);
}
.stepper-progress {
  height: 4px;
  background: var(--gray-200);
  border-radius: 2px;
  margin-bottom: 20px;
  overflow: hidden;
}
.stepper-bar {
  height: 100%;
  background: var(--blue);
  border-radius: 2px;
  transition: width .3s ease;
}
.stepper-step {
  display: none;
}
.stepper-step.active {
  display: block;
  animation: fadeSlide .22s ease;
}
@keyframes fadeSlide {
  from { opacity: 0; transform: translateX(8px); }
  to   { opacity: 1; transform: translateX(0); }
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--blue);
  color: #fff;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 10px;
  flex-shrink: 0;
}
.step-content h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.step-content p {
  font-size: 0.92rem;
  color: var(--gray-600);
  margin-bottom: 14px;
  line-height: 1.7;
}
.step-img-wrap {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 16px;
}
.step-img-wrap img {
  width: 100%;
  border-radius: 0;
}
.step-img-placeholder {
  height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  font-size: 0.83rem;
  gap: 8px;
}
.step-img-placeholder span { font-size: 2rem; }

/* 提示块 */
.tip-block {
  background: var(--green-light);
  border-left: 3px solid var(--green);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 14px;
  font-size: 0.85rem;
  color: #166534;
  margin-bottom: 14px;
  line-height: 1.6;
}
.warn-block {
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 14px;
  font-size: 0.85rem;
  color: #92400e;
  margin-bottom: 14px;
  line-height: 1.6;
}

/* 步进器导航按钮 */
.stepper-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-200);
}
.stepper-nav .btn { min-width: 90px; justify-content: center; }
.stepper-dots {
  display: flex;
  gap: 6px;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gray-200);
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.dot.active { background: var(--blue); transform: scale(1.2); }

/* 完成状态 */
.step-done {
  text-align: center;
  padding: 32px 0 16px;
}
.step-done .done-icon {
  width: 56px;
  height: 56px;
  background: var(--green-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin: 0 auto 16px;
}
.step-done h3 { font-size: 1.15rem; font-weight: 700; color: var(--gray-900); margin-bottom: 8px; }
.step-done p  { font-size: 0.9rem; color: var(--gray-600); }

/* ── 分区标题 ── */
.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 32px 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 18px;
  background: var(--blue);
  border-radius: 2px;
  flex-shrink: 0;
}

/* ── FAQ 折叠 ── */
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: #fff;
  overflow: hidden;
}
.faq-q {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 14px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--gray-900);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  line-height: 1.5;
}
.faq-q:hover { background: var(--gray-50); }
.faq-arrow {
  flex-shrink: 0;
  color: var(--gray-400);
  transition: transform .2s;
  font-size: 0.9rem;
}
.faq-item.open .faq-arrow { transform: rotate(180deg); }
.faq-a {
  display: none;
  padding: 0 16px 14px;
  font-size: 0.88rem;
  color: var(--gray-600);
  line-height: 1.7;
  border-top: 1px solid var(--gray-100);
}
.faq-a p { margin-bottom: 8px; }
.faq-a img { margin-top: 10px; border: 1px solid var(--gray-200); }
.faq-item.open .faq-a { display: block; }

/* ── 配置导入区 ── */
.config-section {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 8px;
}
.config-section h3 { font-size: 1rem; font-weight: 600; margin-bottom: 8px; }
.config-section p  { font-size: 0.88rem; color: var(--gray-600); margin-bottom: 14px; }
.config-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ── 底部版权 ── */
.site-footer {
  text-align: center;
  padding: 24px 16px;
  font-size: 0.8rem;
  color: var(--gray-400);
  border-top: 1px solid var(--gray-200);
  margin-top: 40px;
}

/* ── 响应式微调 ── */
@media (max-width: 480px) {
  .btn { padding: 10px 16px; font-size: 0.85rem; }
  .stepper-nav .btn { min-width: 78px; }
}
/* 竖版手机截图：移动端限制高度，让操作按钮能同屏显示 */
@media (max-width: 600px) {
  .step-img-wrap img {
    max-height: 38vh;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    margin: 0 auto;
  }
}
