/* ============================================================
   AwayDDoS — Keep DDoS Away, Keep Online Always
   Dark tech theme · Teal brand (from logo)
   Mobile / WeChat (X5 & WKWebView) friendly
   ============================================================ */
:root {
  --bg: #070c16;
  --bg-2: #0b1424;
  --card: #0e1729;
  --card-2: #111d33;
  --line: rgba(148, 163, 184, 0.14);
  --text: #e7ecf5;
  --muted: #93a0b4;
  --teal: #14c8b8;
  --cyan: #38bdf8;
  --grad: linear-gradient(135deg, #14c8b8, #38bdf8);
  --radius: 14px;
  --shadow: 0 12px 40px rgba(2, 6, 16, 0.45);
  /* 刘海屏 / 安全区域（微信、iOS、Android 全面屏通用） */
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sal: env(safe-area-inset-left, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "PingFang TC", "PingFang HK", "Microsoft JhengHei",
    "Noto Sans TC", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;   /* 防止 iOS 横屏时字体被放大 */
  text-size-adjust: 100%;
  overflow-x: hidden;
}
a, button, .btn, .nav-toggle, .fab-btn, .fab-link {
  -webkit-tap-highlight-color: transparent;  /* 去掉移动端点击灰色高亮 */
}
section { scroll-margin-top: calc(84px + var(--sat)); }
img, svg { display: block; }
a { color: var(--teal); text-decoration: none; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background: rgba(7, 12, 22, 0.6);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}
.site-header.scrolled { border-bottom-color: var(--line); background: rgba(7, 12, 22, 0.85); }
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 68px; padding-top: var(--sat); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 1.12rem; letter-spacing: 0.3px; margin-right: auto; }
.brand .brand-mark { width: 36px; height: auto; display: block; }
.brand .brand-en { color: var(--text); }
.brand b { color: var(--teal); }
.main-nav { display: flex; align-items: center; gap: 28px; }
.main-nav a { color: var(--muted); font-size: 0.95rem; transition: color 0.2s; }
.main-nav a:hover { color: var(--text); }
.header-actions { display: flex; align-items: center; gap: 14px; }
.lang-switch { display: flex; align-items: center; gap: 2px; font-size: 0.85rem; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.lang-switch .ls-globe { width: 16px; height: 16px; margin: 0 2px 0 7px; fill: none; stroke: var(--muted); stroke-width: 1.6; flex: none; }
.lang-switch a {
  padding: 5px 13px; border-radius: 999px; color: var(--muted);
  font-weight: 600; transition: all 0.2s; white-space: nowrap;
}
.lang-switch a.active { background: var(--grad); color: #04121a; }
.lang-switch a:not(.active):hover { color: var(--text); background: rgba(255, 255, 255, 0.07); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--text); margin: 4px 0; transition: 0.3s; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; overflow: hidden; }
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 80% 60% at 50% 38%, transparent 40%, rgba(7, 12, 22, 0.9) 100%);
}
/* 品牌盾牌水印：融入 Hero 背景的大型 logo */
.hero-mark {
  position: absolute; z-index: 1; pointer-events: none;
  right: -140px; top: 50%; width: min(600px, 64vw);
  transform: translateY(-50%);
  opacity: 0.1;
  filter: drop-shadow(0 0 70px rgba(75, 225, 228, 0.35));
  animation: markFloat 9s ease-in-out infinite;
}
.hero-mark img { width: 100%; height: auto; display: block; }
@keyframes markFloat {
  0%, 100% { transform: translateY(-50%); }
  50% { transform: translateY(calc(-50% - 20px)); }
}
.hero-inner { position: relative; z-index: 2; text-align: center; padding: 120px 24px 80px; max-width: 900px; margin: 0 auto; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--teal);
  border: 1px solid rgba(20, 200, 184, 0.35); background: rgba(20, 200, 184, 0.08);
  padding: 6px 16px; border-radius: 999px; margin-bottom: 28px;
}
.hero-badge .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(20, 200, 184, 0.5); } 70% { box-shadow: 0 0 0 9px rgba(20, 200, 184, 0); } 100% { box-shadow: 0 0 0 0 rgba(20, 200, 184, 0); } }
.hero h1 { font-size: clamp(2.3rem, 5.6vw, 4.1rem); line-height: 1.16; font-weight: 800; letter-spacing: -0.5px; }
.hero h1 .line2 { display: block; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { margin: 24px auto 0; max-width: 640px; color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.15rem); }
.hero-cta { margin-top: 40px; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 13px 30px; border-radius: 10px;
  font-size: 1rem; font-weight: 600; transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  cursor: pointer; border: 1px solid transparent;
}
.btn-primary { background: var(--grad); color: #04121a; box-shadow: 0 8px 26px rgba(20, 200, 184, 0.32); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(20, 200, 184, 0.45); }
.btn-ghost { border-color: var(--line); color: var(--text); background: rgba(255, 255, 255, 0.03); }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); transform: translateY(-2px); }

