/* ===========================================================
   缘宇宙 · 云海孤岛
   视觉语言：宣纸底色 + 水墨 + 朱砂 · 金线
   =========================================================== */

:root {
  --paper: #efe6d2;
  --paper-deep: #e3d6bb;
  --paper-light: #f7f1e2;
  --ink: #2b2925;
  --ink-soft: #4d483f;
  --ink-mute: #7a7266;
  --cinnabar: #a8331f;
  --cinnabar-soft: #c25a40;
  --gold: #b08a44;
  --gold-soft: #d9bd80;
  --jade: #5c8471;
  --jade-deep: #3f6353;
  --shadow: rgba(43, 41, 37, 0.22);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --radius: 14px;
  --ease: cubic-bezier(0.22, 0.68, 0.32, 1);
  --font-serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  width: 100%; height: 100%;
  overflow: hidden;
  background: #d9d0bb;
  color: var(--ink);
  font-family: var(--font-body);
  overscroll-behavior: none;
  touch-action: none;
  -webkit-user-select: none; user-select: none;
}

#scene {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  display: block;
  touch-action: none;
}

/* 宣纸纹理与柔光 */
.paper-overlay {
  position: fixed; inset: 0; pointer-events: none; z-index: 2;
  opacity: 0.5; mix-blend-mode: multiply;
  background-image:
    radial-gradient(circle at 18% 22%, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0) 42%),
    radial-gradient(circle at 82% 78%, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 38%),
    repeating-linear-gradient(94deg, rgba(120,105,80,0.035) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(4deg, rgba(120,105,80,0.028) 0 1px, transparent 1px 4px);
}
.vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 2;
  background:
    radial-gradient(120% 90% at 50% 45%, rgba(0,0,0,0) 42%, rgba(74, 58, 38, 0.28) 100%);
}

.hud {
  position: fixed; inset: 0; z-index: 10;
  pointer-events: none;
  display: flex; flex-direction: column;
  padding: calc(8px + var(--safe-top)) 10px calc(8px + var(--safe-bottom));
  transition: opacity 0.4s var(--ease);
}
.hud.hidden { opacity: 0; pointer-events: none; }
.hud > * { pointer-events: auto; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  width: 100%;
  flex-wrap: nowrap;
}
.brand {
  display: flex; align-items: center; gap: 6px;
  flex-shrink: 0;
  white-space: nowrap;
  padding: 4px 10px 4px 4px;
  background: linear-gradient(135deg, rgba(247,241,226,0.94), rgba(233,222,199,0.86));
  border: 1px solid rgba(176,138,68,0.45);
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(74,58,38,0.14), inset 0 1px 0 rgba(255,255,255,0.7);
  backdrop-filter: blur(8px);
}
.brand-seal {
  width: 26px; height: 26px; flex: none;
  display: grid; place-items: center;
  border-radius: 7px;
  background: linear-gradient(150deg, #b8402a, #8d2614);
  color: #f8ecd4;
  font-family: var(--font-serif);
  font-size: 15px; line-height: 1;
  box-shadow: inset 0 0 0 1.5px rgba(248,236,212,0.55), 0 2px 6px rgba(141,38,20,0.35);
}
.brand-name {
  font-family: var(--font-serif);
  font-size: 14.5px; letter-spacing: 1px; font-weight: 700; color: var(--ink);
}
.brand-sub {
  font-size: 10.5px; color: var(--ink-mute); letter-spacing: 0.5px;
  padding-left: 6px; margin-left: 1px;
  border-left: 1px solid rgba(122,114,102,0.35);
  white-space: nowrap;
}
.brand-weather { display: none; }
.topbar-right { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.pill {
  display: flex; align-items: center; gap: 4px;
  padding: 5px 8px;
  font-size: 11px; color: var(--ink-soft);
  white-space: nowrap;
  background: rgba(247,241,226,0.9);
  border: 1px solid rgba(176,138,68,0.4);
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(74,58,38,0.1);
  backdrop-filter: blur(8px);
}
.pill .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--jade);
  box-shadow: 0 0 0 3px rgba(92,132,113,0.18);
  animation: breathe 2.6s var(--ease) infinite;
}
.pill-txt { color: var(--ink-mute); }
@keyframes breathe { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }

.round-btn {
  width: 32px; height: 32px; padding: 0;
  display: grid; place-items: center;
  color: var(--ink-soft);
  background: rgba(247,241,226,0.9);
  border: 1px solid rgba(176,138,68,0.4);
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(74,58,38,0.1);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: transform 0.18s var(--ease), background 0.18s;
}
.round-btn svg { width: 16px; height: 16px; }
.round-btn:active { transform: scale(0.93); background: rgba(233,222,199,0.95); }
.round-btn.audio-on { color: var(--jade-deep); background: rgba(229,239,226,0.96); }
.round-btn.audio-off { color: var(--ink-mute); }
.pill.offline .dot { background: var(--cinnabar); box-shadow: 0 0 0 3px rgba(168,51,31,0.16); }

