/* ============================================
   Clash Verge 中文官方网站 - c5
   设计风格：简约、浅色调、现代感
   ============================================ */

:root {
  /* 主色调 - 静谧蓝 */
  --primary: #3B82F6;
  --primary-hover: #2563EB;
  --primary-light: #EFF6FF;
  --primary-bg: rgba(59,130,246,0.08);

  /* 辅助色 */
  --accent: #8B5CF6;
  --accent-light: #F5F3FF;
  --success: #10B981;
  --success-light: #ECFDF5;
  --warning: #F59E0B;
  --warning-light: #FFFBEB;
  --danger: #EF4444;
  --danger-light: #FEF2F2;
  --info: #06B6D4;
  --info-light: #ECFEFF;

  /* 中性色 */
  --bg: #F8FAFC;
  --bg-white: #FFFFFF;
  --surface: #FFFFFF;
  --border: #E2E8F0;
  --border-light: #F1F5F9;

  /* 文字 */
  --text-primary: #1E293B;
  --text-secondary: #64748B;
  --text-tertiary: #94A3B8;
  --text-link: #3B82F6;

  /* 阴影 */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.06), 0 4px 6px -4px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.06), 0 8px 10px -6px rgba(0,0,0,0.04);

  /* 圆角 */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* 动画 */
  --transition: 0.25s cubic-bezier(0.4,0,0.2,1);
}

/* ============ Reset & Base ============ */
*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 16px;
}

a { color: var(--text-link); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); }

img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============ Header ============ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  transition: box-shadow var(--transition);
}
.header.scrolled { box-shadow: var(--shadow-sm); }

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}
.header-brand:hover { color: var(--primary); }

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.header-nav a {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.header-nav a:hover {
  color: var(--primary);
  background: var(--primary-light);
}
.header-nav a.active {
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 600;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition);
}

/* ============ Hero ============ */
.hero {
  padding: 140px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(59,130,246,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero h1 {
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 16px;
  position: relative;
}
.hero h1 .gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 20px;
}
.hero-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,100% { opacity:1; }
  50% { opacity:0.4; }
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  text-decoration: none;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59,130,246,0.3);
}
.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}
.btn-sm {
  padding: 7px 16px;
  font-size: 0.82rem;
}
.btn-ghost {
  background: transparent;
  color: var(--primary);
}
.btn-ghost:hover {
  background: var(--primary-light);
}

/* ============ Sections ============ */
.section {
  padding: 72px 0;
}
.section-alt {
  background: var(--bg-white);
}
.section-header {
  text-align: center;
  margin-bottom: 48px;
}
.section-header h2 {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}
.section-header p {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 520px;
  margin: 0 auto;
}

/* ============ Feature Grid ============ */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  transition: all var(--transition);
}
.feature-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 16px;
}
.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 650;
  margin-bottom: 8px;
}
.feature-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ============ Download Grid ============ */
.download-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.download-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  transition: all var(--transition);
}
.download-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.download-card .emoji {
  font-size: 2rem;
  margin-bottom: 12px;
}
.download-card h3 {
  font-size: 1.05rem;
  font-weight: 650;
  margin-bottom: 6px;
}
.download-card p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}
.download-card .version {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 8px;
}

/* ============ Steps ============ */
.steps {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.step {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
}
.step:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.step-num {
  min-width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.step h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.step p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ============ FAQ ============ */
.faq-list {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition);
}
.faq-item:hover {
  border-color: var(--primary);
}
.faq-q {
  padding: 18px 22px;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}
.faq-q::after {
  content: '+';
  font-size: 1.1rem;
  color: var(--text-tertiary);
  transition: transform var(--transition);
}
.faq-item.open .faq-q::after {
  transform: rotate(45deg);
}
.faq-a {
  padding: 0 22px;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
}
.faq-item.open .faq-a {
  padding: 0 22px 18px;
  max-height: 500px;
}

/* ============ Compare Table ============ */
.compare-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.compare-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-size: 0.875rem;
}
.compare-table th,
.compare-table td {
  padding: 14px 18px;
  text-align: center;
  border-bottom: 1px solid var(--border-light);
}
.compare-table th {
  background: var(--primary-light);
  font-weight: 650;
  color: var(--text-primary);
  font-size: 0.82rem;
}
.compare-table td:first-child {
  text-align: left;
  font-weight: 550;
  color: var(--text-primary);
}
.compare-table tr:hover td {
  background: rgba(59,130,246,0.03);
}
.check-yes { color: var(--success); font-weight: 700; }
.check-no { color: var(--text-tertiary); }

