/* ============================================================
   声叙 · 工作台 / 播放器 / 弹窗 / 抽屉 / 提示
   ============================================================ */

.studio { display: grid; grid-template-columns: minmax(0, 1.14fr) minmax(320px, .86fr); gap: 24px; align-items: start; }
.composer { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px; box-shadow: var(--shadow); }
.result-panel { position: sticky; top: calc(var(--nav-h) + 20px); display: flex; flex-direction: column; gap: 16px; }

/* ---------- 模式切换 ---------- */
.mode-tabs { position: relative; display: flex; background: var(--surface-3); border: 1px solid var(--line-2); border-radius: 14px; padding: 5px; margin-bottom: 26px; }
.mode-indicator { position: absolute; top: 5px; left: 5px; height: calc(100% - 10px); width: calc((100% - 10px) / 3); background: var(--surface); border-radius: 10px; box-shadow: var(--shadow-sm); transition: transform .42s var(--ease); z-index: 0; }
.mode-tab { position: relative; z-index: 1; flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 6px; font-size: 13.5px; font-weight: 600; color: var(--muted); border-radius: 10px; transition: color .3s; white-space: nowrap; }
.mode-tab.is-active { color: var(--primary); }
.mt-icon { display: inline-flex; }
.mt-icon svg { width: 16px; height: 16px; }
.mode-panel { display: none; animation: fadeSlide .38s var(--ease); }
.mode-panel.is-active { display: block; }
@keyframes fadeSlide { from { opacity: 0; transform: translateY(8px); } }

/* ---------- 字段通用 ---------- */
.field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 13px; }
.field-head h3 { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.field-hint { font-size: 11.5px; color: var(--muted); }
.optional { font-size: 11px; font-weight: 500; color: var(--muted); margin-left: 6px; }
.field-tools { display: flex; gap: 4px; }
.text-tool { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); padding: 5px 9px; border-radius: 8px; transition: color .2s, background .2s; }
.text-tool svg { width: 13px; height: 13px; }
.text-tool:hover { color: var(--primary); background: var(--primary-soft); }
.field-block { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line-2); }
.inline-note { font-size: 11.5px; color: var(--muted); margin-top: 10px; line-height: 1.7; }

