/* ==========================================================================
   narrative.css — 首页滚动叙事 + 作品页全宽展示 + 能力地图
   Apple 产品页的版面语言：
     · 一屏一个主张，每章占据一屏以上高度
     · 巨大标题 + 极短句，正文行宽压到 60~70 字符
     · 分区底色 黑 / 白 / 浅灰 交替，切换时有"换场"感
     · 章节进入视口时内容整体淡入上浮，滚动进度条同步
   ========================================================================== */

/* ---------- 通用版式 ---------- */
.display {
  font-size: var(--fs-display);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.02;
  margin: 0 0 20px;
}
.display--sm { font-size: var(--fs-h1); letter-spacing: -0.03em; }
.balance { text-wrap: balance; }
.measure { max-width: 30em; }
.measure--narrow { max-width: 22em; margin-left: auto; margin-right: auto; }

/* ---------- 内页页头（作品 / 能力） ---------- */
.hero {
  padding: clamp(72px, 14vh, 132px) 0 clamp(30px, 6vh, 56px);
  text-align: center;
}
.hero__lead {
  max-width: 34em;
  margin: 20px auto 0;
  font-size: var(--fs-lead);
  color: var(--text-secondary);
  line-height: 1.5;
}
.hero__meta {
  margin-top: 26px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

/* ---------- 章节：一屏一主张 ---------- */
.chapter {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100svh;
  padding: clamp(80px, 12vh, 140px) 0;
  overflow: hidden;
  text-align: center;
}
.chapter__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 22px;
}
.chapter--dark {
  background: #000;
  color: #f5f5f7;
  --text: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-tertiary: #8e8e93;
  --line: rgba(255, 255, 255, 0.16);
  --line-soft: rgba(255, 255, 255, 0.12);
  --fill-hover: rgba(255, 255, 255, 0.09);
  --glass: rgba(255, 255, 255, 0.08);
}
:root[data-theme="dark"] .chapter--dark {
  background: #f5f5f7;
  color: #1d1d1f;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --line: rgba(0, 0, 0, 0.12);
  --line-soft: rgba(0, 0, 0, 0.08);
  --fill-hover: rgba(0, 0, 0, 0.05);
  --glass: rgba(255, 255, 255, 0.72);
}
.chapter--alt { background: var(--bg-alt); }
.chapter--compact { min-height: auto; padding: clamp(64px, 9vh, 110px) 0; }

/* 章节开头的极小标记，Apple 常用它交代"这是第几幕" */
.chapter__mark {
  display: inline-block;
  margin-bottom: 22px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.chapter__mark--accent { color: var(--blue); }

/* ---------- 开场：巨大标题 + 光晕 ---------- */
.opening {
  text-align: center;
  padding: clamp(90px, 16vh, 170px) 0 clamp(70px, 10vh, 120px);
  min-height: 92svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.opening__glow {
  position: absolute;
  left: 50%; top: -18%;
  width: min(1200px, 140vw);
  height: 760px;
  transform: translateX(-50%);
  background:
    radial-gradient(closest-side, rgba(0, 113, 227, 0.22), transparent 70%),
    radial-gradient(closest-side at 72% 42%, rgba(191, 90, 242, 0.18), transparent 70%),
    radial-gradient(closest-side at 26% 66%, rgba(64, 200, 224, 0.16), transparent 72%);
  filter: blur(4px);
  pointer-events: none;
}
.opening .wrap { position: relative; z-index: 1; }
.opening__line {
  font-size: var(--fs-display);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.03;
  margin: 0 0 26px;
}
.opening__line span { display: block; }
.opening__by {
  margin-top: clamp(34px, 6vh, 64px);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
}
.opening__by b { color: var(--text-secondary); font-weight: 500; }
.opening__by .status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: 14px;
  color: var(--text-tertiary);
}
.opening__by .status::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(48, 209, 88, 0.18);
}
.opening__intro {
  margin: 22px auto 0;
  color: var(--text-secondary);
  min-height: 3.2em;
}

