/* 情绪旅程 · MOOD JOURNEY — 方案 C「编辑排版」：左文右盘（移动端盘上文下） */

/* ——— 皮肤变量：每套皮肤改变「房间的光线」 ——— */
body.skin-abyss {
  --field: #05070d;
  --ink: rgba(238, 242, 248, 0.92);
  --ink-dim: rgba(238, 242, 248, 0.45);
  --ink-faint: rgba(238, 242, 248, 0.22);
  --line: rgba(255, 255, 255, 0.10);
  --panel: rgba(6, 9, 16, 0.55);
  --panel-strong: rgba(6, 9, 16, 0.72);
  --chip-bg: rgba(255, 255, 255, 0.04);
  --chip-bg-hover: rgba(255, 255, 255, 0.08);
  --btn-bg: rgba(255, 255, 255, 0.10);
  --btn-bg-hover: rgba(255, 255, 255, 0.20);
  --accent: rgba(150, 140, 255, 0.5);
  --stroke-ink: rgba(238, 242, 248, 0.55);
}
body.skin-dusk {
  --field: #170c07;
  --ink: rgba(250, 240, 230, 0.92);
  --ink-dim: rgba(250, 240, 230, 0.45);
  --ink-faint: rgba(250, 240, 230, 0.22);
  --line: rgba(255, 235, 220, 0.12);
  --panel: rgba(24, 12, 6, 0.55);
  --panel-strong: rgba(24, 12, 6, 0.72);
  --chip-bg: rgba(255, 235, 220, 0.05);
  --chip-bg-hover: rgba(255, 235, 220, 0.10);
  --btn-bg: rgba(255, 235, 220, 0.10);
  --btn-bg-hover: rgba(255, 235, 220, 0.20);
  --accent: rgba(255, 190, 140, 0.5);
  --stroke-ink: rgba(250, 240, 230, 0.55);
}
body.skin-moss {
  --field: #07110b;
  --ink: rgba(236, 246, 238, 0.92);
  --ink-dim: rgba(236, 246, 238, 0.45);
  --ink-faint: rgba(236, 246, 238, 0.22);
  --line: rgba(225, 255, 235, 0.10);
  --panel: rgba(6, 18, 11, 0.55);
  --panel-strong: rgba(6, 18, 11, 0.72);
  --chip-bg: rgba(225, 255, 235, 0.04);
  --chip-bg-hover: rgba(225, 255, 235, 0.09);
  --btn-bg: rgba(225, 255, 235, 0.10);
  --btn-bg-hover: rgba(225, 255, 235, 0.20);
  --accent: rgba(150, 230, 180, 0.5);
  --stroke-ink: rgba(236, 246, 238, 0.55);
}
body.skin-mist {
  --field: #100a18;
  --ink: rgba(242, 238, 250, 0.92);
  --ink-dim: rgba(242, 238, 250, 0.45);
  --ink-faint: rgba(242, 238, 250, 0.22);
  --line: rgba(240, 230, 255, 0.10);
  --panel: rgba(16, 10, 24, 0.55);
  --panel-strong: rgba(16, 10, 24, 0.72);
  --chip-bg: rgba(240, 230, 255, 0.05);
  --chip-bg-hover: rgba(240, 230, 255, 0.09);
  --btn-bg: rgba(240, 230, 255, 0.10);
  --btn-bg-hover: rgba(240, 230, 255, 0.20);
  --accent: rgba(190, 150, 255, 0.5);
  --stroke-ink: rgba(242, 238, 250, 0.55);
}
body.skin-paper {
  --field: #f3f0ea;
  --ink: rgba(26, 30, 40, 0.92);
  --ink-dim: rgba(26, 30, 40, 0.52);
  --ink-faint: rgba(26, 30, 40, 0.32);
  --line: rgba(26, 30, 40, 0.14);
  --panel: rgba(255, 255, 255, 0.62);
  --panel-strong: rgba(255, 255, 255, 0.82);
  --chip-bg: rgba(26, 30, 40, 0.04);
  --chip-bg-hover: rgba(26, 30, 40, 0.08);
  --btn-bg: rgba(26, 30, 40, 0.08);
  --btn-bg-hover: rgba(26, 30, 40, 0.16);
  --accent: rgba(90, 100, 200, 0.45);
  --stroke-ink: rgba(26, 30, 40, 0.5);
}