/* ---------- Stats ---------- */
.stats { position: relative; z-index: 2; border-top: 1px solid var(--line); background: rgba(11, 20, 36, 0.55); backdrop-filter: blur(8px); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 34px 0; text-align: center; }
.stat-num { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-label { color: var(--muted); font-size: 0.88rem; margin-top: 4px; }

/* ---------- Sections ---------- */
.section { padding: 100px 0; position: relative; }
.section.alt { background: var(--bg-2); }
.section-head { max-width: 680px; margin: 0 auto 56px; text-align: center; }
.kicker {
  display: inline-block; font-size: 0.82rem; font-weight: 700; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--teal); margin-bottom: 14px;
}
.section-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 800; line-height: 1.25; }
.section-head p { color: var(--muted); margin-top: 16px; }

/* ---------- Advantage cards ---------- */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 24px; transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.card:hover { transform: translateY(-6px); border-color: rgba(20, 200, 184, 0.45); box-shadow: 0 16px 44px rgba(20, 200, 184, 0.12); }
.card-icon {
  width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(20, 200, 184, 0.1); border: 1px solid rgba(20, 200, 184, 0.25); margin-bottom: 20px;
}
.card-icon svg { width: 26px; height: 26px; stroke: var(--teal); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card h3 { font-size: 1.08rem; font-weight: 700; margin-bottom: 10px; }
.card p { color: var(--muted); font-size: 0.92rem; }
.card .tag {
  display: inline-block; margin-top: 16px; font-size: 0.78rem; font-weight: 700; color: var(--teal);
  background: rgba(20, 200, 184, 0.1); border: 1px solid rgba(20, 200, 184, 0.25);
  padding: 3px 10px; border-radius: 999px;
}

/* ---------- Flow (two-layer cleaning) ---------- */
.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; position: relative; }
.flow-step {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 22px; position: relative; transition: border-color 0.3s, transform 0.3s;
}
.flow-step:hover { border-color: rgba(20, 200, 184, 0.45); transform: translateY(-4px); }
.flow-num {
  font-size: 0.8rem; font-weight: 800; color: #04121a; width: 34px; height: 34px;
  display: grid; place-items: center; border-radius: 50%; background: var(--grad); margin-bottom: 16px;
}
.flow-step h3 { font-size: 1rem; margin-bottom: 8px; }
.flow-step p { color: var(--muted); font-size: 0.88rem; }
.flow-note {
  margin-top: 30px; text-align: center; color: var(--muted); font-size: 0.9rem;
  border: 1px dashed rgba(20, 200, 184, 0.35); border-radius: 12px; padding: 16px 20px;
  background: rgba(20, 200, 184, 0.05);
}
.flow-note b { color: var(--teal); }