/* 向下提示 */
.scroll-cue {
  margin-top: clamp(38px, 7vh, 76px);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.scroll-cue i {
  display: block;
  width: 1px; height: 42px;
  margin: 14px auto 0;
  background: linear-gradient(var(--line), transparent);
  transform-origin: top;
  animation: cue 2.4s var(--ease) infinite;
}
@keyframes cue {
  0%, 100% { transform: scaleY(0.35); opacity: 0.35; }
  50% { transform: scaleY(1); opacity: 1; }
}

/* ---------- sticky 场景：左侧钉住，右侧叙述滚动 ---------- */
.scene {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(30px, 5vw, 80px);
  align-items: start;
  text-align: left;
}
.scene__sticky {
  position: sticky;
  top: calc(var(--nav-h) + 12vh);
}
.scene__sticky h2 { margin-bottom: 16px; }
.scene__sticky p { color: var(--text-secondary); }
.scene__steps { display: flex; flex-direction: column; }
.step {
  padding: clamp(40px, 7vh, 72px) 0;
  border-top: 1px solid var(--line-soft);
  opacity: 0.38;
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease-out);
  transform: translateY(10px);
}
.step:first-child { border-top: none; }
.step.is-current { opacity: 1; transform: none; }
.step__no {
  display: block;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--blue);
  letter-spacing: 0.08em;
}
.step h3 {
  font-size: clamp(22px, 2.6vw, 32px);
  letter-spacing: -0.025em;
  margin-bottom: 10px;
}
.step p { color: var(--text-secondary); margin: 0; }

/* ---------- 大数字（Apple 常用的"大字号数据"） ---------- */
.figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: clamp(24px, 4vw, 48px);
  margin-top: clamp(36px, 6vh, 64px);
}
.figure__num {
  font-size: clamp(52px, 8vw, 104px);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.figure__cap {
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-secondary);
}

/* ---------- 全屏视觉块：用渐变承载"产品图"的位置 ---------- */
.visual {
  position: relative;
  width: 100%;
  border-radius: var(--r-xl);
  overflow: hidden;
  display: grid;
  place-items: center;
  box-shadow: var(--sh-2);
}
.visual--wide { aspect-ratio: 16 / 9; }
.visual--tall { aspect-ratio: 4 / 5; }
.visual--square { aspect-ratio: 1 / 1; }
.visual__glyph {
  position: relative;
  z-index: 1;
  font-size: clamp(56px, 9vw, 120px);
  line-height: 1;
  filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.22));
}
.visual__shine {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 74% 16%, rgba(255, 255, 255, 0.42), transparent 58%);
}
.visual__label {
  position: absolute;
  left: 20px; bottom: 18px;
  z-index: 2;
  padding: 6px 13px;
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 12px;
  font-family: var(--font-mono);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

/* ---------- 收尾 CTA ---------- */
.closing {
  text-align: center;
  padding: clamp(90px, 14vh, 160px) 0;
}
.closing__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-top: 30px;
}

/* ---------- 近况列表 ---------- */
.now-list {
  list-style: none;
  margin: clamp(30px, 5vh, 52px) 0 0;
  padding: 0;
  text-align: left;
  display: grid;
  gap: 0;
}
.now-list li {
  display: grid;
  grid-template-columns: 5.5em 1fr;
  gap: 22px;
  padding: 22px 0;
  border-top: 1px solid var(--line-soft);
}
.now-list li:last-child { border-bottom: 1px solid var(--line-soft); }
.now-list b {
  font-weight: 500;
  color: var(--text-tertiary);
  font-size: 13px;
  letter-spacing: 0.08em;
  padding-top: 4px;
}
.now-list span { color: var(--text-secondary); font-size: var(--fs-lead); line-height: 1.5; }

/* ---------- 联系卡片行 ---------- */
.contact-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-top: clamp(30px, 5vh, 52px);
  text-align: left;
}
.contact-row .case h3 { font-size: 19px; word-break: break-all; }

/* ---------- 作品页：全宽交替展示 ---------- */
.showcase {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(28px, 5vw, 76px);
  align-items: center;
  padding: clamp(56px, 9vh, 110px) 0;
  border-top: 1px solid var(--line-soft);
  text-align: left;
}
.showcase:first-of-type { border-top: none; }
.showcase--flip .showcase__visual { order: -1; }
.showcase__index {
  display: block;
  margin-bottom: 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--text-tertiary);
}
.showcase h2 {
  font-size: var(--fs-h2);
  letter-spacing: -0.03em;
  margin-bottom: 14px;
}
.showcase__lead {
  font-size: var(--fs-lead);
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 22px;
}
.showcase__facts {
  list-style: none;
  margin: 0 0 26px;
  padding: 0;
  display: grid;
  gap: 10px;
}
.showcase__facts li {
  display: flex;
  gap: 12px;
  font-size: 15px;
  color: var(--text-secondary);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}
