/* ─── 原基科技 ─── 全局样式 ─── */
@import 'tokens.css';

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-text);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  letter-spacing: -0.01em;
}

/* Typography */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: var(--font-bold);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h1 { font-size: var(--text-6xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }

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

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

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container--narrow {
  max-width: var(--container-narrow);
}

/* Section */
.section {
  padding: var(--space-5xl) 0;
}

.section--alt {
  background: var(--color-bg-alt);
}

.section--dark {
  background: var(--color-bg-dark);
  color: var(--color-text-on-dark);
}

.section__title {
  font-size: var(--text-4xl);
  font-weight: var(--font-bold);
  text-align: center;
  margin-bottom: var(--space-xs);
  color: var(--color-text);
}

.section__subtitle {
  font-size: var(--text-xl);
  color: var(--color-text-secondary);
  text-align: center;
  margin-bottom: var(--space-3xl);
  font-weight: var(--font-normal);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-xl);
  border-radius: var(--radius-full);
  font-family: var(--font-text);
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  text-decoration: none;
  gap: var(--space-xs);
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
}
.btn--primary:hover {
  background: var(--color-primary-hover);
  color: #fff;
  transform: scale(1.02);
}

.btn--outline {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}
.btn--outline:hover {
  background: var(--color-primary);
  color: #fff;
}

.btn--ghost {
  background: transparent;
  color: var(--color-text);
}
.btn--ghost:hover {
  background: var(--color-bg-alt);
}

/* Card as link */
.product-card {
  text-decoration: none;
  color: inherit;
  display: block;
}

/* Card */
.card {
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-base);
  border: 1px solid var(--color-border-light);
}

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

.card__image {
  width: 100%;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
  padding: var(--space-lg);
}
.card__image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.card__body {
  padding: var(--space-lg);
}

.card__title {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  margin-bottom: var(--space-xs);
}

.card__text {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* Tags */
.tag {
  display: inline-block;
  padding: var(--space-2xs) var(--space-sm);
  background: var(--color-tag-bg);
  color: var(--color-tag-text);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
}

/* Grid */
.grid {
  display: grid;
  gap: var(--space-xl);
}

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

/* Hero */
.hero {
  padding: var(--space-5xl) 0;
  text-align: center;
  background: var(--color-bg);
}

.hero__title {
  font-size: var(--text-6xl);
  font-weight: var(--font-bold);
  letter-spacing: -0.03em;
  margin-bottom: var(--space-lg);
  line-height: 1.1;
}

.hero__subtitle {
  font-size: var(--text-xl);
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0 auto var(--space-2xl);
  font-weight: var(--font-normal);
}

/* Product spec table */
.spec-table {
  width: 100%;
  border-collapse: collapse;
}

.spec-table tr {
  border-bottom: 1px solid var(--color-border-light);
}

.spec-table td {
  padding: var(--space-sm) var(--space-md);
}

.spec-table td:first-child {
  width: 100px;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
}

/* Breadcrumb */
.breadcrumb {
  padding: var(--space-lg) 0;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.breadcrumb a {
  color: var(--color-text-secondary);
}

.breadcrumb span {
  margin: 0 var(--space-xs);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-3xl);
}

.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  transition: all var(--transition-fast);
}

.pagination a {
  color: var(--color-text);
  border: 1px solid var(--color-border-light);
}

.pagination a:hover, .pagination a.active {
  background: var(--color-bg-dark);
  color: #fff;
  border-color: var(--color-bg-dark);
}

/* Language switcher */
.lang-switch {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
}

/* Utility */
.text-center { text-align: center; }
.text-secondary { color: var(--color-text-secondary); }
.mt-1 { margin-top: var(--space-sm); }
.mt-2 { margin-top: var(--space-md); }
.mt-3 { margin-top: var(--space-lg); }
.mt-4 { margin-top: var(--space-xl); }
.mt-5 { margin-top: var(--space-3xl); }
.mb-1 { margin-bottom: var(--space-sm); }
.mb-2 { margin-bottom: var(--space-md); }
.mb-3 { margin-bottom: var(--space-lg); }

/* ─── Language Bar ─── */
.lang-bar {
  background: var(--color-text);
  color: #fff;
  font-size: var(--text-xs);
  height: 36px;
  display: flex;
  align-items: center;
}

