.hero {
  --focus-x: 44%;
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
}

/* ---------- 场景层：照片 + 光斑 + 浮尘，整体做视差 ---------- */
.scene {
  position: absolute; inset: 0; z-index: -2;
  transform: translate3d(var(--px, 0px), var(--py, 0px), 0) scale(1.05);
  will-change: transform;
}
.scene-drift {
  position: absolute; inset: 0;
  animation: drift 70s ease-in-out infinite alternate;
  transform-origin: 40% 60%;
}
.scene-photo, .sunlight, .dust {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
.scene-photo {
  object-fit: cover;
  object-position: var(--focus-x) 50%;
  animation: photo-in 2.4s var(--ease-out) both;
}
/* 光斑层：与照片同样的 cover 定位，保证遮罩和窗影对齐 */
.sunlight {
  background: #fff3dc;
  -webkit-mask: url("../assets/img/sunlight-mask.png") var(--focus-x) 50% / cover no-repeat;
          mask: url("../assets/img/sunlight-mask.png") var(--focus-x) 50% / cover no-repeat;
  mix-blend-mode: soft-light;
  opacity: 0;
  animation: sun-breathe 23s ease-in-out 2.4s infinite;
}
.dust { pointer-events: none; }

@keyframes photo-in {
  from { opacity: 0; transform: scale(1.03); }
  to   { opacity: 1; transform: none; }
}
@keyframes drift {
  from { transform: scale(1); }
  to   { transform: scale(1.04) translate3d(-.6%, -.4%, 0); }
}
/* 像云飘过：亮—暗—更亮—渐弱，节奏不规则 */
@keyframes sun-breathe {
  0%   { opacity: 0; }
  18%  { opacity: .75; }
  34%  { opacity: .55; }
  46%  { opacity: .9; }
  63%  { opacity: .2; }
  80%  { opacity: .65; }
  100% { opacity: 0; }
}

/* 轻微压暗四周，托住中间文字 */
.veil {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 46% 40% at 50% 50%, rgba(246, 240, 230, .22), rgba(246, 240, 230, 0) 72%),
    linear-gradient(to bottom, rgba(243, 238, 228, .12), rgba(243, 238, 228, 0) 14%, rgba(30, 24, 18, 0) 82%, rgba(30, 24, 18, .08));
}

/* ---------- 中心内容 ---------- */
.hero-content {
  width: min(640px, calc(100vw - 2 * var(--gutter)));
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  padding: 120px 0 140px;
}

.eyebrow {
  font-family: var(--latin); font-weight: 500;
  font-size: 13px; letter-spacing: .38em; text-transform: uppercase;
  color: rgba(31, 29, 26, .52);
  margin-bottom: 26px;
}

.title {
  display: flex; flex-wrap: wrap; justify-content: center;
  font-size: clamp(34px, 3.7vw, 54px);
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: .16em;
}
.title-line { display: inline-flex; margin-right: -.16em; /* 抵消行末字距，视觉居中 */ }
.title span span {
  display: inline-block;
  animation: char-in 1.5s var(--ease-out) var(--d) both;
}

