/* =============================================================================
 *  Lyra · WELCOME 屏样式（未登录落地页）—— 夜空星图叙事,滚动式移动端落地页
 *  -----------------------------------------------------------------------------
 *  设计:深色 Nocturne 基底(star field + 星云由 .phone 透出,本屏再叠强化星点)。
 *  金 accent + Cormorant 衬线大标题 + Geist 正文。禁紫/emoji作UI/三列圆形网格/全居中。
 *  正文 ≥16px;CTA 触控 ≥50px;安全区留白。文案走 DESIGN §6 人话铁律(无内部术语)。
 * ========================================================================== */
.screen[data-screen="welcome"] { height: 100%; }

/* 屏内滚动容器（星云底透出 .phone；本层透明） */
.wel-scroll {
  flex: 1; min-height: 0;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
}
.wel-scroll::-webkit-scrollbar { width: 0; height: 0; }

/* —— 叠加星点层（幂律:少数亮星 + 长尾暗星;仅亮度 twinkle 不移位,遵 §4 精神） —— */
.wel-stars { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.wel-stars i {
  position: absolute; border-radius: 50%;
  background: var(--ink);
  animation: welTwinkle var(--tw, 4s) ease-in-out infinite;
  animation-delay: var(--dl, 0s);
}
@keyframes welTwinkle { 0%,100% { opacity: var(--o0, .25); } 50% { opacity: var(--o1, .7); } }
@media (prefers-reduced-motion: reduce) { .wel-stars i { animation: none; } }

/* 所有真实内容浮在星点之上 */
.wel-inner { position: relative; z-index: 1; }

/* ===================================================================== HERO */
.wel-hero {
  min-height: calc(100% - 0px);
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(38px + env(safe-area-inset-top)) 26px 30px;
  text-align: left;
  box-sizing: border-box;
}
.wel-brandrow { display: flex; align-items: center; gap: 11px; margin-bottom: 30px; }
.wel-mark { border-radius: 13px; display: block; box-shadow: 0 6px 20px -8px rgba(0,0,0,.6); }
.wel-brandname {
  font-family: var(--display); font-size: 23px; font-weight: 600; letter-spacing: .04em;
  color: var(--ink);
}
.wel-eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--ui); font-size: 11.5px; font-weight: 600;
  letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.wel-eyebrow::before {
  content: ""; width: 18px; height: 1px; background: var(--accent); opacity: .7;
}
.wel-h1 {
  font-family: var(--display);
  font-size: clamp(38px, 12vw, 50px);
  line-height: 1.04; font-weight: 600; letter-spacing: .005em;
  color: var(--ink);
  margin: 0 0 18px;
}
.wel-h1 em {
  font-style: italic; color: var(--accent);
  /* 衬线斜体 + 金,叙事重音 */
}
.wel-lede {
  font-family: var(--ui);
  font-size: 17px; line-height: 1.6; color: var(--ink-muted);
  max-width: 32ch; margin: 0 0 30px;
}
.wel-cta-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  align-self: flex-start;
  min-height: 52px; padding: 0 26px;
  font-family: var(--ui); font-size: 16px; font-weight: 600;
  color: var(--primary-ink);
  background: linear-gradient(180deg, var(--amber-top) 0%, var(--accent) 100%);
  border-radius: 999px;
  box-shadow: 0 12px 30px -12px color-mix(in srgb, var(--accent) 60%, transparent);
  transition: transform .14s ease, box-shadow .2s ease, opacity .16s ease;
}
.wel-cta-primary:hover { transform: translateY(-1px); box-shadow: 0 16px 36px -12px color-mix(in srgb, var(--accent) 66%, transparent); }
.wel-cta-primary:active { transform: translateY(0) scale(.985); }
.wel-cta-primary svg { width: 17px; height: 17px; }

.wel-scrollcue {
  margin-top: 34px; display: flex; align-items: center; gap: 9px;
  font-family: var(--ui); font-size: 12.5px; color: var(--ink-subtle);
}
.wel-scrollcue svg { width: 15px; height: 15px; color: var(--accent); animation: welBob 1.8s ease-in-out infinite; }
@keyframes welBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(3px); } }
@media (prefers-reduced-motion: reduce) { .wel-scrollcue svg { animation: none; } }

