/* ============================================
   英龙智造官网 - 三套主题样式
   Theme 1: 深蓝科技 (blue)
   Theme 2: 烈焰橙韵 (orange)
   Theme 3: 极简素白 (light)
   ============================================ */

/* --- CSS Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  transition: background-color 0.5s ease, color 0.5s ease;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s;
}

img { max-width: 100%; display: block; }
ul { list-style: none; }

/* --- Theme Variables --- */

/* Theme 1: 科技蓝光 Tech Blue */
[data-theme="blue"] {
  --bg: #f0f4f8;
  --bg-alt: #e2e8f0;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 1);
  --text: #475569;
  --text-strong: #0f172a;
  --text-muted: #94a3b8;
  --accent: #2563eb;
  --accent-light: #60a5fa;
  --accent-dark: #1d4ed8;
  --accent-glow: rgba(37, 99, 235, 0.1);
  --border: rgba(37, 99, 235, 0.12);
  --border-hover: rgba(37, 99, 235, 0.3);
  --gradient-hero: linear-gradient(135deg, #0f172a 0%, #1e293b 40%, #1e3a5f 100%);
  --gradient-accent: linear-gradient(135deg, #2563eb, #60a5fa);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 12px 40px rgba(37, 99, 235, 0.12);
  --nav-bg: rgba(240, 244, 248, 0.92);
  --footer-bg: #0f172a;
}

/* Theme 2: 活力阳光 Vibrant Orange */
[data-theme="orange"] {
  --bg: #fffbf7;
  --bg-alt: #fef3e8;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: rgba(255, 255, 255, 1);
  --text: #5c4a3a;
  --text-strong: #2c1810;
  --text-muted: #a08876;
  --accent: #d2692e;
  --accent-light: #e8954a;
  --accent-dark: #b5561f;
  --accent-glow: rgba(210, 105, 46, 0.1);
  --border: rgba(210, 105, 46, 0.12);
  --border-hover: rgba(210, 105, 46, 0.3);
  --gradient-hero: linear-gradient(135deg, #1a0f08 0%, #2c1810 40%, #3d2415 100%);
  --gradient-accent: linear-gradient(135deg, #d2692e, #e8954a);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 12px 40px rgba(210, 105, 46, 0.12);
  --nav-bg: rgba(255, 251, 247, 0.92);
  --footer-bg: #1a0f08;
}

/* Theme 3: 创新紫晶 Innovation Purple */
[data-theme="light"] {
  --bg: #faf5ff;
  --bg-alt: #f3e8ff;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: rgba(255, 255, 255, 1);
  --text: #5b4578;
  --text-strong: #2e1065;
  --text-muted: #a78bcc;
  --accent: #7c3aed;
  --accent-light: #a78bfa;
  --accent-dark: #6d28d9;
  --accent-glow: rgba(124, 58, 237, 0.1);
  --border: rgba(124, 58, 237, 0.12);
  --border-hover: rgba(124, 58, 237, 0.3);
  --gradient-hero: linear-gradient(135deg, #1e0a3e 0%, #2e1065 40%, #3b1a7a 100%);
  --gradient-accent: linear-gradient(135deg, #7c3aed, #a78bfa);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 12px 40px rgba(124, 58, 237, 0.12);
  --nav-bg: rgba(250, 245, 255, 0.92);
  --footer-bg: #1e0a3e;
}

/* --- Container --- */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* --- Theme Switcher --- */
.theme-switcher {
  position: fixed;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
}

.theme-toggle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(12px);
  transition: all 0.3s;
  box-shadow: var(--shadow);
}

.theme-toggle:hover {
  border-color: var(--accent);
  transform: scale(1.1);
}

.theme-panel {
  position: absolute;
  right: 56px;
  top: 50%;
  transform: translateY(-50%) scale(0.9);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  min-width: 160px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.theme-panel.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) scale(1);
}

.theme-panel-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
  font-size: 0.875rem;
}

.theme-option:hover {
  background: var(--accent-glow);
}

.theme-option.active {
  color: var(--accent);
}

.theme-preview {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid transparent;
  flex-shrink: 0;
}

.theme-option.active .theme-preview {
  border-color: var(--accent);
}

.blue-preview {
  background: linear-gradient(135deg, #e2e8f0, #2563eb);
}

.orange-preview {
  background: linear-gradient(135deg, #fef3e8, #d2692e);
}

.light-preview {
  background: linear-gradient(135deg, #f3e8ff, #7c3aed);
}

/* --- Navbar --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 0;
  transition: all 0.4s;
}

.navbar.scrolled {
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0;
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-img {
  height: 36px;
  width: auto;
}

[data-theme] .navbar.scrolled .logo-img {
  filter: invert(1) hue-rotate(180deg);
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-cn {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-strong);
  letter-spacing: 0.1em;
}

.logo-en {
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text);
  position: relative;
  padding: 0.25rem 0;
  transition: color 0.3s;
  white-space: nowrap;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Light theme nav adjustments */
[data-theme] .navbar:not(.scrolled) .nav-link,
[data-theme] .navbar:not(.scrolled) .logo-cn {
  color: rgba(255,255,255,0.9);
}

[data-theme] .navbar:not(.scrolled) .logo-en {
  color: rgba(255,255,255,0.5);
}

[data-theme] .navbar:not(.scrolled) .nav-link:hover,
[data-theme] .navbar:not(.scrolled) .nav-link.active {
  color: var(--accent-light);
}

.lang-switch {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  letter-spacing: 0.05em;
  transition: all 0.3s;
  text-decoration: none;
  flex-shrink: 0;
}

.lang-switch:hover {
  background: var(--accent);
  color: #fff;
}

[data-theme] .navbar:not(.scrolled) .lang-switch {
  color: rgba(255,255,255,0.8);
  border-color: rgba(255,255,255,0.4);
}

[data-theme] .navbar:not(.scrolled) .lang-switch:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-hamburger span {
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: all 0.3s;
  border-radius: 1px;
}

.nav-hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-hamburger.active span:nth-child(2) {
  opacity: 0;
}

.nav-hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Hero Section --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-hero);
  overflow: hidden;
}

/* Light theme hero always has dark bg */
[data-theme] .hero {
  color: #e8f0fe;
}

[data-theme] .hero .hero-desc,
[data-theme] .hero .stat-label {
  color: rgba(255,255,255,0.65);
}

[data-theme] .hero .stat-number,
[data-theme] .hero .stat-unit {
  color: #fff;
}

#heroCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, var(--accent-glow) 0%, transparent 60%);
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 3;
  text-align: center;
  max-width: 900px;
  padding: 40px 2rem 0;
}

.hero-badge {
  display: inline-block;
  padding: 0.4rem 1.5rem;
  border: 1px solid var(--accent);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.15em;
  margin-bottom: 2rem;
  backdrop-filter: blur(8px);
  background: var(--accent-glow);
}

.hero-title {
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 1.5rem;
}

.hero-line {
  display: block;
  color: var(--text-strong);
}

[data-theme] .hero .hero-line {
  color: #fff;
}

.hero-line.accent {
  font-size: clamp(1.6rem, 4.5vw, 3.2rem);
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 2.5rem;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 4rem;
}

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-strong);
  font-family: inherit;
}

.stat-unit {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--accent);
}