/* ---------- 音色选择 ---------- */
.voice-filter { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.chip-filter { font-size: 12px; padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); transition: all .22s; }
.chip-filter:hover { border-color: var(--primary); color: var(--primary); }
.chip-filter.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.voice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-height: 272px; overflow-y: auto; padding-right: 4px; scrollbar-width: thin; }
.voice-grid::-webkit-scrollbar { width: 5px; }
.voice-grid::-webkit-scrollbar-thumb { background: var(--line); border-radius: 9px; }
.voice-card { display: flex; align-items: center; gap: 9px; padding: 11px 10px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); text-align: left; transition: all .25s var(--ease); position: relative; min-width: 0; }
.voice-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.voice-card.is-selected { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 16%, transparent); }
.voice-card.is-selected::after { content: "✓"; position: absolute; top: -6px; right: -5px; width: 17px; height: 17px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 10px; display: grid; place-items: center; box-shadow: 0 2px 8px rgba(108,92,231,.35); }
.vc-avatar { width: 34px; height: 34px; border-radius: 11px; flex: 0 0 34px; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; }
.vc-info { min-width: 0; flex: 1; }
.vc-info strong { display: block; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vc-info span { display: block; font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vc-play { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; color: var(--primary); flex: 0 0 26px; transition: all .2s; }
.vc-play svg { width: 12px; height: 12px; }
.vc-play:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.vc-play.is-loading { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 音色设计 ---------- */
.design-tip { background: var(--surface-3); border: 1px solid var(--line-2); border-radius: 13px; padding: 15px 16px; margin-bottom: 13px; }
.design-tip strong { font-size: 12px; color: var(--primary); }
.design-tip p { font-size: 12.5px; color: var(--ink-2); line-height: 1.8; margin: 6px 0 11px; }
.example-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.example-chip { font-size: 11.5px; padding: 5px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); transition: all .2s; }
.example-chip:hover { border-color: var(--primary); color: var(--primary); }
.textarea { width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: 13px; padding: 14px 16px; font-size: 14px; line-height: 1.8; resize: vertical; outline: none; transition: border-color .25s, box-shadow .25s, background .25s; }
.textarea::placeholder { color: var(--muted); opacity: .8; }
.textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 11%, transparent); background: var(--surface); }
.textarea.small { font-size: 13px; padding: 11px 13px; }
.design-textarea { min-height: 104px; }
.main-textarea { border: 0; background: transparent; border-radius: 0; padding: 16px 17px 4px; min-height: 158px; font-size: 14.5px; }
.main-textarea:focus { box-shadow: none; background: transparent; }
.textarea-wrap { border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); transition: border-color .25s, box-shadow .25s; overflow: visible; position: relative; }
.textarea-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 10%, transparent); background: var(--surface); }
.textarea-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 12px 10px 16px; }
.audio-tag-wrap { position: relative; }
.tag-insert { color: var(--primary); }
.tag-popover { position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 20; width: 320px; max-height: 250px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; box-shadow: var(--shadow-lg); }
.tp-title { font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: 1px; margin: 2px 0 9px; }
.tp-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.tp-chip { font-size: 11.5px; padding: 5px 10px; border-radius: 8px; background: var(--surface-3); color: var(--ink-2); transition: all .2s; }
.tp-chip:hover { background: var(--primary); color: #fff; }
.char-count { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 7px; }
.char-count.is-over { color: var(--danger); }
.char-ring { width: 14px; height: 14px; border-radius: 50%; background: conic-gradient(var(--primary) var(--p, 0%), var(--line) 0); position: relative; }
.char-ring::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--surface-2); }
.textarea-wrap:focus-within .char-ring::after { background: var(--surface); }

/* ---------- 音色复刻 ---------- */
.dropzone { border: 1.5px dashed var(--line); border-radius: 15px; background: var(--surface-2); padding: 32px 20px; text-align: center; transition: all .25s var(--ease); cursor: pointer; }
.dropzone:hover, .dropzone.is-dragover { border-color: var(--primary); background: var(--primary-soft); transform: translateY(-2px); }
.dz-icon { width: 44px; height: 44px; margin: 0 auto 14px; border-radius: 14px; background: var(--surface); display: grid; place-items: center; color: var(--primary); box-shadow: var(--shadow-sm); }
.dz-icon svg { width: 21px; height: 21px; }
.dropzone strong { display: block; font-size: 13.5px; margin-bottom: 5px; }
.dropzone > span { font-size: 11.5px; color: var(--muted); }
.sample-info { display: flex; align-items: center; gap: 12px; margin-top: 12px; background: var(--surface-3); border: 1px solid var(--line); border-radius: 13px; padding: 11px 13px; }
.sample-play { width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; flex: 0 0 34px; }
.sample-play svg { width: 14px; height: 14px; }
.sample-meta { flex: 1; min-width: 0; }
.sample-meta strong { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sample-meta span { font-size: 11px; color: var(--muted); }

/* ---------- 风格标签 ---------- */
.tag-cats { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 13px; scrollbar-width: none; }
.tag-cats::-webkit-scrollbar { display: none; }
.tag-cat { flex: 0 0 auto; font-size: 12px; padding: 6px 12px; border-radius: 9px; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; transition: all .22s; }
.tag-cat:hover { color: var(--primary); }
.tag-cat.is-active { background: var(--primary); color: #fff; }
.tag-list { display: flex; flex-wrap: wrap; gap: 7px; min-height: 42px; }
.tag-chip { font-size: 12.5px; padding: 7px 13px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); transition: all .22s var(--ease); }
.tag-chip:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.tag-chip.is-selected { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 5px 14px rgba(108,92,231,.24); }
.selected-preview { margin-top: 13px; font-size: 12px; color: var(--ink-2); background: var(--surface-3); border-radius: 10px; padding: 10px 13px; line-height: 1.8; }
.selected-preview code { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--primary); background: var(--primary-soft); padding: 2px 6px; border-radius: 5px; font-size: 11.5px; }

