/* ============================================================
 * term-poster.css — 二十四节气 · 沉浸式首屏海报舞台
 * ------------------------------------------------------------
 * 只作用于首页首屏的 .term-banner（加 .tp-stage 后生效），
 * 不改动任何既有布局、结构、业务逻辑；其余页面零影响。
 *
 * 设计语言：新中式 × 东方美学 × 数字艺术 × 沉浸式疗愈
 *   · 全幅无边界舞台（首屏几乎占满视口），画面由 canvas 程序化绘制
 *   · 信息层级：节气名（极大）→ 交节时间·候（中）→ 意境语（一行）
 *   · 其余（倒计时 / 体系链路 / 节气刻度 / 进入按钮）一律弱化
 *   · 明暗自适应：按画面亮度自动切「墨字 / 素字」，保证清晰可读
 *   · 尊重 prefers-reduced-motion 与打印
 * ============================================================ */

/* ── 舞台本体：打破容器宽幅，铺满首屏 ── */
html .term-banner.tp-stage,
html[data-theme="dark"] .term-banner.tp-stage {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  width: 100vw;
  max-width: none;
  margin-left: calc(50% - 50vw);
  margin-right: 0;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
  /* 画面偏暗时一律素字：弱化信息继承此色，绝不能沿用浅色主题的深墨色 */
  color: #fbf8f2;
  background: #14131a;                       /* canvas 未就绪时的兜底底色 */
  min-height: clamp(520px, calc(100vh - var(--nav-h) - 34px), 940px);
  min-height: clamp(520px, calc(100dvh - var(--nav-h) - 34px), 940px);
  min-height: clamp(520px, calc(100svh - var(--nav-h) - 34px), 940px);
  padding: clamp(22px, 3.4vw, 58px) clamp(18px, 4vw, 64px);
  transition: none;
}
html .term-banner.tp-stage:hover { transform: none; }
/* 旧版装饰圆与呼吸动画让位给 canvas 画面 */
html .term-banner.tp-stage::before,
html .term-banner.tp-stage::after { display: none !important; content: none; }