.stat-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  letter-spacing: 0.05em;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
}

.hero-scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
}

[data-theme] .hero-scroll {
  color: rgba(255,255,255,0.5);
}

.scroll-indicator {
  width: 20px;
  height: 32px;
  border: 2px solid var(--text-muted);
  border-radius: 10px;
  position: relative;
}

[data-theme] .scroll-indicator {
  border-color: rgba(255,255,255,0.3);
}

.scroll-dot {
  width: 4px;
  height: 8px;
  background: var(--accent);
  border-radius: 2px;
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  animation: scrollDot 2s infinite;
}

@keyframes scrollDot {
  0%, 100% { top: 4px; opacity: 1; }
  50% { top: 16px; opacity: 0.3; }
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.3s;
  font-family: inherit;
}

.btn-primary {
  background: var(--gradient-accent);
  color: #fff;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(var(--accent), 0.3);
  filter: brightness(1.1);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-outline:hover {
  background: var(--accent-glow);
  transform: translateY(-2px);
}

.btn-full {
  width: 100%;
  justify-content: center;
}

.btn-detail {
  margin-top: 1.25rem;
  padding: 0.6rem 1.5rem;
  font-size: 0.85rem;
  border-radius: 100px;
  width: 100%;
  justify-content: center;
}

/* --- Section Common --- */
.section {
  padding: 6rem 0;
  position: relative;
}

.section:nth-child(even) {
  background: var(--bg-alt);
}

[data-theme] .section:nth-child(even) {
  background: var(--bg-alt);
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.2em;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  color: var(--text-strong);
  margin-bottom: 1rem;
}

.section-title.left-align {
  text-align: left;
}

.section-line {
  width: 60px;
  height: 3px;
  background: var(--gradient-accent);
  margin: 0 auto;
  border-radius: 2px;
}

.section-line.left-align {
  margin: 0;
}

.section-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 800px;
  margin: 1.5rem auto 0;
}