/* 出处：两侧细线夹着的小字 */
.title-src {
  display: flex; align-items: center; gap: 14px;
  margin-top: 20px;
  font-size: 12px; letter-spacing: .36em; color: var(--ink-3);
}
.title-src::before, .title-src::after { content: ""; width: 24px; height: 1px; background: currentColor; opacity: .6; }
.title-src span { margin-right: -.36em; /* 抵消末字字距，两侧横线对称 */ }
@keyframes char-in {
  from { opacity: 0; transform: translateY(14px); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}

.lede {
  margin-top: 30px;
  font-size: 16px; letter-spacing: .22em; color: var(--ink-2);
}

.reveal { animation: rise-in 1.4s var(--ease-out) var(--d, 0s) both; }
@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* 对话框：直角磨砂宣纸 + 题签式内细线。要一眼看出是提问入口，又不失分寸 */
.ask {
  position: relative;
  width: min(680px, calc(100vw - 2 * var(--gutter)));
  margin-top: 48px;
  display: flex; align-items: flex-end;
  background: rgba(251, 248, 242, .84);
  -webkit-backdrop-filter: blur(14px) saturate(1.05);
          backdrop-filter: blur(14px) saturate(1.05);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(60, 42, 24, .08), 0 26px 60px -30px rgba(60, 42, 24, .5);
  text-align: left;
  transition: box-shadow .4s var(--ease-out), background-color .4s var(--ease-out);
}
.ask::before { /* 题签式内框：离外沿 6px 的一圈细线 */
  content: ""; position: absolute; inset: 6px; pointer-events: none;
  border: 1px solid rgba(110, 86, 58, .2);
  transition: border-color .4s var(--ease-out);
}
.ask:hover { background: rgba(251, 248, 242, .9); }
.ask:focus-within {
  background: rgba(251, 248, 242, .94);
  box-shadow: 0 1px 2px rgba(60, 42, 24, .08), 0 30px 70px -30px rgba(60, 42, 24, .55);
}
.ask:focus-within::before { border-color: rgba(166, 138, 91, .6); }



.ask textarea {
  flex: 1; min-width: 0;
  resize: none; border: 0; outline: 0; background: transparent;
  flex: 1; min-width: 0;
  padding: 20px 12px 20px 28px;
  font-size: 16px; line-height: 1.6; letter-spacing: .06em;
  max-height: calc(1.6em * 5 + 40px);
  overflow-y: hidden;
}
.ask textarea::placeholder { color: var(--ink-3); letter-spacing: .12em; }

.ask-send {
  flex: none;
  flex: none;
  width: 40px; height: 40px; margin: 0 14px 13px 0;
  display: grid; place-items: center;
  border: 0; border-radius: 2px;
  background: var(--ink); color: #f3eee4; cursor: pointer;
  box-shadow: inset 0 0 0 3px var(--ink), inset 0 0 0 4px rgba(243, 238, 228, .35); /* 印章的内边框 */
  font-size: 17px; font-weight: 600; line-height: 1;
  transition: background-color .45s var(--ease-out), box-shadow .45s var(--ease-out), transform .3s var(--ease-out);
}
/* 墨印「问」：有字时变成朱砂，像落了一方印 */
.ask-send:hover { transform: translateY(-1px); }
.ask.has-text .ask-send {
  background: var(--cinnabar);
  box-shadow: inset 0 0 0 3px var(--cinnabar), inset 0 0 0 4px rgba(243, 238, 228, .45);
}

.ask-note {
  min-height: 1.6em; margin-top: 12px;
  font-size: 13px; letter-spacing: .14em; color: var(--ink-3);
  opacity: 0; transition: opacity .6s var(--ease-out);
}
.ask-note.show { opacity: 1; }

/* 示例问题：「试问」引导 + 纯文字，「·」相隔，悬停时细线由左展开 */
.prompts {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 8px 0;
  margin-top: 4px;
}
.prompts li + li::before { content: "·"; margin: 0 16px; color: var(--brass); }
.prompts .prompts-label { margin-right: 18px; font-size: 13px; letter-spacing: .3em; color: var(--ink-3); }
.prompts .prompts-label + li::before { content: none; }
.prompts button {
  position: relative;
  border: 0; background: none; padding: 4px 0; cursor: pointer;
  font-size: 14px; letter-spacing: .12em; color: var(--ink-2);
  transition: color .4s var(--ease-out);
}
.prompts button::after {
  content: ""; position: absolute; left: 0; right: .12em; bottom: 0; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform .5s var(--ease-out);
}
.prompts button:hover { color: var(--ink); }
.prompts button:hover::after { transform: scaleX(1); }

/* ---------- 角落信息 ---------- */
.corner { position: absolute; bottom: 36px; z-index: 2; }

.corner-bl {
  left: var(--gutter);
  display: flex; align-items: center; gap: 14px;
  font-size: 13px; letter-spacing: .28em; color: rgba(250, 245, 236, .86);
  text-shadow: 0 1px 12px rgba(40, 28, 16, .35);
}
.corner-bl .term { font-weight: 600; letter-spacing: .36em; }
.corner-rule { width: 28px; height: 1px; background: currentColor; opacity: .6; }

.corner-br {
  right: var(--gutter);
  display: flex; flex-direction: row-reverse; align-items: flex-start; gap: 10px;
  writing-mode: horizontal-tb;
  color: rgba(250, 245, 236, .82);
  text-shadow: 0 1px 12px rgba(20, 14, 8, .5);
}
.quote, .quote-src { writing-mode: vertical-rl; }
.quote { font-size: 15px; letter-spacing: .5em; }
.quote-src {
  font-size: 11px; letter-spacing: .32em; opacity: .7;
  padding-top: 2.6em;
}
.quote-src::before { content: "《"; }
.quote-src::after { content: "》"; }

/* 背后照片偏亮时（由 hero.js 采样判断）改用墨色 */
.corner { transition: color .6s var(--ease-out), text-shadow .6s var(--ease-out); }
.corner.on-light { color: var(--ink-2); text-shadow: 0 1px 12px rgba(246, 240, 230, .7); }
.corner.on-mixed { color: #fbf7ef; text-shadow: 0 0 2px rgba(30, 20, 12, .45), 0 1px 14px rgba(30, 20, 12, .75); }

/* ---------- 响应式 ---------- */
@media (max-aspect-ratio: 4/3) { .hero { --focus-x: 30%; } }

@media (max-width: 720px) {
  .hero { --focus-x: 16%; }
  .hero-content { padding: 110px 0 150px; }
  .eyebrow { font-size: 11px; letter-spacing: .3em; margin-bottom: 20px; }
  .lede { font-size: 14px; letter-spacing: .16em; }
  .ask { margin-top: 36px; }
  .ask textarea { padding: 16px 0 16px 18px; font-size: 16px; }
  .ask textarea { padding: 16px 10px 16px 20px; font-size: 16px; }
  .ask-send { width: 36px; height: 36px; margin: 0 11px 11px 0; font-size: 16px; }
  .prompts li + li::before { margin: 0 10px; }
  .prompts button { font-size: 13px; }
  .corner { bottom: 24px; }
  .quote { font-size: 13px; }
}

@media (max-height: 640px) and (min-width: 721px) {
  .hero-content { padding: 96px 0 96px; }
  .ask { margin-top: 32px; }
  .corner-br { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .scene-drift, .scene-photo, .title span span, .reveal, .nav { animation: none; }
  .sunlight { animation: none; opacity: .5; }
}