/* ---------------- 自身卡片（流式紧随顶栏，绝不重叠） ---------------- */
.self-card {
  position: relative;
  align-self: flex-start;
  margin-top: 8px;
  display: flex; align-items: center; gap: 7px;
  padding: 5px 8px 5px 6px;
  background: linear-gradient(135deg, rgba(247,241,226,0.92), rgba(233,222,199,0.82));
  border: 1px solid rgba(176,138,68,0.38);
  border-radius: 11px;
  box-shadow: 0 6px 18px rgba(74,58,38,0.13);
  backdrop-filter: blur(8px);
}
.self-avatar {
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center;
  font-family: var(--font-serif); font-size: 14px;
  color: #f8ecd4;
  background: linear-gradient(150deg, #5c8471, #3f6353);
  box-shadow: inset 0 0 0 1.5px rgba(248,236,212,0.4);
}
.self-meta { display: flex; flex-direction: column; line-height: 1.3; }
.self-meta strong { font-size: 12px; font-weight: 600; letter-spacing: 0.4px; }
.self-meta span { font-size: 10px; color: var(--ink-mute); }
.self-edit {
  border: 1px solid rgba(176,138,68,0.5);
  background: transparent;
  color: var(--gold);
  font-size: 10px; letter-spacing: 0.5px;
  padding: 3px 7px; border-radius: 6px;
  cursor: pointer;
}
.self-edit:active { background: rgba(176,138,68,0.15); }

/* ---------------- 地点提示 ---------------- */
.place-label {
  position: absolute;
  left: 50%; top: calc(108px + var(--safe-top));
  transform: translate(-50%, -8px);
  opacity: 0;
  font-family: var(--font-serif);
  font-size: 17px; letter-spacing: 5px;
  color: #f7f1e2;
  text-shadow: 0 2px 14px rgba(43,41,37,0.75), 0 0 2px rgba(43,41,37,0.6);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
  pointer-events: none;
  white-space: nowrap;
}
.place-label.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- 侧导航 ---------------- */
.side-nav {
  position: absolute;
  right: 10px; top: 44%;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 7px;
}
.nav-btn {
  width: 42px; padding: 6px 0 4px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: rgba(247,241,226,0.88);
  border: 1px solid rgba(176,138,68,0.4);
  border-radius: 11px;
  color: var(--ink-soft);
  box-shadow: 0 4px 14px rgba(74,58,38,0.12);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: transform 0.18s var(--ease);
}
.nav-btn:active { transform: scale(0.94); }
.nav-btn span,
.nav-btn svg {
  color: var(--cinnabar);
  flex-shrink: 0;
}
.nav-btn em { font-style: normal; font-size: 9.5px; color: var(--ink-mute); letter-spacing: 0.5px; }

/* ---------------- 底部动作区（移动端居中底排，与上移摇杆彻底错开） ---------------- */
.action-dock {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 0 12px calc(10px + var(--safe-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}
.action-dock > * { pointer-events: auto; }
.interact-btn {
  position: fixed;
  right: 14px;
  bottom: calc(84px + var(--safe-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 9px 22px;
  border: 1px solid rgba(217,189,128,0.75);
  border-radius: 13px;
  background: linear-gradient(160deg, #b8402a, #8d2614);
  color: #fbeed6;
  box-shadow: 0 8px 22px rgba(141,38,20,0.35), inset 0 1px 0 rgba(255,255,255,0.25);
  cursor: pointer;
  opacity: 0; transform: translateY(10px) scale(0.96);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  pointer-events: none;
}
.interact-btn.show { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.interact-btn:active { transform: scale(0.96); }
.interact-verb { font-family: var(--font-serif); font-size: 16px; letter-spacing: 2.5px; }
.interact-hint { font-size: 9.5px; letter-spacing: 1px; opacity: 0.78; }

.action-row { display: flex; gap: 10px; }
.act-btn {
  width: 48px; padding: 5px 0 4px;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  background: rgba(247,241,226,0.88);
  border: 1px solid rgba(176,138,68,0.38);
  border-radius: 11px;
  color: var(--ink-soft);
  box-shadow: 0 3px 10px rgba(74,58,38,0.1);
  backdrop-filter: blur(6px);
  cursor: pointer;
  transition: transform 0.15s var(--ease), background 0.15s;
}
.act-btn:active { transform: scale(0.9); background: rgba(233,222,199,0.95); }
.act-btn span,
.act-btn svg { color: var(--jade-deep); flex-shrink: 0; }
.act-btn em { font-style: normal; font-size: 9.5px; color: var(--ink-mute); }

/* ---------------- 摇杆（左手拇指舒适区，上提避开底排动作与系统手势区） ---------------- */
.joystick {
  position: absolute;
  left: max(20px, calc(16px + env(safe-area-inset-left, 0px)));
  bottom: calc(74px + var(--safe-bottom));
  width: 106px; height: 106px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 45%, rgba(247,241,226,0.44), rgba(233,222,199,0.2) 62%, rgba(247,241,226,0.08));
  border: 1.5px solid rgba(247,241,226,0.58);
  box-shadow: inset 0 0 24px rgba(255,255,255,0.32), 0 4px 18px rgba(74,58,38,0.2);
  backdrop-filter: blur(3px);
  touch-action: none;
  transition: opacity 0.3s;
}
.joystick-ring {
  position: absolute; inset: 12px;
  border-radius: 50%;
  border: 1px dashed rgba(247,241,226,0.48);
}
.joystick-knob {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, rgba(255,252,243,0.96), rgba(230,215,187,0.92));
  border: 1px solid rgba(176,138,68,0.6);
  box-shadow: 0 3px 12px rgba(74,58,38,0.28), inset 0 1px 2px #fff;
  transform: translate(0, 0);
  will-change: transform;
}
.joystick.active .joystick-knob { box-shadow: 0 3px 16px rgba(74,58,38,0.36), inset 0 1px 2px #fff; }

.move-hint {
  position: absolute;
  left: 20px; bottom: calc(190px + var(--safe-bottom));
  transform: none;
  font-size: 11px; letter-spacing: 1px;
  color: rgba(43,41,37,0.68);
  background: rgba(247,241,226,0.78);
  padding: 5px 12px; border-radius: 999px;
  opacity: 1; transition: opacity 0.6s var(--ease);
  pointer-events: none;
  white-space: nowrap;
}
.move-hint.gone { opacity: 0; }

/* ---------------- 弹窗 ---------------- */
.modal-root {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: flex-end; justify-content: center;
  pointer-events: none;
  padding: 0 0 var(--safe-bottom);
}
.modal-root.open { pointer-events: auto; }
.modal-mask {
  position: absolute; inset: 0;
  background: rgba(38, 33, 26, 0.42);
  backdrop-filter: blur(2px);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  opacity: 0; transition: opacity 0.32s var(--ease);
}
.modal-root.open .modal-mask { opacity: 1; }
.sheet {
  position: relative;
  width: 100%; max-width: 520px;
  max-height: 78vh;
  display: flex; flex-direction: column;
  background:
    linear-gradient(180deg, rgba(250,245,234,0.99), rgba(240,231,212,0.99));
  border-radius: 20px 20px 0 0;
  border-top: 1px solid rgba(176,138,68,0.55);
  box-shadow: 0 -14px 48px rgba(38,33,26,0.3);
  transform: translateY(28px);
  opacity: 0;
  transition: transform 0.4s var(--ease), opacity 0.32s var(--ease);
  overflow: hidden;
}
.sheet::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--cinnabar) 20%, var(--gold) 50%, var(--cinnabar) 80%, transparent);
  opacity: 0.75;
}
.modal-root.open .sheet { transform: translateY(0); opacity: 1; }
.sheet-grip {
  width: 38px; height: 4px; border-radius: 2px;
  background: rgba(122,114,102,0.3);
  margin: 9px auto 0; flex: none;
}
.sheet-head {
  flex: none;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px;
  padding: 12px 18px 12px;
  border-bottom: 1px solid rgba(176,138,68,0.25);
}
.sheet-title { display: flex; flex-direction: column; gap: 3px; }
.sheet-title h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 20px; letter-spacing: 3px; font-weight: 700;
}
.sheet-title p { margin: 0; font-size: 11.5px; color: var(--ink-mute); letter-spacing: 0.5px; line-height: 1.5; }
.close-btn {
  flex: none;
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid rgba(176,138,68,0.4);
  background: rgba(255,255,255,0.5);
  color: var(--ink-mute);
  font-size: 15px; line-height: 1;
  display: grid; place-items: center;
  cursor: pointer;
}
.sheet-body {
  padding: 16px 18px calc(20px + var(--safe-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.sheet-body::-webkit-scrollbar { width: 3px; }
.sheet-body::-webkit-scrollbar-thumb { background: rgba(176,138,68,0.4); border-radius: 2px; }

/* 通用按钮 */
.primary-btn {
  padding: 12px 30px;
  border: 1px solid rgba(217,189,128,0.8);
  border-radius: 12px;
  background: linear-gradient(160deg, #b8402a, #8d2614);
  color: #fbeed6;
  font-family: var(--font-serif);
  font-size: 16px; letter-spacing: 4px;
  box-shadow: 0 8px 20px rgba(141,38,20,0.3), inset 0 1px 0 rgba(255,255,255,0.22);
  cursor: pointer;
  transition: transform 0.16s var(--ease), filter 0.16s;
}
.primary-btn:active { transform: scale(0.97); filter: brightness(1.06); }
.primary-btn[disabled] { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.ghost-btn {
  padding: 12px 20px;
  border: 1px solid rgba(176,138,68,0.55);
  border-radius: 12px;
  background: rgba(255,255,255,0.4);
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: 14px; letter-spacing: 2px;
  cursor: pointer;
  transition: background 0.16s, transform 0.16s;
}
.ghost-btn:active { transform: scale(0.97); background: rgba(233,222,199,0.8); }
.ghost-btn.slim { padding: 9px 13px; font-size: 12.5px; letter-spacing: 1px; }

/* ---------------- 捏脸层 ---------------- */
.create-layer {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
  background: linear-gradient(180deg, rgba(30,26,20,0.28) 0%, rgba(30,26,20,0.12) 38%, rgba(30,26,20,0.55) 100%);
  transition: opacity 0.5s var(--ease), visibility 0.5s;
}
.create-layer.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.create-panel {
  width: 100%; max-width: 480px;
  padding: 20px 20px calc(20px + var(--safe-bottom));
  background: linear-gradient(180deg, rgba(250,245,234,0.97) 0%, rgba(241,232,214,0.99) 100%);
  border-radius: 22px 22px 0 0;
  border-top: 1px solid rgba(217,189,128,0.7);
  box-shadow: 0 -16px 50px rgba(30,26,20,0.35);
  animation: rise 0.55s var(--ease) both;
}
@keyframes rise { from { transform: translateY(38px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.create-head { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 16px; }
.small-seal {
  width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: 8px; margin-bottom: 2px;
  background: linear-gradient(150deg, #b8402a, #8d2614);
  color: #f8ecd4; font-family: var(--font-serif); font-size: 16px;
  box-shadow: inset 0 0 0 1.5px rgba(248,236,212,0.5);
}
.create-head h2 {
  margin: 0; font-family: var(--font-serif);
  font-size: 21px; letter-spacing: 3px; font-weight: 700;
}
.create-head p { margin: 0; font-size: 11.5px; color: var(--ink-mute); letter-spacing: 0.5px; }

.field { margin-bottom: 14px; }
.field-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--ink-soft);
  letter-spacing: 1px; margin-bottom: 7px;
}
.field-label b { font-family: var(--font-serif); font-size: 17px; color: var(--cinnabar); letter-spacing: 0; }
.field-label em { font-style: normal; font-size: 11px; color: var(--gold); letter-spacing: 1px; }

.seg {
  display: flex; padding: 3px; gap: 3px;
  background: rgba(228,217,196,0.7);
  border: 1px solid rgba(176,138,68,0.3);
  border-radius: 11px;
}
.seg button {
  flex: 1; padding: 9px 0;
  border: none; border-radius: 9px;
  background: transparent;
  color: var(--ink-mute);
  font-family: var(--font-serif); font-size: 14px; letter-spacing: 2px;
  cursor: pointer; transition: all 0.2s var(--ease);
}
.seg button.on {
  background: linear-gradient(160deg, #fdf8ec, #f0e5cf);
  color: var(--cinnabar);
  box-shadow: 0 2px 8px rgba(74,58,38,0.14), inset 0 0 0 1px rgba(176,138,68,0.35);
}

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 22px; background: transparent; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, rgba(176,138,68,0.75), rgba(92,132,113,0.6), rgba(168,51,31,0.65));
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px; margin-top: -8.5px;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, #fffaf0, #dcc9a4);
  border: 1.5px solid var(--cinnabar);
  box-shadow: 0 2px 8px rgba(74,58,38,0.3);
}
input[type="range"]::-moz-range-track { height: 3px; border-radius: 2px; background: rgba(176,138,68,0.6); }
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: #fffaf0; border: 1.5px solid var(--cinnabar);
}
.range-marks {
  display: flex; justify-content: space-between;
  font-size: 9.5px; color: var(--ink-mute);
  letter-spacing: 0.5px; padding: 0 2px;
}
.name-row { display: flex; gap: 8px; }
.name-row input {
  flex: 1; min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(176,138,68,0.45);
  background: rgba(255,255,255,0.55);
  font-family: var(--font-serif);
  font-size: 15px; letter-spacing: 2px; color: var(--ink);
  outline: none;
  -webkit-user-select: text; user-select: text;
}
.name-row input:focus { border-color: var(--cinnabar-soft); background: #fffdf7; }
.name-row input::placeholder { color: rgba(122,114,102,0.65); letter-spacing: 1px; font-size: 13px; }

.create-actions { display: flex; gap: 10px; margin-top: 18px; }
.create-actions .ghost-btn { flex: 0 0 auto; }
.create-actions .primary-btn { flex: 1; }
.create-hint {
  margin: 12px 0 0; text-align: center;
  font-size: 10.5px; color: var(--ink-mute); letter-spacing: 0.5px;
}

/* ---------------- 加载 ---------------- */
.loading {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 42%, #f5eddc, #ddd2ba 70%, #c9bda3);
  transition: opacity 0.7s var(--ease), visibility 0.7s;
}
.loading.done { opacity: 0; visibility: hidden; }
.loading-inner { display: flex; flex-direction: column; align-items: center; gap: 10px; }
@keyframes sealIn {
  0% { transform: scale(0.6) rotate(-8deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.loading-seal {
  width: 66px; height: 66px; display: grid; place-items: center;
  border-radius: 14px;
  background: linear-gradient(150deg, #b8402a, #8d2614);
  color: #f8ecd4; font-family: var(--font-serif); font-size: 36px;
  box-shadow: inset 0 0 0 2px rgba(248,236,212,0.5), 0 10px 30px rgba(141,38,20,0.3);
  animation: sealIn 0.9s var(--ease) both;
}
.loading-title {
  font-family: var(--font-serif); font-size: 22px;
  letter-spacing: 8px; color: var(--ink);
  text-indent: 8px;
  animation: sealIn 0.9s 0.15s var(--ease) both;
}
.loading-tip { font-size: 11.5px; color: var(--ink-mute); letter-spacing: 1.5px; }

/* ---------------- 提示条 ---------------- */
.toast-root {
  position: fixed; left: 0; right: 0;
  top: calc(116px + var(--safe-top));
  z-index: 60;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
  padding: 0 24px;
}
.toast {
  max-width: 100%;
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(43,41,37,0.86);
  color: #f7f1e2;
  font-size: 12.5px; letter-spacing: 1px;
  box-shadow: 0 8px 24px rgba(30,26,20,0.3);
  backdrop-filter: blur(6px);
  animation: toastIn 0.34s var(--ease) both;
  text-align: center;
}
.toast.out { animation: toastOut 0.4s var(--ease) both; }
.toast.good { background: linear-gradient(160deg, rgba(92,132,113,0.95), rgba(63,99,83,0.95)); }
.toast.warm { background: linear-gradient(160deg, rgba(184,64,42,0.95), rgba(141,38,20,0.95)); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px); } }

/* ---------------- 浮动名牌（3D 投影） ---------------- */
.nameplates { position: fixed; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; }
.plate {
  position: absolute; transform: translate(-50%, -100%);
  display: flex; align-items: center; gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(247,241,226,0.9);
  border: 1px solid rgba(176,138,68,0.4);
  font-size: 10.5px; color: var(--ink-soft);
  letter-spacing: 0.5px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(74,58,38,0.16);
  will-change: transform, left, top;
}
.plate.self { background: rgba(168,51,31,0.92); color: #fbeed6; border-color: rgba(248,236,212,0.5); }
.plate .tag {
  font-size: 9px; padding: 0 4px;
  border-radius: 4px;
  background: rgba(92,132,113,0.18);
  color: var(--jade-deep);
}
.plate.far { opacity: 0.55; }

/* 行动气泡 */
.bubble {
  position: absolute;
  transform: translate(-50%, -100%);
  padding: 5px 10px;
  border-radius: 12px 12px 12px 3px;
  background: rgba(255,252,243,0.95);
  border: 1px solid rgba(176,138,68,0.45);
  font-family: var(--font-serif);
  font-size: 13px; color: var(--cinnabar);
  box-shadow: 0 4px 14px rgba(74,58,38,0.2);
  animation: bubbleIn 0.28s var(--ease) both;
  white-space: nowrap;
}
@keyframes bubbleIn { from { opacity: 0; transform: translate(-50%, -90%) scale(0.85); } to { opacity: 1; transform: translate(-50%, -100%) scale(1); } }

/* ---------------- 内容排版组件 ---------------- */
.verse {
  font-family: var(--font-serif);
  font-size: 15px; line-height: 2;
  letter-spacing: 1.5px;
  color: var(--ink);
  white-space: pre-wrap;
  text-align: center;
}
.verse.small { font-size: 13px; line-height: 1.9; }
.divider {
  height: 1px; margin: 14px 0;
  background: linear-gradient(90deg, transparent, rgba(176,138,68,0.5), transparent);
}
.note { font-size: 11.5px; color: var(--ink-mute); line-height: 1.8; letter-spacing: 0.3px; }
.center { text-align: center; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.row-actions > * { flex: 1; min-width: 110px; }

/* 抽签 */
.stick-stage {
  position: relative;
  height: 132px;
  margin: 4px 0 10px;
  display: grid; place-items: center;
  perspective: 700px;
}
.stick-tube {
  position: relative;
  width: 62px; height: 96px;
  border-radius: 8px 8px 26px 26px;
  background: linear-gradient(100deg, #8d5a34, #b9814f 40%, #7a4a2a);
  box-shadow: inset -6px 0 12px rgba(0,0,0,0.25), 0 8px 20px rgba(74,58,38,0.3);
  border: 1px solid rgba(60,38,20,0.5);
}
.stick-tube::after {
  content: ""; position: absolute; left: -4px; right: -4px; top: 10px; height: 11px;
  background: linear-gradient(180deg, #c0341f, #92230f);
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.stick-tube i {
  position: absolute; bottom: 26px; width: 5px; height: 60px;
  background: linear-gradient(180deg, #f0e2c4, #cbb188);
  border-radius: 3px 3px 0 0;
  box-shadow: 0 0 2px rgba(0,0,0,0.2);
}
.shake .stick-tube { animation: shakeTube 0.5s ease-in-out; }
@keyframes shakeTube {
  0%,100% { transform: rotate(0deg); }
  15% { transform: rotate(-7deg); } 35% { transform: rotate(6deg); }
  55% { transform: rotate(-5deg); } 75% { transform: rotate(3deg); }
}
.stick-fly {
  position: absolute; top: 18px; left: 50%;
  width: 8px; height: 84px;
  border-radius: 3px;
  background: linear-gradient(180deg, #fdf6e3, #d8bd90);
  border: 1px solid rgba(140,110,70,0.6);
  transform: translateX(-50%);
  animation: stickFly 0.9s var(--ease) both;
  box-shadow: 0 4px 12px rgba(74,58,38,0.25);
}
.stick-fly::after { content: "签"; position: absolute; top: 6px; left: 50%; transform: translateX(-50%); font-family: var(--font-serif); font-size: 9px; color: var(--cinnabar); }
@keyframes stickFly {
  0% { opacity: 0; transform: translate(-50%, 40px) rotate(0); }
  40% { opacity: 1; }
  100% { opacity: 1; transform: translate(-50%, -26px) rotate(10deg); }
}

.result-card {
  margin-top: 6px;
  padding: 16px 16px 14px;
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,0.75), rgba(255,255,255,0) 65%),
    linear-gradient(180deg, rgba(253,248,236,0.95), rgba(243,234,216,0.95));
  border: 1px solid rgba(176,138,68,0.45);
  box-shadow: 0 6px 20px rgba(74,58,38,0.12), inset 0 0 0 4px rgba(255,255,255,0.35);
  animation: resultIn 0.5s var(--ease) both;
}
@keyframes resultIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.result-level {
  font-family: var(--font-serif);
  font-size: 25px; letter-spacing: 8px;
  text-align: center; margin-bottom: 4px;
  text-indent: 8px;
}
.result-level.best { color: var(--cinnabar); }
.result-level.good { color: var(--jade-deep); }
.result-level.mid { color: var(--gold); }
.result-level.low { color: var(--ink-mute); }
.result-poem {
  font-family: var(--font-serif);
  font-size: 14.5px; line-height: 2.1;
  letter-spacing: 1px; text-align: center;
  color: var(--ink);
  white-space: pre-line;
  margin: 8px 0 10px;
  padding: 10px 0;
  border-top: 1px solid rgba(176,138,68,0.25);
  border-bottom: 1px solid rgba(176,138,68,0.25);
}
.result-read { font-size: 12px; line-height: 1.9; color: var(--ink-soft); letter-spacing: 0.3px; }
.result-read b { color: var(--cinnabar); font-weight: 600; }

/* 许愿池 */
.wish-form { display: flex; flex-direction: column; gap: 10px; }
.wish-form textarea {
  width: 100%; min-height: 74px; resize: none;
  padding: 11px 13px;
  border-radius: 11px;
  border: 1px solid rgba(176,138,68,0.45);
  background: rgba(255,255,255,0.55);
  font-family: var(--font-serif);
  font-size: 14px; line-height: 1.7; letter-spacing: 1px;
  color: var(--ink); outline: none;
  -webkit-user-select: text; user-select: text;
}
.wish-form textarea:focus { border-color: var(--cinnabar-soft); background: #fffdf7; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(176,138,68,0.45);
  background: rgba(255,255,255,0.4);
  font-size: 11.5px; color: var(--ink-soft);
  letter-spacing: 0.5px;
  cursor: pointer;
}
.chip.on { background: rgba(168,51,31,0.1); border-color: var(--cinnabar-soft); color: var(--cinnabar); }

/* 上香 */
.incense-stage {
  position: relative; height: 150px;
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 16px;
}
.censer {
  position: relative;
  width: 110px; height: 54px;
  border-radius: 8px 8px 40% 40%;
  background: linear-gradient(170deg, #a9762f, #7a4f1c 55%, #5d3a12);
  box-shadow: inset 0 8px 12px rgba(255,220,150,0.2), 0 8px 18px rgba(74,58,38,0.28);
  border: 1px solid rgba(60,38,12,0.5);
}
.censer::before {
  content: ""; position: absolute; left: -6px; right: -6px; top: -6px; height: 12px;
  border-radius: 6px;
  background: linear-gradient(180deg, #c99a4e, #8a5c22);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.censer-ash {
  position: absolute; left: 12px; right: 12px; top: 1px; height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle, #d8d2c4, #a9a294);
}
.incense {
  position: absolute; bottom: 42px; left: 50%;
  width: 3px; height: 74px;
  background: linear-gradient(180deg, #8a4a2a, #b07a4a);
  border-radius: 2px;
  transform-origin: bottom center;
}
.incense:nth-child(1) { transform: translateX(-50%) rotate(-7deg); }
.incense:nth-child(2) { transform: translateX(-50%) rotate(0deg); height: 82px; }
.incense:nth-child(3) { transform: translateX(-50%) rotate(7deg); }
.incense .ember {
  position: absolute; top: -2px; left: -1px;
  width: 5px; height: 5px; border-radius: 50%;
  background: radial-gradient(circle, #ffd27a, #e0532a);
  box-shadow: 0 0 8px rgba(224,83,42,0.85);
  animation: ember 2.2s ease-in-out infinite;
}
@keyframes ember { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }
.smoke {
  position: absolute; bottom: 116px; left: 50%;
  width: 4px; height: 0;
  transform: translateX(-50%);
  pointer-events: none;
}
.smoke i {
  position: absolute; bottom: 0; left: -2px;
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(160,155,145,0.42);
  animation: smokeUp 3.4s linear infinite;
}
@keyframes smokeUp {
  0% { opacity: 0; transform: translate(0, 0) scale(0.7); }
  18% { opacity: 0.55; }
  60% { opacity: 0.28; }
  100% { opacity: 0; transform: translate(14px, -72px) scale(1.9); }
}

/* 同游 / 导览列表 */
.list { display: flex; flex-direction: column; gap: 8px; }
.list-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px;
  border-radius: 12px;
  background: rgba(255,255,255,0.45);
  border: 1px solid rgba(176,138,68,0.28);
}
.person-avatar {
  width: 34px; height: 34px; flex: none;
  border-radius: 9px;
  display: grid; place-items: center;
  font-family: var(--font-serif); font-size: 16px;
  color: #f8ecd4;
  background: linear-gradient(150deg, #5c8471, #3f6353);
  box-shadow: inset 0 0 0 1.2px rgba(248,236,212,0.4);
}
.person-avatar.f { background: linear-gradient(150deg, #b8768a, #8a4a5e); }
.person-avatar.npc { background: linear-gradient(150deg, #b08a44, #7f5f26); }
.person-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.person-meta strong { font-size: 13px; font-weight: 600; }
.person-meta span { font-size: 10.5px; color: var(--ink-mute); }
.person-actions { display: flex; gap: 6px; }
.mini-btn {
  padding: 6px 10px;
  border-radius: 9px;
  border: 1px solid rgba(176,138,68,0.4);
  background: rgba(255,255,255,0.5);
  font-size: 11px; letter-spacing: 0.5px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: transform 0.15s, background 0.15s, color 0.15s;
}
.mini-btn:active { transform: scale(0.94); }
.mini-btn.liked { background: rgba(168,51,31,0.1); border-color: var(--cinnabar-soft); color: var(--cinnabar); }
.mini-btn.followed { background: rgba(92,132,113,0.14); border-color: var(--jade); color: var(--jade-deep); }

.tabs {
  display: flex; gap: 4px; margin-bottom: 12px;
  padding: 3px; border-bottom: 1px solid rgba(176,138,68,0.25);
}
.tabs button {
  flex: 1; padding: 8px 0;
  border: none; background: transparent;
  font-family: var(--font-serif);
  font-size: 13px; letter-spacing: 1px;
  color: var(--ink-mute);
  border-bottom: 2px solid transparent;
  cursor: pointer;
}
.tabs button.on { color: var(--cinnabar); border-bottom-color: var(--cinnabar); }

.stat-row { display: flex; gap: 8px; margin-bottom: 12px; }
.stat {
  flex: 1; padding: 10px 8px;
  border-radius: 12px;
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(176,138,68,0.3);
  text-align: center;
}
.stat b {
  display: block;
  font-family: var(--font-serif);
  font-size: 21px; color: var(--cinnabar); line-height: 1.2;
}
.stat span { font-size: 10px; color: var(--ink-mute); letter-spacing: 0.5px; }

.site-row {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 11px;
  border-radius: 12px;
  background: rgba(255,255,255,0.42);
  border: 1px solid rgba(176,138,68,0.26);
  margin-bottom: 8px;
}
.site-seal {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center;
  border-radius: 8px;
  font-family: var(--font-serif); font-size: 15px;
  color: #f8ecd4;
  background: linear-gradient(150deg, #5c8471, #3f6353);
}
.site-seal.warm { background: linear-gradient(150deg, #b8402a, #8d2614); }
.site-seal.gold { background: linear-gradient(150deg, #b08a44, #7f5f26); }
.site-copy { flex: 1; min-width: 0; }
.site-copy strong { display: block; font-family: var(--font-serif); font-size: 14px; letter-spacing: 1px; margin-bottom: 2px; }
.site-copy span { font-size: 11px; color: var(--ink-mute); line-height: 1.6; display: block; }
.go-btn {
  flex: none; align-self: center;
  padding: 7px 11px;
  border-radius: 9px;
  border: 1px solid rgba(168,51,31,0.5);
  background: rgba(168,51,31,0.08);
  color: var(--cinnabar);
  font-size: 11px; letter-spacing: 0.5px;
  cursor: pointer;
}

/* 菜单 */
.menu-list { display: flex; flex-direction: column; gap: 1px; }
.menu-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 13px 4px;
  border: none; border-bottom: 1px solid rgba(176,138,68,0.18);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.menu-item:last-child { border-bottom: none; }
.menu-item strong { font-family: var(--font-serif); font-size: 14.5px; font-weight: 600; letter-spacing: 1px; color: var(--ink); }
.menu-item span { font-size: 11px; color: var(--ink-mute); }
.menu-item em { font-style: normal; font-size: 11px; color: var(--gold); }

@media (min-width: 760px) {
  .hud { padding: calc(10px + var(--safe-top)) 14px calc(10px + var(--safe-bottom)); }
  .brand { padding: 6px 14px 6px 6px; gap: 8px; }
  .brand-seal { width: 30px; height: 30px; font-size: 18px; border-radius: 8px; }
  .brand-name { font-size: 17px; letter-spacing: 2px; }
  .brand-sub { font-size: 11px; padding-left: 8px; }
  .brand-weather { display: inline; }
  .topbar-right { gap: 8px; }
  .pill { padding: 7px 12px; font-size: 12px; gap: 5px; }
  .round-btn { width: 38px; height: 38px; }
  .round-btn svg { width: 19px; height: 19px; }
  .self-card { gap: 9px; padding: 7px 8px 7px 7px; border-radius: 12px; }
  .self-avatar { width: 34px; height: 34px; font-size: 17px; border-radius: 9px; }
  .self-meta strong { font-size: 13px; }
  .self-meta span { font-size: 10.5px; }
  .self-edit { font-size: 10.5px; padding: 4px 7px; }
  .place-label { top: calc(74px + var(--safe-top)); font-size: 20px; letter-spacing: 6px; }
  .side-nav { right: 12px; top: 50%; gap: 10px; }
  .nav-btn { width: 46px; padding: 7px 0 5px; border-radius: 12px; }
  .action-dock { padding-left: 0; padding-right: 0; bottom: 6px; }
  .interact-btn { position: static; padding: 8px 26px; }
  .interact-verb { font-size: 17px; letter-spacing: 3px; }
  .act-btn { width: 44px; }
  .joystick { left: 32px; bottom: 32px; width: 124px; height: 124px; }
  .joystick-knob { width: 52px; height: 52px; }
  .modal-root { align-items: center; padding: 20px; }
  .sheet { border-radius: 20px; max-height: 84vh; }
  .create-layer { align-items: center; }
  .create-panel { border-radius: 22px; max-width: 440px; }
  .move-hint { left: 50%; transform: translateX(-50%); bottom: 98px; }
}
/* ---------------- 心愿值、商城与历史记录 ---------------- */
.wish-pill {
  cursor: pointer;
  border-color: rgba(168,51,31,0.38);
  background: linear-gradient(135deg, rgba(252,246,232,0.94), rgba(242,230,204,0.88));
}
.wish-pill strong {
  font-family: var(--font-serif);
  color: var(--cinnabar);
  font-size: 13px;
}
.wish-star {
  display: inline-grid; place-items: center;
  width: 17px; height: 17px; border-radius: 5px;
  background: linear-gradient(150deg, #b8402a, #8d2614);
  color: #fbeed6; font-family: var(--font-serif); font-size: 11px;
}

.preset-label { font-size: 11px; color: var(--ink-mute); margin-top: 2px; }
.preset-list { display: flex; flex-wrap: wrap; gap: 6px; }
.preset-chip {
  padding: 5px 10px;
  border-radius: 9px;
  border: 1px dashed rgba(176,138,68,0.5);
  background: rgba(255,253,246,0.65);
  font-size: 11px; color: var(--ink-soft);
  cursor: pointer; text-align: left;
  transition: background 0.15s, border-color 0.15s;
}
.preset-chip:active, .preset-chip.on {
  background: rgba(176,138,68,0.16);
  border-color: var(--cinnabar-soft);
  color: var(--cinnabar);
}

.daily-done-box {
  padding: 14px 14px 12px;
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(252,248,238,0.92), rgba(242,232,212,0.92));
  border: 1px solid rgba(176,138,68,0.45);
  margin-bottom: 10px;
}
.daily-done-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 8px;
}
.daily-done-head strong { font-family: var(--font-serif); font-size: 15px; color: var(--cinnabar); letter-spacing: 1px; }
.daily-done-time { font-size: 11px; color: var(--jade-deep); background: rgba(92,132,113,0.14); padding: 2px 8px; border-radius: 999px; }
.daily-done-body { font-size: 13px; line-height: 1.85; color: var(--ink); white-space: pre-line; }

.mall-banner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 13px; margin-bottom: 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(252,246,232,0.92), rgba(238,225,198,0.86));
  border: 1px solid rgba(176,138,68,0.45);
}
.mall-banner strong { font-family: var(--font-serif); font-size: 18px; color: var(--cinnabar); }
.mall-banner span { font-size: 11.5px; color: var(--ink-mute); }

.mall-grid { display: flex; flex-direction: column; gap: 9px; }
.mall-card {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 12px; border-radius: 13px;
  background: rgba(255,255,255,0.52);
  border: 1px solid rgba(176,138,68,0.34);
}
.mall-seal {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center; border-radius: 10px;
  font-family: var(--font-serif); font-size: 18px; color: #fbeed6;
  background: linear-gradient(150deg, #b08a44, #7f5f26);
  box-shadow: inset 0 0 0 1.2px rgba(255,244,214,0.45);
}
.mall-seal.blessed {
  background: linear-gradient(150deg, #b8402a, #8d2614);
  box-shadow: 0 0 12px rgba(184,64,42,0.3), inset 0 0 0 1.2px rgba(255,244,214,0.6);
}
.mall-meta { flex: 1; min-width: 0; }
.mall-meta strong { display: block; font-family: var(--font-serif); font-size: 14.5px; letter-spacing: 0.8px; }
.mall-meta p { margin: 2px 0 3px; font-size: 11px; color: var(--ink-mute); line-height: 1.5; }
.mall-tag { display: inline-block; font-size: 10px; padding: 1px 7px; border-radius: 999px; background: rgba(92,132,113,0.14); color: var(--jade-deep); }
.mall-tag.blessed { background: rgba(168,51,31,0.12); color: var(--cinnabar); }
.mall-act { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.mall-price { font-family: var(--font-serif); font-size: 13px; color: var(--gold); font-weight: 600; }

.daily-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  margin-bottom: 12px;
}
.daily-chip {
  padding: 7px 6px; border-radius: 10px; text-align: center;
  background: rgba(255,255,255,0.45);
  border: 1px solid rgba(176,138,68,0.28);
  font-size: 11px; color: var(--ink-mute);
}
.daily-chip.done {
  background: rgba(92,132,113,0.14);
  border-color: rgba(92,132,113,0.45);
  color: var(--jade-deep);
}
.daily-chip b { display: block; font-family: var(--font-serif); font-size: 12.5px; margin-bottom: 1px; }

.history-row {
  padding: 9px 11px; border-radius: 11px;
  background: rgba(255,255,255,0.48);
  border: 1px solid rgba(176,138,68,0.26);
  margin-bottom: 7px;
}
.history-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11.5px; margin-bottom: 3px;
}
.history-head strong { font-family: var(--font-serif); font-size: 13px; color: var(--ink); }
.history-pts { font-size: 11px; color: var(--jade-deep); font-weight: 600; }
.history-pts.minus { color: var(--cinnabar); }
.history-content { font-size: 11.5px; color: var(--ink-soft); line-height: 1.6; }

@media (max-height: 560px) {
  .self-card { display: none; }
  .joystick { width: 94px; height: 94px; bottom: calc(16px + var(--safe-bottom)); }
  .joystick-knob { width: 40px; height: 40px; }
  .act-btn { width: 40px; }
  .interact-btn { bottom: calc(68px + var(--safe-bottom)); }
  .move-hint { bottom: calc(118px + var(--safe-bottom)); }
}