.lang-bar__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lang-bar__phone {
  opacity: 0.8;
}

.lang-bar__switcher {
  display: flex;
  align-items: center;
  gap: 2px;
}

.lang-bar__link {
  color: #fff;
  text-decoration: none;
  opacity: 0.7;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: opacity 0.15s, background 0.15s;
  font-size: var(--text-xs);
}

.lang-bar__link:hover {
  opacity: 1;
  background: rgba(255,255,255,0.15);
}

.lang-bar__link--active {
  opacity: 1;
  background: rgba(255,255,255,0.2);
  cursor: default;
}

.lang-bar__sep {
  opacity: 0.4;
  user-select: none;
}

/* ─── Header / Navigation ─── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--color-border-light);
  height: var(--nav-height);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--container-max);
}

.nav__logo { text-decoration: none; flex-shrink: 0; }

.nav__logo-img {
  height: 84px;
  width: auto;
  display: block;
}

.nav__menu {
  display: flex;
  align-items: center;
  list-style: none;
  gap: var(--space-xs);
}

.nav__link {
  display: block;
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--color-text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.nav__link:hover,
.nav__link.active {
  color: var(--color-text);
  background: var(--color-bg-alt);
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.nav__lang {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: var(--space-2xs) var(--space-xs);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.nav__lang:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

/* Dropdown menus */
.nav__item--dropdown {
  position: relative;
}

.nav__dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--color-bg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all var(--transition-fast);
  min-width: 140px;
  padding: var(--space-xs);
  z-index: 200;
}

.nav__item--dropdown:hover .nav__dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav__dropdown-inner {
  display: flex;
  flex-direction: column;
}

.nav__dropdown-link {
  display: block;
  padding: var(--space-sm) var(--space-md);
  font-size: var(--text-sm);
  color: var(--color-text);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav__dropdown-link--extra {
  /* hidden on mobile, shown on desktop */
}

.nav__dropdown-link--all {
  display: none;
  color: var(--color-primary);
  font-weight: var(--font-semibold);
  border-top: 1px solid var(--color-border-light);
  margin-top: var(--space-xs);
  padding-top: var(--space-sm);
}

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px 6px;
  /* 44x38px tap target 符合移动端触摸标准 */
}

.nav__toggle span {
  display: block;
  width: 28px;
  height: 3px;
  background: var(--color-text);
  border-radius: 2px;
  transition: all var(--transition-fast);
}

/* ─── Footer ─── */
.footer {
  background: var(--color-bg-alt);
  padding: var(--space-4xl) 0 var(--space-xl);
  border-top: 1px solid var(--color-border-light);
}

.footer__grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-xl);
  margin-bottom: var(--space-3xl);
}

.footer__heading {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--color-text);
  margin-bottom: var(--space-md);
}

.footer__links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer__links a {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer__links a:hover { color: var(--color-primary); }

.footer__contact {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 2;
}

.footer__bottom {
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-border-light);
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
}

.footer__bottom a { color: var(--color-text-tertiary); }

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  :root {
    --text-6xl: 2.5rem;
    --text-4xl: 2rem;
    --text-2xl: 1.375rem;
  }
  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .section { padding: var(--space-3xl) 0; }
  .footer__grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1023px) {
  :root {
    --text-6xl: 2rem;
    --text-4xl: 1.5rem;
    --text-2xl: 1.25rem;
  }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .container { padding: 0 var(--space-md); }
  .hero { padding: var(--space-3xl) 0; }
  .hero__title { font-size: var(--text-4xl); }
  .section { padding: var(--space-2xl) 0; }
  .footer__grid { grid-template-columns: 1fr; text-align: center; }
  .footer__bottom { text-align: center; }
  .footer { padding: var(--space-2xl) 0 var(--space-lg); }
  .breadcrumb { padding: var(--space-md) 0; font-size: var(--text-xs); overflow-x: auto; white-space: nowrap; }

  /* Mobile nav — 点击汉堡从顶部下拉展开 */
  .header { height: 60px; }
  .nav__logo-img { height: 46px; }
  .nav__toggle { display: flex; }
  .nav__menu {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--color-bg);
    flex-direction: column;
    padding: 0 var(--space-lg);
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
    box-shadow: none;
    z-index: 99;
  }
  .nav__menu.open {
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    padding: var(--space-md) var(--space-lg);
    gap: var(--space-2xs);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  }
  .nav__link { font-size: var(--text-lg); padding: 16px; width: 100%; text-align: center; border-bottom: 1px solid var(--color-border-light); }
}