/* --- About Section --- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.about-lead {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text-strong);
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

.about-text p {
  margin-bottom: 1rem;
  color: var(--text);
}

.about-certs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.cert-badge {
  padding: 0.35rem 1rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-glow);
}

.about-card-stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.about-card {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  transition: all 0.3s;
}

.about-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateX(8px);
  box-shadow: var(--shadow-hover);
}

.card-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
}

.about-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 0.5rem;
}

.about-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* --- Subsection Title --- */
.subsection-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-strong);
  text-align: center;
  margin-bottom: 2.5rem;
  position: relative;
  padding-bottom: 0.75rem;
}

.subsection-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 2px;
  background: var(--gradient-accent);
  border-radius: 1px;
}

/* --- Cert Gallery --- */
.cert-section {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid var(--border);
}

.cert-gallery {
  overflow: hidden;
  max-width: 900px;
  margin: 0 auto;
}

.cert-gallery-track {
  display: flex;
  gap: 2.5rem;
  animation: certScroll 25s linear infinite;
  width: max-content;
}

.cert-gallery:hover .cert-gallery-track {
  animation-play-state: paused;
}

@keyframes certScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.cert-card {
  flex: 0 0 auto;
  cursor: pointer;
  text-align: center;
  transition: transform 0.3s;
}

.cert-card:hover {
  transform: translateY(-4px);
}

.cert-card img {
  height: 260px;
  width: auto;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.cert-card span {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  font-weight: 500;
}

.cert-lightbox {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.cert-lightbox.active {
  display: flex;
}

.cert-lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.cert-lightbox-content img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.cert-lightbox-close {
  position: absolute;
  top: -16px; right: -16px;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

@media (max-width: 768px) {
  .cert-gallery { max-width: 100%; }
  .cert-card img { height: 180px; }
}

/* --- Timeline --- */
.timeline-section {
  margin-top: 5rem;
  padding-top: 3rem;
  border-top: 1px solid var(--border);
}

.timeline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.timeline-phase {
  position: relative;
}

.phase-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  background: var(--gradient-accent);
  padding: 0.3rem 0.85rem;
  border-radius: 100px;
  margin-bottom: 1.25rem;
  letter-spacing: 0.05em;
}

.timeline-items {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-left: 1rem;
  border-left: 2px solid var(--border);
}

.timeline-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  position: relative;
  padding-left: 1rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.35rem;
  top: 0.45rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.tl-year {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  font-family: inherit;
}

.tl-event {
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.5;
}

/* --- R&D Section --- */
.rnd-section {
  margin-top: 5rem;
  padding-top: 3rem;
  border-top: 1px solid var(--border);
}

.rnd-intro {
  text-align: center;
  font-size: 1rem;
  color: var(--text);
  max-width: 700px;
  margin: -1rem auto 2.5rem;
  line-height: 1.8;
}

.rnd-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.rnd-card {
  padding: 1.75rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  transition: all 0.3s;
}

.rnd-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.rnd-num {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--accent);
  opacity: 0.2;
  font-family: inherit;
  line-height: 1;
  margin-bottom: 0.75rem;
}

.rnd-card h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 0.4rem;
}

