/* 她的家 · 门户主页（方向 A：汐屿明信片 · 昼夜自适应）
 * 4 时段视觉令牌：morning / day / dusk / night
 */

:root {
  --font-sans: "PingFang SC", "Microsoft YaHei UI", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  --font-serif: "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;

  /* 默认白天（海盐奶白 + 潮汐蓝 + 浅海青） */
  --ink: #1f2d42;
  --ink-soft: #4e627d;
  --ink-muted: #6c809a;
  --accent: #2d5f9e;
  --accent-2: #52adc0;
  --accent-ink: #ffffff;
  --warm-gold: #d99b43;

  --surface: rgba(255, 253, 248, 0.76);
  --surface-strong: rgba(255, 253, 248, 0.90);
  --surface-tile: rgba(255, 255, 255, 0.66);
  --surface-tile-hover: rgba(255, 255, 255, 0.92);
  --surface-pill: rgba(255, 253, 248, 0.72);
  --border: rgba(255, 255, 255, 0.78);
  --border-subtle: rgba(45, 95, 158, 0.14);
  --shadow-card: 0 24px 60px rgba(20, 44, 76, 0.18), 0 4px 16px rgba(20, 44, 76, 0.08);
  --shadow-soft: 0 10px 28px rgba(20, 44, 76, 0.12);

  --fallback-bg:
    radial-gradient(1100px 620px at 22% 18%, rgba(255, 250, 232, 0.92), transparent 62%),
    radial-gradient(900px 560px at 84% 72%, rgba(114, 206, 224, 0.68), transparent 65%),
    linear-gradient(170deg, #8ec9e8 0%, #c6e6f4 48%, #f3e9d8 78%, #dfcba8 100%);
  --vignette: linear-gradient(100deg, rgba(16, 36, 62, 0.08) 0%, rgba(16, 36, 62, 0.02) 48%, rgba(16, 36, 62, 0.14) 100%);
  --actor-filter: drop-shadow(0 18px 34px rgba(22, 46, 82, 0.22));
  --bubble-bg: rgba(255, 253, 248, 0.90);
  --bubble-border: rgba(255, 255, 255, 0.95);
  --input-bg: rgba(255, 255, 255, 0.80);
  --input-border: rgba(45, 95, 158, 0.20);
  --outing-bg: linear-gradient(120deg, rgba(255, 246, 214, 0.92), rgba(255, 236, 189, 0.84));
  --outing-border: rgba(224, 173, 74, 0.55);
  --outing-ink: #6a440a;
}

/* 清晨：海雾淡青蓝 + 朝霞微粉 */
html[data-period="morning"] {
  --ink: #22324a;
  --ink-soft: #526784;
  --ink-muted: #7085a2;
  --accent: #3d6fb0;
  --accent-2: #76b9d4;
  --surface: rgba(252, 251, 255, 0.76);
  --surface-strong: rgba(254, 252, 255, 0.90);
  --surface-tile: rgba(255, 255, 255, 0.68);
  --surface-pill: rgba(252, 250, 255, 0.72);
  --fallback-bg:
    radial-gradient(960px 580px at 78% 24%, rgba(255, 216, 212, 0.82), transparent 62%),
    radial-gradient(880px 540px at 20% 72%, rgba(166, 218, 235, 0.75), transparent 66%),
    linear-gradient(175deg, #8fb8dc 0%, #c8dfef 44%, #f4dce0 76%, #e7d8cc 100%);
  --actor-filter: drop-shadow(0 18px 34px rgba(34, 56, 94, 0.22)) saturate(0.98) brightness(1.01);
}

/* 黄昏：蜜桃晚霞 + 琥珀暖灯 */
html[data-period="dusk"] {
  --ink: #2f2336;
  --ink-soft: #66506b;
  --ink-muted: #846a87;
  --accent: #b85c48;
  --accent-2: #e69d5c;
  --surface: rgba(255, 247, 239, 0.78);
  --surface-strong: rgba(255, 249, 242, 0.92);
  --surface-tile: rgba(255, 250, 244, 0.68);
  --surface-tile-hover: rgba(255, 252, 247, 0.94);
  --surface-pill: rgba(255, 245, 236, 0.74);
  --border: rgba(255, 238, 218, 0.82);
  --border-subtle: rgba(184, 92, 72, 0.18);
  --fallback-bg:
    radial-gradient(960px 560px at 66% 36%, rgba(255, 198, 134, 0.88), transparent 62%),
    radial-gradient(820px 520px at 18% 20%, rgba(124, 114, 178, 0.75), transparent 64%),
    linear-gradient(172deg, #4b507f 0%, #a56d88 38%, #eb9d79 72%, #f4c68e 100%);
  --vignette: linear-gradient(100deg, rgba(44, 24, 52, 0.16) 0%, rgba(44, 24, 52, 0.04) 48%, rgba(44, 24, 52, 0.24) 100%);
  --actor-filter: drop-shadow(0 20px 38px rgba(56, 26, 44, 0.34)) sepia(0.08) saturate(1.06);
  --bubble-bg: rgba(255, 248, 240, 0.92);
  --input-border: rgba(184, 92, 72, 0.24);
}

/* 星夜：深海午夜蓝 + 月光青 + 暖灯琥珀金（呼应 App 深海美学） */
html[data-period="night"] {
  color-scheme: dark;
  --ink: #eef5ff;
  --ink-soft: #b6cbe6;
  --ink-muted: #84a0c4;
  --accent: #68c6e8;
  --accent-2: #f5c987;
  --accent-ink: #0a1728;

  --surface: rgba(13, 27, 46, 0.70);
  --surface-strong: rgba(16, 33, 56, 0.88);
  --surface-tile: rgba(22, 43, 72, 0.64);
  --surface-tile-hover: rgba(30, 58, 94, 0.84);
  --surface-pill: rgba(13, 27, 46, 0.68);
  --border: rgba(154, 206, 240, 0.22);
  --border-subtle: rgba(154, 206, 240, 0.14);
  --shadow-card: 0 28px 68px rgba(4, 10, 22, 0.56), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --shadow-soft: 0 12px 30px rgba(4, 10, 22, 0.42);

  --fallback-bg:
    radial-gradient(900px 520px at 78% 68%, rgba(245, 198, 126, 0.20), transparent 62%),
    radial-gradient(880px 520px at 26% 18%, rgba(74, 146, 212, 0.28), transparent 64%),
    linear-gradient(175deg, #081222 0%, #0f213b 48%, #163253 82%, #1d3955 100%);
  --vignette: linear-gradient(100deg, rgba(6, 12, 24, 0.28) 0%, rgba(6, 12, 24, 0.10) 46%, rgba(6, 12, 24, 0.36) 100%);
  --actor-filter: drop-shadow(0 20px 42px rgba(4, 10, 24, 0.62)) brightness(0.92) contrast(1.03);
  --bubble-bg: rgba(16, 34, 58, 0.84);
  --bubble-border: rgba(146, 204, 240, 0.28);
  --input-bg: rgba(9, 20, 36, 0.64);
  --input-border: rgba(146, 204, 240, 0.24);
  --outing-bg: linear-gradient(120deg, rgba(245, 201, 135, 0.20), rgba(245, 180, 96, 0.12));
  --outing-border: rgba(245, 201, 135, 0.42);
  --outing-ink: #ffe1ad;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100svh;
  font-family: var(--font-sans);
  color: var(--ink);
  overflow-x: hidden;
}

button, input, a {
  font: inherit;
  color: inherit;
}

button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- 背景层与昼夜交叉渐变 ---------- */
#backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-fallback,
.bg-layer,
.lobby-video,
.bg-vignette,
#ambient-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.lobby-video {
  object-fit: cover;
  object-position: center center;
  opacity: 0;
  transition: opacity 0.85s ease;
}

.lobby-video.active {
  opacity: 1;
}

/* 当当前时段启用了动态大厅视频（视频内已包含潮汐与露台实景），隐藏静态立绘避免叠影，保留气泡与点击互动热区 */
body.has-lobby-video #static-actor-img,
body.has-lobby-video #live2d-canvas {
  opacity: 0;
  pointer-events: none;
}

body.has-lobby-video .character-stage {
  justify-content: flex-start;
  padding-top: 12px;
}

body.has-lobby-video .hero-bubble {
  margin-bottom: 0;
}

body.has-lobby-video .stage-caption {
  margin-top: auto;
}

.bg-fallback {
  background: var(--fallback-bg);
  transition: background 1s ease;
}

.bg-layer {
  background-size: cover;
  background-position: center center;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity 1.1s ease, transform 1.4s ease;
}

.bg-layer.active {
  opacity: 1;
  transform: scale(1.0);
}

.bg-vignette {
  background: var(--vignette);
  transition: background 1s ease;
}

#ambient-canvas {
  opacity: 0.85;
}

/* ---------- 顶部明信片栏 ---------- */
.topbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px clamp(16px, 3.2vw, 38px) 8px;
}