/* ============================================================ 通用 section */
.wel-sec { padding: 46px 26px; }
.wel-sec + .wel-sec { border-top: 1px solid var(--hairline); }
.wel-kicker {
  font-family: var(--ui); font-size: 11.5px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent);
  margin: 0 0 12px;
}
.wel-h2 {
  font-family: var(--display); font-size: 27px; line-height: 1.18; font-weight: 600;
  color: var(--ink); margin: 0 0 12px; letter-spacing: .01em;
}
.wel-p {
  font-family: var(--ui); font-size: 16px; line-height: 1.62; color: var(--ink-muted);
  margin: 0; max-width: 34ch;
}
.wel-p .jp { font-family: var(--jp); }

/* 入场淡入（welcome.js 用 IntersectionObserver 加 .in） */
.wel-reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s cubic-bezier(.2,.8,.2,1), transform .7s cubic-bezier(.2,.8,.2,1); }
.wel-reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .wel-reveal { opacity: 1; transform: none; } }

/* ============================================= 活的歌词演示卡（产品灵魂） */
.wel-demo {
  margin-top: 22px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-soft);
  padding: 22px 20px 20px;
  position: relative;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.wel-demo-top {
  display: flex; align-items: center; gap: 9px; margin-bottom: 18px;
  font-family: var(--ui); font-size: 12px; color: var(--ink-subtle);
}
.wel-demo-eq { display: inline-flex; align-items: flex-end; gap: 2.5px; height: 14px; }
.wel-demo-eq span {
  width: 3px; background: var(--accent); border-radius: 2px;
  animation: welEq 1.1s ease-in-out infinite;
}
.wel-demo-eq span:nth-child(1) { height: 6px;  animation-delay: 0s; }
.wel-demo-eq span:nth-child(2) { height: 13px; animation-delay: .18s; }
.wel-demo-eq span:nth-child(3) { height: 9px;  animation-delay: .36s; }
.wel-demo-eq span:nth-child(4) { height: 14px; animation-delay: .54s; }
@keyframes welEq { 0%,100% { transform: scaleY(.45); } 50% { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .wel-demo-eq span { animation: none; } }

/* 歌词行:逐字 ruby,当前 token 高亮 */
.wel-lyric {
  font-family: var(--jp);
  font-size: 26px; line-height: 2.35; color: var(--ink-muted);
  letter-spacing: .01em; word-break: keep-all;
}
.wel-tok {
  position: relative; cursor: default;
  transition: color .28s ease;
  padding: 0 .5px;
}
.wel-tok ruby rt {
  font-size: .42em; color: var(--ink-subtle); font-weight: 500;
  transition: color .28s ease; letter-spacing: 0;
}
/* 卡拉OK 当前高亮 */
.wel-tok.lit { color: var(--ink); }
.wel-tok.lit ruby rt { color: var(--accent); }
.wel-tok.done { color: color-mix(in srgb, var(--ink) 80%, transparent); }
/* 可点词（会いたい）:金色虚下划,脉冲提示 */
.wel-tok.clickable { cursor: pointer; color: var(--ink); }
.wel-tok.clickable > ruby {
  border-bottom: 1.5px dashed color-mix(in srgb, var(--accent) 70%, transparent);
  padding-bottom: 1px;
}
.wel-tok.clickable.pulse::after {
  content: ""; position: absolute; inset: -3px -4px;
  border-radius: 8px; pointer-events: none;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent);
  animation: welPulse 2.2s ease-out infinite;
}
@keyframes welPulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 40%, transparent); }
  70%,100% { box-shadow: 0 0 0 10px transparent; }
}
@media (prefers-reduced-motion: reduce) { .wel-tok.clickable.pulse::after { animation: none; } }

