/**
 * 故宫 AI 导览 · 共享组件样式
 * 包含: CSS 变量、overlay/panel 壳、chat 组件、toast、section pager、
 *        镇馆之宝、图片缩放、3D 查看器、会说话的文物 IP、微短剧。
 * 供研学版和雅游版共同使用。
 */

/* ===== CSS 变量 ===== */
:root {
  --red: #8a1a1a;
  --red-deep: #6e1414;
  --gold: #c8a24a;
  --gold-soft: #e7d49b;
  --ink: #2b2320;
  --paper: #f6efe2;
  --paper-2: #efe5d2;
  --card: #fffaf0;
  --muted: #8a7d68;
  --line: #e3d6bd;
  --shadow: 0 10px 30px rgba(60, 30, 10, 0.16);
  --green: #3f7d4e;
}

/* ===== Header LLM & TTS ===== */
.llm-status { font-size: 15px; color: var(--muted); opacity: 0.6; cursor: default; margin-left: 6px; }
.llm-status.on { color: var(--green); opacity: 1; }
.llm-status.off { color: var(--muted); opacity: 0.5; }
.tts-toggle {
  background: rgba(255,255,255,0.16); border: none; color: #fff; width: 28px; height: 28px;
  border-radius: 50%; cursor: pointer; font-size: 14px; margin-left: 4px;
  display: inline-flex; align-items: center; justify-content: center; opacity: 0.6; transition: .15s;
}
.tts-toggle.on { opacity: 1; color: var(--gold); }
.ai-badge { font-size: 11.5px; font-weight: 700; color: var(--red); background: #fbeeee; border: 1px solid #e7c9c9; border-radius: 999px; padding: 3px 10px; }

/* ===== Overlay / Panel ===== */
.overlay { position: fixed; inset: 0; z-index: 90; background: rgba(40,20,10,0.5); display: flex; align-items: center; justify-content: center; padding: 18px; padding-top: max(18px, env(safe-area-inset-top)); padding-bottom: max(18px, env(safe-area-inset-bottom)); backdrop-filter: blur(2px); }
.overlay[hidden] { display: none; }
.panel { width: 100%; max-width: 640px; max-height: min(88vh, calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 36px)); background: var(--paper); border-radius: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; animation: pop .2s ease; }
@keyframes pop { from { transform: translateY(14px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; padding-top: max(14px, env(safe-area-inset-top)); background: linear-gradient(120deg, var(--red), var(--red-deep)); color: #fdf6e6; }
.panel-head.red { background: linear-gradient(120deg, var(--red), var(--red-deep)); }
.loc-title { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.loc-icon { font-size: 26px; }
.loc-title h3 { font-size: 18px; }
.loc-title small { opacity: 0.8; font-size: 12px; }
.panel-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.icon-btn { background: rgba(255,255,255,0.16); border: none; color: #fff; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 15px; }

/* ===== Chat 组件 ===== */
.chat-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.bubble { display: flex; gap: 10px; max-width: 92%; }
.bubble .face { font-size: 22px; flex-shrink: 0; }
.bubble .content { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; box-shadow: 0 2px 6px rgba(80,50,20,0.06); }
.bubble .content h5 { color: var(--red-deep); font-size: 15px; margin-bottom: 5px; }
.bubble .content p { font-size: 14.5px; color: #3f372e; }
.bubble.user { align-self: flex-end; flex-direction: row-reverse; }
.bubble.user .content { background: var(--red); color: #fdf2dc; border-color: var(--red); }
.bubble.user .content p { color: #fdf2dc; }
.bubble.sys { align-self: center; max-width: 100%; }
.bubble.sys .content { background: var(--gold-soft); border-color: var(--gold); color: #6b551f; font-size: 13px; padding: 6px 12px; }

.suggestions { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 18px; border-top: 1px solid var(--line); background: var(--paper-2); position: relative; }
.suggestions:empty { display: none; }
.suggestions .sug { display: none; }
.suggestions.expanded { padding: 12px 18px; }
.suggestions.expanded .sug { display: block; }
.suggestions.expanded .suggestions-toggle i { transform: rotate(90deg); }
.suggestions-toggle {
  display: none; background: transparent; border: none; color: var(--muted); font-size: 13px;
  cursor: pointer; padding: 2px 6px; margin-left: auto; align-self: center; order: 999;
}
.suggestions-toggle i { transition: transform .2s; }
.sug {
  border: 1px solid var(--gold); background: #fff; color: var(--red-deep);
  border-radius: 999px; padding: 7px 13px; font-size: 13px; cursor: pointer; font-family: inherit; transition: .15s;
}
.sug:hover { background: var(--gold-soft); }
.sug.seen { opacity: 0.7; }

.ask-bar { display: flex; gap: 8px; padding: 10px 18px 16px; border-top: 1px solid var(--line); background: var(--card); }
.ask-bar input {
  flex: 1; font-family: inherit; font-size: 14px; color: #3a322a;
  border: 1px solid var(--line); border-radius: 999px; padding: 10px 16px; background: #fff; outline: none; transition: .15s;
}
.ask-bar input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(200,162,74,0.18); }
.ask-bar input:disabled { background: #f1ece2; color: #9a9082; }
.ask-bar button {
  flex-shrink: 0; font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  border: none; border-radius: 999px; padding: 10px 20px; color: #fff;
  background: linear-gradient(120deg, var(--red), var(--red-deep)); box-shadow: 0 3px 8px rgba(138,26,26,0.25); transition: .15s;
}
.ask-bar button:hover:not(:disabled) { filter: brightness(1.07); transform: translateY(-1px); }
.ask-bar button:disabled { opacity: 0.5; cursor: default; }
.bubble .typing { letter-spacing: 2px; color: var(--gold); animation: typingBlink 1s infinite; }
@keyframes typingBlink { 0%,100% { opacity: .3; } 50% { opacity: 1; } }

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(10px);
  background: rgba(60,30,10,0.92); color: #fdf6e6; padding: 11px 26px;
  border-radius: 999px; font-size: 14.5px; opacity: 0; transition: opacity .3s, transform .3s; pointer-events: none; z-index: 9999;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== Section Pager ===== */
.section-more {
  font-size: 13px; font-weight: 700; font-family: inherit; cursor: pointer;
  color: var(--red-deep); background: var(--gold-soft);
  border: 1px solid var(--gold); border-radius: 999px;
  padding: 8px 22px; transition: .15s;
}
.section-more:hover { background: var(--gold); color: #fff; }
.section-more:disabled { opacity: 0.45; cursor: default; transform: none; filter: none; }
.section-pager {
  display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px;
}
.section-pager .pager-info { font-size: 13px; color: var(--muted); }

/* ===== 镇馆之宝 ===== */
.treasure-section { margin-top: 38px; }
.treasure-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.treasure-card {
  text-align: left; padding: 0; cursor: pointer; font-family: inherit;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  box-shadow: 0 4px 14px rgba(80,50,20,0.08); transition: .18s;
}
.treasure-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(80,50,20,0.18); border-color: var(--gold); }
.tc-img { position: relative; width: 100%; height: 160px; overflow: hidden; background: #2b2320; }
.tc-img img { width: 100%; height: 100%; object-fit: cover; transition: .3s; }
.treasure-card:hover .tc-img img { transform: scale(1.06); }
.tc-zoom {
  position: absolute; right: 8px; bottom: 8px; font-size: 11px; color: #fff;
  background: rgba(40,20,10,0.6); padding: 3px 8px; border-radius: 999px;
}
.tc-body { padding: 11px 13px 14px; }
.tc-where { font-size: 11px; color: var(--gold); font-weight: 700; margin-bottom: 3px; }
.tc-body h4 { font-size: 16px; color: var(--red-deep); }
.tc-body small { font-size: 11px; color: var(--muted); }
.tc-body p { font-size: 12.5px; color: #5b5145; margin-top: 6px; }
.tc-3d {
  position: absolute; left: 8px; top: 8px; font-size: 11px; font-weight: 700;
  color: var(--red-deep); background: var(--gold-soft);
  border: 1px solid var(--gold); padding: 2px 8px; border-radius: 999px;
}

/* Treasure lightbox */
.treasure-panel { max-width: 860px; }
.treasure-detail { display: flex; gap: 0; overflow-y: auto; }
.td-figure { flex: 1.1; min-width: 0; background: #1e1714; display: flex; align-items: center; position: relative; cursor: pointer; }
.td-figure img { width: 100%; max-height: 78vh; object-fit: contain; display: block; }
.td-figure::after {
  content: "\f00e"; font-family: "Font Awesome 6 Free"; font-weight: 900;
  position: absolute; right: 10px; bottom: 10px; font-size: 14px;
  background: rgba(40,20,10,0.6); color: #fff; width: 32px; height: 32px;
  border-radius: 50%; display: grid; place-items: center; pointer-events: none;
}
.td-figure:has(.td-3d-btn)::after { bottom: 56px; }
.td-text { flex: 1; padding: 18px 20px; overflow-y: auto; }
.td-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.td-tags span { font-size: 11px; color: #6b551f; background: var(--gold-soft); border: 1px solid var(--gold); border-radius: 999px; padding: 1px 9px; }
.td-meta { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.td-text h4 { color: var(--red-deep); font-size: 15px; margin: 12px 0 5px; }
.td-text p { font-size: 14px; color: #3f372e; }
.td-look { margin-top: 12px; background: #eaf3ec; border: 1px solid #cfe6d5; border-radius: 10px; padding: 10px 12px; font-size: 13.5px; color: #2f5b3c; }
.td-look b { display: block; color: var(--green); margin-bottom: 3px; }
.td-tip { margin-top: 12px; font-size: 12px; color: var(--muted); }
.td-3d-btn {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  background: linear-gradient(120deg, var(--red), var(--red-deep)); color: #fdf2dc;
  border: 1px solid var(--gold); padding: 9px 16px; border-radius: 999px;
  font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  box-shadow: var(--shadow); white-space: nowrap;
}
.td-3d-btn:hover { filter: brightness(1.08); }

/* Treasure AI chat */
.td-chat { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }
.td-chat-head { font-size: 14px; font-weight: 700; color: var(--red-deep); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.td-chat-body {
  max-height: 240px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px;
  padding: 10px 4px; background: var(--paper-2); border-radius: 10px; margin-bottom: 10px;
}
.td-chat-body:empty::before {
  content: "点下面的问题快速了解，或自由提问"; font-size: 13px; color: var(--muted);
  text-align: center; padding: 20px 10px; display: block;
}
.td-chat-body .bubble { max-width: 96%; }
.td-chat .suggestions { padding: 8px 4px 12px; border-top: none; background: transparent; }
.td-chat .ask-bar { padding: 8px 0 0; border-top: 1px solid var(--line); background: transparent; }

/* ===== 图片缩放 ===== */
.img-zoom { position: absolute; inset: 0; z-index: 10; background: rgba(20,10,5,0.96); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.img-zoom[hidden] { display: none; }
.img-zoom-wrap { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: none; }
.img-zoom-wrap img { max-width: 100%; max-height: 100%; object-fit: contain; transition: none; cursor: grab; user-select: none; -webkit-user-drag: none; touch-action: none; -webkit-touch-callout: none; transform-origin: center center; }
.img-zoom-wrap img:active { cursor: grabbing; }
.img-zoom-close {
  position: absolute; top: 12px; right: 12px; z-index: 11;
  background: rgba(255,255,255,0.15); border: none; color: #fff;
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer; font-size: 16px;
  display: grid; place-items: center;
}
.img-zoom-hint {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 11;
  background: rgba(0,0,0,0.55); color: rgba(255,255,255,0.85);
  font-size: 12px; padding: 6px 14px; border-radius: 999px; white-space: nowrap; pointer-events: none;
}

/* ===== 3D 查看器 ===== */
.viewer3d-panel { max-width: 900px; width: 100%; }
.viewer3d-stage {
  position: relative; width: 100%; height: 62vh; min-height: 360px;
  background: radial-gradient(circle at 50% 35%, #3a2f2a 0%, #1c1512 80%);
  overflow: hidden;
}
#viewer3dCanvas { width: 100%; height: 100%; display: block; touch-action: none; }
.v3d-hotspots { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.v3d-hot {
  position: absolute; transform: translate(-50%, -50%); pointer-events: auto;
  background: none; border: none; cursor: pointer; padding: 10px;
  display: flex; align-items: center; justify-content: center;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; z-index: 6;
}
.v3d-hot-dot {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--gold); color: var(--red-deep); font-weight: 800; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  border: 2.5px solid #fff; box-shadow: 0 0 0 4px rgba(200,162,74,0.5), 0 2px 10px rgba(0,0,0,0.55);
  animation: v3dPulse 1.8s infinite; transition: transform .15s ease;
}
.v3d-hot:active .v3d-hot-dot { transform: scale(1.15); }
.v3d-hot.active .v3d-hot-dot { background: var(--red); color: #fff; box-shadow: 0 0 0 4px rgba(180,40,40,0.5), 0 2px 10px rgba(0,0,0,0.55); }
@keyframes v3dPulse {
  0%,100% { box-shadow: 0 0 0 4px rgba(200,162,74,0.5), 0 2px 10px rgba(0,0,0,0.55); }
  50% { box-shadow: 0 0 0 8px rgba(200,162,74,0.15), 0 2px 10px rgba(0,0,0,0.55); }
}
.v3d-loading {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  color: #f3e6c8; font-size: 14px; background: rgba(0,0,0,0.35);
  padding: 10px 18px; border-radius: 999px; border: 1px solid var(--gold);
}
.v3d-info {
  background: rgba(255,250,240,0.96); border: 1px solid var(--gold); border-radius: 12px;
  padding: 11px 14px; box-shadow: var(--shadow); margin: 8px 16px;
}
.v3d-info b { color: var(--red-deep); font-size: 14px; }
.v3d-info p { color: #5b5145; font-size: 13px; margin-top: 4px; line-height: 1.5; }
.viewer3d-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; background: var(--paper-2); border-top: 1px solid var(--line);
}
.v3d-hint { font-size: 12.5px; color: var(--muted); }
.v3d-controls { display: flex; gap: 8px; margin-left: auto; }
.v3d-btn {
  background: #fff; color: var(--red-deep); border: 1px solid var(--gold);
  border-radius: 999px; padding: 6px 13px; font-family: inherit; font-size: 13px;
  font-weight: 700; cursor: pointer; transition: .15s;
}
.v3d-btn:hover { background: var(--gold-soft); }
.v3d-credit { flex-basis: 100%; font-size: 11px; color: var(--muted); }

/* ===== 会说话的文物 IP ===== */
.char-section { margin-top: 38px; }
.char-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.char-card {
  display: flex; flex-direction: column; text-align: left; padding: 0; cursor: pointer; font-family: inherit;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  box-shadow: 0 4px 14px rgba(80,50,20,0.08); transition: .18s; position: relative;
}
.char-card:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(80,50,20,0.18); border-color: var(--gold); }
.cc-img { position: relative; width: 100%; height: 150px; overflow: hidden; background: linear-gradient(135deg, #3a2a22, #5a3a2c); }
.cc-img img { width: 100%; height: 100%; object-fit: cover; transition: .3s; }
.char-card:hover .cc-img img { transform: scale(1.06); }
.cc-emoji {
  position: absolute; left: 10px; bottom: -18px; width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 24px;
  background: var(--paper); border: 2px solid var(--gold); box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}
.cc-body { padding: 22px 14px 16px; }
.cc-role { font-size: 11px; color: var(--gold); font-weight: 700; margin-bottom: 3px; }
.cc-body h4 { font-size: 17px; color: var(--red-deep); }
.cc-body p { font-size: 12.5px; color: #5b5145; margin-top: 6px; line-height: 1.5; }
.cc-go { display: inline-block; margin-top: 10px; font-size: 12px; color: var(--red); font-weight: 700; }

/* Character chat panel */
.char-panel { max-width: 600px; }
.char-ava { width: 42px; height: 42px; flex-shrink: 0; }
.char-ava .cface-img { display: block; width: 42px; height: 42px; border-radius: 50%; overflow: hidden; border: 2px solid var(--gold); }
.char-ava .cface-img img { width: 100%; height: 100%; object-fit: cover; }
.char-ava .cface-emoji { font-size: 30px; }
.char-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 18px 0; }
.drama-btn {
  border: 1px solid var(--gold); background: linear-gradient(120deg, var(--gold), #d9b85e); color: var(--red-deep);
  border-radius: 999px; padding: 8px 18px; cursor: pointer; font-family: inherit; font-size: 13.5px; font-weight: 700;
  box-shadow: 0 3px 8px rgba(200,162,74,0.3); transition: .15s;
}
.drama-btn:hover:not(:disabled) { filter: brightness(1.05); transform: translateY(-1px); }
.drama-btn:disabled { opacity: 0.55; cursor: default; }
.char-body .bubble.drama { animation: dramaIn .4s ease; }
.char-body .bubble.drama .content { background: #fffaf0; border-color: var(--gold); }
.drama-line .dl-who { display: inline-block; font-size: 11px; font-weight: 700; color: var(--gold); background: #fbf0d8; border: 1px solid var(--gold); border-radius: 999px; padding: 1px 9px; margin-bottom: 5px; }
@keyframes dramaIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ===== 微短剧 ===== */
.drama-stage {
  position: relative;
  background: linear-gradient(180deg, #1c1512 0%, #2a1f18 60%, #1c1512 100%);
  border: 1px solid rgba(200,162,74,0.25); border-radius: 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 20px 16px; margin: 10px 0; animation: stageIn .35s ease;
  min-height: 320px;
}
@keyframes stageIn { from { opacity: 0; } to { opacity: 1; } }
.drama-stage-title {
  font-size: 13px; font-weight: 700; color: var(--gold);
  letter-spacing: 3px; text-align: center; margin-bottom: 14px; opacity: 0.9;
}
.drama-scene-box {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 100%; max-width: 420px; gap: 12px; overflow: hidden;
}
.drama-scene { animation: sceneIn .45s ease; max-width: 92%; }
@keyframes sceneIn { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
.drama-scene.narrator {
  background: rgba(40,30,22,0.9); border: 1px solid rgba(200,162,74,0.45);
  border-radius: 14px; padding: 16px 18px; text-align: center;
  color: #fff8e8; font-size: 15px; line-height: 1.7;
  box-shadow: 0 4px 24px rgba(0,0,0,0.35);
}
.drama-scene.dialogue-left, .drama-scene.dialogue-right { display: flex; align-items: flex-start; gap: 10px; width: 100%; }
.drama-scene.dialogue-left { flex-direction: row; align-self: flex-start; }
.drama-scene.dialogue-right { flex-direction: row-reverse; align-self: flex-end; }
.ds-avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--paper-2);
  border: 2px solid var(--gold); display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0; box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.ds-content {
  background: #fff; border: 1px solid var(--gold); border-radius: 14px;
  padding: 10px 14px; box-shadow: 0 3px 14px rgba(0,0,0,0.28);
  max-width: calc(100% - 56px);
}
.drama-scene.dialogue-left .ds-content { border-bottom-left-radius: 4px; }
.drama-scene.dialogue-right .ds-content { border-bottom-right-radius: 4px; }
.ds-who { font-size: 11px; font-weight: 700; color: var(--red); margin-bottom: 4px; }
.ds-text { font-size: 14px; color: #2b2320; line-height: 1.65; }
.drama-scene.narrator .ds-text { color: #fff8e8; }
.typing-cursor::after { content: "|"; animation: blink 0.8s infinite; color: var(--gold); margin-left: 2px; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }
.drama-progress { display: flex; gap: 6px; margin-top: 10px; }
.drama-progress span { width: 7px; height: 7px; border-radius: 50%; background: rgba(200,162,74,0.25); transition: .25s; }
.drama-progress span.active { background: var(--gold); transform: scale(1.3); }
.drama-progress span.past { background: rgba(200,162,74,0.55); }
.drama-skip-btn {
  position: absolute; top: 10px; right: 12px;
  background: rgba(255,255,255,0.08); color: rgba(243,230,200,0.65);
  border: 1px solid rgba(200,162,74,0.25); border-radius: 999px;
  padding: 4px 12px; font-size: 12px; cursor: pointer; font-family: inherit; transition: .15s;
}
.drama-skip-btn:hover { background: rgba(255,250,240,0.14); color: var(--gold); }

/* ===== 响应式 ===== */
@media (max-width: 640px) {
  .overlay { padding: 0; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); align-items: flex-end; }
  .panel { max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom)); border-radius: 16px 16px 0 0; }
  .panel-head { padding: 12px 14px; padding-top: max(12px, env(safe-area-inset-top)); }
  .icon-btn { width: 40px; height: 40px; font-size: 16px; }
  .loc-title h3 { font-size: 16px; }
  .chat-body { padding: 12px; }
  .bubble { max-width: 96%; }
  .bubble .face { font-size: 18px; }
  .bubble .content { padding: 10px 12px; }
  .bubble .content p { font-size: 14px; }
  .suggestions { padding: 6px 12px; gap: 6px; }
  .suggestions.expanded { padding: 10px 12px; }
  .suggestions-toggle { display: inline-flex; }
  .sug { padding: 6px 10px; font-size: 12px; }
  .ask-bar { padding: 10px 12px 14px; }
  .ask-bar input { padding: 8px 12px; font-size: 14px; }
  .ask-bar button { padding: 8px 16px; font-size: 14px; }

  .treasure-grid { grid-template-columns: 1fr; gap: 12px; }
  .tc-img { height: 160px; }
  .treasure-panel { max-width: 100%; }
  .treasure-detail { flex-direction: column; }
  .td-figure { flex: none; height: 220px; }
  .td-figure img { max-height: 220px; }
  .td-text { padding: 14px 16px; }
  .td-chat-body { max-height: 200px; }

  .char-grid { grid-template-columns: 1fr; gap: 12px; }
  .cc-img { height: 160px; }
  .char-panel { max-width: 100%; }
  .drama-stage { min-height: 280px; padding: 16px 12px; }
  .ds-content { padding: 8px 12px; }
  .ds-text { font-size: 13px; }
  .drama-btn { padding: 7px 14px; font-size: 12px; }

  .section-pager { gap: 8px; }
  .pager-info { font-size: 12px; }
  .toast { padding: 10px 18px; font-size: 14px; bottom: 20px; }

  .viewer3d-panel { max-width: 100%; }
  .viewer3d-stage { height: 55vh; min-height: 280px; }
  .v3d-controls { flex-wrap: wrap; gap: 6px; }
  .v3d-hint { font-size: 12px; }
}

@media (max-width: 620px) {
  .v3d-controls { margin-left: 0; }
  .viewer3d-stage { height: 52vh; }
}
