/* ═══════════════════════════════════════════
   拾序记账 · 产品展示页
   Aesthetic: Editorial luxury × wabi-sabi calm
═══════════════════════════════════════════ */

:root {
  /* Active theme — JS updates these */
  --accent: #f2b5c8;
  --bg: #16121a;
  --text: #f5efe8;

  /* Derived */
  --bg-deep: #0e0a12;
  --text-muted: rgba(245, 239, 232, 0.55);
  --text-ghost: rgba(245, 239, 232, 0.15);
  --accent-wash: rgba(242, 181, 200, 0.08);
  --accent-glow: rgba(242, 181, 200, 0.18);

  /* Typography */
  --serif: "Noto Serif SC", "Songti SC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;

  /* Spatial */
  --page-pad: clamp(20px, 5vw, 80px);
  --section-gap: clamp(72px, 10vh, 140px);
}

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

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 1.2s cubic-bezier(0.22, 1, 0.36, 1),
              color 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

a { color: inherit; text-decoration: none; }
button { font: inherit; border: none; background: none; cursor: pointer; color: inherit; }

::selection {
  background: var(--accent);
  color: var(--bg);
}

/* ── Ambient canvas ── */
#ambient {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.7;
  transition: opacity 1.2s;
}

/* ── Navigation ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px var(--page-pad);
  transition: background 0.4s, backdrop-filter 0.4s;
}

.nav.scrolled {
  background: rgba(22, 18, 26, 0.72);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
}

.nav-logo {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.02em;
  transition: color 1.2s;
}

.nav-cta {
  font-size: 13px;
  font-weight: 700;
  padding: 8px 20px;
  border-radius: 999px;
  border: 1px solid var(--text-ghost);
  transition: all 0.3s;
}

.nav-cta:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

/* ── Reveal animation ── */
[data-reveal] {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

[data-reveal].visible {
  opacity: 1;
  transform: translateY(0);
}

/* ══════════════════════════════════════════
   Hero
══════════════════════════════════════════ */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 80px var(--page-pad) 120px;
}

.hero-inner {
  max-width: 700px;
}

.hero-kicker {
  display: inline-block;
  font-size: clamp(12px, 1.5vw, 14px);
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 24px;
  transition: color 1.2s;
  opacity: 0;
  transform: translateY(24px);
  animation: heroReveal 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.1s forwards;
}

.hero-title {
  font-family: var(--serif);
  font-size: clamp(100px, 20vw, 220px);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.04em;
  margin-bottom: 24px;
  position: relative;
}

.hero-char {
  display: inline-block;
  animation: charReveal 1.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(0.2s + var(--i) * 0.15s);
  opacity: 0;
  transform: translateY(60px) rotateX(40deg);
  transform-origin: bottom center;
}

@keyframes charReveal {
  to {
    opacity: 1;
    transform: translateY(0) rotateX(0);
  }
}

.hero-sub {
  font-family: var(--serif);
  font-size: clamp(18px, 3vw, 28px);
  font-weight: 200;
  line-height: 1.5;
  color: var(--text-muted);
  margin-bottom: 40px;
  letter-spacing: 0.08em;
  transition: color 1.2s;
  opacity: 0;
  transform: translateY(24px);
  animation: heroReveal 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.7s forwards;
}

.hero-cta-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  opacity: 0;
  transform: translateY(24px);
  animation: heroReveal 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.9s forwards;
}

@keyframes heroReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 36px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--accent-glow);
}

.btn-primary:hover::after {
  transform: translateX(100%);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 36px;
  border-radius: 999px;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn-secondary:hover {
  background: var(--accent);
  color: var(--bg);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--accent-glow);
}

.cta-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.btn-large {
  min-height: 56px;
  padding: 0 48px;
  font-size: 17px;
}

.hero-note {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  transition: color 1.2s;
}

/* Scroll hint */
.hero-scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.14em;
  animation: hintFloat 2.4s ease-in-out infinite;
  transition: opacity 0.6s;
}

.hero-scroll-hint.hidden { opacity: 0; pointer-events: none; }

.scroll-dot {
  animation: scrollDot 2s ease-in-out infinite;
}

