/* Marsbetta — shared styles. Design baseline: design-export/*.dc.html */
:root {
  --blue: #0033CC;
  --blue-dark: #00248F;
  --blue-deep: #001466;
  --blue-soft: #7A93FF;
  --ink: #222222;
  --muted: #6B7280;
  --line: #DDE3EE;
  --bg-soft: #F4F6FB;
  --grad-hero: linear-gradient(135deg, #001466 0%, #00248F 45%, #0033CC 100%);
  --grad-cta: linear-gradient(135deg, #001466, #0033CC);
  --grad-card: linear-gradient(160deg, #00248F, #0033CC);
  --font-sans: 'Noto Sans TC', 'Inter', 'PingFang TC', sans-serif;
  --font-en: 'Inter', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }
img { max-width: 100%; }

.container { max-width: 1200px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }
.en-text { font-family: var(--font-en); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes radarSpin {
  from { transform: rotate(0); }
  to { transform: rotate(360deg); }
}

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { height: 68px; display: flex; align-items: center; justify-content: space-between; }
.nav-logo img { height: 30px; display: block; }
.nav-links { display: flex; align-items: center; gap: 32px; font-size: 15px; font-weight: 500; }
.nav-links a { color: var(--ink); }
.nav-links a:hover { color: var(--blue); }
.nav-links a.active { color: var(--blue); }
.nav-cta {
  background: var(--blue); color: #fff !important;
  padding: 10px 22px; border-radius: 8px; font-weight: 700;
}
.nav-cta:hover { background: var(--blue-dark); }
.nav-lang {
  border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 14px; font-size: 13px; font-weight: 600; color: var(--muted) !important;
  font-family: var(--font-en);
}
.nav-lang:hover { border-color: var(--blue); color: var(--blue) !important; }
.nav-lang + .nav-lang { margin-left: -25px; } /* pull adjacent language pills together against the 32px nav gap */
.nav-toggle {
  display: none; background: none; border: none; cursor: pointer; padding: 8px;
  flex-direction: column; gap: 5px;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s, opacity .2s; }

/* ---------- Buttons ---------- */
.btn { display: inline-block; border-radius: 8px; font-weight: 700; text-align: center; transition: background .18s, border-color .18s, color .18s, transform .18s, box-shadow .18s; }
.btn:hover { transform: translateY(-1px); }
.btn-blue:hover, .btn-white:hover { box-shadow: 0 8px 20px rgba(0, 20, 102, .18); }
::selection { background: rgba(0, 51, 204, .16); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.btn-lg { padding: 15px 34px; font-size: 17px; }
.btn-md { padding: 14px 32px; font-size: 16px; }
.btn-sm { padding: 11px 24px; font-size: 14.5px; }
.btn-white { background: #fff; color: var(--blue); }
.btn-white:hover { background: var(--bg-soft); color: var(--blue-dark); }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { background: var(--blue-dark); color: #fff; }
.btn-ghost { border: 1.5px solid rgba(255, 255, 255, .6); color: #fff; }
.btn-ghost:hover { border-color: #fff; background: rgba(255, 255, 255, .09); color: #fff; }
.btn-outline-blue { border: 1.5px solid var(--blue); color: var(--blue); }
.btn-outline-blue:hover { background: var(--bg-soft); color: var(--blue-dark); }

/* ---------- Typography helpers ---------- */
.kicker {
  color: var(--blue); font-weight: 700; letter-spacing: .18em;
  font-size: 13px; font-family: var(--font-en); text-transform: uppercase;
}
.kicker-light { color: var(--blue-soft); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 56px; }
.section-head h2 { font-size: 40px; font-weight: 900; margin: 14px 0 0; }
.section-head p { color: var(--muted); font-size: 17px; line-height: 1.8; margin: 16px 0 0; }

/* ---------- Hero ---------- */
.hero { background: var(--grad-hero); color: #fff; position: relative; overflow: hidden; }
.hero-grid-bg {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 56px 56px;
}
.hero-glow {
  position: absolute; right: -120px; top: -80px; width: 520px; height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .10), transparent 65%);
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px;
  padding: 6px 16px; font-size: 13px; letter-spacing: .12em; font-weight: 600;
  color: rgba(255, 255, 255, .85);
}
.fade-up { animation: fadeUp .7s ease both; }
.fade-up-1 { animation: fadeUp .7s ease .12s both; }
.fade-up-2 { animation: fadeUp .7s ease .24s both; }

/* ---------- Cards ---------- */
.card {
  border: 1px solid var(--line); border-radius: 16px; background: #fff;
  box-shadow: 0 1px 2px rgba(0, 20, 102, .04);
  transition: box-shadow .2s, transform .2s, border-color .2s;
}
.card-hover:hover { box-shadow: 0 20px 48px rgba(0, 51, 204, .14); transform: translateY(-4px); }
.card-glow:hover { box-shadow: 0 16px 40px rgba(0, 51, 204, .12); }
.card-glow-border:hover { box-shadow: 0 16px 40px rgba(0, 51, 204, .12); border-color: var(--blue); }
.card-soft:hover { box-shadow: 0 12px 32px rgba(0, 51, 204, .10); }

.chip {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 14px; font-size: 13px; color: var(--blue-dark); font-weight: 500;
}

/* ---------- Tables (comparison / pricing) ---------- */
.cmp-table { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.cmp-row { display: grid; font-size: 15px; }
.cmp-row + .cmp-row { border-top: 1px solid var(--line); }
.cmp-head { background: var(--blue); color: #fff; font-weight: 700; }
.cmp-cell { padding: 14px 12px; text-align: center; color: var(--muted); }
.cmp-cell-first { padding: 14px 24px; text-align: left; font-weight: 500; color: var(--ink); }
.cmp-head .cmp-cell, .cmp-head .cmp-cell-first { color: #fff; }
.cmp-cell-sx { color: var(--blue); font-weight: 700; background: rgba(0, 51, 204, .05); }
.cmp-head .cmp-cell-sx { background: var(--blue-dark); color: #fff; }
.cmp-row-alt { background: var(--bg-soft); }

/* ---------- Forms ---------- */
.field label { font-size: 13.5px; font-weight: 700; display: block; margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px;
  padding: 11px 14px; font-size: 15px; font-family: inherit;
}
.field input:focus, .field textarea:focus { border-color: var(--blue); outline: none; }
.field textarea { resize: vertical; }
.form-submit {
  background: var(--blue); color: #fff; border: none; padding: 14px;
  border-radius: 8px; font-weight: 700; font-size: 16px; cursor: pointer; font-family: inherit;
  width: 100%; transition: background .18s;
}
.form-submit:hover { background: var(--blue-dark); }
/* 提交中 loading 态（js/main.js 在请求期间加 .loading） */
.form-submit.loading { opacity: .75; cursor: default; pointer-events: none; }
.form-submit.loading::before {
  content: '';
  display: inline-block;
  width: 14px; height: 14px;
  margin-right: 10px;
  vertical-align: -2px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: form-spin .7s linear infinite;
}
@keyframes form-spin { to { transform: rotate(360deg); } }
.topic-chip {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 999px; padding: 8px 18px; font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: background .15s, color .15s, border-color .15s;
}
.topic-chip.active { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ---------- FAQ ---------- */
.faq-item { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.faq-q {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 20px 26px; background: none; border: none; cursor: pointer; font-family: inherit; text-align: left;
}
.faq-q span:first-child { font-weight: 700; font-size: 16.5px; color: var(--ink); }
.faq-icon { color: var(--blue); font-weight: 800; font-size: 20px; flex-shrink: 0; transition: transform .2s; }
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-item { transition: border-color .2s, box-shadow .2s; }
.faq-item.open { border-color: var(--blue); box-shadow: 0 8px 24px rgba(0, 51, 204, .08); }
.faq-a { padding: 0 26px 22px; color: var(--muted); font-size: 15px; line-height: 1.85; display: none; }
.faq-item.open .faq-a { display: block; }

/* ---------- CTA band ---------- */
.cta-band { background: var(--grad-cta); color: #fff; }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: #fff; }
.footer a { color: rgba(255, 255, 255, .6); }
.footer a:hover { color: #fff; }
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand img { width: 34px; height: 34px; border-radius: 8px; }
.footer-brand span { font-family: var(--font-en); font-weight: 800; font-size: 18px; letter-spacing: .06em; }
.footer-meta {
  border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 48px; padding-top: 24px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-size: 13px; color: rgba(255, 255, 255, .45);
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .section-head h2 { white-space: normal !important; }
  .grid-2, .grid-3, .grid-4,
  .grid-side, .grid-side-wide, .grid-hero-split, .grid-dual-engine { grid-template-columns: 1fr !important; }
  .grid-4 { grid-template-columns: 1fr 1fr !important; }
  h1 { font-size: 40px !important; }
  .section-head h2, h2 { font-size: 30px !important; }
  .cmp-cell-first { padding: 14px 14px; }
  .hide-mobile { display: none !important; }
}
@media (max-width: 640px) {
  .container { padding-left: 20px; padding-right: 20px; }
  .grid-4 { grid-template-columns: 1fr !important; }
  h1 { font-size: 32px !important; }
  .cmp-table { overflow-x: auto; }
  .cmp-table-inner { min-width: 640px; }

  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute; left: 0; right: 0; top: 68px;
    background: #fff; border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch; gap: 0; padding: 8px 20px 16px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 4px; border-bottom: 1px solid var(--bg-soft); }
  .nav-links a:last-child { border-bottom: none; }
  .nav-cta { margin-top: 10px; text-align: center; }
  .nav-lang { text-align: center; margin-top: 6px; }
  .nav-lang + .nav-lang { margin-left: 0; }
}

/* Grid helpers (desktop defaults; pages set columns inline where unique) */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-side { display: grid; grid-template-columns: 380px 1fr; gap: 56px; align-items: start; }
.grid-hero-split { display: grid; grid-template-columns: 1.2fr 1fr; gap: 56px; align-items: center; }

/* Toast：表单提交结果提示（js/main.js showToast） */
.toast {
  position: fixed;
  top: 28px;
  left: 50%;
  z-index: 9999;
  max-width: min(520px, calc(100vw - 40px));
  padding: 13px 22px 13px 46px;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.6;
  box-shadow: 0 12px 36px rgba(0, 20, 102, .18), 0 2px 8px rgba(0, 20, 102, .1);
  border: 1px solid var(--line);
  opacity: 0;
  transform: translate(-50%, -12px);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.toast::before {
  content: '✓';
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #16A34A;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}
.toast.toast-error::before { content: '!'; background: #DC2626; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