.postmark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 8px 15px 8px 11px;
  background: var(--surface-pill);
  border: 1px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(16px) saturate(1.25);
  -webkit-backdrop-filter: blur(16px) saturate(1.25);
  box-shadow: var(--shadow-soft);
}

.postmark-ring {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px dashed var(--accent);
  position: relative;
  flex-shrink: 0;
}

.postmark-ring::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.postmark-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.postmark-en {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--ink-muted);
  font-weight: 600;
}

.postmark-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  margin-top: 2px;
}

.sep { opacity: 0.45; }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.period-switcher {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--surface-pill);
  border: 1px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-soft);
}

.period-switcher button {
  border: 0;
  background: transparent;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: background 0.2s ease, color 0.2s ease;
}

.period-switcher button:hover {
  color: var(--ink);
}

.period-switcher button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
}

.chip-btn,
.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--surface-pill);
  border: 1px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, background 0.2s ease;
}

.chip-btn:hover {
  background: var(--surface-strong);
  transform: translateY(-1px);
}

.user-role-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #42c98e;
  box-shadow: 0 0 0 3px rgba(66, 201, 142, 0.22);
}

.text-link {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.text-link:hover { text-decoration: underline; }

/* ---------- 主舞台双栏布局 ---------- */
.stage-shell {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(290px, 1.05fr) minmax(350px, 470px);
  align-items: center;
  gap: clamp(18px, 4vw, 56px);
  min-height: calc(100svh - 118px);
  max-width: 1240px;
  margin: 0 auto;
  padding: 8px clamp(16px, 4vw, 48px) 22px;
}

/* ---------- 左侧：潮汐立绘 / Live2D 舞台 ---------- */
.character-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-height: min(74svh, 660px);
  padding-top: 24px;
}

