/* ========================================
   Nestory · 宣传站样式
   设计 token 完全对齐 docs/品牌设计理念.md
   ======================================== */

/* ---------- 设计 Token ---------- */
:root {
  /* 间距 */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 20px;
  --space-xxl: 28px;
  --space-xxxl: 40px;

  /* 圆角 */
  --radius-badge: 6px;
  --radius-button: 12px;
  --radius-card: 16px;
  --radius-sheet: 24px;

  /* 动效 */
  --motion-fast: 100ms;
  --motion-normal: 200ms;
  --motion-slow: 300ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);

  /* 字体 */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Helvetica Neue", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;

  /* 品牌固定色 */
  --accent: #D97B42;
  --storage: #8B7355;
  --fridge: #4A90E2;
  --success: #34C759;
  --warning: #FF9500;
  --error: #FF3B30;
}

/* ---------- 主题：清晨书房（light） ---------- */
:root,
[data-theme="light"] {
  --bg: #F2DDC1;
  --surface: #FBF5EB;
  --surface-low: #F0E4CC;
  --surface-mid: #E8D5B8;
  --surface-high: #DECAA5;
  --surface-highest: #D4BC94;
  --text: #251E14;
  --text-muted: #6B5E4E;
  --outline: #B8A080;
  --outline-soft: #D4BC94;
  --primary: #D97B42;
  --shadow-sm: 0 2px 8px rgba(37, 30, 20, 0.06);
  --shadow-md: 0 8px 24px rgba(37, 30, 20, 0.10);
  --shadow-lg: 0 24px 60px rgba(37, 30, 20, 0.16);
}

/* ---------- 主题：烛光书房（dark） ---------- */
[data-theme="dark"] {
  --bg: #141210;
  --surface: #1E1B17;
  --surface-low: #1A1713;
  --surface-mid: #24201A;
  --surface-high: #2C2820;
  --surface-highest: #36312A;
  --text: #EDE5D8;
  --text-muted: #A89880;
  --outline: #534A3E;
  --outline-soft: #302C26;
  --primary: #E8924E;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.30);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.40);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
}

/* 跟随系统 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141210;
    --surface: #1E1B17;
    --surface-low: #1A1713;
    --surface-mid: #24201A;
    --surface-high: #2C2820;
    --surface-highest: #36312A;
    --text: #EDE5D8;
    --text-muted: #A89880;
    --outline: #534A3E;
    --outline-soft: #302C26;
    --primary: #E8924E;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.30);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.40);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
  }
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--motion-slow) var(--ease),
              color var(--motion-slow) var(--ease);
}

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

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

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

/* ---------- 通用排版 ---------- */
.eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 var(--space-md);
}
.eyebrow--center { text-align: center; }

.section-title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-lg);
  text-align: center;
}

.section-sub {
  text-align: center;
  color: var(--text-muted);
  max-width: 580px;
  margin: 0 auto var(--space-xxxl);
}

/* ---------- 顶栏 ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-xl);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--outline-soft);
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.nav__brand:hover { opacity: 1; }

.nav__links {
  display: flex;
  gap: var(--space-xxl);
}
.nav__links a {
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}

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

.icon-btn,
.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  border-radius: var(--radius-button);
  color: var(--text);
  padding: 0 var(--space-md);
  border: 1px solid var(--outline-soft);
  background: var(--surface);
  transition: background var(--motion-fast) var(--ease),
              border-color var(--motion-fast) var(--ease);
}
.icon-btn { width: 36px; padding: 0; }
.icon-btn:hover,
.lang-btn:hover { border-color: var(--outline); background: var(--surface-mid); }

.lang-btn { font-size: 13px; font-weight: 600; }

[data-theme="light"] .icon-moon,
:root:not([data-theme="dark"]) .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: none; }
  :root:not([data-theme="light"]) .icon-moon { display: inline; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: var(--space-xxxl) 0 calc(var(--space-xxxl) * 2);
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 720px;
  background:
    radial-gradient(60% 50% at 80% 20%, rgba(217, 123, 66, 0.22), transparent 60%),
    radial-gradient(50% 40% at 10% 30%, rgba(139, 115, 85, 0.18), transparent 60%);
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-xxxl);
  align-items: center;
}

.hero__title {
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin: 0 0 var(--space-lg);
}

.hero__sub {
  font-size: 17px;
  color: var(--text-muted);
  margin: 0 0 var(--space-xxl);
  max-width: 540px;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.hero__hint {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  height: 52px;
  padding: 0 var(--space-xl);
  border-radius: var(--radius-button);
  font-weight: 600;
  font-size: 15px;
  transition: transform var(--motion-fast) var(--ease),
              box-shadow var(--motion-normal) var(--ease),
              opacity var(--motion-fast) var(--ease);
}
.btn:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}
.btn:not(:disabled):hover { transform: translateY(-2px); }

.btn--primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.btn--ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--outline-soft);
}

/* Hero 设备 Mockup */
.hero__visual {
  position: relative;
  display: flex;
  justify-content: center;
  min-height: 560px;
}