@keyframes hintFloat {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

@keyframes scrollDot {
  0% { cy: 8; opacity: 1; }
  50% { cy: 16; opacity: 0.4; }
  100% { cy: 8; opacity: 1; }
}

/* ══════════════════════════════════════════
   Shared section styles
══════════════════════════════════════════ */
section {
  position: relative;
  z-index: 1;
  padding: var(--section-gap) var(--page-pad);
}

.section-inner {
  max-width: 720px;
  margin: 0 auto;
}

.section-index {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 20px;
  font-variant-numeric: tabular-nums;
  transition: color 1.2s;
}

.section-headline {
  font-family: var(--serif);
  font-size: clamp(32px, 6vw, 56px);
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.section-body {
  font-size: clamp(15px, 2vw, 18px);
  line-height: 1.8;
  color: var(--text-muted);
  max-width: 520px;
  transition: color 1.2s;
}

/* ══════════════════════════════════════════
   Philosophy
══════════════════════════════════════════ */
.philosophy-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  max-width: 960px;
  margin: 64px auto 0;
  background: var(--text-ghost);
  border: 1px solid var(--text-ghost);
  transition: background 1.2s, border-color 1.2s;
}

.phil-card {
  padding: clamp(24px, 4vw, 48px);
  background: var(--bg);
  transition: background 1.2s;
}

.phil-card:hover {
  background: var(--accent-wash);
}

.phil-num {
  display: block;
  font-family: var(--serif);
  font-size: clamp(48px, 8vw, 72px);
  font-weight: 900;
  line-height: 1;
  color: var(--accent);
  margin-bottom: 8px;
  transition: color 1.2s;
}

.phil-num small {
  font-size: 0.4em;
  font-weight: 400;
  opacity: 0.6;
}

.phil-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
  color: var(--text);
  transition: color 1.2s;
}

.phil-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  transition: color 1.2s;
}

/* ══════════════════════════════════════════
   Themes
══════════════════════════════════════════ */
.theme-carousel {
  max-width: 720px;
  margin: 48px auto 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 0 var(--page-pad);
}
.theme-carousel::-webkit-scrollbar { display: none; }

.theme-track {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.theme-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 16px;
  transition: transform 0.3s, background 0.3s;
  min-width: 72px;
}

.theme-swatch:hover {
  transform: translateY(-4px);
  background: var(--accent-wash);
}

.theme-swatch.active .swatch-ring {
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent);
}

.swatch-ring {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: attr(data-color);
  transition: box-shadow 0.3s;
}

/* Color applied via JS */
.swatch-name {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  transition: color 0.4s;
}

.theme-swatch.active .swatch-name {
  color: var(--accent);
}

/* ── Theme preview phone ── */
.theme-preview {
  max-width: 360px;
  margin: 48px auto 0;
}

.preview-phone {
  position: relative;
  border-radius: 32px;
  border: 2px solid var(--text-muted);
  padding: 12px;
  background: var(--bg-deep);
  overflow: hidden;
  transition: border-color 1.2s, background 1.2s;
  box-shadow: 0 8px 48px rgba(0,0,0,0.3);
}

.preview-notch {
  width: 100px;
  height: 24px;
  background: var(--bg-deep);
  border-radius: 0 0 16px 16px;
  margin: 0 auto 8px;
  transition: background 1.2s;
}

.preview-screen {
  border-radius: 20px;
  padding: 20px;
  min-height: 420px;
  background: var(--bg);
  transition: background 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.preview-logo {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 900;
  transition: color 0.8s;
}

.preview-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  transition: background 0.8s;
}

.preview-hero-area {
  margin-bottom: 28px;
}

.preview-kicker {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 8px;
  transition: color 0.8s;
}

.preview-amount {
  display: block;
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  transition: color 0.8s;
}

.preview-insight {
  font-size: 13px;
  color: var(--text-muted);
  transition: color 0.8s;
}

.preview-categories {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.preview-cat-row {
  display: grid;
  grid-template-columns: 36px 1fr 60px;
  gap: 10px;
  align-items: center;
}

.preview-cat-name {
  font-size: 12px;
  font-weight: 600;
  transition: color 0.8s;
}

.preview-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--text-ghost);
  overflow: hidden;
  transition: background 0.8s;
}

.preview-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  transition: background 0.8s, width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.preview-cat-amount {
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
  transition: color 0.8s;
}

.preview-divider {
  height: 1px;
  background: var(--text-ghost);
  margin-bottom: 16px;
  transition: background 0.8s;
}