.hero-bubble {
  position: relative;
  z-index: 4;
  max-width: 340px;
  margin-bottom: 14px;
  padding: 12px 16px;
  background: var(--bubble-bg);
  border: 1px solid var(--bubble-border);
  border-radius: 20px 20px 20px 6px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow-soft);
  transition: transform 0.35s ease, opacity 0.35s ease, background 0.6s ease;
}

.hero-bubble::after {
  content: "";
  position: absolute;
  left: 28px;
  bottom: -7px;
  width: 13px;
  height: 13px;
  background: var(--bubble-bg);
  border-right: 1px solid var(--bubble-border);
  border-bottom: 1px solid var(--bubble-border);
  transform: rotate(45deg);
}

.bubble-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 3px;
}

.hero-bubble p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
}

.actor-frame {
  position: relative;
  width: min(100%, 520px);
  height: min(70svh, 620px);
  display: grid;
  place-items: end center;
  will-change: transform;
  transition: transform 0.18s ease-out;
}

#live2d-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: manipulation;
  filter: drop-shadow(0 16px 32px rgba(18, 40, 74, 0.22));
}

.live2d-controls {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.l2d-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface-pill);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-soft);
}

.l2d-group button {
  border: 0;
  background: transparent;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: background 0.18s ease, color 0.18s ease;
}

.l2d-group button:hover {
  color: var(--ink);
  background: var(--surface-tile);
}

.l2d-group button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
}

.static-actor-btn {
  border: 0;
  background: transparent;
  padding: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  cursor: pointer;
}