.phone {
  position: relative;
  width: 280px;
  border-radius: 38px;
  padding: 10px;
  background: linear-gradient(160deg, #2c2820, #0f0d0b);
  box-shadow:
    var(--shadow-lg),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.phone img {
  width: 100%;
  border-radius: 28px;
  display: block;
}
.phone__notch {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 26px;
  background: #0f0d0b;
  border-radius: 14px;
  z-index: 2;
}
.phone--tilt {
  transform: rotate(-3deg);
  z-index: 2;
}
.phone--back {
  position: absolute;
  top: 30px;
  right: 0;
  width: 220px;
  transform: rotate(7deg) translateX(20%);
  opacity: 0.92;
  z-index: 1;
}

/* ---------- Features ---------- */
.features {
  padding: var(--space-xxxl) 0;
}

.features__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
  margin-top: var(--space-xxxl);
}

.feature-card {
  position: relative;
  padding: var(--space-xxl);
  border-radius: var(--radius-card);
  background: var(--surface);
  border: 1px solid var(--outline-soft);
  overflow: hidden;
  transition: transform var(--motion-normal) var(--ease),
              box-shadow var(--motion-normal) var(--ease);
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.feature-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-button);
  background: color-mix(in srgb, var(--storage) 18%, transparent);
  color: var(--storage);
  margin-bottom: var(--space-lg);
}
.feature-card--fridge .feature-card__icon {
  background: color-mix(in srgb, var(--fridge) 18%, transparent);
  color: var(--fridge);
}
.feature-card--pro .feature-card__icon {
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  color: var(--primary);
}

.feature-card h3 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 var(--space-sm);
  letter-spacing: -0.01em;
}
.feature-card p {
  color: var(--text-muted);
  margin: 0 0 var(--space-xl);
  max-width: 460px;
}

.feature-card__shot {
  display: block;
  width: 60%;
  margin: 0 auto;
  border-radius: var(--radius-button);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--outline-soft);
}

.feature-card__badge {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-badge);
}

/* ---------- Gallery ---------- */
.gallery {
  padding: var(--space-xxxl) 0 calc(var(--space-xxxl) * 2);
}

.gallery__track {
  display: flex;
  gap: var(--space-xl);
  overflow-x: auto;
  padding: var(--space-xxl) max(var(--space-xl), calc((100vw - 1200px) / 2)) var(--space-xxl);
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.gallery__track::-webkit-scrollbar { display: none; }

.gallery__item {
  flex: 0 0 240px;
  margin: 0;
  scroll-snap-align: center;
  text-align: center;
  transition: transform var(--motion-normal) var(--ease);
}
.gallery__item:hover { transform: translateY(-6px); }

.gallery__item img {
  width: 100%;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--outline-soft);
  background: var(--surface);
}

.gallery__item figcaption {
  margin-top: var(--space-md);
  font-size: 14px;
  color: var(--text-muted);
}

/* ---------- Philosophy ---------- */
.philosophy {
  padding: var(--space-xxxl) 0 calc(var(--space-xxxl) * 1.5);
  background: var(--surface-low);
  border-top: 1px solid var(--outline-soft);
  border-bottom: 1px solid var(--outline-soft);
}

.philosophy__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xxxl);
  align-items: center;
}

.philosophy__copy p {
  color: var(--text-muted);
  margin: 0 0 var(--space-lg);
}
.philosophy .section-title { text-align: left; }

.philosophy__cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

.pcard {
  padding: var(--space-xl);
  background: var(--surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--outline-soft);
}
.pcard h4 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 var(--space-sm);
}
.pcard p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

/* ---------- Footer ---------- */
.footer {
  padding: var(--space-xxxl) 0 var(--space-xl);
  background: var(--bg);
}

.footer__inner {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: var(--space-xxl);
  padding-bottom: var(--space-xxl);
  border-bottom: 1px solid var(--outline-soft);
}

.footer__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 700;
  font-size: 18px;
  margin-bottom: var(--space-sm);
}
.footer__col--brand p {
  color: var(--text-muted);
  margin: 0;
  font-size: 14px;
}

.footer__col h5 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  margin: 0 0 var(--space-md);
}
.footer__col a,
.footer__col span {
  display: block;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}
.footer__col a { color: var(--text-muted); }
.footer__col a:hover { color: var(--primary); opacity: 1; }
.footer__muted { color: var(--text-muted) !important; }

.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-lg);
  font-size: 13px;
  color: var(--text-muted);
}
.footer__bottom p { margin: 0; }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .hero__inner { grid-template-columns: 1fr; gap: var(--space-xxl); }
  .hero__visual { min-height: 480px; margin-top: var(--space-xl); }
  .features__grid { grid-template-columns: 1fr; }
  .philosophy__inner { grid-template-columns: 1fr; }
  .footer__inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .container { padding: 0 var(--space-lg); }
  .nav { padding: var(--space-sm) var(--space-lg); }
  .nav__links { display: none; }
  .hero { padding: var(--space-xxl) 0; }
  .hero__title { font-size: 32px; }
  .hero__sub { font-size: 15px; }
  .btn { height: 48px; flex: 1 1 100%; justify-content: center; }
  .phone { width: 240px; }
  .phone--back { display: none; }
  .feature-card { padding: var(--space-xl); }
  .philosophy__cards { grid-template-columns: 1fr; }
  .footer__inner { grid-template-columns: 1fr; }
  .footer__bottom { flex-direction: column; gap: var(--space-sm); align-items: flex-start; }
  .gallery__item { flex-basis: 200px; }
}

/* ---------- 无障碍：减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .phone--tilt { transform: none; }
  .phone--back { transform: translateX(20%); }
}
