/* 数命SPU 武汉城市 AI 接待员 · 首页样式（/、/preview/ui*）
   只服务 web/ui-preview.html；/legacy 旧首页仍使用 /style.css。

   图层（从下到上，数字即 z-index，改顺序只改这里）：
  第 1 层  0   .stage-bg      武汉全图底图
  第 2 层  4   .pool          小 SPU 的家（水池，不显示）
           5   .landmark      景点图层：景点小图和圆点
           9   .flyer         仙鹤（在景点之上，在云之下）
          12   .occluder      遮挡图层（当前隐藏）
          13   .cloud         云（在所有景点和仙鹤之上）
  第 3 层 14   .sky-layer     天色调节：白天黑夜的亮度和颜色。里面是装饰：星星（夜里）、太阳或月亮（沿弧线）、雨雪粒子（.sky-fx，减少动态时全部隐藏）
  第 4 层 20   .spu-pet-layer 数命SPU（宠物，见 spu-pet.css），在舞台最上面
          15   .float-panel   对话面板（不受天色影响）
   要让宠物躲到桥后面：把 .occluder 的 z-index 改成 25（写在下面）。代价：桥会盖住面板里的字。
    35  .voice-dock    语音模式话筒
    40  .topbar        顶栏
    70  .poi-card      景点介绍卡
   景点和遮挡图层的位置用 舞台坐标（百分比，见 ui-preview.html 的 data-at）。
   舞台固定 16:9，铺满屏幕且保持比例，所以图层在任何窗口尺寸下都对齐背景。
   窄屏景点带（<720px）在对话抽屉上沿（页面底部），见下方“窄屏景点带”一节。 */

/* ---------- 设计变量 ---------- */
:root {
  --bg: #eef4f1;
  --surface: #ffffff;
  --surface-2: #f6faf8;
  --ink: #1f3a40;
  --ink-2: #4d6a63;
  --muted: #7b8f87;
  --line: #d5e3dc;
  --line-soft: #e7efeb;
  --brand: #2c6851;
  --brand-hover: #245944;
  --brand-soft: #e2efe8;
  --water: #e3f1f8;
  --water-ink: #2f6f8f;
  --danger: #a23c32;
  --danger-soft: #fbefec;
  --amber: #8a5a14;
  --amber-soft: #fbf3e4;
  --focus: #6fae96;

  --radius-l: 20px;
  --radius-m: 14px;
  --radius-s: 10px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  --text-xs: 12px;
  --text-s: 13px;
  --text-m: 15px;
  --text-l: 17px;
  --text-xl: 24px;
  --topbar-h: 64px;
  --gutter: 24px;
  --panel-w: 420px;
  --panel-alpha: .4;     /* 面板透明度，设置里 30%–50% 可调，ui-shell.js 写入 */
  --sw: max(100vw, calc(100vh * 16 / 9));  /* 舞台宽度：铺满屏幕、保持 16:9 */
  --glass: rgba(255, 255, 255, .74);

  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { overflow: hidden; background: #dfeeee; }
p { margin: 0; line-height: 1.7; }
h1, h2 { margin: 0; }
[hidden] { display: none !important; } /* 保证 hidden 属性压过组件的 display 设置 */

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip {
  position: absolute; left: var(--space-4); top: -48px; z-index: 100;
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-s);
  background: var(--brand); color: #fff; text-decoration: none;
}
.skip:focus { top: var(--space-3); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- 按钮与表单 ---------- */
button, input, select, textarea { font: inherit; color: inherit; }

.btn, .message button, #suggestions button {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1);
  min-height: 40px; padding: 0 var(--space-4);
  border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--surface); color: var(--brand);
  font-size: var(--text-m); cursor: pointer;
}
.btn:hover, .message button:hover, #suggestions button:hover { border-color: #b3cbbf; background: var(--surface-2); }
.btn:disabled, .message button:disabled { opacity: .55; cursor: not-allowed; }
.btn-small, .message button { min-height: 32px; padding: 0 var(--space-3); font-size: var(--text-s); }
.btn-primary { border-color: var(--brand); background: var(--brand); color: #fff; font-weight: 600; }
.btn-primary:hover { border-color: var(--brand-hover); background: var(--brand-hover); }
.btn-primary:disabled { opacity: .6; }
.btn-warn { border-color: #e4cfa9; color: var(--amber); background: var(--amber-soft); }
.btn-warn:hover { background: #f6e9cf; border-color: #d9bd88; }

select, input[type=text], input:not([type]) {
  width: 100%; min-height: 40px; padding: 0 var(--space-3);
  border: 1px solid #c3d6cc; border-radius: var(--radius-s); background: var(--surface);
}
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.check input, fieldset input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0;
  border: 1px solid var(--line); border-radius: var(--radius-s); background: rgba(255, 255, 255, .85);
  color: var(--ink-2); font-size: 18px; line-height: 1; cursor: pointer;
}
.icon-btn:hover { background: var(--surface); color: var(--brand); }

/* ---------- 舞台：全景 + 景点图层 ---------- */
.scene-clip { position: absolute; inset: 0; overflow: hidden; pointer-events: none; } /* 裁掉超出屏幕的舞台；不用 fixed，以免打断图层的前后关系 */
.stage {
  position: absolute; pointer-events: none;
  width: var(--sw); height: calc(var(--sw) * 9 / 16);
  left: calc((100vw - var(--sw)) / 2); top: calc((100vh - var(--sw) * 9 / 16) / 2);
}
.stage-bg {
  position: absolute; inset: 0; z-index: 0;
  background: url("/scene/wuhan-base.webp") center / 100% 100% no-repeat, #e4f1f2;
}
/* 第 3 层：天色。web/ui-scene.js 按 /v2/sky 的昼夜权重写入 --night-a / --dusk-a（透明度）。
   夜色用偏灰蓝、不饱和的颜色，最深只到 0.45，避免整片发黑；傍晚用很淡的暖色。 */
.sky-layer {
  position: absolute; inset: 0; z-index: 14; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(40, 62, 104, var(--night-a, 0)), rgba(22, 34, 62, var(--night-a, 0))),
    linear-gradient(rgba(255, 170, 110, var(--dusk-a, 0)), rgba(255, 170, 110, var(--dusk-a, 0)));
}
/* 夜里和傍晚，水面的横向光纹不再显示（夜里白色光纹会在暗色上变成整片横线） */
/* 天色装饰（第 3 层内，全部 pointer-events none；减少动态时整组隐藏）。
   星星的透明度跟着 --night-a（= 夜色权重 × 0.45，见 ui-scene.js），除以 0.45 就是夜色权重本身：夜里满亮，傍晚淡。 */
.sky-fx { position: absolute; inset: 0; pointer-events: none; }
.sky-stars { position: absolute; inset: 0; opacity: calc(var(--night-a, 0) / .45); }
.sky-stars i {
  position: absolute; aspect-ratio: 1; border-radius: 50%; background: #fff;
  box-shadow: 0 0 5px 2px rgba(235, 242, 255, .55); animation: twinkle 3.6s ease-in-out infinite;
}
.sky-stars i:nth-child(3n) { animation-duration: 2.7s; animation-delay: -1.1s; }
.sky-stars i:nth-child(4n) { animation-duration: 4.4s; animation-delay: -2.3s; }
.sky-stars i:nth-child(5n) { width: 2px !important; }   /* 有的星星更小，不一样大 */
@keyframes twinkle { 0%, 100% { opacity: .3; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.1); } }