/* ---------- 语速 / 滑块 ---------- */
.speed-value { font-size: 12px; font-weight: 700; color: var(--primary); background: var(--primary-soft); padding: 4px 10px; border-radius: 8px; }
.speed-row { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--muted); }
input[type="range"] { -webkit-appearance: none; appearance: none; flex: 1; height: 5px; border-radius: 99px; background: var(--line); outline: none; cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 17px; height: 17px; border-radius: 50%; background: var(--surface); border: 3px solid var(--primary); box-shadow: 0 2px 8px rgba(108,92,231,.3); transition: transform .2s; }
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.18); }
input[type="range"]::-moz-range-thumb { width: 13px; height: 13px; border-radius: 50%; background: var(--surface); border: 3px solid var(--primary); box-shadow: 0 2px 8px rgba(108,92,231,.3); }
.speed-marks { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); padding: 7px 22px 0; opacity: .75; }

/* ---------- 高级 ---------- */
.advanced { margin-top: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); overflow: hidden; }
.advanced summary { display: flex; align-items: center; gap: 9px; padding: 14px 16px; font-size: 13.5px; font-weight: 600; cursor: pointer; list-style: none; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary svg { width: 16px; height: 16px; color: var(--primary); }
.advanced summary em { font-style: normal; font-size: 11.5px; font-weight: 400; color: var(--muted); margin-left: auto; }
.advanced summary::after { content: "+"; font-size: 18px; color: var(--muted); line-height: 1; }
.advanced[open] summary::after { content: "−"; }
.advanced-body { padding: 4px 16px 18px; border-top: 1px solid var(--line-2); }
.sub-label { display: block; font-size: 12.5px; font-weight: 600; margin: 16px 0 8px; }
.sub-label span { font-weight: 400; color: var(--muted); font-size: 11.5px; margin-left: 6px; }

/* ---------- 底部生成 ---------- */
.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line-2); }
.format-seg { display: inline-flex; background: var(--surface-3); border-radius: 11px; padding: 4px; gap: 3px; }
.format-seg button { font-size: 12px; padding: 7px 11px; border-radius: 8px; color: var(--muted); transition: all .22s; }
.format-seg button.is-active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); font-weight: 700; }
.btn-generate { min-width: 206px; padding: 13px 18px; }
.gen-icon { display: inline-flex; }
.gen-icon svg { width: 18px; height: 18px; }
.gen-label { flex: 1; text-align: left; }
.btn-generate.is-loading { pointer-events: none; opacity: .82; }
.btn-generate.is-loading .gen-icon { animation: spin 1s linear infinite; }