.showcase__facts b {
  flex: 0 0 4.5em;
  font-weight: 500;
  color: var(--text);
}
.showcase__actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.showcase__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 24px; }
.showcase__visual { position: relative; }
.showcase__visual .visual { aspect-ratio: 4 / 3; }

/* 项目之间的“下一个”导航 */
.next-up {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 34px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
}
.next-up span { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-tertiary); }
.next-up b { display: block; margin-top: 6px; font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }

/* ---------- 能力地图 ---------- */
.capability {
  margin-top: clamp(28px, 5vh, 52px);
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
  padding: clamp(48px, 8vh, 90px) 0;
  border-top: 1px solid var(--line-soft);
  text-align: left;
}
.capability:first-of-type { border-top: none; padding-top: 0; }
.capability__head { position: sticky; top: calc(var(--nav-h) + 10vh); }
.capability__no {
  display: block;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--text-tertiary);
}
.capability__head h2 {
  font-size: var(--fs-h2);
  letter-spacing: -0.03em;
  margin-bottom: 14px;
}
.capability__head p { color: var(--text-secondary); max-width: 26em; }
.capability__cases { display: grid; gap: 18px; }
.case {
  padding: 24px 26px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  background: var(--bg-elevated);
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out),
    border-color 0.3s var(--ease);
}
.case:hover { transform: translateY(-4px); box-shadow: var(--sh-2); border-color: transparent; }
.case__tag {
  display: inline-block;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--blue);
}
.case h3 { font-size: 18px; margin-bottom: 8px; letter-spacing: -0.015em; }
.case p { font-size: 15px; color: var(--text-secondary); margin: 0; }
.case__result {
  display: block;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-tertiary);
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

/* 能力条：只表达"相对强弱"，不写成百分比 */
.levels {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 26px;
}
.level-row {
  display: grid;
  grid-template-columns: 8.5em 1fr;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}
.level-row__track {
  display: flex;
  gap: 4px;
}
.level-row__track i {
  height: 4px;
  flex: 1;
  border-radius: 4px;
  background: var(--line);
}
.level-row__track i.on { background: var(--text); }

/* ---------- 留言板：宽留白、弱装饰 ---------- */
.panel {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 22px;
}
.panel__head { text-align: center; margin-bottom: clamp(34px, 5vh, 54px); }
.panel__head h1 { margin-bottom: 14px; }
.panel__head p { color: var(--text-secondary); margin: 0 auto; max-width: 34em; }

.form-sheet {
  scroll-margin-top: calc(var(--nav-h) + 20px);
  padding: clamp(24px, 3vw, 36px);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-xl);
  background: var(--bg-elevated);
  box-shadow: var(--sh-1);
  position: relative;
}
.opinions { margin-top: clamp(46px, 7vh, 76px); }
.opinions__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 8px;
}
.opinions__bar h2 { margin: 0; font-size: 20px; }
.opinions__tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* 留言条目：极简列表，靠分隔线而不是卡片 */
.note {
  position: relative;
  padding: 26px 0;
  border-bottom: 1px solid var(--line-soft);
  animation: note-in 0.5s var(--ease-out) both;
}
@keyframes note-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.note--pinned { background: linear-gradient(var(--fill-hover), transparent); }
.note__head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}
.note__who {
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.note__meta {
  font-size: 12px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}
.note__ops { margin-left: auto; display: flex; gap: 2px; opacity: 0; transition: opacity 0.25s var(--ease); }
.note:hover .note__ops, .note:focus-within .note__ops { opacity: 1; }
.note__ops .icon-btn { width: 28px; height: 28px; }
.note__text {
  font-size: 16px;
  line-height: 1.62;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}
.note__text em { font-style: normal; background: rgba(255, 159, 10, 0.22); border-radius: 3px; }
.note__reply {
  margin-top: 14px;
  padding: 14px 18px;
  border-radius: var(--r-md);
  background: var(--fill-hover);
  font-size: 15px;
  color: var(--text-secondary);
}
.note__reply b { color: var(--text); font-weight: 600; }
.note__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-tertiary);
}
.note__pill {
  padding: 2px 9px;
  border-radius: var(--r-pill);
  background: var(--fill-hover);
  color: var(--text-secondary);
}
.note__pill--pin { background: rgba(255, 159, 10, 0.16); color: #a86300; }
:root[data-theme="dark"] .note__pill--pin { color: var(--orange); }

.blank {
  padding: 70px 20px;
  text-align: center;
  color: var(--text-tertiary);
}
.blank .big { display: block; font-size: 34px; margin-bottom: 12px; }

/* ---------- 表单 ---------- */
.field { margin-top: 20px; }
.field:first-child { margin-top: 0; }
.field__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 0;
}
.field__row .field { margin-top: 0; }
.field label,
.label-row {
  display: block;
  margin-bottom: 8px;
  font-size: 13.5px;
  color: var(--text-secondary);
}
.req { color: var(--pink); }
.label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}
.counter { font-family: var(--font-mono); font-size: 12px; color: var(--text-tertiary); }
.counter.is-warn { color: var(--pink); }