.static-actor-btn:focus-visible {
  outline-offset: 6px;
  border-radius: 24px;
}

#static-actor-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center bottom;
  filter: var(--actor-filter);
  transform-origin: center bottom;
  animation: actor-breathe 4.6s ease-in-out infinite;
  transition: filter 0.8s ease, opacity 0.4s ease;
  user-select: none;
}

#static-actor-img.is-fallback {
  max-height: min(44svh, 350px);
  margin-bottom: 24px;
}

.actor-frame.react-hop #static-actor-img {
  animation: actor-hop 0.55s cubic-bezier(0.22, 1.35, 0.36, 1);
}

@keyframes actor-breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-6px) scale(1.008); }
}

@keyframes actor-hop {
  0% { transform: translateY(0) scale(1); }
  38% { transform: translateY(-16px) scale(1.03); }
  72% { transform: translateY(-3px) scale(0.995); }
  100% { transform: translateY(0) scale(1); }
}

.stage-caption {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--ink-soft);
  background: var(--surface-pill);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

#stage-mode-badge {
  font-weight: 700;
  color: var(--accent);
}

/* ---------- 右侧：毛玻璃明信片卡片 ---------- */
.portal-panel {
  width: 100%;
}

.glass-card {
  position: relative;
  padding: clamp(22px, 3vw, 32px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 26px;
  backdrop-filter: blur(22px) saturate(1.3);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  box-shadow: var(--shadow-card);
  transition: background 0.6s ease, border-color 0.6s ease, box-shadow 0.6s ease;
}

.card-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--accent);
}

.whale-mark {
  font-size: 15px;
  line-height: 1;
}

.glass-card h1 {
  margin: 8px 0 6px;
  font-family: var(--font-serif);
  font-size: clamp(24px, 2.5vw, 31px);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

.card-sub {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* 身份切换 Tab */
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 22px 0 18px;
  padding: 4px;
  border-radius: 14px;
  background: var(--surface-tile);
  border: 1px solid var(--border-subtle);
}

.auth-tabs button {
  border: 0;
  background: transparent;
  padding: 9px 12px;
  border-radius: 11px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.auth-tabs button[aria-selected="true"] {
  background: var(--surface-strong);
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(18, 38, 68, 0.10);
}

/* 表单 */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field span {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
}

.field input,
.legacy-inner input,
.chat-compose input {
  width: 100%;
  padding: 11px 13px;
  border-radius: 13px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--ink);
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.field input:focus,
.legacy-inner input:focus,
.chat-compose input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.check-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}

.btn-primary {
  width: 100%;
  margin-top: 4px;
  padding: 12px 18px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 32%, transparent);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px color-mix(in srgb, var(--accent) 38%, transparent);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

.btn-soft {
  padding: 9px 13px;
  border-radius: 11px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-tile);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.btn-soft:hover {
  background: var(--surface-tile-hover);
}

.legacy-box {
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-muted);
}

.legacy-box summary {
  cursor: pointer;
  user-select: none;
}

.legacy-inner {
  display: flex;
  gap: 8px;
  margin-top: 9px;
}

.friend-note {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-muted);
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-tile);
  border: 1px dashed var(--border-subtle);
}

.auth-feedback {
  margin: 12px 0 0;
  min-height: 1.3em;
  font-size: 12.5px;
  color: #d64545;
  font-weight: 600;
}

html[data-period="night"] .auth-feedback {
  color: #ff9494;
}

/* ---------- 登录后：客厅入口枢纽 ---------- */
.hub-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--border-subtle);
}

.hub-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  background: var(--surface-tile);
  box-shadow: 0 6px 16px rgba(18, 38, 68, 0.14);
  flex-shrink: 0;
}

.hub-status-copy { min-width: 0; flex: 1; }

.hub-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.hub-card h1 {
  margin: 0;
  font-size: clamp(20px, 2vw, 24px);
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--surface-tile);
  border: 1px solid var(--border-subtle);
  color: var(--ink-soft);
}

.live-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3bc487;
  box-shadow: 0 0 8px rgba(59, 196, 135, 0.7);
}