.preview-records {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.preview-record {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
  transition: color 0.8s;
}

.preview-rec-amount {
  font-family: var(--serif);
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  transition: color 0.8s;
}

.preview-caption {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  transition: color 0.8s;
}

/* ══════════════════════════════════════════
   Editorial features
══════════════════════════════════════════ */
.editorial-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  max-width: 840px;
  margin: 64px auto 0;
  background: var(--text-ghost);
  transition: background 1.2s;
}

.ed-feature {
  padding: clamp(28px, 4vw, 48px);
  background: var(--bg);
  transition: background 1.2s;
  position: relative;
}

.ed-feature:hover {
  background: var(--accent-wash);
}

.ed-index {
  display: block;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 200;
  color: var(--accent);
  margin-bottom: 16px;
  transition: color 1.2s;
}

.ed-feature h3 {
  font-family: var(--serif);
  font-size: clamp(18px, 2.5vw, 22px);
  font-weight: 900;
  margin-bottom: 12px;
}

.ed-feature p {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-muted);
  transition: color 1.2s;
}

/* ══════════════════════════════════════════
   Privacy
══════════════════════════════════════════ */
.privacy {
  text-align: center;
}

.privacy .section-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.privacy .section-headline {
  text-align: center;
}

.privacy .section-body {
  text-align: center;
  max-width: 480px;
}

.privacy-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  margin-top: 48px;
}

.lock-icon {
  width: 48px;
  color: var(--accent);
  transition: color 1.2s;
  animation: lockFloat 3s ease-in-out infinite;
}

.lock-icon svg {
  width: 100%;
  height: auto;
}

@keyframes lockFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.privacy-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.p-badge {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid var(--text-ghost);
  color: var(--text-muted);
  transition: all 0.4s;
}

.p-badge:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ══════════════════════════════════════════
   Final CTA
══════════════════════════════════════════ */
.final-cta {
  text-align: center;
  padding-bottom: 80px;
}

.cta-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.cta-headline {
  font-family: var(--serif);
  font-size: clamp(36px, 7vw, 64px);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.cta-sub {
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  transition: color 1.2s;
}

/* ══════════════════════════════════════════
   iPhone install guide modal
══════════════════════════════════════════ */
.ios-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.ios-modal[hidden] { display: none; }

.ios-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.ios-modal-panel {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--text-ghost);
  border-radius: 24px;
  padding: clamp(28px, 5vw, 40px);
  animation: iosModalIn 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes iosModalIn {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.ios-modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 28px;
  line-height: 1;
  color: var(--text-muted);
  transition: color 0.3s;
}

.ios-modal-close:hover { color: var(--text); }

.ios-modal-kicker {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 8px;
}

.ios-modal-panel h3 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--text-ghost);
}

.ios-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 24px;
}

.ios-steps li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.7;
}

.ios-step-num {
  flex-shrink: 0;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 200;
  color: var(--accent);
  line-height: 1.4;
}

.ios-steps strong {
  color: var(--text);
  font-weight: 700;
}

.ios-step-link {
  font-size: 13px;
  color: var(--accent);
  border-bottom: 1px solid var(--accent-glow);
  word-break: break-all;
}

.ios-modal-note {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-muted);
  padding-top: 16px;
  border-top: 1px solid var(--text-ghost);
}

/* ══════════════════════════════════════════
   Footer
══════════════════════════════════════════ */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 48px var(--page-pad) 40px;
  border-top: 1px solid var(--text-ghost);
  transition: border-color 1.2s;
}

.footer-logo {
  display: block;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 8px;
}

.footer p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
  transition: color 1.2s;
}

.footer-copy {
  margin-top: 16px;
  font-size: 11px;
  letter-spacing: 0.1em;
}

/* ══════════════════════════════════════════
   Responsive
══════════════════════════════════════════ */
@media (max-width: 768px) {
  .philosophy-grid {
    grid-template-columns: 1fr;
  }

  .editorial-features {
    grid-template-columns: 1fr;
  }

  .theme-track {
    justify-content: flex-start;
    flex-wrap: nowrap;
  }

  .theme-carousel {
    margin-left: calc(-1 * var(--page-pad));
    margin-right: calc(-1 * var(--page-pad));
    padding: 0 var(--page-pad);
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 28vw;
  }

  .preview-phone {
    border-radius: 24px;
  }
}

/* ── Print ── */
@media print {
  #ambient, .nav, .hero-scroll-hint, .theme-carousel, .btn-primary { display: none; }
  body { background: #fff; color: #222; }
  section { padding: 40px 20px; }
}
