:root {
  --navy-900: #0b1120;
  --navy-800: #0f172a;
  --navy-700: #111b34;
  --blue-700: #1e40af;
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --blue-300: #93c5fd;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-400: #94a3b8;
  --slate-600: #475569;
  --white: #ffffff;
  --max-width: 1200px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --shadow-lg: 0 20px 60px rgba(15, 23, 42, 0.25);
  --shadow-md: 0 16px 40px rgba(15, 23, 42, 0.18);
  --font-sans: "HarmonyOS Sans", "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
}

body {
  font-family: var(--font-sans);
  color: var(--navy-900);
  background: var(--white);
  line-height: 1.6;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

body > main {
  flex: 1;
}

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

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

/* Skip to content */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--blue-600);
  color: var(--white);
  padding: 8px 16px;
  border-radius: 0 0 8px 8px;
  z-index: 100;
  font-size: 14px;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
}

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--blue-500);
  outline-offset: 2px;
}

.container {
  width: min(100% - 48px, var(--max-width));
  margin: 0 auto;
}

.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--slate-200);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--blue-600), var(--blue-700));
  display: grid;
  place-items: center;
  color: var(--white);
  font-size: 18px;
  font-weight: 800;
}

.brand-logo {
  height: 42px;
  width: auto;
  object-fit: contain;
}

.brand-text small {
  display: block;
  font-size: 12px;
  color: var(--slate-600);
  margin-top: 2px;
}

.footer-brand-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--slate-200);
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  color: var(--slate-600);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--slate-200);
  border-radius: 999px;
  padding: 8px 14px;
  background: var(--white);
}

.search-box input {
  border: none;
  outline: none;
  font-size: 14px;
  width: 180px;
}

.navbar {
  background: var(--navy-900);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  position: relative;
}

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

.nav-links a {
  display: inline-flex;
  align-items: center;
  padding: 18px 0;
  font-size: 15px;
  color: var(--slate-100);
  position: relative;
}

.nav-item {
  position: relative;
}

.nav-menu {
  position: absolute;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  min-width: 180px;
  background: #0b142a;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  padding: 10px;
  box-shadow: var(--shadow-md);
  display: none;
  z-index: 20;
  text-align: center;
}

.nav-menu a {
  display: block;
  padding: 10px 14px;
  color: var(--slate-100);
  border-radius: 8px;
  font-size: 14px;
}

.nav-menu a:hover {
  background: rgba(59, 130, 246, 0.2);
}

.nav-item:hover .nav-menu {
  display: block;
}

.nav-links a.active::after,
.nav-links a:hover::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 8px;
  width: 100%;
  height: 3px;
  background: var(--blue-500);
  border-radius: 999px;
}

/* Hamburger button */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--slate-100);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* nav cta removed */

.hero {
  background: var(--white);
  color: var(--navy-900);
  padding: 0 0 56px;
  position: relative;
  overflow: hidden;
}

.hero .container {
  width: 100%;
  max-width: none;
  padding: 0;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 36px;
  align-items: center;
  min-height: 420px;
}

.hero h1 {
  font-size: clamp(32px, 3.6vw, 48px);
  line-height: 1.15;
  margin-bottom: 18px;
}

.hero p {
  color: var(--slate-200);
  margin-bottom: 26px;
  max-width: 520px;
}

.hero-tags {
  display: inline-flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.hero-tags span {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(147, 197, 253, 0.4);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--slate-100);
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  padding: 12px 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.btn.primary {
  background: var(--blue-600);
  color: var(--white);
  box-shadow: var(--shadow-md);
}

.btn.ghost {
  background: transparent;
  color: var(--slate-100);
  border-color: rgba(148, 163, 184, 0.6);
}

.hero-carousel {
  position: relative;
  width: 100%;
  min-height: 460px;
  overflow: hidden;
  border-radius: 0;
  background: linear-gradient(180deg, #1a2b4e 0%, #152543 45%, #0f1f3a 100%);
  box-shadow: none;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
  padding: 48px 0;
}

.hero-slide.active {
  opacity: 1;
  position: relative;
}

.hero-inner {
  color: var(--white);
  text-shadow: 0 2px 14px rgba(7, 12, 24, 0.55);
  width: min(100% - 48px, var(--max-width));
  margin: 0 auto;
}

.hero-tags span {
  background: rgba(59, 130, 246, 0.22);
  border: 1px solid rgba(147, 197, 253, 0.45);
}

.hero-visual {
  background: transparent;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
}

.hero-visual img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 16px 40px rgba(4, 10, 24, 0.45));
}

.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, 0.5);
  color: var(--white);
  font-size: 28px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s ease;
}

.hero-arrow:hover {
  background: rgba(59, 130, 246, 0.5);
}