.hub-detail {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.45;
}

/* 外出暖金提示条 */
.outing-banner {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 14px;
  padding: 11px 14px;
  border-radius: 16px;
  background: var(--outing-bg);
  border: 1px solid var(--outing-border);
  color: var(--outing-ink);
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.outing-banner:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(180, 128, 32, 0.18);
}

.outing-dot { font-size: 16px; }
.outing-copy { flex: 1; min-width: 0; }
.outing-copy strong { display: block; font-size: 13.5px; }
.outing-copy small { display: block; font-size: 12px; opacity: 0.85; }
.outing-go { font-size: 12.5px; font-weight: 700; white-space: nowrap; }

/* 入口卡片组 */
.entry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
  margin-top: 16px;
}

.entry-hero {
  grid-column: 1 / -1;
  padding: 15px 16px 13px;
  border-radius: 18px;
  background: var(--surface-tile);
  border: 1px solid var(--border);
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.entry-hero:hover {
  background: var(--surface-tile-hover);
  box-shadow: var(--shadow-soft);
}

.entry-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.entry-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.mini-switch {
  border: 1px solid var(--border-subtle);
  background: transparent;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-soft);
}

.mini-switch:hover {
  color: var(--ink);
  background: var(--surface-strong);
}

.entry-hero-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  text-decoration: none;
}

.entry-hero-link h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.entry-hero-link p {
  margin: 4px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.enter-arrow {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
}

.pack-slot {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 11px;
  padding-top: 9px;
  border-top: 1px dashed var(--border-subtle);
  font-size: 11.5px;
  color: var(--ink-muted);
}

.pack-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  flex-shrink: 0;
}

.entry-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  border-radius: 17px;
  background: var(--surface-tile);
  border: 1px solid var(--border);
  text-decoration: none;
  text-align: left;
  position: relative;
  transition: transform 0.18s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.entry-tile:hover {
  transform: translateY(-2px);
  background: var(--surface-tile-hover);
  box-shadow: var(--shadow-soft);
}

.tile-icon { font-size: 20px; line-height: 1; }
.tile-body h3 { margin: 0; font-size: 14.5px; font-weight: 700; }
.tile-body p { margin: 4px 0 0; font-size: 12px; line-height: 1.45; color: var(--ink-soft); }
.tile-arrow {
  position: absolute;
  right: 12px;
  top: 12px;
  font-size: 13px;
  color: var(--ink-muted);
}

/* 主人专属行 */
.owner-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-subtle);
  font-size: 12px;
}

.owner-bar-label {
  color: var(--ink-muted);
  font-weight: 600;
}

.owner-bar-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chip-link {
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-tile);
  border: 1px solid var(--border-subtle);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.chip-link:hover {
  background: var(--surface-tile-hover);
}

.preview-notice {
  margin: 12px 0 0;
  padding: 8px 11px;
  border-radius: 11px;
  background: var(--surface-tile);
  border: 1px dashed var(--border-subtle);
  font-size: 12px;
  color: var(--ink-muted);
}

/* ---------- 底部极简合规条 ---------- */
.portal-footer {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 16px 16px;
  font-size: 12px;
  color: var(--ink-muted);
}

.footer-link {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 12px;
  color: inherit;
}

.footer-link:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* ---------- 右侧轻聊天抽屉 ---------- */
.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 28;
  background: rgba(8, 18, 34, 0.36);
  backdrop-filter: blur(4px);
}

.chat-drawer {
  position: fixed;
  top: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 30;
  width: min(410px, calc(100vw - 24px));
  display: flex;
  flex-direction: column;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 24px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.chat-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--border);
}

.chat-head strong { display: block; font-size: 14.5px; }
.chat-head small { display: block; font-size: 11.5px; color: var(--ink-muted); }

