/* ══════════════════════════════════════════════════
   人生之书 · The Book of Life
   深墨 + 鎏金配色 / 3D 书籍开合 / 翻页动画
   ══════════════════════════════════════════════════ */
:root {
  --ink-0: #0b101b;      /* 最深底 */
  --ink-1: #101726;      /* 面板底 */
  --ink-2: #18233a;      /* 卡片底 */
  --ink-3: #223050;      /* 边界 */
  --gold: #d4b06a;       /* 鎏金 */
  --gold-2: #f0d9a8;     /* 亮金 */
  --paper: #f3ecd9;      /* 纸色 */
  --paper-2: #e8dec4;
  --text: #e8e4d8;
  --text-dim: #9aa3b5;
  --serif: "Noto Serif SC", "Source Han Serif SC", "STZhongsong", "SimSun", "宋体", serif;
  --kai: "KaiTi", "STKaiti", "楷体", serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  background: var(--ink-0);
  color: var(--text);
  font-family: var(--serif);
  line-height: 1.7;
  overflow-x: hidden;
}
a { color: var(--gold); text-decoration: none; }

/* ── 导航 ── */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  background: rgba(11,16,27,.72);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(212,176,106,.16);
}
.nav-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 24px; height: 60px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.nav-logo { font-size: 20px; letter-spacing: 6px; color: var(--gold-2); cursor: pointer; font-weight: 700; }
.logo-dot { display: inline-block; width: 7px; height: 7px; background: var(--gold); border-radius: 50%; margin-left: 2px; vertical-align: 3px; }
.nav-links { display: flex; gap: 26px; }
.nav-links a { color: var(--text-dim); font-size: 14px; letter-spacing: 2px; transition: color .25s; }
.nav-links a:hover { color: var(--gold-2); }
.nav-user { display: flex; align-items: center; gap: 10px; }
.nav-user .avatar { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--gold); }
.nav-user .uname { font-size: 13px; color: var(--gold-2); }
.nav-vip { font-size: 11px; color: var(--ink-0); background: linear-gradient(135deg, var(--gold-2), var(--gold)); padding: 2px 8px; border-radius: 10px; font-weight: 700; }