.hero-arrow.prev {
  left: 12px;
}

.hero-arrow.next {
  right: 12px;
}

.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.45);
  border-radius: 999px;
}

.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: none;
  background: rgba(226, 232, 240, 0.4);
  cursor: pointer;
  transition: all 0.2s ease;
}

.hero-dot.active {
  width: 20px;
  background: var(--slate-100);
}

.section {
  padding: 72px 0;
}

.section-title {
  font-size: clamp(24px, 2.4vw, 32px);
  margin-bottom: 16px;
}

.section-subtitle {
  color: var(--slate-600);
  max-width: 720px;
}

.section.center .section-title,
.section.center .section-subtitle {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

/* Image hover gallery */
.img-gallery {
  position: relative;
  overflow: hidden;
}

.img-gallery-track {
  display: flex;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.img-gallery-track img {
  flex: 0 0 100%;
  width: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.img-gallery-dots {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 5px;
  pointer-events: none;
}

.img-gallery-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transition: background 0.2s, transform 0.2s;
}

.img-gallery-dot.active {
  background: #fff;
  transform: scale(1.3);
}

/* Gallery inside card-media */
.card-media .img-gallery {
  width: 100%;
  height: 100%;
}

.card-media .img-gallery-track {
  height: 100%;
}

.card-media .img-gallery-track img {
  height: 100%;
}

/* Gallery inside list-item */
.list-item .img-gallery {
  height: 140px;
  border-radius: 12px;
  flex-shrink: 0;
}

.list-item .img-gallery-track {
  height: 100%;
}

.list-item .img-gallery-track img {
  height: 100%;
  border-radius: 0;
}

/* Product detail hero card */
.pd-hero-section {
  background: #eef2f7;
}

.pd-hero-card {
  display: grid;
  grid-template-columns: 210px 1fr 300px;
  max-height: 500px;
  background: var(--white);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.pd-hero-left {
  padding: 48px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--white);
}

#detail-image-wrap {
  overflow: hidden;
}

#detail-image-wrap .img-gallery {
  height: 100%;
  width: 100%;
}

#detail-image-wrap .img-gallery-track {
  height: 100%;
}

#detail-image-wrap .img-gallery-track img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  object-position: center;
}

#detail-image-wrap > img {
  height: 100%;
  width: 100%;
  object-fit: cover;
}

.pd-hero-right {
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--white);
}

.pd-hero-name {
  font-size: 52px;
  font-weight: 700;
  color: var(--blue-600);
  line-height: 1.1;
}

.pd-hero-type {
  font-size: 18px;
  font-weight: 600;
  color: var(--navy-900);
  letter-spacing: 0.12em;
  margin-top: 10px;
}

.pd-hero-divider {
  width: 40px;
  height: 3px;
  background: var(--blue-600);
  border-radius: 2px;
  margin: 24px 0;
}

.pd-hero-keywords {
  color: var(--slate-600);
  font-size: 14px;
  line-height: 2;
}

.pd-hero-specs {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.pd-hero-spec {
  display: flex;
  flex-direction: column;
}

.pd-hero-spec-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--navy-900);
  line-height: 1.2;
}

.pd-hero-spec-label {
  font-size: 12px;
  color: var(--slate-500);
  margin-top: 3px;
}

.pd-highlights {
  list-style: none;
  padding: 0;
  margin-top: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 32px;
}

.pd-highlights li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--navy-900);
  line-height: 1.6;
}

.pd-highlights li::before {
  content: "✓";
  color: var(--blue-600);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.card-media {
  width: 100%;
  height: 160px;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 16px;
  background: #0f172a;
  display: grid;
  place-items: center;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 32px;
}

.card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 24px;
}

.card.dark {
  background: linear-gradient(155deg, #1e3a8a 0%, #2563eb 100%);
  color: var(--white);
}

.card.dark p {
  color: rgba(241, 245, 249, 0.9);
}

.badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
  color: var(--blue-700);
  font-size: 12px;
  margin-bottom: 12px;
}

.list {
  display: grid;
  gap: 20px;
  margin-top: 32px;
}

.list-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 20px;
}

.list-item img {
  border-radius: 12px;
  height: 140px;
  width: 100%;
  object-fit: cover;
}

.list-item h3 {
  margin-bottom: 10px;
  font-size: 20px;
}

.meta {
  color: var(--slate-600);
  font-size: 13px;
  margin-bottom: 12px;
}

.detail-hero {
  background: var(--navy-900);
  color: var(--white);
  padding: 48px 0;
}

.detail-hero h1 {
  font-size: clamp(28px, 3vw, 40px);
  margin-bottom: 16px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  margin-top: 32px;
}