/* 太阳或月亮：一个小圆点，位置由 ui-scene.js 按方位角和高度角写入 left/top（舞台百分比）。
   data-body=none 时不画；data-dim=1（有云或有雨雪）时变淡。 */
.sky-body {
  position: absolute; left: 50%; top: 20%; width: 2.4%; aspect-ratio: 1; transform: translate(-50%, -50%);
  opacity: 0; transition: left 1.5s ease, top 1.5s ease, opacity 1.5s ease;
}
.sky-body[data-body=sun] { opacity: .95; }
.sky-body[data-body=moon] { opacity: .9; }
.sky-body[data-dim="1"] { opacity: .65; }
.sky-sun, .sky-moon { position: absolute; inset: 0; border-radius: 50%; display: none; }
.sky-body[data-body=sun] .sky-sun {
  display: block; background: radial-gradient(closest-side, #fff3b0 40%, #ffd24d 70%, rgba(255, 201, 77, 0) 100%);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .55), 0 0 20px 8px rgba(255, 214, 110, .5);
}
/* 月相：被照亮的部分是实心的，没照亮的部分只留一圈淡边。--k 是被照亮的比例（0 新月、1 满月），
   亮边的分界线是一条直线（示意，不是精确的月相形状）；--flip 为 1（渐圆，亮在右）或 -1（渐缺，亮在左）。 */
.sky-body[data-body=moon] .sky-moon {
  display: block; transform: scaleX(var(--flip, 1));
  background: linear-gradient(to right, rgba(243, 246, 239, .16) calc((1 - var(--k, 1)) * 100%), #f3f6ef calc((1 - var(--k, 1)) * 100%));
  box-shadow: inset 0 0 0 1px rgba(243, 246, 239, .4), 0 0 16px 5px rgba(225, 235, 255, .35);
}

/* 雨雪粒子：固定在视口上，数量和速度由 ui-scene.js 按天气和 intensity 生成 */
.sky-weather { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.sky-weather i { position: absolute; top: -10vh; display: block; will-change: transform; }
.sky-weather .drop {
  width: 2px; border-radius: 1px; background: linear-gradient(rgba(210, 232, 245, 0), rgba(215, 235, 247, .95));
  animation: fx-rain linear infinite;
}
.sky-weather .flake {
  border-radius: 50%; background: #fff; opacity: .85; box-shadow: 0 0 4px rgba(255, 255, 255, .6);
  animation: fx-snow linear infinite;
}
@keyframes fx-rain { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(var(--dx, -18vh), 125vh, 0); } }
@keyframes fx-snow {
  0% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(var(--sway, 2vw), 55vh, 0); }
  100% { transform: translate3d(calc(var(--sway, 2vw) * -0.4), 115vh, 0); }
}

/* 图层位置由 web/ui-scene.js 按 data-at（舞台百分比）写入 --x --y --w */
.stage-item { position: absolute; left: var(--x); top: var(--y); width: var(--w); }
.stage-item img { display: block; width: 100%; height: auto; }

.cloud { position: absolute; z-index: 13; width: min(46vw, 760px); opacity: .7; will-change: transform; }
.cloud-a { top: 3%; left: 4%; animation: drift 46s ease-in-out infinite alternate; }
.cloud-b { top: 15%; right: -6%; width: min(34vw, 560px); opacity: .5; transform: scaleX(-1); animation: drift-r 60s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translateX(-6vw); } to { transform: translateX(10vw); } }
@keyframes drift-r { from { transform: scaleX(-1) translateX(-4vw); } to { transform: scaleX(-1) translateX(9vw); } }