:root {
  --serif: "Songti SC", "Noto Serif SC", "STSong", "SimSun", serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, monospace;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body {
  background: var(--field);
  color: var(--ink);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  transition: background 1.2s ease;
}
.serif { font-family: var(--serif); }
.hidden { display: none !important; }

/* ——— 画布 ——— */
#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

/* ——— 盘面四极 · 竖排象限标注（位置由 main.js 逐帧写入） ——— */
#poles { position: fixed; inset: 0; z-index: 4; pointer-events: none; }
.pole {
  position: absolute; font-family: var(--serif); font-size: 13px;
  letter-spacing: 0.5em; color: var(--ink-dim);
  writing-mode: vertical-rl; white-space: nowrap;
}

/* ——— 品牌 ——— */
#brand {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 24px; pointer-events: none;
}
.brand-name { font-size: 13px; letter-spacing: 0.42em; font-weight: 400; }
.brand-sub  { font-size: 11px; letter-spacing: 0.3em; color: var(--ink-faint); margin-left: 14px; }
.brand-right { display: flex; gap: 14px; align-items: center; font-family: var(--mono); font-size: 10px; color: var(--ink-dim); letter-spacing: 0.15em; pointer-events: auto; }
#quality-badge { padding: 3px 8px; border: 1px solid var(--line); border-radius: 99px; }
#audio-badge { padding: 3px 8px; border: 1px solid var(--line); border-radius: 99px; }
#audio-badge.badge-ok   { color: #9fd8c9; border-color: rgba(127, 184, 169, 0.5); }
#audio-badge.badge-warn { color: #e0b07a; border-color: rgba(190, 150, 100, 0.5); }
#audio-badge.badge-err  { color: #e07a7a; border-color: rgba(190, 100, 100, 0.55); }

/* 皮肤圆点 */
#skin-dots { display: flex; gap: 7px; pointer-events: auto; }
#skin-dots button {
  width: 14px; height: 14px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--dot);
  cursor: pointer; padding: 0; opacity: 0.55;
  transition: opacity .3s, transform .3s, box-shadow .3s;
}
#skin-dots button:hover { opacity: 1; transform: scale(1.15); }
#skin-dots button.active { opacity: 1; box-shadow: 0 0 0 2px var(--line), 0 0 8px var(--ink-faint); }

/* ——— 左侧竖排装饰 ——— */
#rail {
  position: fixed; left: 26px; top: 50%; transform: translateY(-50%);
  writing-mode: vertical-rl; font-size: 13px; letter-spacing: 0.6em;
  color: var(--ink-faint); z-index: 5; pointer-events: none;
}

