/* ==========================================================================
   BYRONBIO 拜伦生物官网
   Design tokens extracted from DESIGN.md (Airbnb design language)
   ========================================================================== */

:root {
  /* Brand & accent — Rausch Red is the singular accent (CTA only) */
  --palette-bg-primary-core: #ff385c;
  --palette-bg-tertiary-core: #e00b41;

  /* Text scale */
  --palette-text-primary: #222222;
  --palette-text-focused: #3f3f3f;
  --palette-text-secondary: #6a6a6a;
  --palette-text-legal: #428bff;
  --palette-text-disabled: rgba(0, 0, 0, 0.24);

  /* Surfaces */
  --palette-bg-surface: #ffffff;
  --palette-surface-light: #f2f2f2;
  --palette-border: #c1c1c1;
  --palette-border-soft: #ebebeb;

  /* Elevation */
  --shadow-card: rgba(0, 0, 0, 0.02) 0px 0px 0px 1px,
                 rgba(0, 0, 0, 0.04) 0px 2px 6px,
                 rgba(0, 0, 0, 0.1) 0px 4px 8px;
  --shadow-hover: rgba(0, 0, 0, 0.08) 0px 4px 12px;

  /* Radius scale */
  --radius-btn: 8px;
  --radius-badge: 14px;
  --radius-card: 20px;
  --radius-large: 32px;
  --radius-circle: 50%;

  /* Type */
  --font-primary: "Airbnb Cereal VF", Circular, -apple-system, system-ui, Roboto,
    "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans SC", sans-serif;

  --header-h: 72px;
}

/* ---------- Base ---------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--palette-bg-surface);
  color: var(--palette-text-primary);
  font-family: var(--font-primary);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.43;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  margin: 0;
  color: var(--palette-text-primary);
  font-weight: 700;
}

p { margin: 0; }

ul, ol { margin: 0; padding: 0; list-style: none; }

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

.container {
  width: 100%;
  max-width: 1128px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border: 0;
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.25;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--palette-bg-surface), 0 0 0 4px var(--palette-text-primary);
}

.btn:active { transform: scale(0.96); }

.btn-dark {
  background: var(--palette-text-primary);
  color: #ffffff;
}
.btn-dark:hover { background: var(--palette-bg-primary-core); box-shadow: var(--shadow-hover); }

.text-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--palette-text-primary);
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: color 0.2s ease;
}
.text-link:hover { color: var(--palette-bg-primary-core); }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--palette-bg-surface);
  transition: box-shadow 0.25s ease;
}

.site-header.scrolled { box-shadow: var(--shadow-card); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 34px;
  height: 40px;
  object-fit: contain;
  border-radius: 6px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-text strong {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-text small {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.28em;
  color: var(--palette-text-secondary);
}

.main-nav {
  display: flex;
  gap: 4px;
}

.main-nav a {
  padding: 8px 14px;
  border-radius: var(--radius-btn);
  font-size: 15px;
  font-weight: 500;
  color: var(--palette-text-focused);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.main-nav a:hover {
  background: var(--palette-surface-light);
  color: var(--palette-text-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0 9px;
  border: 0;
  border-radius: var(--radius-btn);
  background: transparent;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--palette-text-primary);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

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

/* ---------- Hero ---------- */

.hero {
  padding: 88px 0 96px;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  padding: 8px 18px;
  border-radius: var(--radius-badge);
  background: var(--palette-surface-light);
  font-size: 13px;
  font-weight: 600;
  color: var(--palette-text-focused);
}

.hero h1 {
  margin: 28px auto 0;
  max-width: 16em;
  font-size: clamp(42px, 6.4vw, 68px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.022em;
}

.hero-sub {
  max-width: 34em;
  margin: 22px auto 0;
  font-size: 18px;
  line-height: 1.7;
  color: var(--palette-text-secondary);
}

.hero-visual {
  position: relative;
  max-width: 880px;
  margin: 64px auto 0;
}

.hero-visual img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center 34%;
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-card);
}

.float-chip {
  position: absolute;
  padding: 10px 18px;
  border-radius: var(--radius-badge);
  background: var(--palette-bg-surface);
  box-shadow: var(--shadow-card);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.float-chip strong { color: var(--palette-bg-primary-core); }

.chip-1 { top: 28px; left: -18px; }
.chip-2 { bottom: 28px; right: -18px; }

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 40px;
}

.hero-trust li {
  padding: 6px 16px;
  border: 1px solid var(--palette-border-soft);
  border-radius: var(--radius-badge);
  font-size: 12px;
  font-weight: 600;
  color: var(--palette-text-secondary);
}

/* ---------- Section scaffolding ---------- */

section { padding: 96px 0; }

.section-head {
  max-width: 640px;
  margin: 0 auto 56px;
  text-align: center;
}

.eyebrow {
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--palette-text-secondary);
}

.section-head h2,
.about-copy h2 {
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.018em;
}

.section-sub {
  margin-top: 16px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--palette-text-secondary);
}

/* ---------- Cards ---------- */

.card {
  background: var(--palette-bg-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

/* ---------- Products ---------- */

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

.product-card figure {
  margin: 0;
  background: var(--palette-surface-light);
}

.product-card figure img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.card-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 24px;
}

.tag {
  padding: 4px 12px;
  border-radius: var(--radius-badge);
  background: var(--palette-surface-light);
  font-size: 12px;
  font-weight: 600;
  color: var(--palette-text-focused);
}

.product-card h3 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.009em;
}

.product-card p,
.more-card p,
.news-card p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--palette-text-secondary);
}

.spec {
  font-size: 12px;
  font-weight: 600;
  color: var(--palette-text-secondary);
}

.more-card {
  display: flex;
  background: var(--palette-surface-light);
  box-shadow: none;
}

