/* ========== CSS Variables & Reset ========== */
:root {
  --red: #f13830;
  --red-dark: #d42f28;
  --red-light: #F5E6E9;
  --white: #FFFFFF;
  --off-white: #F9F9F9;
  --gray-50: #FAFAFA;
  --gray-100: #F3F3F3;
  --gray-200: #E5E5E5;
  --gray-300: #D1D1D1;
  --gray-500: #888;
  --gray-700: #444;
  --gray-900: #1A1A1A;
  --font-cn: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-en: "Inter", "Segoe UI", Arial, sans-serif;
  --max-w: 1200px;
  --header-h: 80px;
  --shadow: 0 2px 20px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.10);
  --radius: 12px;
  --transition: .3s ease;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-cn);
  color: var(--gray-900);
  background: var(--white);
  line-height: 1.7;
  overflow-x: hidden;
}
body[data-lang="en"] { font-family: var(--font-en); }
a { color: inherit; text-decoration: none; transition: color var(--transition); }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
button, input, textarea, select {
  font: inherit; border: none; outline: none; background: none;
}
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* Language toggle content */
[data-lang="en"] .lang-zh { display: none !important; }
[data-lang="zh"] .lang-en { display: none !important; }

/* ========== Header ========== */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--header-h);
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-200);
  transition: box-shadow var(--transition);
}
.header.scrolled { box-shadow: var(--shadow); }
.header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 100%;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-img { height: 52px; width: auto; display: block; }
.logo-img-footer { height: 44px; }
.logo-icon {
  width: 46px; height: 46px; background: var(--red); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--white); font-weight: 700; font-size: 20px;
}
.logo-text { font-weight: 700; font-size: 22px; color: var(--gray-900); }
.logo-text small { display: block; font-size: 12px; font-weight: 400; color: var(--gray-500); line-height: 1.2; }

.nav { display: flex; align-items: center; gap: 36px; }
.nav a {
  font-size: 17px; font-weight: 500; color: var(--gray-700);
  position: relative; padding: 4px 0;
}
.nav a::after {
  content: ''; position: absolute; bottom: -2px; left: 0; width: 0;
  height: 2px; background: var(--red); transition: width var(--transition);
}
.nav a:hover, .nav a.active { color: var(--red); }
.nav a:hover::after, .nav a.active::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 16px; }
.lang-switch {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; cursor: pointer; color: var(--gray-500);
  border: 1px solid var(--gray-200); border-radius: 20px;
  padding: 4px 12px;
}
.lang-switch:hover { border-color: var(--red); color: var(--red); }
.btn-cta {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 24px; border-radius: 6px; font-weight: 600;
  font-size: 14px; cursor: pointer; transition: all var(--transition);
}
.btn-primary { background: var(--red); color: var(--white); }
.btn-primary:hover { background: var(--red-dark); transform: translateY(-1px); box-shadow: 0 4px 15px rgba(200,16,46,.3); }
.btn-outline { border: 2px solid var(--red); color: var(--red); background: transparent; }
.btn-outline:hover { background: var(--red); color: var(--white); }

/* Mobile menu */
.menu-toggle { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 4px; }
.menu-toggle span { display: block; width: 24px; height: 2px; background: var(--gray-900); transition: var(--transition); }
.menu-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