.icon-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--surface-tile);
  font-size: 18px;
  line-height: 1;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msg {
  max-width: 84%;
  padding: 10px 13px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg.her {
  align-self: flex-start;
  background: var(--surface-tile);
  border: 1px solid var(--border-subtle);
  border-bottom-left-radius: 5px;
}

.msg.me {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  border-bottom-right-radius: 5px;
}

.msg.sys {
  align-self: center;
  font-size: 12px;
  color: var(--ink-muted);
  background: transparent;
  padding: 4px 8px;
}

.msg-tag {
  display: inline-block;
  margin-bottom: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

/* ---------- 访客人设 & 插件额度抽屉 ---------- */
.guest-drawer {
  width: min(460px, calc(100vw - 24px));
}

.drawer-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.mode-switch-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mode-opt {
  text-align: left;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1.5px solid var(--border-subtle);
  background: var(--surface-tile);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.mode-opt strong { display: block; font-size: 13.5px; }
.mode-opt small { display: block; font-size: 11.5px; color: var(--ink-muted); margin-top: 2px; }

.mode-opt[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--surface-tile-hover);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent);
}

.status-banner {
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.5;
  background: var(--surface-tile);
  border: 1px solid var(--border-subtle);
}

.status-banner.is-pending {
  background: var(--outing-bg);
  border-color: var(--outing-border);
  color: var(--outing-ink);
}

.status-banner.is-rejected {
  border-color: rgba(214, 69, 69, 0.45);
  color: #d64545;
}

html[data-period="night"] .status-banner.is-rejected {
  color: #ff9494;
}

.sub-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 15px;
  background: var(--surface-tile);
  border: 1px solid var(--border-subtle);
}

.sub-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

.mini-pill,
.char-count {
  font-size: 11.5px;
  color: var(--ink-muted);
  font-weight: 600;
}

.sub-box textarea {
  width: 100%;
  resize: vertical;
  padding: 10px 11px;
  border-radius: 12px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
}

.sub-box-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tiny-note {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-muted);
}

.wallet-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, var(--surface-tile)), var(--surface-tile));
  border: 1px solid var(--border);
}

.wallet-label {
  display: block;
  font-size: 12px;
  color: var(--ink-soft);
}

.wallet-num {
  font-size: 24px;
  color: var(--accent);
}

.wallet-card small {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-muted);
}

.quota-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quota-card {
  padding: 12px;
  border-radius: 14px;
  background: var(--surface-tile);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quota-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.quota-card-top strong { font-size: 13.5px; }

.quota-bars {
  display: grid;
  gap: 6px;
}

.q-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-soft);
}

.q-track {
  height: 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink-muted) 20%, transparent);
  overflow: hidden;
}

.q-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.25s ease;
}

.quota-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.chat-compose {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border-subtle);
}

.btn-send {
  padding: 0 16px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 13.5px;
  white-space: nowrap;
}

/* ---------- 说明弹窗 & Toast ---------- */
.info-dialog {
  width: min(460px, calc(100vw - 28px));
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface-strong);
  color: var(--ink);
  box-shadow: var(--shadow-card);
}

.info-dialog::backdrop {
  background: rgba(8, 16, 30, 0.45);
  backdrop-filter: blur(4px);
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.dialog-head h2 { margin: 0; font-size: 17px; }
.dialog-body {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink-soft);
}

.base-persona-view {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-tile);
  border: 1px solid var(--border-subtle);
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink-soft);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 46vh;
  overflow-y: auto;
  user-select: text;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 40;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(16, 30, 52, 0.90);
  color: #f4f8ff;
  font-size: 13px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

/* ---------- 响应式适配 ---------- */
@media (max-width: 900px) {
  .lobby-video {
    object-position: 30% center;
  }

  .stage-shell {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 14px;
    padding-top: 4px;
  }

  .character-stage {
    min-height: 290px;
    padding-top: 6px;
  }

  .actor-frame {
    height: 240px;
    width: min(100%, 300px);
  }

  .hero-bubble {
    margin-bottom: 8px;
    max-width: 92%;
  }
}

@media (max-width: 560px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .topbar-actions {
    justify-content: space-between;
  }

  .entry-grid {
    grid-template-columns: 1fr;
  }

  .entry-hero-link {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  #static-actor-img,
  .actor-frame.react-hop #static-actor-img {
    animation: none !important;
  }
  .bg-layer,
  .glass-card {
    transition: none !important;
  }
}