/* ============ Timeline ============ */
.timeline {
  max-width: 640px;
  margin: 0 auto;
  position: relative;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-item {
  padding: 0 0 28px 52px;
  position: relative;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--primary);
}
.timeline-item h4 {
  font-size: 0.95rem;
  font-weight: 650;
  margin-bottom: 4px;
}
.timeline-item .time {
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 6px;
}
.timeline-item p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ============ Protocol Grid ============ */
.protocol-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.protocol-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  text-align: center;
  transition: all var(--transition);
}
.protocol-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-xs);
}
.proto-name {
  font-weight: 650;
  font-size: 0.9rem;
  margin-bottom: 4px;
}
.proto-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* ============ Stats Row ============ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.stat-item {
  text-align: center;
  padding: 28px 16px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
}
.stat-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.stat-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}
.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ============ Content Prose ============ */
.prose {
  max-width: 740px;
  margin: 0 auto;
  font-size: 0.92rem;
  line-height: 1.8;
  color: var(--text-secondary);
}
.prose h3 {
  color: var(--text-primary);
  font-size: 1.15rem;
  font-weight: 650;
  margin: 28px 0 12px;
}
.prose p {
  margin-bottom: 14px;
}
.prose ul {
  margin: 10px 0 16px 20px;
}
.prose li {
  margin-bottom: 6px;
}
.prose a {
  color: var(--primary);
  font-weight: 550;
}

/* ============ Tags ============ */
.tag {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
}
.tag-blue { background: var(--primary-light); color: var(--primary); }
.tag-green { background: var(--success-light); color: var(--success); }
.tag-amber { background: var(--warning-light); color: var(--warning); }
.tag-red { background: var(--danger-light); color: var(--danger); }
.tag-purple { background: var(--accent-light); color: var(--accent); }

/* ============ Footer ============ */
.footer {
  background: var(--bg-white);
  border-top: 1px solid var(--border-light);
  padding: 48px 0 24px;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}
.footer-brand h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.footer-brand p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.footer-links h4 {
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.footer-links a {
  display: block;
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding: 3px 0;
  transition: color var(--transition);
}
.footer-links a:hover {
  color: var(--primary);
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

/* ============ Friend Links (text only) ============ */
.friend-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: center;
}
.friend-links a {
  color: var(--text-secondary);
  font-size: 0.88rem;
  transition: color var(--transition);
}
.friend-links a:hover {
  color: var(--primary);
}

/* ============ Animations ============ */
.animate-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.animate-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============ Back to Top ============ */
#backTop {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  border: none;
  z-index: 99;
  transition: all var(--transition);
}
#backTop:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* ============ Platform Page Hero ============ */
.platform-hero {
  padding: 120px 0 48px;
  text-align: center;
}
.platform-hero h1 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.platform-hero p {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 520px;
  margin: 0 auto;
}

/* ============ Responsive ============ */
@media(max-width:1024px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .download-grid { grid-template-columns: repeat(2, 1fr); }
  .protocol-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media(max-width:768px) {
  .header-nav { display:none; }
  .header-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    gap: 4px;
    box-shadow: var(--shadow-md);
  }
  .menu-toggle { display:flex; }
  .hero h1 { font-size: 2rem; }
  .hero { padding: 120px 0 56px; }
  .section { padding: 48px 0; }
  .section-header h2 { font-size: 1.5rem; }
  .feature-grid { grid-template-columns: 1fr; }
  .download-grid { grid-template-columns: 1fr; }
  .protocol-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  .compare-table { font-size: 0.78rem; }
  .platform-hero h1 { font-size: 1.7rem; }
}

@media(max-width:480px) {
  .stats-row { grid-template-columns: 1fr; }
  .protocol-grid { grid-template-columns: 1fr 1fr; }
}