/* ========== Hero ========== */
.hero {
  margin-top: var(--header-h);
  position: relative;
  min-height: 560px;
  display: flex; align-items: center;
  background: linear-gradient(135deg, var(--red) 0%, #f54e47 40%, #d42f28 100%);
  overflow: hidden;
}
.hero-bg-pattern {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(255,255,255,.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,.05) 0%, transparent 40%);
}
/* Circuit board decorative lines */
.hero-circuits {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none;
}
.hero-circuits::before, .hero-circuits::after {
  content: ''; position: absolute;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
}
.hero-circuits::before {
  width: 400px; height: 400px; top: -80px; right: -60px;
}
.hero-circuits::after {
  width: 250px; height: 250px; bottom: -40px; left: 10%;
}
.circuit-line {
  position: absolute; background: rgba(255,255,255,.08);
}
.circuit-line:nth-child(1) { width: 1px; height: 200px; top: 10%; right: 30%; }
.circuit-line:nth-child(2) { width: 150px; height: 1px; top: 35%; right: 25%; }
.circuit-line:nth-child(3) { width: 1px; height: 120px; bottom: 15%; right: 45%; }
.circuit-dot {
  position: absolute; width: 8px; height: 8px;
  background: rgba(255,255,255,.2); border-radius: 50%;
}
.circuit-dot:nth-child(4) { top: 10%; right: 30%; }
.circuit-dot:nth-child(5) { top: 35%; right: 25%; }
.circuit-dot:nth-child(6) { bottom: 15%; right: 45%; }

.hero .container { position: relative; z-index: 2; }
.hero-content { max-width: 600px; color: var(--white); }
.hero-content h1 { font-size: 42px; font-weight: 700; line-height: 1.25; margin-bottom: 20px; }
.hero-content p { font-size: 17px; opacity: .9; margin-bottom: 32px; line-height: 1.7; }
.hero-btns { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-btns .btn-primary { background: var(--white); color: var(--red); }
.hero-btns .btn-primary:hover { background: var(--gray-100); box-shadow: 0 4px 20px rgba(0,0,0,.15); }
.hero-btns .btn-outline { border-color: var(--white); color: var(--white); }
.hero-btns .btn-outline:hover { background: var(--white); color: var(--red); }

/* ========== Section ========== */
.section { padding: 80px 0; }
.section-alt { background: var(--gray-50); }
.section-title {
  text-align: center; font-size: 32px; font-weight: 700;
  margin-bottom: 16px; color: var(--gray-900);
}
.section-subtitle {
  text-align: center; font-size: 16px; color: var(--gray-500);
  margin-bottom: 56px; max-width: 600px; margin-left: auto; margin-right: auto;
}

/* ========== Services Grid ========== */
.services-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}
.service-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 36px 24px;
  text-align: center;
  border: 1px solid var(--gray-200);
  transition: all var(--transition);
  position: relative;
}
.service-card::after {
  content: ''; position: absolute; bottom: 0; left: 50%;
  transform: translateX(-50%); width: 48px; height: 3px;
  background: var(--red); border-radius: 2px;
  transition: width var(--transition);
}
.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}
.service-card:hover::after { width: 64px; }
.service-icon {
  width: 72px; height: 72px; margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: center;
}
.service-icon svg { width: 56px; height: 56px; color: var(--red); }
.service-card h3 { font-size: 18px; font-weight: 600; margin-bottom: 10px; }
.service-card p { font-size: 14px; color: var(--gray-500); line-height: 1.6; }

/* ========== Process / How it Works ========== */
.process-steps {
  display: flex; align-items: flex-start; justify-content: center;
  gap: 16px; flex-wrap: wrap;
}
.process-step {
  flex: 1; min-width: 180px; max-width: 220px;
  text-align: center; position: relative;
}
.process-step-icon {
  width: 80px; height: 80px; margin: 0 auto 16px;
  border: 2px solid var(--red); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--white); position: relative; z-index: 1;
}
.process-step-icon svg { width: 36px; height: 36px; color: var(--red); }
.process-step h4 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.process-step p { font-size: 13px; color: var(--gray-500); line-height: 1.5; }
.process-arrow {
  display: flex; align-items: center; padding-top: 28px;
  color: var(--red); font-size: 20px;
}

/* ========== Partners ========== */
.partners-row {
  display: flex; align-items: center; justify-content: center;
  gap: 48px; flex-wrap: wrap; opacity: .6;
}
.partners-row span {
  font-size: 20px; font-weight: 700; color: var(--gray-500);
  white-space: nowrap;
}

