/* ═══════════════════════════════════════
   星汐科技 — GLOBAL DESIGN SYSTEM & VARIABLES
   ═══════════════════════════════════════ */
:root {
  --bg-deep: #f5f5f7;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --cyan: #0066cc;
  --cyan-bright: #0077ed;
  --cyan-dim: #0044aa;
  --cyan-glow: rgba(0, 102, 204, 0.04);
  --gold: #b8922e;
  --gold-bright: #d4a853;
  --gold-glow: rgba(184, 146, 46, 0.08);
  --text-primary: #1d1d1f;
  --text-secondary: #515154;
  --text-muted: #86868b;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.15);
  --card-bg: #ffffff;
  --card-border: rgba(0, 0, 0, 0.08);
  --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  --card-shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.08);

  /* Compatibility variables for login/user pages */
  --primary: #0071e3;
  --primary-hover: #0077ed;
  --black: #1d1d1f;
  --text-2: #515154;
  --border-in-light: rgba(0, 0, 0, 0.08);
}

/* ═══════════════════════════════════════
   GLOBAL RESET & BASE STYLES
   ═══════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background: var(--bg-deep);
  color: var(--text-primary);
}

body {
  font-family: 'Noto Sans SC', 'Outfit', system-ui, sans-serif;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  background: var(--bg-deep);
  caret-color: transparent;
}

input, textarea, [contenteditable] {
  caret-color: auto;
}

::selection {
  background: var(--cyan);
  color: #fff;
}

::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 2px;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

/* ═══════════════════════════════════════
   GLOBAL NOISE OVERLAY
   ═══════════════════════════════════════ */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.015;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 128px;
}

/* ═══════════════════════════════════════
   ANIMATED BACKGROUND — PARTICLE FIELD
   ═══════════════════════════════════════ */
#particle-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ═══════════════════════════════════════
   LIQUID BACKGROUND ORBS (NEXTCHAT STYLE)
   ═══════════════════════════════════════ */
.hero-orb,
.liquid-bg-blob-1,
.liquid-bg-blob-2,
.liquid-bg-blob-3 {
  display: block;
  position: fixed;
  z-index: -1;
  pointer-events: none;
  filter: blur(80px);
  opacity: 0.65;
  transition: all 1s ease;
}

.hero-orb-1,
.liquid-bg-blob-1 {
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(0, 122, 255, 0.25) 0%, rgba(0, 122, 255, 0) 70%);
  top: -10%; left: -10%;
  animation: blob-drift 20s infinite alternate ease-in-out;
}

.hero-orb-2,
.liquid-bg-blob-2 {
  width: 800px; height: 800px;
  background: radial-gradient(circle, rgba(212, 168, 83, 0.2) 0%, rgba(212, 168, 83, 0) 70%);
  bottom: -20%; right: -10%;
  animation: blob-drift-reverse 25s infinite alternate ease-in-out;
}

.hero-orb-3,
.liquid-bg-blob-3 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(255, 45, 85, 0.15) 0%, rgba(255, 45, 85, 0) 70%);
  top: 35%; right: 15%;
  animation: blob-drift-mid 22s infinite alternate ease-in-out;
}

@keyframes blob-drift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(80px, 50px) scale(1.15); }
}

@keyframes blob-drift-reverse {
  0% { transform: translate(0, 0) scale(1.1); }
  100% { transform: translate(-100px, -60px) scale(0.9); }
}

@keyframes blob-drift-mid {
  0% { transform: translate(0, 0) scale(0.95); }
  100% { transform: translate(-50px, 80px) scale(1.1); }
}

/* ═══════════════════════════════════════
   GLOBAL LAYOUT
   ═══════════════════════════════════════ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

section {
  position: relative;
  z-index: 1;
}

/* Semi-transparent section backdrops for scrolling glass parallax depth */
.about, .products, .capabilities, .team, .cta {
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.capabilities, .cta {
  background: rgba(245, 245, 247, 0.45);
}

/* ═══════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 20px 0;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav.scrolled {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding: 14px 0;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}

.logo-cn {
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
}

.logo-en {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.logo-mark {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-bright);
  position: relative;
  overflow: hidden;
}

.logo-mark::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.3));
  border-radius: inherit;
}

.nav-links {
  display: flex;
  gap: 36px;
  list-style: none;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-secondary);
  transition: color 0.3s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--cyan);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-cta {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.02),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  color: var(--text-primary);
  border-radius: 8px;
  font-weight: 500;
  backdrop-filter: blur(12px) saturate(130%);
  -webkit-backdrop-filter: blur(12px) saturate(130%);
  padding: 8px 20px;
  font-size: 0.85rem;
  transition: all 0.3s;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  height: 28px;
  line-height: 1;
  text-decoration: none;
}

.nav-cta:hover {
  background: rgba(255, 255, 255, 0.35);
  border-color: rgba(255, 255, 255, 0.6);
  color: var(--text-primary);
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
}

/* ═══════════════════════════════════════
   BUTTONS (APPLE STANDARD PILL STYLE)
   ═══════════════════════════════════════ */
.btn-primary {
  padding: 14px 32px;
  border-radius: 980px;
  font-size: 0.95rem;
  font-weight: 500;
  background: #0071e3;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  background: #0077ed;
  transform: translateY(-1px);
}

.btn-outline {
  padding: 14px 32px;
  border-radius: 980px;
  font-size: 0.95rem;
  font-weight: 500;
  background: transparent;
  color: #0071e3;
  border: 1.5px solid #0071e3;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-outline:hover {
  border-color: #0077ed;
  background: rgba(0, 113, 227, 0.05);
  color: #0077ed;
}

/* Active click scale down for micro-interaction */
.btn-primary:active, .btn-outline:active, .nav-cta:active, .login-btn:active {
  transform: scale(0.97) translateY(0) !important;
  transition: transform 0.1s ease !important;
}

/* ═══════════════════════════════════════
   PREMIUM LIGHT LIQUID GLASS CARDS
   ═══════════════════════════════════════ */
.product-card, .cap-card, .about-card, .cta-box, .phone-modal-box, .portal-card, .login-card, .user-card {
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 
    0 4px 30px rgba(0, 0, 0, 0.03),
    0 1px 3px rgba(0, 0, 0, 0.02),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  border-radius: 20px;
  backdrop-filter: blur(30px) saturate(190%);
  -webkit-backdrop-filter: blur(30px) saturate(190%);
  position: relative;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Specular edge highlight overlay for 3D liquid glass */
.product-card::after, .cap-card::after, .about-card::after, .cta-box::after, .portal-card::after, .login-card::after, .user-card::after {
  content: '';
  display: block;
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px; /* border width */
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.08) 40%, rgba(0, 0, 0, 0.02) 60%, rgba(255, 255, 255, 0.25) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
  transition: background 0.4s ease;
}

.product-card:hover::after, .cap-card:hover::after, .about-card:hover::after, .cta-box:hover::after, .portal-card:hover::after, .login-card:hover::after, .user-card:hover::after {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.2) 30%, rgba(0, 102, 204, 0.2) 70%, rgba(255, 255, 255, 0.45) 100%);
}