.rnd-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* --- Advantage Grid --- */
.advantage-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: 1rem;
}

.advantage-item {
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--accent-glow);
  transition: all 0.3s;
}

.advantage-item:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.advantage-item h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.advantage-item p {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.6;
}

/* --- Products Section --- */
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.products-grid-2 {
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-bottom: 3.5rem;
}

.products-grid-4 {
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.products-grid-5 {
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5rem;
}

.product-series-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-strong);
  margin-bottom: 1.5rem;
  padding-left: 1rem;
  border-left: 3px solid var(--accent);
}

.product-card-compact {
  padding: 0;
  display: flex;
  flex-direction: column;
}

.product-card-compact .product-img-wrap {
  border-radius: 16px 16px 0 0;
}

.product-card-compact .product-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-series-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.product-card-compact .product-title {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.product-brief {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 0.75rem;
  flex: 1;
}

.product-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.product-tag {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: var(--accent-glow);
  color: var(--accent);
  font-weight: 500;
  border: 1px solid var(--border);
}

.product-card {
  padding: 2rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  transition: all 0.4s;
  position: relative;
  overflow: hidden;
}

.product-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-accent);
  opacity: 0;
  transition: opacity 0.3s;
}

.product-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}

.product-card:hover::before {
  opacity: 1;
}

.product-img-wrap {
  margin: -0.5rem -0.5rem 1.5rem;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-alt);
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.4s;
}

.product-card:hover .product-img {
  transform: scale(1.03);
}

/* Clean frame for product images with transparent PNGs */
[data-theme] .product-img-wrap {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: inset 0 0 20px rgba(0,0,0,0.03);
}

.product-number {
  font-size: 3rem;
  font-weight: 900;
  color: var(--accent);
  opacity: 0.1;
  font-family: inherit;
  line-height: 1;
  margin-bottom: 1rem;
}

.product-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 1.5rem;
}

.product-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-strong);
  margin-bottom: 0.75rem;
}

.product-desc {
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.product-specs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.spec-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}

.spec-item:last-child {
  border-bottom: none;
}

.spec-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.spec-value {
  font-size: 0.85rem;
  color: var(--text-strong);
  font-weight: 500;
  text-align: right;
}

.product-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.product-features li {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid var(--border);
}

/* --- Tech Section --- */
.tech-showcase {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.tech-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}

.material-pyramid-img {
  width: 100%;
  max-width: 500px;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

/* 3D Printer CSS Illustration */
.printer-3d {
  perspective: 800px;
}

.printer-frame {
  width: 240px;
  transform: rotateY(-12deg) rotateX(5deg);
  transform-style: preserve-3d;
}

.printer-top {
  height: 12px;
  background: var(--accent);
  border-radius: 6px 6px 0 0;
  opacity: 0.7;
}

.printer-body {
  height: 200px;
  border: 2px solid var(--border-hover);
  border-top: none;
  border-radius: 0 0 4px 4px;
  position: relative;
  background: var(--bg-card);
  overflow: hidden;
}

.printer-head {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: printHead 4s ease-in-out infinite;
}

@keyframes printHead {
  0%, 100% { left: 30%; }
  50% { left: 70%; }
}

.nozzle {
  width: 16px;
  height: 16px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 20px var(--accent-glow), 0 0 40px var(--accent-glow);
}

.filament {
  width: 2px;
  height: 30px;
  background: linear-gradient(to bottom, var(--accent), transparent);
}

.print-bed {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  height: 4px;
  background: var(--accent);
  opacity: 0.3;
  border-radius: 2px;
}

.print-object {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column-reverse;
}

.layer {
  width: calc(60px - var(--i) * 4px);
  height: 6px;
  background: var(--accent);
  opacity: calc(0.9 - var(--i) * 0.08);
  margin: 0 auto;
  border-radius: 1px;
  animation: layerBuild 4s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.15s);
}

