:root {
  --bg: #FBF5EC;
  --card: #FFFDF9;
  --ink: #3A2E28;
  --muted: #8C7B70;
  --line: #EEE2D3;
  --maple: #C8642B;
  --amber: #E8A85C;
  --sage: #8E9F86;
  --soft: #F6E7D4;
  --radius: 18px;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", serif;
  --sans: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 100% -10%, #F7DFC4 0%, transparent 60%),
    radial-gradient(900px 500px at -20% 30%, #F3E9DA 0%, transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  min-height: 100vh;
}

main {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 20px calc(40px + env(safe-area-inset-bottom));
}

h1, h2, h3, h4, blockquote { font-family: var(--serif); font-weight: 700; margin: 0; }
p { margin: 0; }
h1, h2, .tagline, .contact p { text-wrap: balance; }

/* ---------- 封面 ---------- */
.hero { text-align: center; padding: 72px 0 40px; }
.avatar {
  width: 112px; height: 112px; margin: 0 auto 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--amber), var(--maple));
  display: grid; place-items: center;
  box-shadow: 0 10px 30px rgba(200, 100, 43, .25), 0 0 0 6px var(--card);
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar span { color: #fff; font-family: var(--serif); font-size: 46px; }
.hero h1 { font-size: 32px; letter-spacing: .04em; margin: 4px 0 14px; }
.tagline { color: var(--muted); font-family: var(--serif); font-size: 17px; }

.toc { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 28px; }
.toc a {
  color: var(--ink); text-decoration: none; font-size: 13px;
  padding: 6px 14px; border-radius: 999px;
  background: rgba(255, 253, 249, .7); border: 1px solid var(--line);
}
.toc a:active { background: var(--soft); }

/* ---------- 通用 ---------- */
.sec { padding: 36px 0 8px; }
.kicker {
  color: var(--maple); font-size: 12px; letter-spacing: .2em;
  text-transform: uppercase; margin-bottom: 4px;
}
.sec h2 { font-size: 24px; margin-bottom: 18px; }
.sec h3 { font-size: 18px; margin: 28px 0 12px; }
.card h4 { font-size: 16px; margin-bottom: 6px; color: var(--maple); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: 0 4px 18px rgba(120, 80, 40, .05);
}
.card + .card { margin-top: 12px; }

/* ---------- 基本信息 ---------- */
.basics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.basics .card + .card { margin-top: 0; }
.basic { display: flex; flex-direction: column; padding: 14px 16px; }
.basic .label { font-size: 12px; color: var(--muted); }
.basic .value { font-family: var(--serif); font-size: 22px; font-weight: 700; line-height: 1.4; }
.basic .value small { font-size: 13px; margin-left: 2px; color: var(--muted); font-weight: 400; }
.basic .note { font-size: 12px; color: var(--muted); }

/* ---------- 照片 ---------- */
.photos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.photos img {
  width: 100%; aspect-ratio: 3 / 4; object-fit: cover;
  border-radius: 14px; border: 4px solid var(--card);
  box-shadow: 0 4px 14px rgba(120, 80, 40, .1);
}

/* ---------- 关于我 ---------- */
.prose p + p { margin-top: 10px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tags span {
  font-size: 13px; padding: 5px 12px; border-radius: 999px;
  background: var(--soft); color: #7A4A2A;
}
.doing { list-style: none; margin: 0; padding: 0; }
.doing li {
  position: relative; padding: 0 0 14px 22px;
  border-left: 1px dashed #E2CDB6; margin-left: 6px;
}
.doing li:last-child { border-left-color: transparent; padding-bottom: 0; }
.doing li::before {
  content: ""; position: absolute; left: -6px; top: 7px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--amber); box-shadow: 0 0 0 3px var(--bg);
}
.doing strong { display: block; font-size: 15px; }
.doing span { color: var(--muted); font-size: 14px; }

.portfolio {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 20px; padding: 16px 20px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--amber), var(--maple));
  color: #fff; text-decoration: none;
  box-shadow: 0 8px 22px rgba(200, 100, 43, .25);
}
.portfolio span { font-family: var(--serif); font-size: 17px; font-weight: 700; }
.portfolio small { font-size: 13px; opacity: .9; white-space: nowrap; }
.portfolio:active { transform: scale(.98); }

/* ---------- 使用说明 ---------- */
.energy { display: flex; align-items: center; gap: 18px; }
.battery {
  flex: none; width: 34px; height: 60px; position: relative;
  border: 2.5px solid var(--ink); border-radius: 7px; padding: 3px;
  display: flex; align-items: flex-end;
}
.battery::before {
  content: ""; position: absolute; top: -7px; left: 50%; transform: translateX(-50%);
  width: 12px; height: 4px; background: var(--ink); border-radius: 2px 2px 0 0;
}
.battery-fill { width: 100%; height: 100%; border-radius: 3px; background: var(--sage); }
.in .battery-fill { animation: drain 6s ease-in-out infinite; }
@keyframes drain {
  0%, 10% { height: 100%; background: var(--sage); }
  55%, 70% { height: 18%; background: var(--maple); }
  100% { height: 100%; background: var(--sage); }
}