.product-card:hover, .cap-card:hover, .about-card:hover, .portal-card:hover, .login-card:hover, .user-card:hover {
  border-color: rgba(0, 102, 204, 0.25);
  background: rgba(255, 255, 255, 0.55);
  transform: translateY(-5px) scale(1.01);
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.05),
    0 1px 3px rgba(0, 0, 0, 0.02),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

/* ═══════════════════════════════════════
   PHONE MODAL
   ═══════════════════════════════════════ */
.phone-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.phone-modal.show {
  display: flex;
}

.phone-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
}

.phone-modal-box {
  position: relative;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
  border-radius: 20px;
  padding: 48px 56px;
  text-align: center;
  color: var(--text-primary);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1001;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.phone-modal-close {
  position: absolute;
  top: 16px; right: 20px;
  background: none;
  border: none;
  font-size: 1.2rem;
  color: rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: color 0.2s;
}

.phone-modal-close:hover {
  color: #000;
}

.phone-modal-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.phone-modal-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.phone-modal-number {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--cyan);
  text-decoration: none;
  display: block;
  margin-bottom: 8px;
}

.phone-modal-number:hover {
  text-decoration: underline;
}

.phone-modal-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════ */
.footer {
  background: #f5f5f7;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding: 40px 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
}

.footer-brand .logo-cn {
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
}

.footer-brand .logo-en {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-muted);
}

.footer-brand .logo-mark {
  width: 28px; height: 28px;
  color: var(--gold-bright);
}

.footer-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.footer-links a {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color 0.3s;
}

.footer-links a:hover {
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════
   SCROLL REVEAL & CORE ANIMATIONS
   ═══════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.6s; }
.reveal-delay-7 { transition-delay: 0.7s; }

/* Shake animation for input errors */
@keyframes shake {
  0%, 100% { transform: translate(0, 0); }
  15%, 45%, 75% { transform: translate(-6px, 0); }
  30%, 60%, 90% { transform: translate(6px, 0); }
}
.shake {
  animation: shake 0.4s ease-in-out !important;
}

.input-error {
  border-color: #ff3b30 !important;
  box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.15) !important;
}

/* Smooth fade-in/slide-down error popup */
.error-msg {
  display: none;
  background-color: rgba(255, 59, 48, 0.1);
  color: #ff3b30;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 20px;
  text-align: left;
  transform: translateY(-8px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.error-msg.show-error {
  display: block;
  transform: translateY(0);
  opacity: 1;
}

/* ═══════════════════════════════════════
   RESPONSIVE MEDIA QUERIES (GLOBAL)
   ═══════════════════════════════════════ */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-cta-portal { display: inline-flex; }
  .nav-cta { padding: 3px 10px; font-size: 0.7rem; border-radius: 6px; }
  .phone-modal-box { padding: 36px 32px; margin: 0 20px; }
  .phone-modal-number { font-size: 1.4rem; }
}

@media (min-width: 901px) {
  .nav-cta { padding: 8px 20px; font-size: 0.85rem; }
}

/* Mobile Header Adjustments */
@media (max-width: 768px) {
  .nav-inner {
    padding: 0 16px !important;
  }
  .nav-logo {
    font-size: 1.1rem !important;
    gap: 6px !important;
  }
  .nav-logo .logo-en {
    display: none !important;
  }
  .nav-logo .logo-mark {
    width: 30px !important;
    height: 30px !important;
  }
  .nav-inner > button.nav-cta {
    display: none !important;
  }
  .nav-cta {
    padding: 5px 10px !important;
    font-size: 0.75rem !important;
    border-radius: 6px !important;
    height: auto !important;
  }
  #nav-user-widget {
    margin-left: 6px !important;
    gap: 6px !important;
  }
  #nav-user-widget .nav-username {
    max-width: 45px !important;
  }
}

@media (max-width: 480px) {
  #nav-user-widget .nav-username {
    display: none !important;
  }
}
