/* =========================================================
   SWTCON · Components  —  buttons · cards · nav · footer · modal · toast
   ========================================================= */

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 52px; padding: 0 28px; border-radius: var(--r-full);
  font-family: var(--font-display); font-weight: 600; font-size: 15px;
  letter-spacing: .01em; transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn--primary { background: var(--grad-brand); color: #fff; box-shadow: var(--sh-brand); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 24px 56px rgba(11,95,255,.44); }
.btn--ghost { background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.30); backdrop-filter: blur(6px); }
.btn--ghost:hover { background: rgba(255,255,255,.18); transform: translateY(-2px); border-color: rgba(255,255,255,.55); }
.btn--line { background: #fff; color: var(--brand-700); border: 1.5px solid var(--line-strong); }
.btn--line:hover { border-color: var(--brand-400); color: var(--brand-700); transform: translateY(-2px); box-shadow: var(--sh-sm); }
.btn--sm { height: 44px; padding: 0 22px; font-size: 14.5px; }
.btn--xs { height: 40px; padding: 0 18px; font-size: 13px; }
.btn--block { width: 100%; }

/* ---------- Badges / chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 13px;
  border-radius: var(--r-full); font-size: 13px; font-weight: 600; letter-spacing: .01em;
}
.badge--brand { background: var(--brand-50); color: var(--brand-700); }
.badge--cyan { background: rgba(47,211,238,.14); color: #0c93ac; }
.badge--line { background: #fff; border: 1px solid var(--line-strong); color: var(--ink-600); }
.badge--dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan-400); box-shadow: 0 0 0 4px rgba(47,211,238,.18); }

.chip {
  display: inline-flex; align-items: center; height: 32px; padding: 0 14px;
  border-radius: var(--r-full); background: #fff; border: 1px solid var(--line);
  font-size: 13.5px; color: var(--ink-600); transition: all .25s var(--ease);
}
.chip:hover { border-color: var(--brand-300); color: var(--brand-700); background: var(--brand-50); }

/* ---------- Card ---------- */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--sh-sm); transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
}
.card--hover:hover { transform: translateY(-6px); box-shadow: var(--sh-lg); border-color: var(--brand-200); }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 12px; }
.logo__mark { width: 44px; height: 44px; flex: 0 0 44px; }
.logo__txt { display: flex; flex-direction: column; line-height: 1; }
.logo__en { font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: .05em; color: var(--ink-900); }
.logo__cn { font-size: 12px; color: var(--ink-500); letter-spacing: .24em; margin-top: 5px; }
.logo--light .logo__en { color: #fff; }
.logo--light .logo__cn { color: rgba(255,255,255,.7); }

/* ---------- Header / Nav (transparent over hero, solid on scroll) ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; height: var(--header-h); z-index: 100;
  display: flex; align-items: center;
  background: transparent; border-bottom: 1px solid transparent;
  transition: background .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease);
}
.site-header .logo__en { color: #fff; transition: color .35s var(--ease); }
.site-header .logo__cn { color: rgba(255,255,255,.72); transition: color .35s var(--ease); }
.site-header .logo__mark { filter: drop-shadow(0 4px 12px rgba(11,95,255,.4)); }

.nav { display: flex; align-items: center; gap: 40px; }
.nav__link { font-size: 15.5px; font-weight: 600; color: rgba(255,255,255,.82); position: relative; padding: 6px 0; transition: color .25s var(--ease); }
.nav__link::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--grad-brand-soft); border-radius: 2px; transition: width .3s var(--ease); }
.nav__link:hover, .nav__link.is-active { color: #fff; }
.nav__link:hover::after, .nav__link.is-active::after { width: 100%; }
.header__phone { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: 15px; color: #fff; }
.header__phone svg { width: 17px; height: 17px; color: var(--cyan-400); }

/* stuck = solid white */
.site-header.is-stuck { background: rgba(255,255,255,.82); backdrop-filter: saturate(180%) blur(18px); border-bottom-color: var(--line); box-shadow: var(--sh-sm); }
.site-header.is-stuck .logo__en { color: var(--ink-900); }
.site-header.is-stuck .logo__cn { color: var(--ink-500); }
.site-header.is-stuck .logo__mark { filter: none; }
.site-header.is-stuck .nav__link { color: var(--ink-700); }
.site-header.is-stuck .nav__link:hover, .site-header.is-stuck .nav__link.is-active { color: var(--brand-700); }
.site-header.is-stuck .header__phone { color: var(--brand-700); }

.nav-toggle { display: none; width: 46px; height: 46px; border-radius: var(--r-sm); align-items: center; justify-content: center; }
.nav-toggle span { position: relative; width: 22px; height: 2px; background: #fff; border-radius: 2px; transition: .3s var(--ease); }
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; width: 22px; height: 2px; background: #fff; border-radius: 2px; transition: .3s var(--ease); }
.nav-toggle span::before { top: -7px; } .nav-toggle span::after { top: 7px; }
.site-header.is-stuck .nav-toggle span, .site-header.is-stuck .nav-toggle span::before, .site-header.is-stuck .nav-toggle span::after { background: var(--ink-800); }

/* ---------- Footer ---------- */
.site-footer { background: var(--grad-deep); color: rgba(255,255,255,.72); padding: 76px 0 30px; position: relative; overflow: hidden; }
.site-footer::before { content: ""; position: absolute; inset: 0; background: var(--grad-mesh); opacity: .5; }
.site-footer::after { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--grad-brand); opacity: .9; }
.footer__grid { position: relative; display: grid; grid-template-columns: 1.7fr 1fr 1fr 1.2fr; gap: 40px; }
.footer__about p { margin-top: 16px; font-size: 14.5px; color: rgba(255,255,255,.62); max-width: 320px; }
.footer__col h4 { color: #fff; font-size: 15px; margin-bottom: 18px; font-family: var(--font-display); }
.footer__col a { display: block; font-size: 14.5px; color: rgba(255,255,255,.62); padding: 6px 0; transition: color .25s var(--ease); }
.footer__col a:hover { color: var(--cyan-400); }
.footer__contact { display: flex; flex-direction: column; gap: 14px; }
.footer__contact h4 { color: #fff; font-size: 15px; margin-bottom: 2px; font-family: var(--font-display); font-weight: 700; letter-spacing: .02em; }
.footer__contact .row { display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: rgba(255,255,255,.72); }
.footer__contact .row svg { width: 18px; height: 18px; color: var(--cyan-400); flex: 0 0 18px; }
.footer__qr { width: 100px; height: 100px; border-radius: var(--r-sm); background: #fff; padding: 6px; }
.footer__bottom { position: relative; margin-top: 54px; padding-top: 24px; border-top: 1px solid var(--line-dark); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 13px; color: rgba(255,255,255,.5); }

/* ---------- Modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  padding: 24px; opacity: 0; visibility: hidden; transition: opacity .3s var(--ease), visibility .3s var(--ease);
}
.modal.is-open { opacity: 1; visibility: visible; }
.modal__overlay { position: absolute; inset: 0; background: rgba(4,7,15,.6); backdrop-filter: blur(4px); }
.modal__panel {
  position: relative; width: 100%; max-width: 880px; background: #fff; border-radius: var(--r-xl);
  box-shadow: var(--sh-lg); overflow: hidden; transform: translateY(24px) scale(.98); transition: transform .35s var(--ease-out);
  display: grid; grid-template-columns: 1.25fr .85fr; max-height: 92vh;
}
.modal.is-open .modal__panel { transform: none; }
.modal__close { position: absolute; top: 16px; right: 16px; width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.7); display: flex; align-items: center; justify-content: center; color: var(--ink-600); z-index: 3; transition: .25s var(--ease); }
.modal__close:hover { background: var(--brand-50); color: var(--brand-700); transform: rotate(90deg); }
.modal__close svg { width: 18px; height: 18px; }
.modal__main { padding: 40px 40px 36px; }
.modal__side { background: var(--grad-deep); color: #fff; padding: 40px 32px; position: relative; overflow: hidden; display: flex; flex-direction: column; }
.modal__side::before { content: ""; position: absolute; inset: 0; background: var(--grad-mesh); opacity: .55; }

/* ---------- Form fields ---------- */
.field { margin-bottom: 18px; }
.field__label { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink-700); margin-bottom: 8px; }
.field__label .req { color: #e5484d; margin-left: 3px; }
.input, .textarea {
  width: 100%; border: 1.5px solid var(--line-strong); border-radius: var(--r-md);
  padding: 0 16px; height: 50px; color: var(--ink-900); background: var(--bg-soft);
  transition: border-color .25s var(--ease), background .25s var(--ease), box-shadow .25s var(--ease);
}
.textarea { height: auto; padding: 13px 16px; resize: vertical; min-height: 96px; line-height: 1.6; }
.input:focus, .textarea:focus { outline: none; border-color: var(--brand-400); background: #fff; box-shadow: 0 0 0 4px rgba(43,115,242,.12); }
.input::placeholder, .textarea::placeholder { color: var(--ink-400); }
.field__err { color: #e5484d; font-size: 12.5px; margin-top: 6px; display: none; }
.field.has-error .input, .field.has-error .textarea { border-color: #e5484d; background: #fff5f5; }
.field.has-error .field__err { display: block; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.toast {
  display: inline-flex; align-items: center; gap: 10px; padding: 14px 22px; border-radius: var(--r-full);
  background: var(--navy-900); color: #fff; font-size: 14.5px; font-weight: 500; box-shadow: var(--sh-dark);
  opacity: 0; transform: translateY(14px); transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.toast.is-show { opacity: 1; transform: none; }
.toast svg { width: 18px; height: 18px; color: var(--cyan-400); }
.toast--ok svg { color: #4ade80; }

/* ---------- Floating CTA ---------- */
.float-cta {
  position: fixed; right: 28px; bottom: 28px; z-index: 120; display: inline-flex; align-items: center; gap: 10px;
  height: 60px; padding: 0 26px; border-radius: var(--r-full); background: var(--grad-brand); color: #fff;
  font-family: var(--font-display); font-weight: 700; font-size: 15px; box-shadow: var(--sh-brand);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease); animation: floaty 3.4s ease-in-out infinite;
}
.float-cta:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 24px 56px rgba(11,95,255,.46); }
.float-cta svg { width: 20px; height: 20px; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* ---------- Responsive nav ---------- */
@media (max-width: 980px) {
  .nav-toggle { display: flex; }
  .header__nav { position: fixed; top: var(--header-h); left: 0; right: 0; background: #fff; flex-direction: column; align-items: stretch; gap: 0; padding: 12px 28px 22px; border-bottom: 1px solid var(--line); box-shadow: var(--sh); transform: translateY(-12px); opacity: 0; visibility: hidden; transition: .3s var(--ease); }
  .header__nav.is-open { transform: none; opacity: 1; visibility: visible; }
  .nav__link { padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--ink-700); }
  .nav__link::after { display: none; }
  .header__phone { display: none; }
  .modal__panel { grid-template-columns: 1fr; max-width: 460px; }
  .modal__side { display: none; }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 560px) {
  .footer__grid { grid-template-columns: 1fr; }
  .float-cta span { display: none; }
  .float-cta { width: 60px; padding: 0; justify-content: center; }
}