/* 点词释义气泡 */
.wel-gloss {
  margin-top: 16px;
  border: 1px solid var(--hairline-strong);
  background: var(--surface-2);
  border-radius: var(--rad-lg);
  padding: 0 15px;
  max-height: 0; opacity: 0; overflow: hidden;
  transition: max-height .4s cubic-bezier(.2,.8,.2,1), opacity .3s ease, padding .4s ease, margin-top .4s ease;
}
.wel-gloss.show { max-height: 160px; opacity: 1; padding: 14px 15px; }
.wel-gloss-hd { display: flex; align-items: baseline; gap: 10px; }
.wel-gloss-word { font-family: var(--jp); font-size: 20px; color: var(--ink); font-weight: 600; }
.wel-gloss-read { font-family: var(--jp); font-size: 13px; color: var(--accent); }
.wel-gloss-def { font-family: var(--ui); font-size: 15px; color: var(--ink-muted); margin-top: 7px; line-height: 1.5; }
.wel-gloss-relisten {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 12px;
  font-family: var(--ui); font-size: 13px; font-weight: 600; color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-radius: 999px; padding: 7px 13px; cursor: pointer;
  transition: background .16s ease;
}
.wel-gloss-relisten:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.wel-gloss-relisten svg { width: 13px; height: 13px; }
.wel-demo-hint {
  margin: 15px 2px 0; font-family: var(--ui); font-size: 12.5px; color: var(--ink-subtle);
  line-height: 1.5;
}

/* =========================================================== 三步叙事 */
.wel-steps { margin-top: 20px; display: flex; flex-direction: column; gap: 0; }
.wel-step {
  display: grid; grid-template-columns: 34px 1fr; gap: 15px;
  padding: 17px 0;
}
.wel-step + .wel-step { border-top: 1px solid var(--hairline); }
.wel-step-n {
  font-family: var(--display); font-style: italic; font-size: 26px;
  color: var(--accent); line-height: 1; padding-top: 2px;
}
.wel-step-t { font-family: var(--ui); font-size: 16.5px; font-weight: 600; color: var(--ink); margin: 0 0 4px; }
.wel-step-d { font-family: var(--ui); font-size: 14.5px; line-height: 1.55; color: var(--ink-muted); margin: 0; }
.wel-step-d .jp { font-family: var(--jp); color: var(--ink); }

/* ====================================================== 星座预览 */
.wel-constel { margin-top: 8px; display: flex; justify-content: center; padding: 6px 0 2px; }
.wel-constel svg { width: 100%; max-width: 300px; height: auto; overflow: visible; }
.wel-cst-line { stroke: var(--fig-line-anchor); stroke-width: 1; fill: none; stroke-linecap: round; }
.wel-cst-star { fill: var(--ink); }
.wel-cst-star.anchor { fill: var(--accent); }
.wel-cst-glow { fill: var(--accent); opacity: .18; }
.wel-cst-draw { stroke-dasharray: 1; stroke-dashoffset: 1; }
.wel-constel.in .wel-cst-draw { animation: welDraw 1.1s ease .2s forwards; }
@keyframes welDraw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .wel-cst-draw { stroke-dashoffset: 0; } }

/* ================================================= 泛化进度视觉 */
.wel-meter { margin-top: 20px; }
.wel-meter-row {
  display: flex; align-items: baseline; justify-content: space-between;
  font-family: var(--ui); font-size: 13px; color: var(--ink-muted); margin-bottom: 9px;
}
.wel-meter-num {
  font-family: var(--display); font-style: italic; font-size: 34px; color: var(--accent);
  line-height: 1;
}
.wel-meter-track {
  height: 8px; border-radius: 999px;
  background: var(--fill-line); overflow: hidden;
}
.wel-meter-fill {
  height: 100%; width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--s-learn), var(--accent));
  transition: width 1.3s cubic-bezier(.2,.8,.2,1);
}
.wel-meter.in .wel-meter-fill { width: var(--pct, 88%); }
.wel-meter-cap { margin-top: 11px; font-family: var(--ui); font-size: 13px; color: var(--ink-subtle); line-height: 1.5; }