.flyer { position: absolute; z-index: 9; display: block; pointer-events: none; will-change: transform; }
.crane { display: block; width: 100%; }   /* the wings are animated in the image itself (web/scene/crane.webp, 12 frames) */
@keyframes flap { 0%, 100% { transform: translateY(0) scaleY(1); } 50% { transform: translateY(-6px) scaleY(.9); } }
.flyer-a { top: 9%; left: 0; width: 120px; animation: fly-across 38s linear infinite; animation-delay: -6s; }
@keyframes fly-across {
  0% { transform: translate(-16vw, 4vh); }
  55% { transform: translate(108vw, -3vh); }
  100% { transform: translate(108vw, -3vh); }
}
@keyframes shimmer { from { background-position: 0 0; } to { background-position: -60% 0; } }

/* 景点：z 5，低于宠物（宠物可以站在上面） */
.landmarks { display: contents; }
.landmark {
  position: absolute; z-index: 5; left: var(--x); top: var(--y); width: var(--w); transform: translate(-50%, -100%);
  display: block; padding: 0; border: 0; background: none; cursor: pointer; pointer-events: auto;
  transition: transform .35s ease, filter .35s ease;
}
.landmark > img:first-child { display: block; width: 100%; height: auto; filter: drop-shadow(0 8px 14px rgba(40, 80, 70, .16)); }
.landmark:hover, .landmark:focus-visible { transform: translate(-50%, calc(-100% - 4px)); filter: saturate(1.12) brightness(1.04); }
.landmark:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; border-radius: 12px; }
.tag {
  position: absolute; left: 50%; top: -8px; transform: translate(-50%, -100%);
  padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .92); color: var(--ink);
  font-size: var(--text-s); font-weight: 600; white-space: nowrap; box-shadow: 0 4px 12px rgba(30, 60, 50, .12);
  opacity: 0; transition: opacity .2s ease; pointer-events: none;
}
.tag::after { content: ""; position: absolute; left: 50%; bottom: -5px; border: 5px solid transparent; border-bottom: 0; border-top-color: rgba(255, 255, 255, .92); transform: translateX(-50%); }
.landmark:hover .tag, .landmark:focus-visible .tag, .landmark.is-selected .tag { opacity: 1; }
.ledge { position: absolute; height: 2px; pointer-events: none; }

/* 黄鹤楼：云绕楼身，鹤在楼前盘旋 */
.wisp { position: absolute; left: -10%; top: 34%; width: 120%; opacity: .55; animation: wisp 16s ease-in-out infinite alternate; pointer-events: none; }
@keyframes wisp { from { transform: translateX(-12%); } to { transform: translateX(12%); } }
.flyer-b { left: 52%; top: 8%; width: 14%; animation: circle 12s ease-in-out infinite; }
@keyframes circle {
  0% { transform: translate(0, 0); }
  24% { transform: translate(90px, -26px); }
  25% { transform: translate(90px, -26px) scaleX(-1); }
  49% { transform: translate(-70px, -6px) scaleX(-1); }
  50% { transform: translate(-70px, -6px); }
  100% { transform: translate(0, 0); }
}

/* 吉庆街：灯笼暖光摇曳，小摊冒热气 */
.lantern {
  position: absolute; width: 5%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 170, 120, .75), rgba(255, 140, 90, 0));
  mix-blend-mode: screen; animation: glow 2.8s ease-in-out infinite alternate; pointer-events: none;
}
.lantern:nth-of-type(2n) { animation-duration: 3.4s; animation-delay: -1.2s; }
.lantern:nth-of-type(3n) { animation-duration: 2.2s; animation-delay: -.6s; }
@keyframes glow { from { opacity: .35; transform: translate(-50%, -50%) scale(.85); } to { opacity: 1; transform: translate(-46%, -50%) scale(1.15); } }
.steam {
  position: absolute; width: 10px; height: 26px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .85), rgba(255, 255, 255, 0));
  animation: steam 3.2s ease-out infinite; pointer-events: none;
}
.steam.s2 { animation-delay: -1.6s; }
@keyframes steam { 0% { opacity: 0; transform: translate(-50%, 0) scale(.6); } 25% { opacity: .9; } 100% { opacity: 0; transform: translate(-30%, -46px) scale(1.4); } }
/* 灯笼和水雾原本就全局隐藏（不改变现有效果）；东湖的拱桥遮挡和湖面闪光已删除（4.3） */
.lantern, .steam { display: none; }

/* 东湖：全景上的热区标记（呼吸的小圆点） */
.lake { border-radius: 0; }
.lake .pin {
  position: absolute; inset: 28%; border-radius: 50%; background: rgba(255, 255, 255, .9);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .35), 0 4px 12px rgba(30, 60, 50, .25);
}
.lake .pin::after { content: ""; position: absolute; inset: -14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .8); animation: ripple 3s ease-out infinite; }
/* 东湖的圆点已换成插画：悬停沿用 .landmark:hover（只上移 4px，不改锚点，不会左右晃） */