/* ── 画面层 ── */
.tp-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}
/* 文字可读性护罩：按亮度由 JS 切 data-lum */
.tp-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(100deg, rgba(12, 11, 16, .52) 0%, rgba(12, 11, 16, .24) 34%, rgba(12, 11, 16, 0) 62%),
    linear-gradient(0deg, rgba(12, 11, 16, .34) 0%, rgba(12, 11, 16, 0) 42%);
  transition: background .6s ease;
}
.tp-stage[data-lum="light"] .tp-veil {
  background:
    linear-gradient(100deg, rgba(252, 249, 242, .58) 0%, rgba(252, 249, 242, .26) 34%, rgba(252, 249, 242, 0) 62%),
    linear-gradient(0deg, rgba(252, 249, 242, .38) 0%, rgba(252, 249, 242, 0) 42%);
}
/* 顶部与底部各留一道柔光，强化「门」的框感 */
.tp-frame {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  border-top: 1px solid color-mix(in srgb, var(--tp-g, #fff) 26%, transparent);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  box-shadow: inset 0 0 120px rgba(0, 0, 0, .22);
}

/* ── 文案层 ── */
.tp-copy {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  min-height: 100%;
}
/* 画面偏亮时改墨字（.tp-copy 及其未显式着色的弱化信息一并切换） */
.tp-stage[data-lum="light"] .tp-copy { color: #22201b; }

/* 顶部：序号 + 季节五行 */
.tp-top {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 11.5px;
  letter-spacing: 3px;
  opacity: .78;
}
.tp-idx b { font-weight: 700; font-size: 13px; letter-spacing: 1px; }
.tp-sep { opacity: .35; }
.tp-season {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.tp-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--tp-x, #888);
  box-shadow: 0 0 10px color-mix(in srgb, var(--tp-x, #888) 70%, transparent);
}

/* 中部：节气名 + 时间候 + 意境语 */
.tp-mid {
  margin: auto 0;
  max-width: min(760px, 84%);
  padding: 6px 0;
}
html .term-banner.tp-stage .tb-name,
html .term-banner.tp-stage .tp-name,
html[data-theme="dark"] .term-banner.tp-stage .tb-name,
html[data-theme="dark"] .term-banner.tp-stage .tp-name {
  font-family: var(--serif, "Songti SC", "SimSun", serif);
  font-size: clamp(58px, 9.2vw, 124px);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: clamp(6px, 1.6vw, 20px);
  color: #fbf8f2;
  text-shadow: 0 2px 40px rgba(0, 0, 0, .45), 0 0 90px color-mix(in srgb, var(--tp-g, #fff) 26%, transparent);
  margin: 0;
}
.tp-stage[data-lum="light"] .tb-name {
  color: #1c1a16;
  text-shadow: 0 2px 30px rgba(255, 255, 255, .55);
}
.tp-rule {
  width: 58px; height: 1px;
  margin: 18px 0 14px;
  background: linear-gradient(90deg, var(--tp-x, #fff), transparent);
  opacity: .9;
}
.tp-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  letter-spacing: 2.4px;
  color: rgba(251, 248, 242, .82);
}
.tp-stage[data-lum="light"] .tp-meta { color: rgba(34, 32, 27, .8); }
.tp-hou {
  padding: 4px 12px;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 99px;
  background: rgba(255, 255, 255, .08);
  font-family: var(--serif, serif);
  letter-spacing: 3px;
}
.tp-stage[data-lum="light"] .tp-hou {
  border-color: rgba(34, 32, 27, .28);
  background: rgba(255, 255, 255, .42);
}
.tp-time { opacity: .78; }
.tp-line {
  margin: 22px 0 0;
  font-family: var(--serif, serif);
  font-size: clamp(16px, 1.7vw, 23px);
  line-height: 1.9;
  letter-spacing: 5px;
  color: rgba(251, 248, 242, .93);
}
.tp-stage[data-lum="light"] .tp-line { color: rgba(28, 26, 21, .88); }

/* 竖排题签：东方气质，纯装饰 */
.tp-vert {
  position: absolute;
  right: clamp(14px, 3vw, 46px);
  top: clamp(22px, 4vw, 58px);
  z-index: 3;
  writing-mode: vertical-rl;
  font-family: var(--serif, serif);
  font-size: 12.5px;
  letter-spacing: 7px;
  color: rgba(251, 248, 242, .5);
  pointer-events: none;
  user-select: none;
}
.tp-stage[data-lum="light"] .tp-vert { color: rgba(28, 26, 21, .5); }

/* 底部：倒计时 / 体系链路 / 节气刻度 / 进入 */
.tp-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.tp-left, .tp-right { display: flex; flex-direction: column; gap: 10px; }
.tp-right { align-items: flex-end; }

/* 倒计时（弱化，保留实时感） */
html .term-banner.tp-stage .tb-count {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-variant-numeric: tabular-nums;
  opacity: .6;
  font-size: 11.5px;
  letter-spacing: 2px;
}
.tp-stage .cd-label { font-size: 11.5px; letter-spacing: 2px; margin-right: 2px; }
.tp-stage .cd-num {
  font-size: 15px;
  font-weight: 600;
  color: inherit;
  min-width: 1.2em;
  text-align: center;
}
.tp-stage .cd-seg i { font-size: 10.5px; }
.tp-stage .cd-sep { font-size: 13px; }

/* 体系链路：节气 → 色彩 → 精油 → 五行 → 经络 → 疗愈 */
.tp-chain {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 12px;
  font-size: 10.5px;
  letter-spacing: 3px;
  opacity: .5;
}
.tp-chain span { position: relative; }
.tp-chain span::after {
  content: '';
  position: absolute;
  left: 100%;
  top: 50%;
  width: 8px; height: 1px;
  margin-left: 1px;
  background: currentColor;
  opacity: .5;
}
.tp-chain span:last-child::after { display: none; }
.tp-chain::before {
  content: '';
  position: absolute;
  left: -6px; right: -6px; top: 2px;
  height: 1px;
  background: linear-gradient(90deg, transparent, currentColor 12%, currentColor 88%, transparent);
  opacity: .22;
}
.tp-chain::after {   /* 沿链路行走的光点：暗示「节气之境 → 色彩精油世界」 */
  content: '';
  position: absolute;
  left: -6px; top: 0;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--tp-x, #fff);
  box-shadow: 0 0 10px var(--tp-x, #fff);
  animation: tpChainRun 7.5s linear infinite;
}
@keyframes tpChainRun {
  0%   { transform: translateX(0);    opacity: 0; }
  8%   { opacity: .95; }
  92%  { opacity: .95; }
  100% { transform: translateX(var(--tp-chain-w, 190px)); opacity: 0; }
}

/* 24 节气刻度（可点选跳转） */
.tp-ticks {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 16px;
}
.tp-tick {
  width: 3px;
  height: 6px;
  border-radius: 2px;
  background: currentColor;
  opacity: .3;
  cursor: pointer;
  transition: height .35s cubic-bezier(.22,.8,.3,1), opacity .35s, background .35s;
}
.tp-tick:hover { opacity: .75; height: 12px; }
.tp-tick.on {
  height: 16px;
  opacity: 1;
  background: var(--tp-x, #fff);
  box-shadow: 0 0 10px color-mix(in srgb, var(--tp-x, #fff) 70%, transparent);
}

/* 进入按钮（弱化但可点） */
html .term-banner.tp-stage .tb-go,
html[data-theme="dark"] .term-banner.tp-stage .tb-go {
  font-size: 12.5px;
  letter-spacing: 3px;
  padding: 8px 18px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, .34);
  background: rgba(255, 255, 255, .1);
  color: inherit;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background .25s, border-color .25s;
}
.tp-stage[data-lum="light"] .tb-go {
  border-color: rgba(28, 26, 21, .3);
  background: rgba(255, 255, 255, .48);
}
html .term-banner.tp-stage:hover .tb-go {
  background: rgba(255, 255, 255, .2);
  border-color: rgba(255, 255, 255, .6);
}
.tp-stage[data-lum="light"]:hover .tb-go { background: rgba(255, 255, 255, .72); }

/* ── 文案转场：柔进出场，配合画面电影感切换 ── */
.tp-copy.is-out { opacity: 0; transform: translateY(-10px); transition: opacity .42s ease, transform .42s ease; }
.tp-copy.is-in  { animation: tpRise .9s cubic-bezier(.2, .8, .25, 1) both; }
@keyframes tpRise {
  from { opacity: 0; transform: translateY(14px); filter: blur(3px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}

/* ── 自适应 ── */
@media (max-width: 1024px) {
  .tp-mid { max-width: 88%; }
  .tp-vert { display: none; }
}
@media (max-width: 720px) {
  html .term-banner.tp-stage,
  html[data-theme="dark"] .term-banner.tp-stage {
    min-height: clamp(480px, calc(100svh - var(--nav-h) - 26px), 760px);
    padding: 20px 16px 18px;
  }
  .tp-mid { max-width: 100%; }
  .tp-top { font-size: 10.5px; letter-spacing: 2px; gap: 10px; }
  .tp-line { margin-top: 16px; letter-spacing: 3px; }
  .tp-bottom { gap: 10px; }
  .tp-chain { display: none; }          /* 窄屏优先保证不堆字 */
  .tp-ticks { gap: 2px; }
  .tp-tick { width: 2px; }
  html .term-banner.tp-stage .tb-go { padding: 7px 13px; letter-spacing: 2px; }
}

/* ── 无障碍与打印 ── */
@media (prefers-reduced-motion: reduce) {
  .tp-chain::after { animation: none; opacity: .8; left: 40%; }
  .tp-copy.is-in { animation: none; }
  .tp-copy.is-out { transition: none; }
  .tp-tick { transition: none; }
}
@media print {
  .tp-canvas, .tp-frame, .tp-ticks, .tp-chain { display: none !important; }
}