.more-card .card-body {
  justify-content: center;
  gap: 14px;
  padding: 32px;
}

.more-card h3 {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.011em;
}

.more-card:hover { transform: none; box-shadow: none; }

/* ---------- Science ---------- */

.science { background: var(--palette-surface-light); }

.sci-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.sci-row + .sci-row { margin-top: 88px; }

.sci-row.reverse .sci-copy { order: 2; }
.sci-row.reverse .sci-visual { order: 1; }

.sci-copy h3 {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.sci-copy p {
  margin-top: 16px;
  font-size: 16px;
  line-height: 1.8;
  color: var(--palette-text-secondary);
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.chip-list li {
  padding: 6px 16px;
  border-radius: var(--radius-badge);
  background: var(--palette-bg-surface);
  box-shadow: var(--shadow-card);
  font-size: 13px;
  font-weight: 600;
}

.panel {
  padding: 36px;
  border-radius: var(--radius-card);
  background: var(--palette-bg-surface);
  box-shadow: var(--shadow-card);
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 24px;
  counter-reset: step;
}

.steps li {
  display: flex;
  align-items: center;
  gap: 18px;
}

.step-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-circle);
  background: var(--palette-surface-light);
  font-size: 16px;
  font-weight: 700;
}

.steps strong {
  display: block;
  font-size: 16px;
  font-weight: 600;
}

.steps small {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  color: var(--palette-text-secondary);
}

.metrics {
  display: flex;
  flex-direction: column;
}

.metric {
  padding: 22px 0;
  border-bottom: 1px solid var(--palette-border-soft);
  text-align: center;
}

.metric:first-child { padding-top: 0; }
.metric:last-child { border-bottom: 0; padding-bottom: 0; }

.metric strong {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.metric strong span {
  font-size: 18px;
  font-weight: 600;
  color: var(--palette-text-secondary);
}

.metric small {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--palette-text-secondary);
}

.origin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.origin {
  padding: 20px;
  border-radius: var(--radius-badge);
  background: var(--palette-surface-light);
  text-align: center;
}

.origin strong {
  display: block;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.009em;
}

.origin small {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--palette-text-secondary);
}

.origin-note {
  margin-top: 20px;
  font-size: 13px;
  color: var(--palette-text-secondary);
  text-align: center;
}

/* ---------- Quality ---------- */

.quality-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.quality-card { padding: 28px; }

.quality-card .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-circle);
  background: var(--palette-surface-light);
  color: var(--palette-text-primary);
}

.quality-card .icon svg { width: 24px; height: 24px; }

.quality-card h3 {
  margin-top: 18px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.009em;
}

.quality-card p {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--palette-text-secondary);
}

/* ---------- Stats ---------- */

.stats {
  padding: 72px 0;
  background: var(--palette-text-primary);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  text-align: center;
}

.stats strong {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.stats small {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.64);
}

/* ---------- About ---------- */

.about-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: center;
}

.about-copy .eyebrow { text-align: left; }

.about-copy p:not(.eyebrow) {
  margin-top: 18px;
  font-size: 16px;
  line-height: 1.85;
  color: var(--palette-text-secondary);
}

.about-copy .text-link { margin-top: 24px; display: inline-block; }

.about-visual img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: center 36%;
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-card);
}

/* ---------- News ---------- */

.news { background: var(--palette-surface-light); }

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

.news-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 32px;
}

.news-card time {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--palette-text-secondary);
}

.news-card h3 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.009em;
}

.news-card .text-link { margin-top: auto; }

/* ---------- Utilities ---------- */

.nw { white-space: nowrap; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--palette-border-soft);
  padding: 72px 0 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.2fr;
  gap: 48px;
}

.footer-brand p {
  margin-top: 18px;
  font-size: 14px;
  color: var(--palette-text-secondary);
}

.footer-col h4 {
  font-size: 14px;
  font-weight: 700;
}

.footer-col a,
.footer-col p {
  display: block;
  margin-top: 12px;
  font-size: 14px;
  color: var(--palette-text-secondary);
  transition: color 0.2s ease;
}

.footer-col a:hover { color: var(--palette-text-primary); }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--palette-border-soft);
}

.footer-bottom p {
  font-size: 12px;
  color: var(--palette-text-secondary);
}

.footer-legal a {
  color: var(--palette-text-legal);
  margin-left: 16px;
}

.footer-legal a:first-child { margin-left: 0; }

.footer-legal a:hover { text-decoration: underline; }

/* ---------- Reveal on scroll ---------- */

/* 仅在 JS 可用时启用进场动画，避免无 JS 环境内容不可见 */
html.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease var(--d, 0s), transform 0.7s ease var(--d, 0s);
}

html.js .reveal.visible {
  opacity: 1;
  transform: none;
}

/* ---------- Responsive ---------- */

@media (max-width: 1128px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .quality-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 950px) {
  .main-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 0;
    padding: 12px 24px 20px;
    background: var(--palette-bg-surface);
    box-shadow: var(--shadow-card);
  }

  body.nav-open .main-nav { display: flex; }

  .main-nav a {
    padding: 14px 8px;
    border-radius: 0;
    font-size: 16px;
  }

  .nav-toggle { display: flex; }

  .sci-row,
  .about-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .sci-row.reverse .sci-copy { order: 1; }
  .sci-row.reverse .sci-visual { order: 2; }

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

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

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

  section { padding: 72px 0; }
}

@media (max-width: 640px) {
  .hero { padding: 56px 0 72px; }

  .float-chip { display: none; }

  .product-grid,
  .quality-grid { grid-template-columns: 1fr; }

  .stats-grid { gap: 24px; }

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

  .footer-bottom { flex-direction: column; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  html.js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .card,
  .btn { transition: none; }
}