/* ——— 覆盖层（编辑排版：左侧排版列） ——— */
.overlay {
  position: fixed; inset: 0; z-index: 8;
  pointer-events: none; /* 让盘面拖拽穿透覆盖层 */
  animation: fadein 1.2s ease both;
}
.overlay button, .overlay input, .help-box { pointer-events: auto; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.ed-col {
  position: absolute; left: 9vw; top: 50%; transform: translateY(-50%);
  width: min(560px, 44vw);
  display: flex; flex-direction: column; align-items: flex-start;
  text-align: left;
}
.kicker {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.36em;
  color: var(--ink-dim);
}

/* ——— 入口屏 ——— */
.entry-title {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(52px, 6.8vw, 104px); line-height: 1.18; letter-spacing: 0.06em;
  margin: 22px 0 26px;
}
/* 实空心混排：「你在哪里？」描边空心字 */
.entry-title em {
  font-style: normal; color: transparent;
  -webkit-text-stroke: 1px var(--stroke-ink);
}
.entry-copy {
  max-width: 400px; color: var(--ink-dim); font-size: 14.5px; line-height: 2.1;
  letter-spacing: 0.04em; margin-bottom: 38px;
  border-left: 1px solid var(--line); padding-left: 18px;
}
.input-pill {
  display: flex; align-items: center; gap: 8px;
  width: min(460px, 100%); height: 56px; padding: 0 10px 0 24px;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(10, 14, 24, 0.28); margin-bottom: 16px;
  transition: border-color 0.4s;
}
body.skin-paper .input-pill { background: rgba(255, 255, 255, 0.4); }
.input-pill:focus-within { border-color: var(--accent); }
.input-pill input {
  flex: 1; background: none; border: none; outline: none; color: var(--ink);
  font-size: 14.5px; font-weight: 300; letter-spacing: 0.06em; min-width: 0;
}
.input-pill input::placeholder { color: var(--ink-faint); }
.input-pill .go {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--chip-bg);
  color: var(--ink); font-size: 15px; cursor: pointer; transition: all 0.3s;
}
.input-pill .go:hover { border-color: var(--accent); background: var(--chip-bg-hover); }
.chips { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.chips button {
  padding: 8px 18px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--chip-bg); color: var(--ink-dim);
  font-size: 13px; letter-spacing: 0.06em; cursor: pointer; transition: 0.25s;
  font-weight: 300;
}
.chips button:hover { color: var(--ink); border-color: var(--accent); }
.chips.presets button { border-style: dashed; font-size: 12px; }
.entry-hint { font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; color: var(--ink-faint); margin-top: 8px; }
#entry-no {
  position: fixed; right: 34px; bottom: 26px; z-index: 5;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.3em; color: var(--ink-faint);
  pointer-events: none;
}

/* 通用实心按钮（帮助关闭等） */
.btn-solid {
  background: var(--btn-bg); border: 1px solid var(--line);
  color: var(--ink); border-radius: 99px; padding: 13px 26px;
  font-size: 13px; letter-spacing: 0.3em; cursor: pointer;
  transition: background .4s, border-color .4s; font-weight: 300;
}
.btn-solid:hover { background: var(--btn-bg-hover); }

/* ——— 双终点分歧 ——— */
.fork-lead {
  font-size: clamp(28px, 3.4vw, 44px); letter-spacing: 0.14em;
  line-height: 1.5; margin: 22px 0 40px; font-weight: 400;
}
.fork-cards { display: flex; gap: 22px; flex-wrap: wrap; }
.fork-card {
  width: min(280px, 80vw); padding: 30px 26px; text-align: left;
  background: var(--chip-bg); border: 1px solid var(--line);
  border-radius: 18px; cursor: pointer; color: var(--ink);
  transition: transform .5s cubic-bezier(.2,.8,.2,1), border-color .5s, background .5s;
  font-weight: 300;
}
.fork-card:hover { transform: translateY(-6px); border-color: var(--accent); background: var(--chip-bg-hover); }
.fork-card .fc-name { font-family: var(--serif); font-size: 20px; letter-spacing: 0.2em; display: block; margin-bottom: 10px; }
.fork-card .fc-desc { font-size: 12px; line-height: 1.9; color: var(--ink-dim); letter-spacing: 0.08em; display: block; }
.fork-card .fc-coord { font-family: var(--mono); font-size: 10px; color: var(--ink-faint); display: block; margin-top: 14px; letter-spacing: 0.12em; }