/* 小 SPU 的家：水池（z 4，低于景点） */
.pool {
  position: absolute; z-index: 4; left: var(--x); top: var(--y); width: var(--w); aspect-ratio: 6 / 1; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 40%, rgba(255,255,255,.55), rgba(160, 210, 235, .35) 60%, rgba(160, 210, 235, 0) 72%);
  pointer-events: none;
}
.ripple { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .8); animation: ripple 4.2s ease-out infinite; }
.ripple.r2 { animation-delay: -2.1s; }
@keyframes ripple { from { opacity: .9; transform: scale(.35); } to { opacity: 0; transform: scale(1.25); } }

/* 遮挡层：拱桥。轮廓外是透明的。z 12：低于面板（字清楚）、低于宠物（宠物在桥上面）。
   改成 25 后宠物会躲到桥后面，但桥会盖住面板的字。 */

/* ---------- 浮动面板：半透明，可拖动，可折叠，空白处点击穿透 ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  height: var(--topbar-h); padding: 0 var(--gutter);
  border-bottom: 1px solid rgba(213, 227, 220, .5); background: rgba(255, 255, 255, .45);
  backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: baseline; gap: var(--space-3); font-size: inherit; font-weight: inherit; min-width: 0; }
.brand-mark { font-size: 22px; font-weight: 800; letter-spacing: .04em; }
.brand-name { font-size: var(--text-m); color: var(--ink-2); letter-spacing: .04em; white-space: nowrap; }
.top-actions { display: flex; gap: var(--space-2); flex-shrink: 0; }
/* 顶栏天气：一个小按钮（温度和天气），点开看注意事项。数据来自 /v2/weather，与页面和对话同一份 */
.weather { position: relative; min-width: 0; flex-shrink: 1; }
.weather-chip { min-height: 32px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.weather-chip[aria-expanded=true] { background: var(--brand-soft); }
.weather-tips {
  position: absolute; top: calc(var(--topbar-h) - 4px); left: 0; width: min(340px, calc(100vw - 2 * var(--space-4)));
  padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-m); background: rgba(255, 255, 255, .97);
  box-shadow: 0 18px 40px -20px rgba(30, 60, 50, .45); z-index: 41;
}
.weather-head { font-size: var(--text-m); font-weight: 600; margin-bottom: var(--space-2); }
.weather-list { margin: 0; padding-left: 1.2em; font-size: var(--text-s); color: var(--ink-2); display: grid; gap: 4px; }
.weather-src { margin-top: var(--space-3); font-size: var(--text-xs); color: var(--muted); }
@media (max-width: 560px) { .ticker { display: none; } .weather-chip { max-width: 96px; font-size: var(--text-xs); padding-left: 8px; padding-right: 8px; } .brand-name { display: none; } .brand-mark { white-space: nowrap; } }
#voice-mode[aria-pressed=true] { background: var(--brand); border-color: var(--brand); color: #fff; }
#menu-btn[aria-expanded=true] { background: var(--brand-soft); }

.menu {
  position: absolute; top: calc(var(--topbar-h) - 4px); right: var(--gutter); width: min(340px, calc(100vw - 2 * var(--space-4)));
  display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-4);
  border: 1px solid var(--line); border-radius: var(--radius-m); background: rgba(255, 255, 255, .96);
  box-shadow: 0 18px 40px -20px rgba(30, 60, 50, .45);
}
.menu h2 { font-size: var(--text-m); margin-bottom: var(--space-2); }
.menu p { font-size: var(--text-s); color: var(--ink-2); }
.menu .tech { font-size: var(--text-xs); color: var(--muted); }
.menu section + section { padding-top: var(--space-4); border-top: 1px solid var(--line-soft); }
.menu .pet-mode { display: flex; justify-content: space-between; margin-bottom: var(--space-3); font-size: var(--text-s); color: var(--ink-2); }
.menu .pet-mode select { width: auto; }
.opacity-row { display: flex; justify-content: space-between; font-size: var(--text-s); color: var(--ink-2); }
#panel-opacity { width: 100%; margin: var(--space-2) 0 var(--space-3); accent-color: var(--brand); }
#panel-reset { width: 100%; }

.float-panel {
  position: fixed; z-index: 15; display: flex; flex-direction: column;
  top: calc(var(--topbar-h) + var(--space-4)); right: var(--gutter);
  width: var(--panel-w); height: calc(100vh - var(--topbar-h) - 2 * var(--space-4));
  border: 1px solid rgba(255, 255, 255, .55); border-radius: var(--radius-l);
  background: rgba(255, 255, 255, var(--panel-alpha)); backdrop-filter: blur(10px);
  box-shadow: 0 20px 50px -30px rgba(20, 50, 40, .55);
  pointer-events: none; /* 空白处点击穿透到全景；有内容的部分在下面单独接收 */
}
.float-panel.is-placed { right: auto; }
.float-panel[data-collapsed=true] { height: auto; }
.float-panel[data-collapsed=true] .panel-body { display: none; }
.float-panel.is-dragging { box-shadow: 0 24px 60px -24px rgba(20, 50, 40, .7); }

.panel-head {
  display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3);
  cursor: grab; touch-action: none; user-select: none; pointer-events: auto;
  border-bottom: 1px solid rgba(255, 255, 255, .5);
}
.is-dragging .panel-head { cursor: grabbing; }
.panel-head #avatar-stage { width: 44px; }
.panel-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.guide-name { font-size: var(--text-m); font-weight: 700; }
.panel-body {
  flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-2) var(--space-3) var(--space-3);
}
.panel-body > .guide-note, .panel-body > button, .panel-body > .trip-planner, .composer { pointer-events: auto; }
.guide-note { font-size: var(--text-xs); color: var(--ink-2); padding: 0 var(--space-1); }
.panel-body > .guide-note { align-self: flex-start; padding: 2px var(--space-2); border-radius: 999px; background: rgba(255, 255, 255, .7); }