/* ---------- 结果卡 ---------- */
.result-card, .quota-card, .quick-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.result-card { padding: 22px; }
.result-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.result-head h3, .quota-head h3, .quick-head h3 { font-size: 15px; font-weight: 700; }
.result-empty { text-align: center; padding: 22px 10px 18px; }
.empty-visual { width: 100%; height: 96px; display: grid; place-items: center; margin-bottom: 14px; }
.empty-wave { height: 60px; display: flex; align-items: center; gap: 4px; opacity: .5; }
.empty-wave i { width: 4px; border-radius: 4px; background: linear-gradient(180deg, var(--primary-2), var(--primary)); }
.result-empty strong { display: block; font-size: 14.5px; margin-bottom: 7px; }
.result-empty > span { display: block; font-size: 12px; color: var(--muted); line-height: 1.8; max-width: 250px; margin: 0 auto; }
.result-ready { animation: fadeSlide .45s var(--ease); }
.now-playing { display: flex; align-items: center; gap: 11px; margin-bottom: 16px; }
.np-avatar { width: 40px; height: 40px; border-radius: 13px; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px; flex: 0 0 40px; }
.np-meta { flex: 1; min-width: 0; }
.np-meta strong { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-meta span { font-size: 11px; color: var(--muted); }
.np-badge { font-size: 10px; font-weight: 700; letter-spacing: .6px; color: var(--primary); background: var(--primary-soft); padding: 4px 8px; border-radius: 6px; }
.wave-canvas { width: 100%; height: 96px; display: block; border-radius: 12px; background: var(--surface-3); }
.player-progress { position: relative; height: 6px; background: var(--line); border-radius: 99px; margin: 15px 0 8px; cursor: pointer; }
.pp-buffer { position: absolute; inset: 0; border-radius: 99px; background: var(--line-2); }
.pp-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.pp-handle { position: absolute; top: 50%; left: 0; width: 13px; height: 13px; border-radius: 50%; background: var(--surface); border: 3px solid var(--primary); transform: translate(-50%, -50%); box-shadow: 0 2px 8px rgba(108,92,231,.3); opacity: 0; transition: opacity .2s; }
.player-progress:hover .pp-handle { opacity: 1; }
.player-time { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.player-controls { display: flex; align-items: center; gap: 6px; margin: 14px 0 18px; }
.player-controls .icon-btn { width: 32px; height: 32px; flex: 0 0 32px; font-size: 11px; font-weight: 700; }
.volume-range { width: 58px; flex: 0 0 58px; height: 4px; }
.play-btn { width: 46px; height: 46px; border-radius: 50%; margin: 0 auto; background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 22px rgba(108,92,231,.32); transition: transform .25s var(--ease); flex: 0 0 46px; }
.play-btn:hover { transform: scale(1.08); }
.play-btn svg { width: 19px; height: 19px; }
.result-actions { display: flex; gap: 9px; }
.result-actions .btn { flex: 1; }
.result-loading { text-align: center; padding: 30px 10px 22px; }
.loading-orbit { width: 74px; height: 74px; margin: 0 auto 20px; position: relative; }
.loading-orbit i { position: absolute; inset: 0; border: 2px solid transparent; border-top-color: var(--primary); border-radius: 50%; animation: spin 1.4s linear infinite; }
.loading-orbit i:nth-child(2) { inset: 10px; border-top-color: var(--accent); animation-duration: 1.9s; animation-direction: reverse; }
.loading-orbit i:nth-child(3) { inset: 21px; border-top-color: var(--primary-2); animation-duration: 2.4s; }
.result-loading strong { font-size: 14.5px; }
.loading-steps { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; max-width: 230px; margin-left: auto; margin-right: auto; text-align: left; }
.ls-item { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; transition: color .3s; }
.ls-item i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.ls-item.is-done { color: var(--success); }
.ls-item.is-done i { background: var(--success); }
.ls-item.is-active { color: var(--primary); font-weight: 600; }
.ls-item.is-active i { background: var(--primary); animation: pulse 1.2s infinite; }

/* ---------- 额度卡 ---------- */
.quota-card { padding: 20px 22px; }
.quota-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.quota-date { font-size: 11px; color: var(--muted); }
.quota-unlocked { display: flex; align-items: center; gap: 11px; background: color-mix(in srgb, var(--success) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--success) 26%, var(--line)); border-radius: 12px; padding: 11px 13px; margin-bottom: 14px; }
.unlock-icon { width: 30px; height: 30px; border-radius: 9px; background: var(--success); color: #fff; display: grid; place-items: center; font-size: 14px; flex: 0 0 30px; }
.quota-unlocked strong { display: block; font-size: 12.5px; color: var(--success); }
.quota-unlocked span { font-size: 11px; color: var(--muted); }
.quota-meter { margin-bottom: 14px; }
.qm-top { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-2); margin-bottom: 7px; }
.qm-top b { font-variant-numeric: tabular-nums; font-weight: 700; }
.qm-track { height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.qm-fill { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--primary), var(--primary-2)); transition: width .6s var(--ease); }
.qm-fill.alt { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.qm-fill.is-full { background: linear-gradient(90deg, var(--danger), var(--accent)); }
.quota-note { font-size: 11px; color: var(--muted); line-height: 1.7; margin-top: 11px; }

/* ---------- 最近生成 ---------- */
.quick-list { padding: 18px 22px 16px; }
.quick-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.quick-empty { font-size: 12px; color: var(--muted); padding: 12px 0; text-align: center; }
.quick-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.quick-item:last-child { border-bottom: 0; }
.qi-play { width: 28px; height: 28px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex: 0 0 28px; }
.qi-play svg { width: 13px; height: 13px; }
.qi-info { flex: 1; min-width: 0; }
.qi-info strong { display: block; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qi-info span { font-size: 10.5px; color: var(--muted); }
.qi-dl { color: var(--muted); }
.qi-dl svg { width: 14px; height: 14px; }
.qi-dl:hover { color: var(--primary); }

/* ---------- 弹窗 ---------- */
.modal-backdrop, .drawer-backdrop { position: fixed; inset: 0; z-index: 120; background: rgba(19, 20, 35, .5); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: grid; place-items: center; padding: 20px; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.modal { position: relative; width: min(440px, 100%); max-height: calc(100dvh - 40px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 32px; box-shadow: var(--shadow-lg); animation: modalIn .38s var(--ease); }
@keyframes modalIn { from { opacity: 0; transform: translateY(24px) scale(.96); } }
.modal-close { position: absolute; top: 14px; right: 16px; width: 32px; height: 32px; border-radius: 50%; font-size: 22px; line-height: 1; color: var(--muted); display: grid; place-items: center; transition: background .2s, color .2s, transform .2s; }
.modal-close:hover { background: var(--surface-3); color: var(--ink); transform: rotate(90deg); }
.redeem-visual { width: 64px; height: 64px; margin: 0 auto 18px; position: relative; display: grid; place-items: center; }
.redeem-glow { position: absolute; inset: -14px; border-radius: 50%; background: radial-gradient(circle, rgba(245,133,107,.24), transparent 70%); animation: pulse 3s infinite; }
.redeem-icon { width: 64px; height: 64px; border-radius: 20px; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; display: grid; place-items: center; box-shadow: 0 12px 30px rgba(108,92,231,.3); position: relative; }
.redeem-icon svg { width: 30px; height: 30px; }
.redeem-modal { text-align: center; }
.redeem-modal h2, .doc-modal h2 { font-size: 21px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 10px; }
.modal-sub { font-size: 13px; color: var(--ink-2); line-height: 1.85; margin-bottom: 20px; }
.qr-frame { width: 190px; height: 190px; margin: 0 auto 20px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface-2); display: grid; place-items: center; overflow: hidden; box-shadow: var(--shadow-sm); }
.qr-frame img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.qr-placeholder { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--muted); }
.qr-placeholder svg { width: 46px; height: 46px; opacity: .5; }
.qr-placeholder small { font-size: 11px; }
.code-label { display: block; text-align: left; font-size: 12px; font-weight: 600; margin-bottom: 8px; color: var(--ink-2); }
.code-input { width: 100%; text-align: center; letter-spacing: 3px; font-size: 17px; font-weight: 700; text-transform: uppercase; padding: 13px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); outline: none; transition: border-color .2s, box-shadow .2s; font-family: ui-monospace, Menlo, Consolas, monospace; }
.code-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent); }
.code-input.is-error { border-color: var(--danger); animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.code-msg { min-height: 20px; font-size: 12px; margin: 8px 0 4px; color: var(--danger); }
.code-msg.is-ok { color: var(--success); }
.redeem-foot { font-size: 11px; color: var(--muted); margin-top: 14px; }
.doc-modal { width: min(560px, 100%); text-align: left; }
.doc-body { font-size: 14px; color: var(--ink-2); line-height: 1.95; white-space: pre-wrap; margin-top: 16px; }

/* ---------- 抽屉 ---------- */
.drawer-backdrop { display: block; padding: 0; }
.drawer { position: absolute; right: 0; top: 0; bottom: 0; width: min(430px, 100%); background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: drawerIn .4s var(--ease); }
@keyframes drawerIn { from { transform: translateX(100%); } }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 24px 24px 18px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 19px; }
.drawer-head span { font-size: 11.5px; color: var(--muted); }
.drawer-head .modal-close { position: static; }
.drawer-body { flex: 1; overflow-y: auto; padding: 14px 24px; }
.drawer-foot { padding: 14px 24px 22px; border-top: 1px solid var(--line); }
.history-item { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 10px; }
.hi-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.hi-top strong { font-size: 12.5px; }
.hi-top span { font-size: 10.5px; color: var(--muted); }
.hi-text { font-size: 12px; color: var(--ink-2); line-height: 1.7; max-height: 42px; overflow: hidden; margin-bottom: 11px; }
.hi-actions { display: flex; gap: 7px; align-items: center; }
.hi-btn { font-size: 11.5px; padding: 6px 11px; border-radius: 8px; background: var(--surface-3); color: var(--ink-2); transition: all .2s; display: inline-flex; align-items: center; gap: 5px; }
.hi-btn svg { width: 12px; height: 12px; }
.hi-btn:hover { background: var(--primary); color: #fff; }
.hi-btn.danger:hover { background: var(--danger); }
.hi-meta { margin-left: auto; font-size: 10.5px; color: var(--muted); }
.history-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 60px 0; }