@keyframes layerBuild {
  0%, 30% { transform: scaleX(0); }
  50%, 100% { transform: scaleX(1); }
}

.printer-base {
  height: 16px;
  background: var(--accent);
  opacity: 0.4;
  border-radius: 0 0 8px 8px;
}

.tech-features {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.tech-feature {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: all 0.3s;
}

.tech-feature:hover {
  border-color: var(--border);
  background: var(--bg-card);
}

.feature-num {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  opacity: 0.4;
  font-family: inherit;
  min-width: 40px;
}

.feature-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 0.5rem;
}

.feature-content p {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.7;
}

/* --- Cases Section --- */
.cases-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.cases-grid-auto {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.case-card {
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-card);
  text-align: center;
  transition: all 0.3s;
  backdrop-filter: blur(8px);
}

.case-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.case-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1.25rem;
}

.case-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 0.75rem;
}

.case-card p {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.7;
}

/* --- Services Section --- */
.service-highlights {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  flex-wrap: nowrap;
  margin-bottom: 3.5rem;
}

.service-highlight-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--accent-glow);
  white-space: nowrap;
}

.service-highlight-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.service-highlight-item span {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
}

.service-flow {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
}

.service-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 140px;
  position: relative;
}

.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient-accent);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  font-family: inherit;
}

.step-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 0.75rem;
}

.service-step h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 0.35rem;
}

.service-step p {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.step-connector {
  display: flex;
  align-items: center;
  padding-top: 14px;
  width: 40px;
  justify-content: center;
}

.step-connector span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--border-hover);
  position: relative;
}

.step-connector span::after {
  content: '';
  position: absolute;
  right: -2px;
  top: -3px;
  border: 4px solid transparent;
  border-left-color: var(--accent);
  opacity: 0.5;
}

/* 4-column cases grid */
.cases-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* --- Network Map Section --- */
.network-map {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3rem;
  align-items: center;
}

.map-container {
  position: relative;
  width: 100%;
  max-width: 600px;
}

.china-map-bg {
  width: 100%;
  height: auto;
  opacity: 0.18;
  filter: brightness(0.8);
}

[data-theme] .china-map-bg {
  opacity: 0.12;
  filter: brightness(0.4);
}

.china-map-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.china-map-overlay text {
  font-family: inherit;
}

.city-dot {
  transition: all 0.3s;
}

.city-dot:hover {
  filter: brightness(1.3);
}

.city-dot-hq {
  animation: hqPulse 2s ease-in-out infinite;
}

@keyframes hqPulse {
  0%, 100% { r: 14; }
  50% { r: 17; }
}

.city-ring {
  animation: ringPulse 3s ease-in-out infinite;
}

@keyframes ringPulse {
  0%, 100% { r: 22; opacity: 0.4; }
  50% { r: 28; opacity: 0.15; }
}

.network-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.network-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  font-size: 0.9rem;
  color: var(--text);
  transition: all 0.3s;
}

.network-item:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateX(4px);
}

.network-item strong {
  color: var(--text-strong);
  font-weight: 600;
}

.network-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  opacity: 0.6;
}