/* 行程面板：展开时占用面板内的一块区域，对话列表在它下面收缩，不叠在一起 */
.panel.trip-planner {
  flex: 0 1 auto; min-height: 0; overflow: auto; max-height: 58%;
  padding: var(--space-2) var(--space-3); background: rgba(255, 255, 255, .86);
}
.trip-fields { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2) var(--space-3); margin: var(--space-2) 0; }
.trip-fields label { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: var(--text-s); color: var(--ink-2); }
.trip-fields select, .trip-fields input { min-height: 34px; font-size: var(--text-s); }
#trip-interests { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin: 0 0 var(--space-3); padding: 0; border: 0; font-size: var(--text-s); }
#trip-interests legend { margin-bottom: var(--space-2); padding: 0; color: var(--ink-2); }
#trip-interests label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
#trip-prepare { width: 100%; min-height: 36px; }
#trip-status { margin-top: var(--space-2); color: var(--brand); }
#trip-status:empty { display: none; }
.trip-planner summary { cursor: pointer; }
.trip-planner[open] summary { margin-bottom: var(--space-2); }
/* 行程面板展开时，对话列表在剩下的区域里滚动（欢迎语和建议问题仍可点） */

.chat { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; pointer-events: none; }
#messages {
  flex: 1 1 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; pointer-events: none;
  display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-3) var(--space-1);
  scroll-padding-bottom: var(--space-3);
}
#messages > * { pointer-events: auto; }
.welcome { margin: auto 0 0; padding: var(--space-4); border-radius: var(--radius-m); background: rgba(255, 255, 255, .72); }
.welcome h2 { font-size: 22px; line-height: 1.3; margin-bottom: var(--space-2); }
.welcome p { font-size: var(--text-m); color: var(--ink-2); margin-bottom: var(--space-4); }
#suggestions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
#suggestions button { border-radius: 999px; text-align: left; line-height: 1.4; padding: var(--space-2) var(--space-4); color: var(--ink); }

/* ---------- 消息 ---------- */
.message {
  max-width: min(46em, 92%); padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-l); border: 1px solid var(--line-soft); background: var(--surface);
}
.message.user { align-self: flex-end; border-color: transparent; background: var(--brand-soft); border-bottom-right-radius: 6px; }
.message.assistant {
  align-self: flex-start; border-top-left-radius: 6px;
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: var(--space-3);
}
.message .who { grid-column: 1 / -1; margin-bottom: 4px; font-size: var(--text-xs); font-weight: 700; color: var(--muted); letter-spacing: .04em; }
.message .text { grid-column: 1 / -1; white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--text-m); line-height: 1.8; }
.message .meta { font-size: var(--text-xs); color: var(--muted); line-height: 1.6; }
.message .sources { grid-column: 1 / -1; order: 2; margin-top: var(--space-2); padding-top: var(--space-2); border-top: 1px solid var(--line-soft); color: var(--ink-2); }
.message .source-detail { grid-column: 1 / -1; order: 3; margin-top: 6px; font-size: var(--text-xs); color: var(--ink-2); }
.source-detail summary { cursor: pointer; line-height: 1.8; border-radius: 4px; width: fit-content; }
.source-detail summary:hover { color: var(--brand); }
.source-detail p {
  margin-top: 6px; padding: var(--space-3); max-height: 220px; overflow: auto;
  border-radius: var(--radius-s); background: var(--surface-2);
  white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7;
}
.message.assistant > button { order: 4; margin-top: var(--space-2); justify-self: start; }
.message .timing { order: 4; margin-top: var(--space-2); }
.message.assistant .text:empty::after {
  content: ""; display: inline-block; width: 36px; height: 10px;
  background: radial-gradient(circle closest-side, var(--muted) 90%, transparent) 0 50% / 12px 10px repeat-x;
  animation: wait 1s steps(3) infinite; opacity: .7;
}
@keyframes wait { from { width: 12px; } to { width: 48px; } }
.message.streaming .text::after {
  content: ""; display: inline-block; width: 7px; height: 1.05em; margin-left: 2px; vertical-align: -.15em;
  border-radius: 2px; background: #9cc7b2; animation: caret .9s steps(2) infinite;
}
@keyframes caret { 50% { opacity: 0; } }
.message.failed { border-color: #ecd0ca; background: #fffaf9; }
.message.failed .text { color: #6d3a33; }
.message.failed > button { border-color: #e2bdb5; color: var(--danger); }

/* ---------- 输入区 ---------- */
.composer {
  margin: 0; padding: var(--space-3) var(--space-3) var(--space-2);
  border: 1px solid #c9dbd0; border-radius: var(--radius-l); background: var(--surface);
  box-shadow: 0 10px 30px -18px rgba(30, 70, 50, .35);
}
.composer:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(111, 174, 150, .25); }
#form { display: flex; align-items: flex-end; gap: var(--space-2); }
#input {
  flex: 1; min-width: 0; min-height: 48px; max-height: 160px; padding: 6px 4px;
  border: 0; background: transparent; resize: vertical; font-size: var(--text-m); line-height: 1.6;
}
#input:focus-visible { outline: none; }
#send { min-width: 84px; height: 44px; }
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3);
  margin-top: var(--space-2); padding-top: var(--space-2); border-top: 1px solid var(--line-soft);
  font-size: var(--text-s); color: var(--ink-2);
}
#count { margin-left: auto; font-size: var(--text-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
#status { min-height: 20px; padding-top: 4px; font-size: var(--text-s); color: var(--ink-2); }
#status.error { color: var(--danger); }
#audio { display: block; width: 100%; height: 34px; margin: 4px 0 var(--space-1); }
#audio:not([src]) { display: none; }
.composer-note { font-size: var(--text-xs); color: var(--muted); padding-bottom: 2px; }
.asr-lang, .pet-mode { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-xs); color: var(--ink-2); }
.asr-lang select, .pet-mode select { width: auto; min-height: 30px; padding: 0 6px; font-size: var(--text-xs); }