/* ========== Inquiry / Contact Form ========== */
.inquiry-section { background: var(--gray-50); }
.inquiry-form {
  max-width: 680px; margin: 0 auto;
  background: var(--white); border-radius: var(--radius);
  padding: 48px; box-shadow: var(--shadow);
}
.form-row { display: flex; gap: 16px; margin-bottom: 16px; }
.form-row .form-group { flex: 1; }
.form-group { margin-bottom: 16px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 12px 16px;
  border: 1px solid var(--gray-200);
  border-radius: 8px; font-size: 15px;
  transition: border-color var(--transition);
}
.form-group input:focus, .form-group textarea:focus {
  border-color: var(--red);
}
.form-group textarea { resize: vertical; min-height: 100px; }
.form-submit {
  width: 100%; padding: 14px; background: var(--red);
  color: var(--white); border-radius: 8px; font-size: 16px;
  font-weight: 600; cursor: pointer; transition: background var(--transition);
}
.form-submit:hover { background: var(--red-dark); }

/* ========== Stats ========== */
.stats-bar {
  background: var(--red);
  color: var(--white);
  padding: 48px 0;
}
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 24px; text-align: center;
}
.stat-item h3 { font-size: 36px; font-weight: 700; }
.stat-item p { font-size: 14px; opacity: .85; margin-top: 4px; }

/* ========== News ========== */
.news-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.news-card {
  background: var(--white); border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--gray-200);
  transition: all var(--transition);
}
.news-card:hover {
  transform: translateY(-4px); box-shadow: var(--shadow-lg);
}
.news-card-img {
  height: 200px; background: var(--red-light);
  display: flex; align-items: center; justify-content: center;
  color: var(--red); font-size: 48px;
}
.news-card-body { padding: 24px; }
.news-card-date { font-size: 13px; color: var(--gray-500); margin-bottom: 8px; }
.news-card h3 { font-size: 17px; font-weight: 600; margin-bottom: 10px; line-height: 1.5; }
.news-card p { font-size: 14px; color: var(--gray-500); line-height: 1.6; }

/* ========== About page ========== */
.about-intro {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 60px; align-items: center;
}
.about-img {
  background: linear-gradient(135deg, var(--red-light), var(--white));
  border-radius: var(--radius); height: 360px;
  display: flex; align-items: center; justify-content: center;
  font-size: 64px; color: var(--red);
}
.about-text h2 { font-size: 28px; font-weight: 700; margin-bottom: 16px; }
.about-text p { font-size: 15px; color: var(--gray-700); line-height: 1.8; }

.team-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}
.team-card { text-align: center; }
.team-avatar {
  width: 100px; height: 100px; margin: 0 auto 16px;
  border-radius: 50%; background: var(--red-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; color: var(--red);
}
.team-card h4 { font-size: 16px; font-weight: 600; }
.team-card p { font-size: 13px; color: var(--gray-500); }

/* ========== Footer ========== */
.footer {
  background: var(--gray-900); color: var(--gray-300);
  padding: 60px 0 0;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 32px; padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.footer-brand .logo-icon { background: var(--red); }
.footer-brand .logo-img { height: 42px; width: auto; }
.footer-brand p { font-size: 14px; color: var(--gray-500); margin-top: 12px; line-height: 1.6; }
.footer-col h4 {
  font-size: 15px; font-weight: 600; color: var(--white);
  margin-bottom: 16px;
}
.footer-col a {
  display: block; font-size: 14px; color: var(--gray-500);
  padding: 4px 0; transition: color var(--transition);
}
.footer-col a:hover { color: var(--white); }
.footer-social { display: flex; gap: 12px; margin-top: 16px; }
.footer-social a {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-300); font-size: 16px;
  transition: all var(--transition);
}
.footer-social a:hover { background: var(--red); color: var(--white); }
.footer-bottom {
  text-align: center; padding: 20px 0;
  font-size: 13px; color: var(--gray-500);
}
.footer-bottom a { color: var(--gray-500); }
.footer-bottom a:hover { color: var(--white); }

/* ========== Page Header (inner pages) ========== */
.page-header {
  margin-top: var(--header-h);
  background: linear-gradient(135deg, var(--red) 0%, #f54e47 100%);
  padding: 60px 0;
  text-align: center;
  color: var(--white);
  position: relative;
  overflow: hidden;
}
.page-header h1 { font-size: 36px; font-weight: 700; margin-bottom: 8px; }
.page-header p { font-size: 16px; opacity: .85; }

/* ========== Enhanced Animations ========== */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200,16,46,.15); }
  50% { box-shadow: 0 0 20px 4px rgba(200,16,46,.1); }
}
@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
.hero-illustration { animation: float 6s ease-in-out infinite; }
.service-card:hover .service-icon svg { transform: scale(1.1); transition: transform .3s ease; }
.process-step-icon { animation: pulse-glow 3s ease-in-out infinite; }
.news-card-img svg { transition: transform .4s ease; }
.news-card:hover .news-card-img svg { transform: scale(1.05); }