/* ——— 旅程态排版区 ——— */
.j-mood {
  font-family: var(--serif); font-weight: 600; line-height: 1.25;
  font-size: clamp(46px, 5.6vw, 88px); letter-spacing: 0.08em; margin: 20px 0 6px;
}
.j-mood .from { display: block; }
.j-mood .arrow {
  display: block; font-size: 0.42em; color: var(--ink-dim);
  margin: 6px 0 6px 0.18em; font-family: var(--mono); letter-spacing: 0;
}
.j-mood .to { display: block; } /* 颜色由 main.js 按终点情绪色写入 */
.j-coords {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.14em;
  color: var(--ink-dim); line-height: 2.1; margin-top: 22px;
}
.j-coords em { font-style: normal; color: var(--ink); }
.j-progress {
  margin-top: 30px; width: min(320px, 80%); height: 1px;
  background: var(--line); position: relative;
}
.j-progress i {
  position: absolute; left: 0; top: -1px; height: 3px; width: 0;
  background: linear-gradient(90deg, #5b8cff, #a06bff);
  transition: width 0.6s linear;
}
body.skin-paper .j-progress i { background: linear-gradient(90deg, #3a55c8, #7a4fd0); }
.j-progress .t {
  position: absolute; top: 10px; left: 0; font-family: var(--mono);
  font-size: 10px; letter-spacing: 0.16em; color: var(--ink-faint); white-space: nowrap;
}
.j-ctrl { display: flex; gap: 14px; margin-top: 56px; align-items: center; }
.cbtn {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--chip-bg); color: var(--ink); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: 0.25s;
}
.cbtn:hover { border-color: var(--accent); }
.cbtn.play { width: 50px; height: 50px; border-color: var(--ink-dim); }
#journey-controls { display: flex; gap: 12px; margin-top: 26px; }
#journey-controls button {
  background: transparent; border: 1px solid var(--line); color: var(--ink-dim);
  border-radius: 99px; padding: 8px 20px; font-size: 12px; letter-spacing: 0.25em;
  text-indent: 0.25em; cursor: pointer; transition: all 0.4s; font-weight: 300;
}
#journey-controls button:hover { color: var(--ink); border-color: var(--ink-dim); }

/* ——— HUD ——— */
#hud {
  position: fixed; right: 20px; top: 64px; z-index: 5;
  width: 218px; padding: 14px 16px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.hud-title { font-family: var(--mono); font-size: 9px; letter-spacing: 0.3em; color: var(--ink-faint); margin-bottom: 10px; }
.hud-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 11px; }
.hud-grid span { color: var(--ink-dim); letter-spacing: 0.1em; }
.hud-grid b { font-family: var(--mono); font-weight: 400; text-align: right; letter-spacing: 0.05em; }

/* ——— 调参台 ——— */
#params {
  position: fixed; right: 20px; top: 64px; bottom: 20px; z-index: 7;
  width: 264px; padding: 14px 16px; overflow-y: auto;
  background: var(--panel-strong); border: 1px solid var(--line);
  border-radius: 14px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
#params::-webkit-scrollbar { width: 4px; }
#params::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.params-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.params-head span { font-family: var(--mono); font-size: 9px; letter-spacing: 0.3em; color: var(--ink-faint); }
.params-head button { background: none; border: 1px solid var(--line); color: var(--ink-dim); border-radius: 6px; font-size: 9px; font-family: var(--mono); padding: 3px 8px; cursor: pointer; letter-spacing: 0.15em; }
.param-group { font-size: 10px; letter-spacing: 0.3em; color: var(--ink-faint); margin: 16px 0 8px; }
.param-row { margin-bottom: 10px; }
.param-row label { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-dim); margin-bottom: 4px; letter-spacing: 0.06em; }
.param-row label output { font-family: var(--mono); color: var(--ink); }
.param-row input[type=range] { width: 100%; accent-color: #8fb8d8; height: 14px; cursor: pointer; background: transparent; }

/* ——— 帮助 ——— */
#help { z-index: 12; display: flex; align-items: center; justify-content: center; }
.help-box {
  background: var(--panel-strong); border: 1px solid var(--line);
  border-radius: 18px; padding: 34px 38px; max-width: 420px; width: 92vw;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); text-align: left;
}
.help-box h2 { font-size: 18px; letter-spacing: 0.3em; margin-bottom: 18px; font-weight: 300; }
.help-box table { width: 100%; border-collapse: collapse; font-size: 12px; }
.help-box td { padding: 6px 0; color: var(--ink-dim); letter-spacing: 0.08em; }
.help-box td:first-child { font-family: var(--mono); color: var(--ink); width: 84px; }
.help-foot { margin: 16px 0; font-size: 11px; color: var(--ink-faint); letter-spacing: 0.1em; }