/* ---------- 头像与阶段标签（头像本体由 p0-video.js 写入舞台） ---------- */
#avatar-stage { position: relative; width: 200px; aspect-ratio: 1; flex-shrink: 0; }
#avatar-stage canvas, .p0-video-fallback, .p0-candidate-fallback {
  position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; background: transparent;
}
#avatar-stage[data-p0-failed=true] canvas { display: none; }
.phase {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px; border-radius: 999px;
  background: var(--line-soft); color: var(--ink-2); font-size: var(--text-xs);
}
.phase::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .7; }
body[data-phase=ready] .phase, body[data-phase=answering] .phase { background: var(--brand-soft); color: var(--brand); }
body[data-phase=answering] .phase::before { animation: pulse 1.1s ease-in-out infinite; }
body[data-phase=speaking] .phase { background: var(--water); color: var(--water-ink); }
body[data-phase=speaking] .phase::before { animation: pulse .8s ease-in-out infinite; }
body[data-phase=cancelling] .phase { background: var(--amber-soft); color: var(--amber); }
body[data-phase=error] .phase { background: var(--danger-soft); color: var(--danger); }
@keyframes pulse { 50% { opacity: .2; transform: scale(.8); } }

/* ---------- 漫游的小 SPU：视频身体放进交互引擎，隐藏 SVG 占位 ---------- */
.spu-pet.is-video .spu-pet__spin > svg { visibility: hidden; }
.spu-pet #avatar-stage {
  position: absolute; left: 50%; bottom: calc(var(--pet-w) * -.22);
  width: calc(var(--pet-w) * 1.53); transform: translateX(-50%); pointer-events: none;
}