/* ========== Page Header enhanced ========== */
.page-header::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 80% 30%, rgba(255,255,255,.08) 0%, transparent 50%),
    radial-gradient(circle at 20% 70%, rgba(255,255,255,.05) 0%, transparent 40%);
  pointer-events: none;
}
.page-header::after {
  content: ''; position: absolute;
  width: 300px; height: 300px; border: 1px solid rgba(255,255,255,.1);
  border-radius: 50%; right: -80px; top: -80px; pointer-events: none;
}

/* ========== Partner logo cards ========== */
.partner-logo {
  background: #fff; padding: 12px 28px; border-radius: 8px;
  border: 1px solid var(--gray-200); font-size: 16px; font-weight: 700;
  color: var(--gray-700); box-shadow: 0 2px 8px rgba(0,0,0,.04);
  transition: all var(--transition); white-space: nowrap;
}
.partner-logo:hover {
  border-color: var(--red); color: var(--red);
  box-shadow: 0 4px 16px rgba(200,16,46,.1);
  transform: translateY(-2px);
}

/* ========== Responsive ========== */
@media (max-width: 1024px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .news-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
  .about-intro { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --header-h: 60px; }
  .nav {
    display: none; position: fixed;
    top: var(--header-h); left: 0; right: 0;
    background: var(--white); flex-direction: column;
    padding: 24px; gap: 16px;
    box-shadow: var(--shadow-lg);
    border-top: 1px solid var(--gray-200);
  }
  .nav.open { display: flex; }
  .menu-toggle { display: flex; }
  .header-actions .btn-cta { display: none; }

  .hero { min-height: 440px; }
  .hero-content h1 { font-size: 28px; }
  .hero-content p { font-size: 15px; }

  .section { padding: 56px 0; }
  .section-title { font-size: 26px; }
  .section-subtitle { font-size: 14px; }

  .services-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
  .service-card { padding: 24px 16px; }
  .service-icon { width: 56px; height: 56px; }
  .service-icon svg { width: 40px; height: 40px; }

  .process-steps { flex-direction: column; align-items: center; }
  .process-arrow { transform: rotate(90deg); padding: 0; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .stat-item h3 { font-size: 28px; }

  .news-grid { grid-template-columns: 1fr; }

  .inquiry-form { padding: 28px 20px; }
  .form-row { flex-direction: column; gap: 0; }

  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }

  .about-img { height: 240px; }
  .team-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }

  .partners-row { gap: 24px; }
  .partners-row span { font-size: 16px; }
}

@media (max-width: 480px) {
  .services-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: 1fr; }
  .hero-btns { flex-direction: column; }
  .hero-btns .btn-cta { width: 100%; text-align: center; }
}