/* ---------- Global network ---------- */
.network-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
#globe-canvas { width: 100%; aspect-ratio: 1/1; max-width: 520px; margin: 0 auto; touch-action: pan-y; }
.regions { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.region {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px;
}
.region h3 { font-size: 0.95rem; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.region h3 .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 8px var(--teal); }
.region p { color: var(--muted); font-size: 0.86rem; }

/* ---------- FAQ ---------- */
.faq { max-width: 780px; margin: 0 auto; }
.faq details {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  margin-bottom: 14px; overflow: hidden; transition: border-color 0.3s;
}
.faq details[open] { border-color: rgba(20, 200, 184, 0.4); }
.faq summary {
  cursor: pointer; padding: 20px 24px; font-weight: 600; font-size: 1rem;
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--teal); font-size: 1.4rem; font-weight: 400; transition: transform 0.3s; flex-shrink: 0; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .faq-a { padding: 0 24px 22px; color: var(--muted); font-size: 0.94rem; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 40px; align-items: start; }
.contact-cards { display: grid; gap: 16px; }
.contact-item {
  display: flex; gap: 16px; align-items: flex-start; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 20px;
  transition: border-color 0.3s, transform 0.3s;
}
.contact-item:hover { border-color: rgba(20, 200, 184, 0.45); transform: translateY(-3px); }
.contact-item .ci-icon { width: 44px; height: 44px; flex-shrink: 0; border-radius: 10px; display: grid; place-items: center; background: rgba(20, 200, 184, 0.1); border: 1px solid rgba(20, 200, 184, 0.25); }
.contact-item .ci-icon svg { width: 22px; height: 22px; stroke: var(--teal); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.contact-item h3 { font-size: 0.98rem; margin-bottom: 4px; }
.contact-item p { color: var(--muted); font-size: 0.88rem; word-break: break-all; }
.contact-form {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px;
}
.contact-form h3 { font-size: 1.15rem; margin-bottom: 6px; }
.contact-form .form-tip { color: var(--muted); font-size: 0.88rem; margin-bottom: 22px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.86rem; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea {
  /* 16px 是 iOS 微信/ Safari 的关键阈值：小于 16px 聚焦时会强制缩放页面 */
  width: 100%; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; color: var(--text); font-size: 16px; font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(20, 200, 184, 0.15);
}
.field textarea { min-height: 130px; resize: vertical; }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 20px; }
.form-foot .alt { color: var(--muted); font-size: 0.86rem; }

/* ---------- Floating contact widget (WeChat-friendly) ---------- */
.fab {
  position: fixed;
  right: calc(22px + var(--sar));
  bottom: calc(22px + var(--sab));
  z-index: 200; display: flex; flex-direction: column; align-items: flex-end; gap: 12px;
}
.fab-panel {
  background: var(--card-2); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
  width: 264px; padding: 10px; opacity: 0; transform: translateY(12px) scale(0.97); pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.fab.open .fab-panel { opacity: 1; transform: none; pointer-events: auto; }
.fab-panel .fab-title { font-size: 0.82rem; color: var(--muted); padding: 10px 12px 6px; }
.fab-link {
  display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px;
  color: var(--text); font-size: 0.92rem; transition: background 0.2s;
}
.fab-link:hover { background: rgba(20, 200, 184, 0.09); }
.fab-link .fi { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.fab-link .fi svg { width: 20px; height: 20px; }
.fab-link small { display: block; color: var(--muted); font-size: 0.78rem; }
.fab-btn {
  width: 58px; height: 58px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--grad); display: grid; place-items: center;
  box-shadow: 0 10px 30px rgba(20, 200, 184, 0.4); transition: transform 0.2s;
}
.fab-btn:hover { transform: scale(1.07); }
.fab-btn svg { width: 27px; height: 27px; stroke: #04121a; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fab-btn .icon-close { display: none; }
.fab.open .fab-btn .icon-chat { display: none; }
.fab.open .fab-btn .icon-close { display: block; }
.fab-ring {
  position: absolute;
  right: calc(22px + var(--sar));
  bottom: calc(22px + var(--sab));
  width: 58px; height: 58px; border-radius: 50%; border: 2px solid rgba(20, 200, 184, 0.5); animation: ring 2.2s infinite; pointer-events: none;
}
@keyframes ring { 0% { transform: scale(1); opacity: 0.8; } 100% { transform: scale(1.7); opacity: 0; } }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: 56px 0 32px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-grid p { color: var(--muted); font-size: 0.9rem; margin-top: 14px; max-width: 320px; }
.footer-col h4 { font-size: 0.95rem; margin-bottom: 16px; }
.footer-col a { display: block; color: var(--muted); font-size: 0.9rem; margin-bottom: 10px; transition: color 0.2s; }
.footer-col a:hover { color: var(--teal); }
.footer-bottom {
  border-top: 1px solid var(--line); padding-top: 24px; display: flex; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 0.84rem;
}

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.08s; } .reveal.d2 { transition-delay: 0.16s; } .reveal.d3 { transition-delay: 0.24s; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .flow { grid-template-columns: repeat(2, 1fr); }
  .network-grid, .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 26px 12px; }
}
@media (max-width: 640px) {
  .main-nav {
    position: fixed; top: calc(68px + var(--sat)); left: 0; right: 0; flex-direction: column; align-items: flex-start;
    background: rgba(9, 15, 28, 0.98); border-bottom: 1px solid var(--line); padding: 20px 24px;
    gap: 18px; display: none;
  }
  .main-nav.open { display: flex; }
  .nav-toggle { display: block; }
  .header-actions { gap: 10px; }
  .lang-switch a { padding: 5px 10px; }
  .cards, .flow, .regions { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .section { padding: 64px 0; }
  .hero-inner { padding: 110px 20px 64px; }
  .hero-mark { right: -34vw; width: 88vw; opacity: 0.07; }
  .contact-form { padding: 24px; }
  .fab-panel { width: min(264px, calc(100vw - 44px - var(--sar) - var(--sal))); }
}
@media (max-width: 380px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 20px 8px; }
  .stat-num { font-size: 1.5rem; }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; justify-content: center; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
  .reveal { opacity: 1; transform: none; }
  .hero-mark { animation: none; }
}
