/*
 * [INPUT]: 依赖 index.html 的角色卡、底部浮层、历史列表、状态节点与两份响应式场景图
 * [OUTPUT]: 对外提供手机优先的暖调角色选择、通话记录与结果交互
 * [POS]: public 模块的视觉层，不承担角色数据和业务状态判断
 * [PROTOCOL]: 变更时更新此头部，然后检查 AGENTS.md
 */
:root { color-scheme: dark; font-family: "PingFang SC", "Microsoft YaHei", sans-serif; color: #fbf5ef; background: #241f23; font-synthesis: none; }
* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100dvh; margin: 0; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.scene, .scene-shade, .starlight { position: fixed; inset: 0; pointer-events: none; }
.scene { background: url('/room-mobile.webp') center / cover no-repeat; }
.scene-shade { background: linear-gradient(180deg, #1d1926c7 0%, #251c2aa3 43%, #171722e3 100%); }
.starlight { overflow: hidden; }
.starlight i { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff8ed; box-shadow: 0 0 8px 3px #fff1dd9c; opacity: 0; animation: glimmer 8s ease-in-out infinite; }
.starlight i:nth-child(1) { left: 12%; top: 19%; animation-delay: .3s; }
.starlight i:nth-child(2) { left: 80%; top: 15%; animation-delay: 1.6s; }
.starlight i:nth-child(3) { left: 62%; top: 34%; animation-delay: 3.1s; }
.starlight i:nth-child(4) { left: 23%; top: 54%; animation-delay: 4.8s; }
.starlight i:nth-child(5) { left: 88%; top: 66%; animation-delay: 6.2s; }
.starlight i:nth-child(6) { left: 40%; top: 80%; animation-delay: 2.3s; }
.starlight i:nth-child(7) { left: 72%; top: 91%; animation-delay: 5.4s; }
.starlight i:nth-child(8) { left: 31%; top: 28%; animation-delay: 7.1s; }
@keyframes glimmer { 0%, 100% { opacity: 0; transform: translateY(7px); } 50% { opacity: .75; transform: translateY(-8px); } }
.app { position: relative; z-index: 1; width: min(100% - 36px, 480px); min-height: 100dvh; margin: auto; padding: 21px 0 24px; }
.masthead { display: flex; align-items: center; justify-content: space-between; min-height: 43px; }
.brand { display: flex; align-items: center; gap: 8px; color: #fff5ec; }
.brand > span { color: #f6dac0; font-size: 23px; text-shadow: 0 0 15px #f6dac09c; }
.brand strong { font-family: "Songti SC", "Noto Serif CJK SC", serif; font-size: 18px; font-weight: 600; letter-spacing: .13em; }
.recent-button { min-height: 40px; padding: 0 10px; border: 1px solid #e8d5c883; border-radius: 99px; background: #312b3685; color: #f1e5db; font-size: 11px; backdrop-filter: blur(12px); }
.recent-button:hover, .recent-button:focus-visible { border-color: #ffe9d6; outline: none; background: #514049b8; }
.recent-button span { margin-left: 4px; }
.intro { padding: clamp(28px, 6vh, 64px) 0 23px; }
.eyebrow { color: #e8c8b8; font-size: 10px; font-weight: 700; letter-spacing: .19em; text-shadow: 0 2px 8px #241b25; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { margin: 16px 0 14px; font-family: "Songti SC", "Noto Serif CJK SC", serif; font-size: clamp(42px, 10.5vw, 56px); font-weight: 500; line-height: 1.23; letter-spacing: .03em; text-shadow: 0 4px 20px #160f1d; }
.intro p { margin-bottom: 0; color: #efe0d7; font-family: "Songti SC", serif; font-size: 15px; line-height: 1.7; text-shadow: 0 2px 10px #160f1d; }
.service-notice { display: flex; align-items: center; gap: 12px; margin-bottom: 21px; padding: 11px 14px; border: 1px solid #f4ddc587; border-radius: 12px; background: #2c2833c2; box-shadow: inset 0 1px #fff4e827; backdrop-filter: blur(12px); }
.service-notice > span { flex: none; color: #f0d5b6; font-size: 20px; text-shadow: 0 0 10px #f0d5b6a1; }
.service-notice p { margin: 0; color: #f5e6db; font-size: 11px; font-weight: 600; line-height: 1.65; }
.section-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; color: #f9efe6; font-size: 12px; font-weight: 650; letter-spacing: .11em; }
.section-top small { color: #dcc4bb; font-size: 10px; letter-spacing: .18em; }
.role-list { display: grid; gap: 12px; }
.role-card { position: relative; display: flex; align-items: center; width: 100%; min-height: 116px; overflow: hidden; padding: 17px 19px; border: 1px solid #f2dfd484; border-radius: 18px; background: linear-gradient(110deg, #282735d9, #55424c91); box-shadow: 0 12px 29px #1a141fc4, inset 0 1px #fffaf12c; color: #fff8f0; text-align: left; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.role-card:hover, .role-card:focus-visible { border-color: #ffe9d3; outline: none; transform: translateY(-2px); box-shadow: 0 16px 34px #18121fc9, 0 0 0 3px #ffedda2b; }
.role-card:active { transform: scale(.99); }
.role-card.lishen { background: linear-gradient(110deg, #222e3ad9, #454852a6); }
.role-card.qiyu { background: linear-gradient(110deg, #3d303ad9, #694d4b9e); }
.role-mark { position: absolute; right: 49px; top: -34px; color: #efdee09c; font-family: Georgia, serif; font-size: 121px; font-weight: 300; line-height: 1; pointer-events: none; text-shadow: 0 0 25px #fff8ef55; }
.role-card.lishen .role-mark { top: -14px; right: 40px; font-size: 99px; color: #d9e5e6a6; }
.role-card.qiyu .role-mark { top: -43px; right: 29px; font-size: 157px; color: #f0d0c8b3; }
.role-content { position: relative; z-index: 1; display: flex; flex-direction: column; min-width: 0; }
.role-content small { color: #e8d2c8; font-size: 9px; font-weight: 700; letter-spacing: .18em; }
.role-content strong { margin-top: 5px; font-family: "Songti SC", serif; font-size: 25px; font-weight: 500; letter-spacing: .12em; }
.role-content > span { margin-top: 5px; color: #f1e1dd; font-size: 11px; line-height: 1.35; }
.role-arrow { position: absolute; z-index: 1; right: 16px; bottom: 16px; display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid #f8e6d3a1; border-radius: 50%; color: #ffebdc; font-size: 15px; }
.page-note { margin: 19px 0 0; color: #e6d1c8; font-size: 10px; line-height: 1.6; text-shadow: 0 2px 8px #1a141f; }
.call-dialog { position: fixed; top: auto; right: 0; bottom: 0; left: 0; width: min(100%, 520px); max-width: none; max-height: 94dvh; margin: 0 auto; padding: 0; overflow: auto; border: 1px solid #f7e6d48f; border-bottom: 0; border-radius: 23px 23px 0 0; background: #27232ff5; color: #fbf4ec; box-shadow: 0 -20px 75px #130e19d9, inset 0 1px #fff9e333; backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }
.call-dialog::backdrop { background: #17111db8; backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); }
.sheet-handle { width: 36px; height: 4px; margin: 10px auto 0; border-radius: 4px; background: #b9a8a9; }
.sheet-inner { padding: 17px 22px max(28px, env(safe-area-inset-bottom)); }
.sheet-heading { display: flex; justify-content: space-between; align-items: start; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid #e7d5c145; }
.sheet-kicker { color: #dbc2b0; font-size: 9px; font-weight: 750; letter-spacing: .2em; }
.sheet-heading h2 { margin: 5px 0 5px; font-family: "Songti SC", serif; font-size: 27px; font-weight: 500; letter-spacing: .08em; }
.sheet-heading p { margin: 0; color: #cdbdc1; font-size: 11px; }
.close-button { flex: none; width: 36px; height: 36px; border: 1px solid #e9d6c570; border-radius: 50%; background: #e9d6c51e; color: #f3e5dc; font-size: 22px; line-height: 1; }
.close-button:hover, .close-button:focus-visible { border-color: #fff0dc; outline: none; background: #e9d6c53c; }
.field { margin-top: 18px; }
.field label, .prompt-details label { display: block; margin-bottom: 8px; color: #f1e6df; font-size: 12px; font-weight: 650; }
input, textarea { display: block; width: 100%; border: 1px solid #e0cbb785; border-radius: 11px; outline: none; background: #171a25a8; color: #fff9f2; font-size: 14px; transition: border-color .18s ease, box-shadow .18s ease; }
input { min-height: 49px; padding: 0 13px; }
textarea { min-height: 180px; padding: 11px 13px; resize: vertical; line-height: 1.65; }
input::placeholder, textarea::placeholder { color: #a89fa7; }
input:hover, textarea:hover { border-color: #f0dbc5; }
input:focus, textarea:focus { border-color: #ffecd4; box-shadow: 0 0 0 3px #e9caa948; }
.prompt-details { margin-top: 20px; border-top: 1px solid #e7d5c13d; }
.prompt-details summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; color: #e9d6c8; cursor: pointer; font-size: 12px; list-style: none; }
.prompt-details summary::-webkit-details-marker { display: none; }
.prompt-details summary:focus-visible { outline: 2px solid #eed7be; outline-offset: 2px; }
.prompt-details[open] summary span { transform: rotate(180deg); }
.prompt-details label { margin-top: 4px; }
.submit-button { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 52px; margin-top: 16px; padding: 0 17px; border: 1px solid #ffead1; border-radius: 11px; background: linear-gradient(135deg, #ebc8a9, #f5dbb8); color: #392d31; font-size: 14px; font-weight: 800; box-shadow: 0 9px 22px #130d19a6, inset 0 1px #fff9e5; }
.submit-button:hover:not(:disabled), .submit-button:focus-visible { outline: none; background: #ffe2bc; box-shadow: 0 0 0 3px #f9dfbc51; }
.submit-button:active:not(:disabled) { transform: scale(.99); }
.submit-button:disabled { opacity: .55; cursor: wait; }
.submit-note { margin: 9px 0 0; color: #b8a9b0; font-size: 10px; line-height: 1.5; }
.history-view { padding-top: 18px; }
.history-note { margin: 0 0 14px; color: #c7b5b7; font-size: 11px; line-height: 1.6; }
.history-list { display: grid; gap: 10px; }
.history-empty { padding: 28px 12px; color: #d9c5c0; font-size: 12px; text-align: center; line-height: 1.7; }
.history-item { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; width: 100%; padding: 14px; border: 1px solid #e7d5c173; border-radius: 12px; background: #171a2499; color: #f5e8de; text-align: left; }
.history-item:hover, .history-item:focus-visible { border-color: #ffead1; outline: none; background: #3d3540; }
.history-item strong { font-family: "Songti SC", serif; font-size: 17px; font-weight: 500; }
.history-item span { align-self: center; color: #f0d2ba; font-size: 11px; }
.history-item small { grid-column: 1 / -1; color: #baaab0; font-size: 10px; }
.back-button { margin: 0 0 18px; padding: 0; border: 0; background: none; color: #eacbb2; font-size: 11px; }
.back-button:hover, .back-button:focus-visible { outline: none; color: #fff1e4; text-decoration: underline; }
.result-view { padding-top: 21px; }
.status-header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.status-header > span:first-child { color: #c6b2b6; font-size: 12px; }
.status-badge { color: #f3d7bf; font-family: "Songti SC", serif; font-size: 23px; }
.status-badge[data-status="ENDED"] { color: #c2ddc4; }
.status-badge[data-status="FAILED"], .status-badge[data-status="CANCELED"], .status-badge[data-status="NOT_ANSWERED"] { color: #f2b5a9; }
.status-time { margin: 6px 0 0; color: #b1a3aa; font-size: 10px; font-variant-numeric: tabular-nums; }
.call-id-row { display: flex; justify-content: space-between; gap: 10px; margin: 20px 0; padding: 12px 0; border-top: 1px solid #e7d5c13d; border-bottom: 1px solid #e7d5c13d; color: #b9a9ae; font-size: 10px; letter-spacing: .08em; }
.call-id-row code { color: #e9dcd8; font-size: 11px; letter-spacing: 0; overflow-wrap: anywhere; }
.progress { padding: 0 0 0 6px; margin: 0; list-style: none; }
.progress li { position: relative; display: flex; gap: 16px; min-height: 57px; color: #aa9fa7; }
.progress li:not(:last-child)::before { position: absolute; top: 13px; bottom: -1px; left: 5px; width: 1px; background: #d7c4b950; content: ''; }
.progress-dot { position: relative; z-index: 1; width: 11px; height: 11px; flex: none; margin-top: 2px; border: 2px solid #9c8994; border-radius: 50%; background: #282430; }
.progress strong { display: block; font-size: 12px; font-weight: 650; }
.progress small { display: block; margin-top: 4px; font-size: 10px; }
.progress li.reached { color: #f4e6dc; }
.progress li.reached .progress-dot { border-color: #ebc5a7; background: #ebc5a7; box-shadow: 0 0 0 4px #ebc5a72b; }
.call-detail { margin: 2px 0 0; color: #c8b7b8; font-size: 11px; }
.transcript-section { margin-top: 18px; padding-top: 16px; border-top: 1px solid #e7d5c13d; }
.transcript-head { display: flex; justify-content: space-between; align-items: baseline; }
.transcript-head h3 { margin: 0 0 12px; font-family: "Songti SC", serif; font-size: 18px; font-weight: 500; }
.transcript-head span { color: #ad9fa7; font-size: 11px; }
.dialogue { margin: 8px 0; padding: 11px 12px; border: 1px solid #e5d5c13e; border-radius: 9px; background: #171a2499; }
.dialogue p { margin: 5px 0; color: #e8dbd7; font-size: 12px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.dialogue strong { display: inline-block; min-width: 48px; margin-right: 7px; color: #e5c5aa; }
.transcript-empty { color: #baadb2; font-size: 12px; }
.saved-details { margin-top: 18px; border-top: 1px solid #e7d5c13d; }
.saved-details summary { display: flex; justify-content: space-between; padding: 16px 0; color: #e9d6c8; font-size: 12px; cursor: pointer; list-style: none; }
.saved-details summary::-webkit-details-marker { display: none; }
.saved-details summary:focus-visible { outline: 2px solid #eed7be; outline-offset: 2px; }
.saved-details[open] summary span { transform: rotate(180deg); }
.saved-details dl { display: grid; grid-template-columns: 76px 1fr; gap: 9px; margin: 0 0 15px; font-size: 11px; }
.saved-details dt { color: #ad9fa7; }
.saved-details dd { margin: 0; color: #eadbd6; overflow-wrap: anywhere; }
.saved-details strong { color: #e9d6c8; font-size: 11px; font-weight: 600; }
.saved-details p { margin: 8px 0 0; color: #cdbdc1; font-size: 11px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.message { margin: 15px 0 0; padding: 10px 12px; border: 1px solid #e4d5c055; border-radius: 9px; background: #e7d4bf1a; color: #e9d8ca; font-size: 11px; line-height: 1.6; }
.message.error { border-color: #efb2a16b; background: #693e4040; color: #ffbcae; }
.message.success { border-color: #bdd8bc70; background: #6d9d7040; color: #d7ead0; }
@media (min-width: 700px) { .scene { background-image: url('/room-desktop.webp'); } .scene-shade { background: linear-gradient(90deg, #1c1724d9, #21192187 46%, #261c231a), linear-gradient(0deg, #171622e0, transparent 75%); } .app { padding-top: 31px; } .intro { padding-top: clamp(56px, 10vh, 104px); } }
@media (max-width: 359px) { .app { width: calc(100% - 28px); } .role-card { padding: 15px; } .role-content > span { max-width: 230px; } .sheet-inner { padding-right: 17px; padding-left: 17px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