/* ——— 声音引导 ——— */
#audio-gate { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 9; }
#audio-gate-btn {
  background: var(--btn-bg); border: 1px solid var(--line);
  color: var(--ink); border-radius: 99px; padding: 11px 30px; font-size: 12px;
  letter-spacing: 0.35em; cursor: pointer; font-weight: 300;
  animation: gatePulse 3s ease-in-out infinite;
}
@keyframes gatePulse { 0%,100% { box-shadow: 0 0 0 0 var(--line);} 50% { box-shadow: 0 0 0 12px transparent;} }

/* ——— 过渡纱幕（LLM 推断 / 选歌期间）———
   唱片缓动变暗 + 宋体小字慢呼吸；不打转圈、不弹错。 */
#veil {
  position: fixed; inset: 0; z-index: 7;
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 20vh;
  background: rgba(4, 6, 11, 0.42);
  opacity: 0; pointer-events: none;
  transition: opacity 1.6s ease;
}
#veil.show { opacity: 1; }
#veil-text {
  font-size: 15px; letter-spacing: 0.5em; text-indent: 0.5em;
  color: var(--ink-dim); font-weight: 300;
  animation: veilBreath 3.6s ease-in-out infinite;
}
@keyframes veilBreath { 0%, 100% { opacity: 0.35; } 50% { opacity: 0.95; } }

/* ——— 吐司 ——— */
#toast {
  position: fixed; top: 72px; left: 50%; transform: translateX(-50%) translateY(-8px);
  z-index: 10; padding: 9px 22px; border-radius: 99px;
  background: var(--panel-strong); border: 1px solid var(--line);
  font-size: 12px; letter-spacing: 0.2em; color: var(--ink);
  opacity: 0; pointer-events: none; transition: opacity .5s, transform .5s;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ——— 移动端（≤720px）：盘上文下 ——— */
@media (max-width: 720px) {
  #hud { right: 12px; top: 58px; width: 178px; padding: 10px 12px; }
  .hud-grid { font-size: 10px; gap: 4px 8px; }
  #params { right: 12px; left: 12px; top: 58px; bottom: 178px; width: auto; }
  #brand { padding: 14px 16px; }
  .brand-sub { display: none; }
  #rail, #entry-no { display: none; }
  .pole { font-size: 10px; letter-spacing: 0.35em; }

  .ed-col {
    left: 24px; right: 24px; width: auto;
    top: auto; bottom: 32px; transform: none;
  }
  .entry-title { font-size: clamp(40px, 12vw, 60px); margin: 14px 0 16px; }
  .entry-copy { font-size: 13px; margin-bottom: 22px; max-width: none; }
  .input-pill { height: 50px; margin-bottom: 12px; }
  .chips { gap: 8px; margin-bottom: 10px; }
  .chips button { padding: 7px 14px; font-size: 12px; }
  .chips.presets { display: none; } /* 移动端降噪：只留情绪 chips */
  .entry-hint { display: none; }

  .fork-lead { font-size: clamp(24px, 7vw, 32px); margin: 16px 0 26px; }
  .fork-cards { gap: 14px; }
  .fork-card { width: 100%; padding: 20px 22px; }

  /* 旅程态：排版区贴底，盘面在上方（投影器 cy≈0.34H） */
  .j-mood { font-size: clamp(34px, 9.5vw, 48px); margin: 12px 0 4px; }
  .j-mood .arrow { margin: 2px 0 2px 0.1em; }
  .j-coords { margin-top: 12px; font-size: 10.5px; }
  .j-progress { margin-top: 18px; width: 100%; }
  .j-ctrl { margin-top: 40px; }
  #journey-controls { margin-top: 16px; }
}