.input,
.textarea,
.select {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  line-height: 1.45;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.22s var(--ease), box-shadow 0.22s var(--ease),
    background-color 0.22s var(--ease);
}
.input::placeholder,
.textarea::placeholder { color: var(--text-tertiary); }
.input:hover,
.textarea:hover,
.select:hover { border-color: var(--text-tertiary); }
.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: var(--ring);
}
.textarea { min-height: 132px; resize: vertical; }
.select--sm {
  width: auto;
  padding: 7px 13px;
  font-size: 13px;
  border-radius: var(--r-pill);
  background: var(--bg-elevated);
  color: var(--text-secondary);
}
.select--sm option { background: var(--bg-elevated); color: var(--text); }

/* 校验状态：只在该出现的地方出现 */
.field.is-invalid .input,
.field.is-invalid .textarea { border-color: var(--pink); box-shadow: 0 0 0 4px rgba(255, 55, 95, 0.14); }
.field.is-valid .input,
.field.is-valid .textarea { border-color: var(--green); }
.field__error {
  display: none;
  margin: 7px 0 0;
  font-size: 12.5px;
  color: var(--pink);
}
.field.is-invalid .field__error { display: block; animation: nudge 0.32s var(--ease); }
@keyframes nudge {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-3px); }
  70% { transform: translateX(3px); }
}

/* 星级：纯 radio + 兄弟选择器做悬停预览 */
.rate { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.rate input { position: absolute; opacity: 0; pointer-events: none; }
.rate label {
  margin: 0;
  font-size: 24px;
  line-height: 1;
  color: var(--line);
  cursor: pointer;
  transition: transform 0.2s var(--ease-out), color 0.2s var(--ease);
}
.rate label:hover,
.rate label:hover ~ label,
.rate input:checked ~ label { color: var(--orange); }
.rate label:hover { transform: scale(1.16) rotate(-5deg); }

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
}
.form-actions .btn--primary { min-width: 140px; }
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 提交成功的盖章 */
.stamp {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: var(--r-xl);
  background: color-mix(in srgb, var(--bg-elevated) 86%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s var(--ease);
}
.stamp.is-show { opacity: 1; }
.stamp__badge {
  display: grid;
  place-items: center;
  width: 84px; height: 84px;
  border-radius: 50%;
  background: var(--grad-green);
  color: #fff;
  font-size: 36px;
  box-shadow: 0 16px 40px rgba(48, 209, 88, 0.38);
  animation: pop 0.5s var(--ease-out);
}
@keyframes pop {
  0% { transform: scale(0.4); opacity: 0; }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .scene,
  .showcase,
  .capability { grid-template-columns: 1fr; gap: 30px; }
  .scene__sticky,
  .capability__head { position: static; }
  .scene__steps .step { padding: 26px 0; }
  .showcase--flip .showcase__visual { order: 0; }
  .showcase .showcase__visual { order: -1; }
  .step { opacity: 1; transform: none; }
  .chapter { min-height: auto; }
}
@media (max-width: 560px) {
  .level-row { grid-template-columns: 1fr; gap: 8px; }
  .figures { grid-template-columns: repeat(2, 1fr); gap: 22px; }
}