.hero-slider {
  position: relative;
  width: 100%;
  height: 420px;
  overflow: hidden;
  margin-bottom: var(--space-2xl);
  background: var(--color-bg-dark);
}

.hero-slider__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
  z-index: 1;
}

.hero-slider__slide.active {
  opacity: 1;
  z-index: 2;
}

.hero-slider__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-slider__overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: var(--space-lg);
  pointer-events: none;
}

.hero-slider__inner {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  pointer-events: auto;
}

.hero-slider__text {
  flex: 1;
  max-width: 600px;
}

.hero-slider__title {
  font-size: var(--text-5xl);
  font-weight: var(--font-bold);
  color: #fff;
  margin: 0 0 var(--space-sm);
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
  line-height: 1.15;
}

.hero-slider__subtitle {
  font-size: var(--text-lg);
  color: rgba(255,255,255,0.9);
  margin: 0;
  text-shadow: 0 1px 6px rgba(0,0,0,0.3);
  line-height: 1.5;
}

/* 按钮区域 — 右下角并排 */
.hero-slider__actions {
  display: flex;
  flex-direction: row;
  gap: var(--space-md);
}

.hero-slider__actions .btn {
  background: var(--color-primary);
  color: #fff;
  border: 1.5px solid var(--color-primary);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  padding: var(--space-sm) var(--space-xl);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.hero-slider__actions .btn:hover {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,0.7);
  transform: translateY(-2px);
}

.btn--lg {
  padding: 14px 32px;
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
}

/* 箭头 */
.hero-slider__arrow {
  position: absolute;
  top: 50%;
  z-index: 4;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  border: none;
  background: rgba(255,255,255,0.2);
  color: #fff;
  font-size: var(--text-xl);
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
}

.hero-slider:hover .hero-slider__arrow {
  opacity: 1;
}

.hero-slider__arrow:hover {
  background: rgba(255,255,255,0.4);
}

.hero-slider__arrow--prev { left: var(--space-lg); }
.hero-slider__arrow--next { right: var(--space-lg); }

/* 圆点指示器 */
.hero-slider__dots {
  position: absolute;
  bottom: var(--space-lg);
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  gap: var(--space-sm);
}

.hero-slider__dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  border: 2px solid rgba(255,255,255,0.6);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: all var(--transition-fast);
}

.hero-slider__dot.active {
  background: #fff;
  border-color: #fff;
  transform: scale(1.2);
}

.hero-slider__dot:hover {
  border-color: #fff;
}

@media (max-width: 1024px) {
  .hero-slider { height: 340px; }
  .hero-slider__title { font-size: var(--text-3xl); }
  .hero-slider__subtitle { font-size: var(--text-base); }
}

@media (max-width: 1023px) {
  .hero-slider { height: auto; min-height: 220px; }
  .hero-slider__img { object-fit: contain; background: #1a1a2e; }
  .hero-slider__overlay { padding: var(--space-sm); }
  .hero-slider__actions { gap: var(--space-sm); }
  .hero-slider__actions .btn { padding: var(--space-xs) var(--space-lg); font-size: var(--text-xs); }
  .hero-slider__arrow { width: 32px; height: 32px; font-size: var(--text-sm); opacity: 1; }
  .hero-slider__dots { bottom: var(--space-sm); }
}

/* ========== 子页面 Hero 横幅 ========== */
.page-hero {
  position: relative;
  width: 100%;
  max-height: 220px;
  overflow: hidden;
  margin-bottom: var(--space-2xl);
}

.page-hero__bg {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.page-hero__overlay {
  display: none;
}

.page-hero__title {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  color: #fff;
  margin: 0 0 var(--space-xs);
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.page-hero__subtitle {
  font-size: var(--text-base);
  color: rgba(255,255,255,0.9);
  margin: 0;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

@media (max-width: 1023px) {
  .page-hero { max-height: none; }  .page-hero__bg { height: auto; min-height: 180px; object-fit: contain; background: #1a1a2e; }
  .page-hero__title { font-size: var(--text-2xl); }
  .page-hero__subtitle { font-size: var(--text-sm); }
}
