:root {
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --fg: #1f2937;
  --fg-muted: #475569;
  --fg-dim: #94a3b8;
  --line: #e2e8f0;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --accent: #0ea5e9;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 1px rgba(15, 23, 42, 0.02);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.06);
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); text-decoration: underline; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
}

/* ============ Topbar ============ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(160%) blur(8px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  font-weight: 600;
  font-size: 18px;
}
.brand:hover { text-decoration: none; color: var(--primary); }
.brand-mark {
  color: var(--primary);
  font-size: 20px;
}

.topnav {
  display: flex;
  gap: 24px;
  align-items: center;
  font-size: 14px;
  flex-wrap: nowrap;
  overflow: visible;
}
.topnav a { color: var(--fg-muted); }
.topnav a:hover { color: var(--fg); text-decoration: none; }

.topbar { overflow: visible; }

.nav-dropdown {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}
.nav-dropdown__toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  margin: -6px -10px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--fg-muted);
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
  white-space: nowrap;
}
.nav-dropdown__toggle:hover,
.nav-dropdown.is-open .nav-dropdown__toggle {
  color: var(--fg);
  background: #f1f5f9;
}
.nav-dropdown__caret {
  font-size: 11px;
  opacity: 0.75;
  transition: transform 0.2s ease;
}
.nav-dropdown.is-open .nav-dropdown__caret {
  transform: rotate(180deg);
}

/* 默认隐藏；展开时为纵向浮层列表 */
.nav-dropdown__menu {
  display: none !important;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 200;
  min-width: 168px;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: #2b2f36;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.22);
  flex-direction: column;
}
.nav-dropdown.is-open .nav-dropdown__menu {
  display: flex !important;
}
.nav-dropdown__menu li {
  display: block;
  margin: 0;
  padding: 0;
}
.nav-dropdown__menu a {
  display: block;
  width: 100%;
  padding: 11px 20px;
  color: #e8eaed;
  font-size: 14px;
  line-height: 1.4;
  white-space: nowrap;
  text-decoration: none;
  box-sizing: border-box;
}
.nav-dropdown__menu a:hover {
  background: #3d434d;
  color: #fff;
  text-decoration: none;
}
.nav-dropdown__menu a.is-active {
  color: #fff;
  font-weight: 600;
  background: #2563eb;
}
.topnav-cta {
  background: var(--primary) !important;
  color: #fff !important;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 500;
}
.topnav-cta:hover { background: var(--primary-hover) !important; }

/* ============ Hero ============ */
.hero {
  position: relative;
  min-height: 620px;
  padding: 124px max(24px, calc((100vw - 1080px) / 2)) 112px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(2, 6, 23, 0.82) 42%, rgba(2, 6, 23, 0.34) 100%),
    radial-gradient(circle at 70% 38%, rgba(118, 185, 0, 0.28), transparent 32%),
    url('/assets/hero-circuit.jpg') center right / cover no-repeat;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(2, 6, 23, 0.2), rgba(2, 6, 23, 0.78)),
    radial-gradient(circle at 18% 25%, rgba(118, 185, 0, 0.16), transparent 28%);
}
.hero::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 120px;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, var(--bg));
}
.hero > * {
  position: relative;
  z-index: 1;
  max-width: 720px;
}
.eyebrow {
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 0 0 12px;
}
.hero .eyebrow {
  color: #9be22d;
  text-shadow: 0 0 24px rgba(118, 185, 0, 0.26);
}
.hero-title {
  font-size: clamp(38px, 5vw, 66px);
  line-height: 1.15;
  margin: 0 0 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #f8fafc;
  text-shadow: 0 18px 60px rgba(0, 0, 0, 0.58);
}
.hero-sub {
  max-width: 680px;
  margin: 0 0 36px;
  color: #dbeafe;
  font-size: 18px;
}
.hero-cta { display: inline-flex; gap: 12px; flex-wrap: wrap; justify-content: flex-start; }
.hero-meta {
  margin-top: 28px;
  color: rgba(226, 232, 240, 0.78);
  font-size: 13px;
}

.btn-primary {
  background: #76b900;
  color: #07110a;
  padding: 12px 28px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 16px;
  transition: background 0.15s ease, transform 0.15s ease;
  box-shadow: 0 10px 30px rgba(118, 185, 0, 0.24);
}
.btn-primary:hover {
  background: #8ee000;
  text-decoration: none;
  transform: translateY(-1px);
  color: #07110a;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  padding: 12px 28px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 16px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(8px);
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
  text-decoration: none;
}