.network-dot.hq {
  opacity: 1;
  box-shadow: 0 0 8px var(--accent-glow);
  width: 12px;
  height: 12px;
}

/* --- News Section --- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.news-card {
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  transition: all 0.3s;
}

.news-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.news-date {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  padding: 0.2rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--accent-glow);
  margin-bottom: 1rem;
  font-family: inherit;
  letter-spacing: 0.05em;
}

.news-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.news-card p {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Form Tabs (Contact + Support) --- */
.form-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
}

.form-tab {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: color 0.3s;
  font-family: inherit;
}

.form-tab::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.3s;
}

.form-tab.active {
  color: var(--accent);
}

.form-tab.active::after {
  transform: scaleX(1);
}

.form-tab:hover {
  color: var(--text-strong);
}

.form-tab-content {
  display: none;
}

.form-tab-content.active {
  display: block;
}

/* --- Contact Section --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 4rem;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding-top: 1rem;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.contact-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--accent-glow);
  flex-shrink: 0;
  padding: 10px;
}

.contact-item h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 0.25rem;
}

.contact-item p {
  font-size: 0.9rem;
  color: var(--text);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-group {
  position: relative;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text-strong);
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.3s;
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group label {
  position: absolute;
  top: -8px;
  left: 12px;
  font-size: 0.7rem;
  color: var(--accent);
  background: var(--bg);
  padding: 0 4px;
  opacity: 0;
  transition: opacity 0.3s;
}

.form-group input:focus ~ label,
.form-group select:focus ~ label,
.form-group textarea:focus ~ label {
  opacity: 1;
}

[data-theme] .form-group label {
  background: var(--bg-alt);
}

.form-group select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

/* --- Footer --- */
.footer {
  background: var(--footer-bg);
  padding: 4rem 0 2rem;
  border-top: 1px solid var(--border);
}

[data-theme] .footer {
  color: #c8d6e5;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.footer-logo span {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-strong);
}

[data-theme] .footer-logo span {
  color: #e8f0fe;
}

.footer-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

[data-theme] .footer-desc {
  color: #7f8fa6;
}

.footer-links h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 1rem;
}

[data-theme] .footer-links h4 {
  color: #e8f0fe;
}

.footer-links a,
.footer-links span {
  display: block;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  transition: color 0.3s;
}

[data-theme] .footer-links a,
[data-theme] .footer-links span {
  color: #7f8fa6;
}

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

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

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

[data-theme] .footer-bottom p {
  color: #7f8fa6;
}

.footer-certs {
  display: flex;
  gap: 1rem;
}

.footer-certs span {
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
}

[data-theme] .footer-certs span {
  color: #7f8fa6;
}