.detail-card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 24px;
}

.footer {
  background: #0b1120;
  color: var(--slate-200);
  padding: 48px 0;
  font-size: 13px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 140px;
  gap: 32px;
  margin-bottom: 24px;
}

.footer-qr {
  display: grid;
  place-items: center;
  gap: 8px;
}

.footer-qr img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  background: #0f172a;
  border-radius: 12px;
  padding: 10px;
}

.footer small {
  color: var(--slate-400);
}

.footer-nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
}

.footer-nav-links a {
  display: inline-block;
  padding: 5px 14px;
  border: 1px solid var(--slate-600);
  border-radius: 20px;
  color: var(--slate-200);
  text-decoration: none;
  font-size: 13px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.footer-nav-links a:hover {
  background: var(--blue-600);
  border-color: var(--blue-600);
  color: var(--white);
}

.footer-nav-sep {
  color: var(--slate-600);
  font-size: 14px;
  user-select: none;
  padding: 0 2px;
}

.footer-icp {
  margin-left: 16px;
}

.footer-icp a {
  color: var(--slate-400);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-icp a:hover {
  color: var(--slate-200);
}

/* Applicable fields grid (product detail) */
.field-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.field-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.field-item img {
  width: 100%;
  border-radius: 8px;
}

.field-item span {
  font-size: 12px;
  color: var(--slate-600);
  line-height: 1.4;
}

/* Measurement case blocks (product detail) */
.case-block {
  margin-top: 20px;
}

.case-caption {
  font-size: 13px;
  color: var(--slate-600);
  margin-bottom: 8px;
  font-style: italic;
}

.case-pair {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
}

.case-pair figure {
  margin: 0;
}

.case-pair figure img {
  width: 300px;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

.case-pair figcaption {
  text-align: center;
  font-size: 12px;
  color: var(--slate-400);
  margin-top: 4px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 16px;
}

.table th,
.table td {
  border-bottom: 1px solid var(--slate-200);
  padding: 12px 8px;
  text-align: left;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

input,
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--slate-200);
  font-family: var(--font-sans);
}

textarea {
  min-height: 120px;
}

.notice {
  background: #f8fafc;
  border-left: 4px solid var(--blue-600);
  padding: 16px 20px;
  border-radius: 12px;
  margin-top: 20px;
  color: var(--slate-600);
}

/* Loading placeholder */
.loading {
  display: grid;
  gap: 16px;
  padding: 24px 0;
}

.loading-item {
  height: 80px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, var(--slate-100) 25%, var(--slate-200) 50%, var(--slate-100) 75%);
  background-size: 200% 100%;
  animation: loading-pulse 1.5s ease-in-out infinite;
}

@keyframes loading-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Login overlay */
.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.login-box {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 40px;
  width: 360px;
  max-width: 90vw;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.login-box h2 {
  margin-bottom: 8px;
}

.login-box p {
  color: var(--slate-600);
  font-size: 14px;
  margin-bottom: 20px;
}

.login-box input {
  margin-bottom: 12px;
}

.login-error {
  color: #dc2626;
  font-size: 13px;
  min-height: 20px;
  margin-bottom: 8px;
}

@media (max-width: 960px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

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

  .list-item {
    grid-template-columns: 1fr;
  }

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

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

  .pd-hero-card {
    grid-template-columns: 1fr;
    max-height: none;
  }

  .pd-hero-left {
    padding: 24px;
  }

  .pd-hero-specs {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px 32px;
  }

  #detail-image-wrap {
    min-height: 240px;
  }

  .pd-hero-right {
    padding: 28px 24px;
  }

  .pd-hero-name {
    font-size: 36px;
  }

  .pd-hero-type {
    font-size: 16px;
  }

  .pd-highlights {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  /* Topbar: keep one row, hide search, shrink button */
  .topbar-inner {
    flex-direction: row;
    align-items: center;
    padding: 12px 0;
    gap: 10px;
  }

  .topbar-meta {
    gap: 10px;
    font-size: 12px;
    margin-left: auto;
  }

  .search-box {
    display: none;
  }

  .topbar-meta .btn.primary {
    padding: 6px 12px;
    font-size: 12px;
  }

  /* Hamburger button: visible background */
  .nav-toggle {
    display: flex;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 10px;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 0;
    padding: 8px 0;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 12px 0;
  }

  .nav-links a.active::after,
  .nav-links a:hover::after {
    bottom: 4px;
  }

  .navbar-inner {
    flex-wrap: wrap;
    justify-content: flex-start;
    min-height: 52px;
  }

  .nav-item:hover .nav-menu {
    display: none;
  }
}

@media (max-width: 640px) {
  .grid-3 {
    grid-template-columns: 1fr;
  }

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