/* ---------- 语音输入 ---------- */
.mic {
  position: relative; flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid #c3d6cc; background: var(--surface); color: var(--brand); cursor: pointer;
  display: grid; place-items: center;
}
.mic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.mic svg rect { fill: currentColor; stroke: none; }
.mic:hover { background: var(--surface-2); }
.mic[aria-pressed=true] { background: var(--danger); border-color: var(--danger); color: #fff; animation: rec 1.4s ease-in-out infinite; }
.mic[aria-busy=true] { opacity: .6; cursor: progress; }
.mic-level { position: absolute; inset: -5px; border-radius: 50%; border: 2px solid rgba(162, 60, 50, .4); transform: scale(calc(1 + var(--level, 0) * .35)); opacity: 0; }
.mic[aria-pressed=true] .mic-level { opacity: 1; }
@keyframes rec { 50% { box-shadow: 0 0 0 6px rgba(162, 60, 50, .18); } }
.message.user.voice .who::after { content: " · 语音"; font-weight: 400; }
.mic-home { display: contents; }

/* 录音中：按钮变成“说完了”，上方提示条显示听到声音与自动结束 */
.mic-text { display: none; font-size: var(--text-s); font-weight: 600; white-space: nowrap; line-height: 1; }
.mic[aria-pressed=true] { width: auto; padding: 0 var(--space-4) 0 var(--space-3); border-radius: 999px; display: inline-flex; gap: 6px; }
.mic[aria-pressed=true] .mic-text { display: inline; }
.mic-hint {
  display: flex; align-items: center; gap: var(--space-2);
  margin: 0 0 var(--space-2); padding: 6px var(--space-3); border-radius: var(--radius-s);
  background: var(--danger-soft); color: #7a2f27; font-size: var(--text-s);
}
.mic-wave { display: inline-flex; align-items: center; gap: 2px; height: 16px; }
.mic-wave i { width: 3px; height: calc(4px + var(--level, 0) * 12px); border-radius: 2px; background: var(--danger); animation: wave .9s ease-in-out infinite; }
.mic-wave i:nth-child(2) { animation-delay: -.2s; } .mic-wave i:nth-child(3) { animation-delay: -.4s; } .mic-wave i:nth-child(4) { animation-delay: -.6s; }
@keyframes wave { 50% { transform: scaleY(.45); } }

/* ---------- 景点介绍卡 ---------- */
.poi-card {
  position: fixed; z-index: 70; width: min(360px, calc(100vw - 2 * var(--space-4)));
  padding: var(--space-4) var(--space-4) var(--space-3);
  border: 1px solid var(--line); border-radius: var(--radius-m); background: rgba(255, 255, 255, .96);
  box-shadow: 0 18px 40px -18px rgba(30, 60, 50, .5);
}
.poi-card h2 { font-size: var(--text-l); margin: 0 32px var(--space-2) 0; }
.poi-intro { font-size: var(--text-s); color: var(--ink); max-height: 9.5em; overflow: auto; }
.poi-source { margin-top: var(--space-2); font-size: var(--text-xs); color: var(--muted); }
.poi-photo { margin: 0 0 var(--space-3); }
.poi-photo img { display: block; width: 100%; height: 170px; object-fit: cover; border-radius: var(--radius-s); }
.poi-photo figcaption { margin-top: 4px; font-size: var(--text-xs); color: var(--muted); }
/* with a photo the whole introduction is shown (the card grows); the text is not cut off */
.poi-card:has(.poi-photo:not([hidden])) .poi-intro { max-height: none; overflow: visible; }
.poi-source:empty { display: none; }
/* 公告牌（M3）：挂在景点上的公告；样例只在开发预览出现 */
.poi-notice { margin-top: var(--space-2); padding: 8px 10px; border-radius: var(--radius-s); background: #fff8e6; border: 1px solid #f0d58a; font-size: var(--text-xs); }
.poi-notice[hidden] { display: none; }
.poi-notice b { display: block; margin-bottom: 2px; }
.poi-ask { margin-top: var(--space-3); font-weight: 700; color: var(--brand); }
.poi-choices { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
.poi-close { position: absolute; top: var(--space-2); right: var(--space-2); }

/* ---------- 语音模式：可拖动的话筒 ---------- */
body[data-voice=on] .float-panel { display: none; }
.voice-dock {
  position: fixed; z-index: 35; right: 40px; bottom: 40px; max-width: min(440px, calc(100vw - 32px));
  display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-4) var(--space-2) var(--space-2);
  border: 1px solid rgba(255, 255, 255, .6); border-radius: 999px;
  background: rgba(255, 255, 255, calc(var(--panel-alpha) + .35)); backdrop-filter: blur(10px);
  box-shadow: 0 16px 40px -20px rgba(20, 50, 40, .6); cursor: grab; touch-action: none; user-select: none;
}
.voice-dock.is-placed { right: auto; bottom: auto; }
.voice-dock.is-dragging { cursor: grabbing; }
.voice-grip { color: var(--muted); font-size: 18px; padding: 0 2px; }
.voice-dock .mic { width: 60px; height: 60px; }
.voice-dock .mic svg { width: 28px; height: 28px; }
.voice-dock .mic[aria-pressed=true] { height: 60px; width: auto; min-width: 60px; padding: 0 var(--space-4); border-radius: 999px; }
.voice-dock .mic[aria-pressed=true] .mic-text { font-size: var(--text-m); letter-spacing: .02em; }
.voice-caption {
  max-width: 230px; font-size: var(--text-s); color: var(--ink); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.voice-dock .mic-hint { position: absolute; left: 0; bottom: calc(100% + 8px); margin: 0; white-space: nowrap; }
body[data-voice=on] .mic-home { display: none; }

/* ---------- 窄屏（≤1080）：面板变成贴底抽屉；景点改用视口坐标，排在顶部一条带子上 ---------- */
@media (max-width: 1080px) {
  :root { --gutter: 12px; }
  .stage-bg { background-size: cover; background-position: 50% 70%; }
  .float-panel, .float-panel.is-placed {
    left: 0; right: 0; bottom: 0; top: auto; width: auto;
    height: calc(100vh - var(--topbar-h) - 150px - var(--space-2)); min-height: 250px;
    border-radius: var(--radius-l) var(--radius-l) 0 0; border-bottom: 0;
  }
  .panel-head { cursor: default; }
  .stage-item, .landmark, .pool { position: fixed; left: auto; top: auto; width: auto; }
  .tower { left: 2%; top: calc(var(--topbar-h) + 8px); height: 124px; width: auto; }
  .tower > img:first-child { width: auto; height: 124px; }
  .bridge { left: 40%; top: calc(var(--topbar-h) + 60px); width: 30%; }
  .street { right: 2%; top: calc(var(--topbar-h) + 14px); width: auto; height: 112px; }
  .street > img:first-child { width: auto; height: 112px; }
  .lake { left: 22%; top: calc(var(--topbar-h) + 8px); width: 44px; }
  .pool { left: 26%; top: calc(var(--topbar-h) + 112px); width: 96px; }
  .voice-dock { right: 16px; bottom: 16px; }
  .trip-planner[open] { max-height: 36%; }
}
@media (max-width: 1080px) and (max-height: 560px) {
  .float-panel, .float-panel.is-placed { height: calc(100vh - var(--topbar-h) - 96px); min-height: 0; }
  .welcome { display: none; }
  .composer { padding: 6px var(--space-2) 4px; }
  .composer-note, .guide-note { display: none; }
  .composer { padding-bottom: calc(var(--space-2) + env(safe-area-inset-bottom)); }
  .welcome h2 { font-size: 20px; }
  .brand-name { display: none; }
}
/* 窄屏：新增的四个景点只在桌面显示（顶部一条带子放不下它们；窄屏上怎么排待定，见 handoffs/stage-2.md） */
@media (max-width: 1080px) { .landmark.extra { display: none; } }
@media (max-width: 600px) {
  :root { --topbar-h: 56px; }
  .brand-mark { font-size: 19px; }
  .float-panel, .float-panel.is-placed { height: calc(100vh - var(--topbar-h) - 118px - var(--space-2)); }
  .tower { height: 96px; }
  .tower > img:first-child { height: 96px; }
  .street { height: 92px; }
  .street > img:first-child { height: 92px; }
  .bridge { width: 34%; }
  .pool { width: 84px; }
  .tag { display: none; }
  .landmark.is-selected .tag { display: block; }
  .message { max-width: 94%; }
  #send { min-width: 64px; }
  .trip-fields { grid-template-columns: 1fr; }
  .composer-note { display: none; }
  .voice-caption { max-width: 150px; }
}

/* 窄屏景点带（<720px）：顶部的景点在这么窄的屏上只剩一半露在顶栏下面，改成对话抽屉上沿的一条缩略图带。
   缩略图由 ui-scene.js 从上面的景点生成，点击走同一个 open()（同一张介绍卡）。位置 bottom 由 ui-scene.js 贴到抽屉上沿。
   720px 及以上不显示，那里的景点位置和以前一样。 */
.landmark-strip { display: none; }
.strip-item {
  position: relative; flex: 0 0 auto; width: 76px; scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 4px 5px;
  border: 1px solid rgba(255, 255, 255, .75); border-radius: var(--radius-s); background: rgba(255, 255, 255, .9);
  box-shadow: 0 6px 16px -10px rgba(30, 60, 50, .55); color: var(--ink); cursor: pointer;
}
.strip-item.is-selected { border-color: var(--brand); background: var(--brand-soft); }
.strip-thumb { display: block; width: 100%; height: 44px; border-radius: 7px; overflow: hidden; }
.strip-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.strip-thumb.is-text { position: relative; background: linear-gradient(135deg, #e2efe8, #f3f8f5); }
.strip-thumb.is-text::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px;
  border-radius: 50%; background: #fff; border: 2px solid var(--brand);
}
.strip-name {
  max-width: 100%; font-size: 12px; font-weight: 600; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.strip-ledge { position: absolute; left: 0; right: 0; top: 0; height: 2px; pointer-events: none; }   /* 小 SPU 站在缩略图上沿 */

@media (max-width: 719px) {
  .landmarks .landmark { display: none; }   /* 顶部的景点不显示，改由下面的缩略图带代替（它们的位置仍在，只是不占画面） */
  .landmark-strip {
    display: flex; position: fixed; left: 0; right: 0; z-index: 16; bottom: 8px;
    gap: var(--space-2); padding: var(--space-1) var(--space-3) var(--space-2);
    overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; scroll-snap-type: x proximity;
    pointer-events: none;   /* 缩略图之间的空隙点击穿透；缩略图本身接收点击和横向滑动 */
  }
  .landmark-strip::-webkit-scrollbar { display: none; }
  .strip-item { pointer-events: auto; }
  body[data-voice=on] .landmark-strip { display: none; }   /* 语音模式下抽屉隐藏，景点带一起收起 */
}

/* 矮屏（含 200% 缩放）：输入区收紧，欢迎语和形象说明隐藏 */
@media (max-height: 560px) {
  #input { min-height: 40px; }
  #send { height: 40px; }
  .composer-note { display: none; }
  .toolbar { margin-top: 4px; padding-top: 4px; }
  .welcome p { display: none; }
  #status { min-height: 18px; padding-top: 2px; }
  .panel-head { padding: 4px var(--space-3); }
  .panel-head #avatar-stage { width: 32px; }
  body:not(:has(#avatar-stage[data-p0-failed=true])) .panel-body > .guide-note { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .flyer-a { display: none; }
  .sky-fx { display: none; }   /* 星星、日月、雨雪都是动的装饰，减少动态时整组不显示（天色的底色照常） */
  .landmark:hover, .landmark:focus-visible { transform: none; }
}

/* 标位置工具（?mark=1，仅开发用）：显示最近一次点击的舞台百分比 */
#mark-out { position: fixed; left: 12px; bottom: 12px; z-index: 60; padding: 6px 10px; border-radius: 8px; background: #fff; color: #1d2b27; font: 13px/1.4 monospace; box-shadow: 0 2px 8px rgba(0,0,0,.2); }

/* 武汉全图（阶段 2 第 5 步）：景点在真实位置上，建筑小图默认很小，点击（is-selected）后放大；
   没有插画的景点只显示一个圆点。东湖插画的装饰（拱桥遮挡、灯笼、水雾）只属于旧的东湖背景，先隐藏，美术阶段再做。 */
.landmark.is-selected { transform: translate(-50%, -100%) scale(3.2); transform-origin: 50% 100%; z-index: 30; pointer-events: none; }   /* enlarged one must not block its neighbours */
.landmark .pin { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%;
  background: #fff; border: 2px solid var(--brand); box-shadow: 0 1px 4px rgba(30, 60, 50, .35); }
.landmark .pin::after { display: none; }
.landmark:has(> img) .pin { display: none; }
.pool { opacity: 0; }   /* the pet's home (东湖) stays usable as a perch; the lake drawing itself is hidden */
.weather-chip[hidden], .weather-tips[hidden] { display: none; }
/* 顶栏滚屏：本周挑战与活动，循环滚动；鼠标放上去暂停；减少动态时不滚动 */
.ticker { flex: 1; min-width: 0; overflow: hidden; height: 32px; display: flex; align-items: center;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.ticker-track { display: flex; white-space: nowrap; width: max-content; font-size: var(--text-s); color: var(--ink-2);
  animation: ticker var(--ticker-dur, 40s) linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item { padding-right: 2.5em; }
.ticker-item b { color: var(--brand); font-weight: 600; margin-right: .4em; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation: none; } .ticker { overflow-x: auto; } }


/* sleeping video body: closed-eye overlay */
#avatar-stage .p0-lids { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .3s; }
.spu-pet.is-asleep #avatar-stage .p0-lids { opacity: 1; }