.row p, .energy p, .past p { color: #5A4A40; font-size: 15px; }

.states .legend { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.dot.think { margin-left: 10px; }
.feel { background: var(--maple); }
.think { background: var(--sage); }
.state { display: grid; grid-template-columns: 72px 1fr; gap: 4px 12px; align-items: center; }
.state + .state { margin-top: 14px; }
.state-label { font-size: 14px; font-weight: 600; }
.bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--line); }
.bar i { display: block; height: 100%; width: 0; transition: width 1.2s ease .2s; }
.in .bar i { width: var(--w); }
.state-text { grid-column: 2; font-size: 13px; color: var(--muted); }

/* ---------- 恋爱观 ---------- */
.quote {
  font-size: 21px; line-height: 1.6; text-align: center; text-wrap: balance;
  padding: 26px 16px; margin-bottom: 16px; color: var(--maple);
  position: relative;
}
.quote::before, .quote::after {
  font-size: 48px; color: var(--amber); opacity: .45; line-height: 0;
  position: relative; top: 14px;
}
.quote::before { content: "“"; margin-right: 4px; }
.quote::after { content: "”"; margin-left: 4px; }
.love { list-style: none; margin: 0 0 16px; padding: 0; }
.love li {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 16px 12px 44px; position: relative; font-size: 15px;
}
.love li + li { margin-top: 8px; }
.love li::before {
  content: ""; position: absolute; left: 16px; top: 50%; transform: translateY(-50%) rotate(-45deg);
  width: 12px; height: 12px; background: var(--maple); opacity: .8;
  border-radius: 0 50% 0 50%;
}
.past { background: transparent; border-style: dashed; box-shadow: none; }
.past h4 { color: var(--muted); }

/* ---------- 理想型 ---------- */
.must { background: linear-gradient(135deg, #FCEBDB, #FFF6EC); border-color: #F1D3B5; }
.must-item { font-family: var(--serif); font-size: 19px; font-weight: 700; }
.must-item + .must-item { margin-top: 4px; }
.must-item::before { content: "✓"; color: var(--maple); margin-right: 10px; font-family: var(--sans); }
.bonus { margin: 0; padding: 0; list-style: none; }
.bonus li { font-size: 15px; color: #5A4A40; position: relative; padding-left: 20px; }
.bonus li + li { margin-top: 6px; }
.bonus li::before { content: "+"; position: absolute; left: 2px; color: var(--amber); font-weight: 700; }
.mbti { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.mbti-label { font-size: 13px; color: var(--muted); margin-right: 4px; }
.mbti span:not(.mbti-label) {
  font-size: 13px; font-weight: 700; letter-spacing: .06em;
  padding: 4px 12px; border-radius: 8px; background: var(--ink); color: var(--bg);
}

/* ---------- 认识过程 ---------- */
.flow { display: flex; flex-direction: column; align-items: stretch; }
.step { position: relative; }
.step p { font-size: 14px; color: var(--muted); }
.step.first { text-align: center; }
.num {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--maple); color: #fff; font-size: 13px; margin-bottom: 6px;
}
.fork {
  height: 36px; margin: 0 25%;
  border: 2px dashed #E2CDB6; border-bottom: none; border-radius: 14px 14px 0 0;
  position: relative;
}
.fork::before {
  content: ""; position: absolute; left: 50%; top: -14px; height: 14px;
  border-left: 2px dashed #E2CDB6;
}
.branches { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.branches .card + .card { margin-top: 0; }
.branches .step { text-align: center; }
.step.yes { border-color: #F1C9A5; background: #FFF4E8; }
.step.yes h4 { color: var(--maple); }
.step.no h4 { color: var(--sage); }

/* ---------- 联系 ---------- */
.contact { text-align: center; padding-top: 56px; }
.contact p { color: #5A4A40; max-width: 420px; margin: 0 auto; }
.qr { width: 180px; margin-top: 20px; border-radius: 14px; border: 6px solid var(--card); }
.wechat { margin-top: 14px !important; }
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 40px 0 0; }

/* ---------- 动效 ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }

.leaves { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.leaf {
  position: absolute; top: -40px; width: var(--size); height: var(--size); opacity: .55;
  animation: fall var(--dur) linear var(--delay) infinite;
}
.leaf svg { width: 100%; height: 100%; display: block; }
@keyframes fall {
  0%   { transform: translate(0, -5vh) rotate(0deg); }
  50%  { transform: translate(var(--drift), 50vh) rotate(180deg); }
  100% { transform: translate(0, 110vh) rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .bar i { transition: none; }
  .in .battery-fill { animation: none; }
}

/* ---------- 桌面 ---------- */
@media (min-width: 720px) {
  .hero { padding-top: 96px; }
  .hero h1 { font-size: 38px; }
  .basics { grid-template-columns: repeat(4, 1fr); }
  .photos { grid-template-columns: repeat(3, 1fr); }
}