/* --- Reveal Animation --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* --- Responsive --- */
@media (max-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .products-grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .products-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .products-grid-5 {
    grid-template-columns: repeat(2, 1fr);
  }

  .tech-showcase {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .tech-visual {
    order: -1;
    min-height: auto;
  }

  .timeline {
    grid-template-columns: repeat(2, 1fr);
  }

  .rnd-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .advantage-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cases-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .network-map {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .news-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .service-step {
    width: 120px;
  }

  .step-connector {
    width: 24px;
  }
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--bg);
    flex-direction: column;
    padding: 5rem 2rem 2rem;
    gap: 1.5rem;
    transition: right 0.4s;
    border-left: 1px solid var(--border);
    z-index: 99;
  }

  .nav-links.active {
    right: 0;
  }

  .nav-hamburger {
    display: flex;
    z-index: 100;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

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

  .products-grid-2 {
    grid-template-columns: 1fr;
  }

  .products-grid-4 {
    grid-template-columns: 1fr;
  }

  .products-grid-5 {
    grid-template-columns: 1fr;
  }

  .timeline {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

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

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

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

  .cases-grid-auto {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .cases-grid-4 {
    grid-template-columns: 1fr;
  }

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

  .service-flow {
    flex-direction: column;
    align-items: center;
  }

  .step-connector {
    transform: rotate(90deg);
    width: 40px;
    padding-top: 0;
    margin: 0.5rem 0;
  }

  .service-step {
    width: 200px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .hero-stats {
    gap: 1rem;
  }

  .stat-divider {
    display: none;
  }

  .stat-item {
    min-width: 80px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .theme-switcher {
    right: 1rem;
  }

  .network-map {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  .section {
    padding: 4rem 0;
  }

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

  .hero-title {
    font-size: 2rem;
  }

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

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

  .cases-grid-auto {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   AI Chatbot Widget
   ============================================ */

.chatbot {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
}

/* --- Floating Action Button --- */
.chatbot-fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--gradient-accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25), 0 0 40px var(--accent-glow);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  z-index: 2;
}

.chatbot-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(0,0,0,0.3), 0 0 60px var(--accent-glow);
}

.chatbot-fab:active {
  transform: scale(0.95);
}

.fab-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  position: absolute;
}

.fab-icon.chat-icon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.fab-icon.close-icon {
  opacity: 0;
  transform: scale(0.5) rotate(-90deg);
}

.chatbot.open .fab-icon.chat-icon {
  opacity: 0;
  transform: scale(0.5) rotate(90deg);
}

.chatbot.open .fab-icon.close-icon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

/* Pulse ring */
.fab-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0;
  animation: fabPulse 3s ease-out infinite;
}

.chatbot.open .fab-pulse {
  animation: none;
  opacity: 0;
}

@keyframes fabPulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* AI Badge */
.fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 0.55rem;
  font-weight: 800;
  background: var(--accent);
  color: #fff;
  padding: 2px 5px;
  border-radius: 6px;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  font-family: inherit;
}

.chatbot.open .fab-badge {
  opacity: 0;
  transform: scale(0);
  transition: all 0.2s;
}

/* --- Chat Window --- */
.chatbot-window {
  position: absolute;
  bottom: 72px;
  right: 0;
  width: 400px;
  height: 580px;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-hover);
  background: var(--bg);
  box-shadow: 0 12px 48px rgba(0,0,0,0.3), 0 0 1px rgba(0,0,0,0.1);

  /* Hidden by default */
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: bottom right;
}

.chatbot.open .chatbot-window {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Light theme adjustments */
[data-theme] .chatbot-window {
  box-shadow: 0 12px 48px rgba(0,0,0,0.12), 0 0 1px rgba(0,0,0,0.08);
}

/* --- Chat Header --- */
.chatbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.chatbot-header-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chatbot-avatar {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.chatbot-header-text {
  display: flex;
  flex-direction: column;
}

.chatbot-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-strong);
  line-height: 1.3;
}

.chatbot-status {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #27ae60;
  animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.chatbot-header-actions {
  display: flex;
  gap: 0.25rem;
}

.chatbot-header-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.chatbot-header-btn:hover {
  background: var(--accent-glow);
  color: var(--accent);
}

/* --- Chat Body (iframe area) --- */
.chatbot-body {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

.chatbot-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.chatbot-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: var(--bg);
  z-index: 2;
  transition: opacity 0.4s;
}

.chatbot-loading.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

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

/* --- Chat Footer --- */
.chatbot-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.chatbot-powered {
  font-size: 0.65rem;
  color: var(--text-muted);
  opacity: 0.5;
}

/* --- Chatbot Responsive --- */
@media (max-width: 480px) {
  .chatbot {
    bottom: 1rem;
    right: 1rem;
  }

  .chatbot-window {
    width: calc(100vw - 2rem);
    height: calc(100vh - 8rem);
    right: -0.5rem;
    bottom: 64px;
    border-radius: 12px;
  }

  .chatbot-fab {
    width: 50px;
    height: 50px;
  }
}

@media (max-width: 768px) {
  .chatbot-window {
    width: 360px;
    height: 520px;
  }
}