/* ============ Shared Sections ============ */
.section-title {
  text-align: center;
  font-size: 28px;
  font-weight: 600;
  margin: 0 0 40px;
  letter-spacing: -0.01em;
}

.modules, .about, .contact, .page-section, .split-section {
  max-width: 1080px;
  margin: 0 auto;
  padding: 72px 24px;
}

/* ============ Module Cards ============ */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.module-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.module-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}
.module-ic {
  font-size: 28px;
  color: var(--primary);
  margin-bottom: 16px;
}
.module-card h3 {
  margin: 0 0 10px;
  font-size: 19px;
  font-weight: 600;
}
.module-card p {
  margin: 0 0 18px;
  color: var(--fg-muted);
  font-size: 15px;
}
.module-link {
  font-size: 14px;
  font-weight: 500;
}

/* ============ Marketing Page Components ============ */
.page-hero {
  max-width: 1080px;
  margin: 0 auto;
  padding: 72px 24px 44px;
}
.page-hero h1 {
  max-width: 760px;
  margin: 0 0 18px;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.page-hero p {
  max-width: 760px;
  margin: 0;
  color: var(--fg-muted);
  font-size: 17px;
}
.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 32px;
  align-items: start;
}
.split-copy h2 {
  margin: 0 0 14px;
  font-size: 30px;
  line-height: 1.25;
}
.split-copy p {
  color: var(--fg-muted);
  margin: 0;
}
.feature-list {
  display: grid;
  gap: 12px;
}
.feature-list a,
.feature-list .feature-row {
  display: block;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.feature-list a:hover {
  text-decoration: none;
  border-color: #bfdbfe;
  color: var(--primary-hover);
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}
.content-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.content-card h3 {
  margin: 0 0 10px;
  font-size: 18px;
}
.content-card p,
.content-card li {
  color: var(--fg-muted);
  font-size: 15px;
}
.content-card p { margin: 0 0 14px; }
.content-card ul { margin: 0; padding-left: 18px; }
.badge {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
}
.badge--muted {
  background: #f1f5f9;
  color: var(--fg-muted);
}

/* ============ Product Catalog ============ */
.section-title {
  margin: 0 0 10px;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.section-lead {
  margin: 0 0 28px;
  max-width: 720px;
  color: var(--fg-muted);
  font-size: 16px;
}
.page-section--alt {
  background: #fff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.product-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  max-width: 1080px;
  margin: -20px auto 0;
  padding: 0 24px 8px;
  position: sticky;
  top: 57px;
  z-index: 40;
}
.product-nav a {
  padding: 8px 16px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--fg-muted);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}
.product-nav a:hover {
  color: var(--primary);
  border-color: #bfdbfe;
  text-decoration: none;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.product-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.product-card--live {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
}
.product-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
}
.product-card__desc {
  margin: 0 0 14px;
  color: var(--fg-muted);
  font-size: 15px;
}
.spec-list {
  margin: 0;
  padding-left: 18px;
  color: var(--fg-muted);
  font-size: 14px;
  line-height: 1.65;
}
.spec-list li { margin-bottom: 4px; }
.product-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 14px;
}
.product-table th,
.product-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.product-table th {
  background: #f8fafc;
  color: var(--fg);
  font-weight: 600;
}
.product-table tr:last-child td { border-bottom: none; }
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.tag--ok {
  background: #ecfdf5;
  color: #047857;
}
.tag--warn {
  background: #fff7ed;
  color: #c2410c;
}
.hw-category-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  color: var(--fg);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
  display: inline-block;
}
.hw-category-desc {
  margin: 0 0 20px;
  max-width: 720px;
  color: var(--fg-muted);
  font-size: 15px;
  line-height: 1.6;
}
.hw-cat-section { display: none; scroll-margin-top: 72px; }
.hw-cat-section.is-active { display: block; }
.product-empty {
  text-align: center;
  padding: 56px 24px 80px;
  color: var(--fg-muted);
  font-size: 16px;
}
.product-empty[hidden] { display: none !important; }
.hw-category-title--spaced { margin-top: 36px; }
.hw-product-card__body--plain { padding: 24px; min-height: 100%; }
.notice-box--contact {
  margin-top: 28px;
  background: #f8fafc;
  border-color: var(--line);
  color: var(--fg-muted);
}