/* ── 按钮体系 ── */
.btn {
  font-family: var(--serif); cursor: pointer; border: none;
  padding: 12px 30px; font-size: 15px; letter-spacing: 3px;
  border-radius: 3px; transition: all .3s ease; position: relative;
}
.btn-sm { padding: 7px 18px; font-size: 13px; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-gold {
  background: linear-gradient(135deg, var(--gold-2), var(--gold) 55%, #b8934f);
  color: #241a08; font-weight: 700;
  box-shadow: 0 4px 22px rgba(212,176,106,.35);
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(212,176,106,.5); }
.btn-outline { background: transparent; color: var(--gold-2); border: 1px solid rgba(212,176,106,.55); }
.btn-outline:hover { background: rgba(212,176,106,.1); border-color: var(--gold); }
.btn-ghost { background: transparent; color: var(--text-dim); border: 1px solid var(--ink-3); }
.btn-ghost:hover { color: var(--gold-2); border-color: var(--gold); }
.btn-wechat { background: #07c160; color: #fff; font-weight: 700; width: 100%; }
.btn-wechat:hover { background: #06ad56; }

/* ══════════════ HERO ══════════════ */
.hero {
  min-height: 100vh; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 90px 20px 40px; overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 55% at 50% 30%, rgba(212,176,106,.10), transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(60,80,140,.12), transparent 60%),
    var(--ink-0);
}
.particles { position: absolute; inset: 0; pointer-events: none; }
.particle {
  position: absolute; border-radius: 50%;
  background: rgba(212,176,106,.45);
  animation: floatUp linear infinite;
}
@keyframes floatUp {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  10%  { opacity: .8; }
  90%  { opacity: .3; }
  100% { transform: translateY(-70vh) translateX(30px); opacity: 0; }
}

.hero-stage { perspective: 1600px; margin: 10px 0 40px; }

/* ── 3D 书籍 ── */
.book3d-wrap { position: relative; }
.book3d {
  position: relative; width: 250px; height: 350px;
  transform-style: preserve-3d;
  transform: rotateX(12deg) rotateY(-24deg);
  transition: transform 1.6s cubic-bezier(.22,.9,.3,1.05);
  cursor: pointer;
  animation: bookBob 5.5s ease-in-out infinite;
}
.book3d.opened {
  transform: rotateX(8deg) rotateY(-6deg) translateX(35px);
  animation: none;
}
@keyframes bookBob {
  0%, 100% { margin-top: 0; }
  50% { margin-top: -14px; }
}

/* 封面 */
.book-cover {
  position: absolute; inset: 0;
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform 1.8s cubic-bezier(.3,.7,.2,1);
  backface-visibility: hidden;
}
.book-cover.front {
  background: linear-gradient(115deg, #5a1626 0%, #3d0f1c 45%, #571525 100%);
  border-radius: 4px 8px 8px 4px;
  border-left: 6px solid #2c0a14;
  box-shadow: inset 0 0 60px rgba(0,0,0,.5);
  z-index: 30;
}
.book3d.opened .book-cover.front { transform: rotateY(-168deg); }
.book-cover.back {
  transform: rotateY(-180deg);
  background: linear-gradient(115deg, #571525, #3d0f1c);
  border-radius: 4px 8px 8px 4px;
}
.book3d.opened .book-cover.back { transform: rotateY(-172deg); }

.cover-frame {
  position: absolute; inset: 12px;
  border: 1px solid rgba(212,176,106,.65);
  border-radius: 3px 6px 6px 3px;
}
.cover-frame::after {
  content: ""; position: absolute; inset: 5px;
  border: 1px solid rgba(212,176,106,.3); border-radius: 2px;
}
.cover-title {
  position: absolute; top: 34%; width: 100%; text-align: center;
  font-family: var(--kai); font-size: 40px; letter-spacing: 10px;
  color: var(--gold-2); text-shadow: 0 0 18px rgba(212,176,106,.5);
  writing-mode: vertical-rl; left: 50%; transform: translateX(-50%);
  height: 46%;
}
.cover-sub {
  position: absolute; bottom: 52px; width: 100%; text-align: center;
  font-size: 10px; letter-spacing: 5px; color: rgba(212,176,106,.75);
}
.cover-ornament {
  position: absolute; bottom: 26px; width: 100%; text-align: center;
  color: rgba(212,176,106,.7); font-size: 18px;
}
.cover-inner-text {
  position: absolute; top: 50%; left: 55%; transform: translate(-50%,-50%);
  writing-mode: vertical-rl; font-family: var(--kai); font-size: 16px;
  color: rgba(243,236,217,.85); letter-spacing: 6px; line-height: 2.4;
  width: 100%; text-align: center;
}

/* 内页（右页） */
.book-page {
  position: absolute; inset: 2px 1px 2px 8px;
  background: linear-gradient(105deg, var(--paper) 0%, var(--paper-2) 100%);
  border-radius: 2px 6px 6px 2px;
  z-index: 5;
}
.right-page { z-index: 4; display: flex; align-items: center; justify-content: center; }
.page-content { padding: 26px 20px; text-align: center; color: #4a3f2d; }
.page-quote {
  font-family: var(--kai); font-size: 15px; line-height: 2;
  color: #5a4c33; margin-bottom: 18px;
}
.btn-open { padding: 9px 20px; font-size: 13px; }

/* 页扇（打开时展开） */
.page-stack { position: absolute; inset: 2px 1px 2px 8px; transform-style: preserve-3d; z-index: 10; }
.stack-page {
  position: absolute; inset: 0;
  background: linear-gradient(100deg, var(--paper-2), var(--paper));
  border-radius: 2px 6px 6px 2px;
  transform-origin: left center;
  transition: transform 1.4s cubic-bezier(.3,.7,.2,1);
  box-shadow: 0 0 6px rgba(0,0,0,.08);
}
.sp5 { transform: rotateY(-2deg); }
.sp4 { transform: rotateY(-1.4deg); }
.sp3 { transform: rotateY(-.9deg); }
.sp2 { transform: rotateY(-.4deg); }
.book3d.opened .sp5 { transform: rotateY(-13deg); transition-delay: .45s; }
.book3d.opened .sp4 { transform: rotateY(-9.5deg); transition-delay: .55s; }
.book3d.opened .sp3 { transform: rotateY(-6.5deg); transition-delay: .65s; }
.book3d.opened .sp2 { transform: rotateY(-3.5deg); transition-delay: .75s; }

/* 封底 + 书脊 */
.book-backcover {
  position: absolute; inset: 0;
  background: linear-gradient(115deg, #4a1220, #380d19);
  border-radius: 4px 8px 8px 4px;
  transform: translateZ(-4px);
  z-index: 1;
}
.book-spine {
  position: absolute; left: -8px; top: 2px; bottom: 2px; width: 10px;
  background: linear-gradient(90deg, #2c0a14, #571525);
  transform: rotateY(90deg) translateZ(-5px);
}
.book-shadow {
  width: 300px; height: 36px; margin: 26px auto 0;
  background: radial-gradient(ellipse at center, rgba(0,0,0,.55), transparent 70%);
  animation: shadowBob 5.5s ease-in-out infinite;
}
@keyframes shadowBob {
  0%, 100% { transform: scaleX(1); opacity: .9; }
  50% { transform: scaleX(.86); opacity: .6; }
}

/* Hero 文案 */
.hero-text { text-align: center; max-width: 680px; position: relative; z-index: 5; }
.hero-title {
  font-family: var(--kai); font-size: 46px; letter-spacing: 16px;
  color: var(--gold-2); margin-bottom: 14px;
  text-shadow: 0 0 34px rgba(212,176,106,.35);
}
.hero-sub { color: var(--text-dim); font-size: 15px; margin-bottom: 26px; }
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.hero-hint { margin-top: 16px; font-size: 12px; color: rgba(212,176,106,.55); letter-spacing: 2px; }

/* ══════════════ 通用 Section ══════════════ */
.section { max-width: 1120px; margin: 0 auto; padding: 90px 24px; }
.section-dark {
  max-width: none;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(212,176,106,.06), transparent),
    var(--ink-1);
  border-top: 1px solid rgba(212,176,106,.1);
  border-bottom: 1px solid rgba(212,176,106,.1);
}
.section-dark > * { max-width: 1120px; margin-left: auto; margin-right: auto; }
.sec-title {
  text-align: center; font-family: var(--kai); font-size: 32px;
  letter-spacing: 8px; color: var(--gold-2); margin-bottom: 10px;
}
.sec-desc { text-align: center; color: var(--text-dim); font-size: 14px; margin-bottom: 48px; }

/* 滚动渐显 */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ── 三步 ── */
.steps { display: flex; align-items: stretch; justify-content: center; gap: 10px; flex-wrap: wrap; }
.step {
  flex: 1 1 260px; max-width: 300px; text-align: center;
  background: var(--ink-2); border: 1px solid var(--ink-3);
  border-radius: 8px; padding: 34px 24px; position: relative;
  transition: transform .35s, border-color .35s, box-shadow .35s;
}
.step:hover { transform: translateY(-6px); border-color: rgba(212,176,106,.5); box-shadow: 0 14px 40px rgba(0,0,0,.4); }
.step-num {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  color: #241a08; font-weight: 700; width: 30px; height: 30px; line-height: 30px;
  border-radius: 50%; font-size: 14px;
}
.step-icon { font-size: 40px; margin: 10px 0 14px; }
.step h3 { color: var(--gold-2); letter-spacing: 5px; margin-bottom: 10px; }
.step p { color: var(--text-dim); font-size: 13.5px; }
.step-arrow { align-self: center; color: var(--gold); opacity: .5; font-size: 18px; }

/* ══════════════ 翻页书 ══════════════ */
.flipbook-wrap { perspective: 2200px; display: flex; flex-direction: column; align-items: center; }
.flipbook {
  position: relative; width: min(720px, 92vw); height: 440px;
  transform-style: preserve-3d;
}
/* 翻页书：两张静态页 + 翻动叶 */
.fb-page {
  position: absolute; inset: 0;
  background: linear-gradient(100deg, var(--paper-2) 0%, var(--paper) 60%);
  border-radius: 4px 10px 10px 4px;
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
  color: #4a3f2d; padding: 40px 46px; overflow: hidden;
}
.fb-page.left-half { border-radius: 10px 4px 4px 10px; border-right: 1px dashed rgba(74,63,45,.25); }
.leaf {
  position: absolute; left: 50%; top: 0; width: 50%; height: 100%;
  transform-style: preserve-3d; transform-origin: left center;
  transition: transform 1.1s cubic-bezier(.35,.75,.25,1);
  z-index: 10;
}
.leaf.flipped { transform: rotateY(-180deg); }
.leaf-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: linear-gradient(100deg, var(--paper-2) 0%, var(--paper) 60%);
  border-radius: 0 10px 10px 0;
  box-shadow: -8px 0 24px rgba(0,0,0,.25);
  color: #4a3f2d; padding: 34px 36px; overflow: hidden;
}
.leaf-face.back { transform: rotateY(180deg); border-radius: 10px 0 0 10px; }
.leaf-face.right-edge::after, .fb-page.right-half::after {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 26px;
  background: linear-gradient(90deg, transparent, rgba(0,0,0,.12));
}
.fb-chapter-tag { font-size: 11px; letter-spacing: 4px; color: #a08a5c; margin-bottom: 8px; }
.fb-chapter-title { font-family: var(--kai); font-size: 26px; color: #3d3018; margin-bottom: 14px; letter-spacing: 4px; }
.fb-chapter-body { font-size: 14px; line-height: 2.1; color: #55482e; text-align: justify; }
.fb-page-num { position: absolute; bottom: 14px; right: 24px; font-size: 11px; color: #a08a5c; }
.flipbook-ctrl { margin-top: 26px; display: flex; align-items: center; gap: 22px; }
.flip-indicator { font-size: 13px; color: var(--text-dim); letter-spacing: 2px; min-width: 90px; text-align: center; }
.flipbook.closing .leaf, .flipbook.opening .leaf { pointer-events: none; }

/* ══════════════ AI 访谈 ══════════════ */
.interview-wrap { display: grid; grid-template-columns: 1fr 280px; gap: 26px; align-items: start; }
.chat-panel {
  background: var(--ink-1); border: 1px solid var(--ink-3); border-radius: 10px;
  overflow: hidden; display: flex; flex-direction: column; height: 520px;
}
.chat-head {
  display: flex; align-items: center; gap: 10px; padding: 13px 18px;
  background: rgba(212,176,106,.07); border-bottom: 1px solid var(--ink-3);
}
.chat-dot { width: 9px; height: 9px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 10px #4ade80; animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .4; } }
.chat-title { font-size: 13px; letter-spacing: 3px; color: var(--gold-2); }
.chat-progress { margin-left: auto; font-size: 12px; color: var(--text-dim); }
.chat-body { flex: 1; overflow-y: auto; padding: 20px 18px; display: flex; flex-direction: column; gap: 14px; }
.bubble { max-width: 82%; padding: 12px 16px; border-radius: 12px; font-size: 14px; line-height: 1.85; animation: bubbleIn .4s ease; }
@keyframes bubbleIn { from { opacity: 0; transform: translateY(10px); } }
.bubble.ai { align-self: flex-start; background: var(--ink-2); border: 1px solid var(--ink-3); border-top-left-radius: 3px; }
.bubble.me { align-self: flex-end; background: linear-gradient(135deg, rgba(212,176,106,.9), rgba(184,147,79,.9)); color: #241a08; border-top-right-radius: 3px; }
.bubble.typing span { display: inline-block; width: 6px; height: 6px; margin-right: 4px; background: var(--text-dim); border-radius: 50%; animation: tp 1.2s infinite; }
.bubble.typing span:nth-child(2) { animation-delay: .2s; }
.bubble.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes tp { 30% { transform: translateY(-5px); opacity: .5; } }
.chat-input-row { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--ink-3); background: rgba(0,0,0,.2); }
.chat-input-row textarea {
  flex: 1; resize: none; background: var(--ink-2); color: var(--text);
  border: 1px solid var(--ink-3); border-radius: 8px; padding: 10px 14px;
  font-family: var(--serif); font-size: 14px; outline: none;
}
.chat-input-row textarea:focus { border-color: var(--gold); }

/* 书稿侧栏 */
.book-meta {
  background: var(--ink-2); border: 1px solid var(--ink-3); border-radius: 10px; padding: 22px;
}
.book-meta h4 { color: var(--gold-2); letter-spacing: 4px; margin-bottom: 16px; font-size: 15px; }
.meta-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-dim); margin-bottom: 10px; }
.meta-row b { color: var(--gold-2); font-size: 15px; }
.meta-bar { height: 7px; background: var(--ink-3); border-radius: 4px; overflow: hidden; margin: 6px 0 18px; }
.meta-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-2)); border-radius: 4px; transition: width .8s ease; }
.meta-tip { font-size: 12px; color: var(--text-dim); line-height: 1.9; margin-bottom: 14px; }

/* ══════════════ 定价 ══════════════ */
.pricing { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; }
.price-card {
  flex: 1 1 220px; max-width: 260px; text-align: center;
  background: var(--ink-2); border: 1px solid var(--ink-3); border-radius: 12px;
  padding: 32px 22px; transition: transform .35s, border-color .35s, box-shadow .35s;
  position: relative;
}
.price-card:hover { transform: translateY(-8px); border-color: rgba(212,176,106,.55); box-shadow: 0 18px 50px rgba(0,0,0,.5); }
.price-card.hot { border-color: var(--gold); }
.price-card.hot::before {
  content: "最受欢迎"; position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: #241a08;
  font-size: 11px; font-weight: 700; padding: 3px 14px; border-radius: 10px; letter-spacing: 2px;
}
.pc-name { font-size: 15px; letter-spacing: 4px; color: var(--text-dim); margin-bottom: 12px; }
.pc-price { font-size: 38px; font-family: var(--serif); color: var(--gold-2); font-weight: 700; }
.pc-price small { font-size: 14px; color: var(--text-dim); font-weight: 400; }
.pc-feats { list-style: none; margin: 18px 0 22px; font-size: 13px; color: var(--text-dim); }
.pc-feats li { padding: 5px 0; }
.pc-feats li::before { content: "· "; color: var(--gold); }
.pay-note { text-align: center; color: var(--text-dim); font-size: 13px; margin-top: 34px; }
.pay-note b { color: #1677ff; }

/* ══════════════ 页脚 ══════════════ */
.footer { text-align: center; padding: 50px 20px 40px; color: var(--text-dim); font-size: 13px; }
.footer-dim { font-size: 11px; opacity: .55; margin-top: 6px; }

/* ══════════════ 弹层 ══════════════ */
.modal-mask {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(5,8,14,.7); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn .25s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  width: min(400px, 94vw); background: var(--ink-1);
  border: 1px solid rgba(212,176,106,.3); border-radius: 14px;
  padding: 30px 28px; position: relative; animation: modalUp .35s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes modalUp { from { opacity: 0; transform: translateY(30px) scale(.96); } }
.modal h3 { text-align: center; color: var(--gold-2); letter-spacing: 5px; margin-bottom: 20px; }
.modal-x {
  position: absolute; top: 10px; right: 14px; background: none; border: none;
  color: var(--text-dim); font-size: 22px; cursor: pointer;
}
.modal-x:hover { color: var(--gold-2); }
.login-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.ltab {
  flex: 1; padding: 9px; background: var(--ink-2); color: var(--text-dim);
  border: 1px solid var(--ink-3); border-radius: 8px; cursor: pointer;
  font-family: var(--serif); font-size: 13px; letter-spacing: 2px;
}
.ltab.active { color: var(--gold-2); border-color: var(--gold); background: rgba(212,176,106,.08); }
.ipt {
  width: 100%; margin-bottom: 12px; padding: 12px 14px;
  background: var(--ink-2); color: var(--text);
  border: 1px solid var(--ink-3); border-radius: 8px;
  font-family: var(--serif); font-size: 14px; outline: none;
}
.ipt:focus { border-color: var(--gold); }
.wx-box { text-align: center; padding: 10px 0 4px; }
.wx-qr-hint { font-size: 13px; color: var(--text-dim); margin-bottom: 16px; }
.wx-note { text-align: center; font-size: 12px; color: var(--text-dim); margin-top: 14px; }
.login-err { color: #e07a6a; font-size: 12.5px; text-align: center; min-height: 18px; margin-top: 10px; }
.pay-waiting { text-align: center; color: var(--text-dim); font-size: 14px; margin: 8px 0 20px; }
.spinner {
  width: 38px; height: 38px; margin: 0 auto 16px;
  border: 3px solid var(--ink-3); border-top-color: var(--gold);
  border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* toast */
.toast {
  position: fixed; bottom: 34px; left: 50%; transform: translateX(-50%);
  background: rgba(24,35,58,.95); border: 1px solid var(--gold);
  color: var(--gold-2); padding: 11px 26px; border-radius: 30px;
  font-size: 13.5px; letter-spacing: 1px; z-index: 300;
  animation: toastIn .3s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 14px); } }

/* ══════════════ 响应式 ══════════════ */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .hero-title { font-size: 34px; letter-spacing: 10px; }
  .book3d { width: 200px; height: 285px; }
  .cover-title { font-size: 32px; }
  .interview-wrap { grid-template-columns: 1fr; }
  .flipbook { height: 480px; }
  .fb-page { padding: 26px 24px; }
  .leaf { left: 0; width: 100%; }
  .leaf-face { border-radius: 10px; }
  .fb-page.left-half { display: none; }
  .step-arrow { display: none; }
  .section { padding: 64px 18px; }
}