/* ---------- Toast ---------- */
.toast-stack { position: fixed; z-index: 300; top: calc(var(--nav-h) + 14px); right: 20px; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; min-width: 240px; max-width: 340px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 12px 14px; box-shadow: var(--shadow-lg); font-size: 13px; color: var(--ink); animation: toastIn .35s var(--ease); }
.toast.is-out { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(24px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(24px); } }
.toast i { width: 20px; height: 20px; border-radius: 50%; flex: 0 0 20px; display: grid; place-items: center; font-size: 11px; font-style: normal; color: #fff; margin-top: 1px; }
.toast.success i { background: var(--success); } .toast.error i { background: var(--danger); } .toast.info i { background: var(--primary); } .toast.warn i { background: var(--accent); }

/* ---------- 移动端底栏 ---------- */
.mobile-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px); border-top: 1px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); align-items: center; gap: 12px; }
.mb-quota { font-size: 11.5px; color: var(--muted); flex: 1; }
.mobile-bar .btn { flex: 0 0 auto; }

@media (max-width: 1080px) {
  .studio { grid-template-columns: 1fr; }
  .result-panel { position: static; }
  .voice-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .composer { padding: 18px; border-radius: 20px; }
  .mode-tab { font-size: 12px; gap: 5px; }
  .mt-icon svg { width: 14px; height: 14px; }
  .voice-grid { grid-template-columns: repeat(2, 1fr); max-height: 250px; }
  .composer-foot { flex-direction: column; align-items: stretch; }
  .btn-generate { width: 100%; }
  .format-seg { justify-content: center; }
  .result-card, .quota-card, .quick-list { padding: 18px; border-radius: 20px; }
  .tag-popover { width: min(300px, calc(100vw - 60px)); }
  .mobile-bar { display: flex; }
  body { padding-bottom: 68px; }
  .toast-stack { left: 16px; right: 16px; top: auto; bottom: 80px; }
  .toast { max-width: none; min-width: 0; }
  .modal { padding: 26px 20px; border-radius: 20px; }
  .qr-frame { width: 168px; height: 168px; }
  .speed-marks { padding: 7px 14px 0; }
  .field-head { flex-wrap: wrap; }
}