/* ============ Plans placeholder ============ */
.plans-empty {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 32px;
  text-align: center;
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.plans-empty__title {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 600;
  color: var(--fg);
}
.plans-empty__desc {
  margin: 0 0 20px;
  color: var(--fg-muted);
  font-size: 15px;
  line-height: 1.65;
}
.plans-empty__hint {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--fg-dim);
}
.plans-empty__list {
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  text-align: left;
  font-size: 14px;
  color: var(--fg-muted);
  line-height: 1.7;
}
.plans-empty__list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.plans-empty__list li:last-child { border-bottom: none; }
.plans-empty__cta {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff !important;
  font-weight: 500;
  text-decoration: none;
}
.plans-empty__cta:hover {
  background: var(--primary-hover);
  text-decoration: none;
}
.hw-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}
.hw-product-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.hw-product-thumb {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: #f8fafc;
  cursor: zoom-in;
  position: relative;
}
.hw-product-thumb img {
  width: 100%;
  height: 140px;
  object-fit: contain;
  display: block;
  background: #f8fafc;
}
.hw-product-thumb__hint {
  position: absolute;
  right: 10px;
  bottom: 8px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.65);
  color: #fff;
  font-size: 11px;
  pointer-events: none;
}
.hw-product-thumb:hover .hw-product-thumb__hint {
  background: rgba(37, 99, 235, 0.85);
}

.image-lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  overflow: visible;
}
.image-lightbox::backdrop {
  background: rgba(2, 6, 23, 0.9);
}
.image-lightbox__content {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100%;
  padding: 48px 24px 24px;
  box-sizing: border-box;
}
.image-lightbox__img {
  max-width: min(96vw, 1100px);
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  background: #fff;
}
.image-lightbox__close {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 1;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.image-lightbox__close:hover { background: rgba(255, 255, 255, 0.35); }
.hw-product-card__body { padding: 20px; }
.hw-product-card__body h3 { margin: 0 0 8px; font-size: 18px; }
.hw-product-card__body p {
  margin: 0 0 12px;
  color: var(--fg-muted);
  font-size: 14px;
}
.hw-product-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.hw-product-card__actions a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}
.hw-btn-manual {
  background: var(--primary);
  color: #fff !important;
}
.hw-btn-manual:hover { background: var(--primary-hover); text-decoration: none; }
.hw-btn-doc {
  background: #ecfdf5;
  color: #047857 !important;
  border: 1px solid #a7f3d0;
}
.hw-btn-doc:hover { background: #d1fae5; text-decoration: none; }
@media (max-width: 640px) {
  .product-table { display: block; overflow-x: auto; }
  .product-nav { top: 52px; }
}
.notice-box {
  padding: 18px 20px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--radius);
  color: #9a3412;
}
.login-panel {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px;
  border-radius: 18px;
  background: linear-gradient(145deg, #0f172a, #111827);
  color: #fff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}
.login-panel p { color: #cbd5e1; }
.login-panel .btn-primary {
  background: #60a5fa;
  color: #0f172a;
}
.login-panel .btn-ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.24);
}

/* ============ About ============ */
.about { background: #ffffff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px;
}
.about-item h4 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--fg);
}
.about-item p {
  margin: 0;
  color: var(--fg-muted);
  font-size: 15px;
}

/* ============ Contact ============ */
.contact { text-align: center; }
.contact-line { color: var(--fg-muted); margin: 8px 0; }

/* ============ Footer ============ */
.footer {
  text-align: center;
  padding: 32px 24px 40px;
  color: var(--fg-dim);
  font-size: 13px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.footer p { margin: 4px 0; }
.footer-sub { color: var(--fg-dim); opacity: 0.8; }

/* ============ Responsive ============ */
@media (max-width: 560px) {
  .topbar { padding: 12px 16px; }
  .topnav { gap: 14px; }
  .topnav a:not(.topnav-cta) { display: none; }
  .hero {
    min-height: 560px;
    padding: 72px 20px 76px;
    background:
      linear-gradient(180deg, rgba(2, 6, 23, 0.94) 0%, rgba(2, 6, 23, 0.86) 58%, rgba(2, 6, 23, 0.52) 100%),
      radial-gradient(circle at 62% 20%, rgba(118, 185, 0, 0.2), transparent 34%),
      url('/assets/hero-circuit.jpg') center top / cover no-repeat;
  }
  .hero-title { font-size: clamp(34px, 10vw, 46px); }
  .hero-sub { font-size: 16px; }
  .hero-cta { width: 100%; }
  .hero-cta .btn-primary,
  .hero-cta .btn-ghost {
    width: 100%;
    text-align: center;
  }
  .modules, .about, .contact, .page-section, .split-section { padding: 56px 20px; }
  .split-section { grid-template-columns: 1fr; }
}