/* ==================================================== 底部 CTA */
.wel-final {
  padding: 50px 26px calc(46px + env(safe-area-inset-bottom));
  text-align: center;
  border-top: 1px solid var(--hairline);
}
.wel-final .wel-h2 { margin-left: auto; margin-right: auto; }
.wel-final-sub {
  font-family: var(--ui); font-size: 15px; line-height: 1.6; color: var(--ink-muted);
  margin: 0 auto 26px; max-width: 30ch;
}
.wel-final .wel-cta-primary { align-self: center; margin: 0 auto; }
.wel-login {
  margin-top: 20px; font-family: var(--ui); font-size: 14px; color: var(--ink-subtle);
}
.wel-login button {
  font: inherit; color: var(--accent); font-weight: 600;
  text-underline-offset: 3px; text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.wel-login button:hover { text-decoration-color: var(--accent); }
.wel-note {
  margin-top: 22px; font-family: var(--ui); font-size: 12px; color: var(--ink-subtle);
  line-height: 1.5; opacity: .85;
}

/* =============================================================================
 *  桌面并排营销栏（电脑端友好首屏）—— 仅宽屏(≥960px)显示；手机/窄屏 display:none,
 *  手机端体验完全不变（与手机端页面共存）。右侧手机框即"真机预览"。
 *  welcome.js 注入 <aside class="wel-desktop"> 到 .app-backdrop,并给 body 加 wel-desktop-on。
 * ========================================================================== */
.wel-desktop { display: none; }

@media (min-width: 960px) {
  /* 两栏并排居中：左营销栏 + 右手机框（.app-backdrop 本就是 flex center） */
  body.wel-desktop-on .app-backdrop { gap: 56px; }
  body.wel-desktop-on .phone { flex: 0 0 auto; }        /* 手机框锁定,不被压缩变形 */
  .wel-desktop {
    display: flex;
    flex: 1 1 auto; min-width: 0; max-width: 480px;
    align-self: center;
    max-height: min(900px, calc(100svh - 64px));
    overflow-y: auto; color: var(--ink);
  }
  .wel-desktop::-webkit-scrollbar { width: 0; }
}
/* 更宽屏：给标题更大呼吸 */
@media (min-width: 1280px) { .wel-desktop { max-width: 520px; } }

.wd-inner { display: flex; flex-direction: column; padding: 8px 6px; }
.wd-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.wd-brand .wel-mark { width: 44px; height: 44px; }
.wd-brandname {
  font-family: var(--display); font-size: 26px; font-weight: 600; letter-spacing: .04em; color: var(--ink);
}
.wd-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--ui); font-size: 12px; font-weight: 600; letter-spacing: 1.8px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 18px;
}
.wd-eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--accent); opacity: .7; }
.wd-h1 {
  font-family: var(--display); font-size: clamp(44px, 4.6vw, 60px); line-height: 1.04;
  font-weight: 600; letter-spacing: .005em; color: var(--ink); margin: 0 0 20px;
}
.wd-h1 em { font-style: italic; color: var(--accent); }
.wd-lede {
  font-family: var(--ui); font-size: 18px; line-height: 1.6; color: var(--ink-muted);
  max-width: 42ch; margin: 0 0 26px;
}
.wd-points { list-style: none; margin: 0 0 30px; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.wd-points li {
  position: relative; padding-left: 26px;
  font-family: var(--ui); font-size: 15.5px; line-height: 1.5; color: var(--ink);
}
.wd-points li::before {
  content: ""; position: absolute; left: 4px; top: 7px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 10px 1px color-mix(in srgb, var(--accent) 55%, transparent);
}

/* 「为手机而生」提示条 —— 明确提醒最佳体验在手机端 */
.wd-note {
  display: flex; gap: 14px; align-items: flex-start;
  border: 1px solid var(--hairline-strong);
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  border-radius: var(--r-sm); padding: 16px 18px; margin-bottom: 26px;
}
.wd-note-ic {
  flex: none; width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.wd-note-ic svg { width: 20px; height: 20px; }
.wd-note-tx { display: flex; flex-direction: column; gap: 5px; }
.wd-note-tx strong { font-family: var(--ui); font-size: 15px; font-weight: 700; color: var(--ink); }
.wd-note-tx span { font-family: var(--ui); font-size: 13.5px; line-height: 1.55; color: var(--ink-muted); }
.wd-note-tx b { color: var(--accent); font-weight: 600; }

.wd-continue {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 46px; padding: 0 20px;
  font-family: var(--ui); font-size: 15px; font-weight: 600; color: var(--ink);
  background: var(--fill-soft); border: 1px solid var(--hairline-strong);
  border-radius: 999px; cursor: pointer;
  transition: background .16s ease, border-color .16s ease;
}
.wd-continue:hover { background: var(--fill-hover); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.wd-continue svg { width: 15px; height: 15px; color: var(--accent); }
