:root {
    --bg: #080c18;
    --bg-soft: #0d1324;
    --panel: rgba(17, 24, 43, .9);
    --panel-strong: #121a2d;
    --line: rgba(148, 163, 184, .16);
    --line-bright: rgba(148, 163, 184, .28);
    --text: #f5f7fb;
    --muted: #8e9bb1;
    --muted-light: #b8c2d2;
    --accent: #7c6df2;
    --accent-bright: #a598ff;
    --accent-soft: rgba(124, 109, 242, .14);
    --cyan: #51d9d0;
    --success: #42d3a1;
    --warning: #f7b955;
    --danger: #ff7685;
    --radius: 22px;
    --shadow: 0 26px 70px rgba(0, 0, 0, .28);
    color-scheme: dark;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); scroll-behavior: smooth; }
body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 74% 4%, rgba(89, 80, 204, .18), transparent 31rem),
        radial-gradient(circle at 8% 26%, rgba(48, 135, 156, .09), transparent 25rem),
        linear-gradient(180deg, #090e1b 0%, #080c18 54%, #080b14 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.qwen-shell { min-height: 100vh; overflow: hidden; }
.topbar {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 78px;
    padding: 12px max(28px, calc((100vw - 1380px) / 2));
    border-bottom: 1px solid var(--line);
    background: rgba(8, 12, 24, .7);
    backdrop-filter: blur(18px);
}

.brand, .top-actions { display: flex; align-items: center; }
.brand { gap: 12px; }
.brand-mark {
    position: relative;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(153, 140, 255, .4);
    border-radius: 13px;
    background: linear-gradient(145deg, rgba(138, 121, 255, .24), rgba(50, 210, 204, .08));
    box-shadow: inset 0 0 20px rgba(137, 117, 255, .12);
}
.brand-mark span { position: absolute; width: 5px; border-radius: 8px; background: linear-gradient(#b9aeff, #5ce2d4); }
.brand-mark span:nth-child(1) { height: 13px; transform: translateX(-9px); }
.brand-mark span:nth-child(2) { height: 23px; }
.brand-mark span:nth-child(3) { height: 16px; transform: translateX(9px); }
.brand b, .brand small { display: block; }
.brand b { font-size: 16px; letter-spacing: .02em; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.top-actions { gap: 14px; color: var(--muted-light); font-size: 13px; }
.model-pill { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .025); }
.model-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 10px var(--success); }
.user-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-link { color: var(--muted); transition: color .2s; }
.text-link:hover { color: var(--text); }

.studio { width: min(1320px, calc(100% - 48px)); margin: 0 auto; padding: 68px 0 76px; }
.hero-copy { display: grid; grid-template-columns: 1.3fr .7fr; align-items: end; gap: 60px; margin-bottom: 38px; }
.eyebrow { color: var(--accent-bright); font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.hero-copy h1 { margin: 14px 0 0; font-size: clamp(38px, 5.2vw, 68px); line-height: 1.05; letter-spacing: -.045em; }
.hero-copy h1 em { color: transparent; background: linear-gradient(100deg, #eeeaff, #8e80f4 54%, #66d8d0); background-clip: text; -webkit-background-clip: text; font-style: normal; }
.hero-copy > p { margin: 0 0 6px; color: var(--muted-light); font-size: 15px; line-height: 1.8; }

.panel { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(20, 28, 49, .96), rgba(13, 19, 35, .94)); box-shadow: var(--shadow); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 20px; border: 0; border-radius: 13px; color: var(--text); font-weight: 700; cursor: pointer; transition: transform .18s, filter .18s, border-color .18s; }
.button:hover { transform: translateY(-1px); filter: brightness(1.08); }
.button:disabled { cursor: wait; filter: grayscale(.2); opacity: .7; transform: none; }
.button-primary { background: linear-gradient(125deg, #806ff4, #6556d8); box-shadow: 0 12px 28px rgba(91, 74, 211, .3); }
.button-ghost { border: 1px solid var(--line-bright); background: rgba(255,255,255,.03); }
.button-small { min-height: 36px; padding: 0 15px; border-radius: 10px; }

.login-gate { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px; padding: 34px; }
.gate-icon { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 19px; color: var(--accent-bright); background: var(--accent-soft); font-size: 28px; }
.login-gate h2 { margin: 7px 0; font-size: 25px; }
.login-gate p { margin: 0; color: var(--muted); line-height: 1.7; }

.access-strip {
    display: grid;
    grid-template-columns: minmax(220px, .85fr) minmax(320px, 1.35fr);
    gap: 14px 16px;
    align-items: stretch;
    min-height: 0;
    margin-bottom: 20px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(15, 22, 39, .72);
}
.access-strip.is-unlocked {
    border-color: rgba(66, 211, 161, .18);
    background: linear-gradient(90deg, rgba(66, 211, 161, .06), rgba(15, 22, 39, .72) 42%);
}
.access-strip.is-free {
    border-color: rgba(247, 185, 85, .16);
}
.access-strip .account-usage {
    min-width: 0;
    max-width: none;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.access-strip .usage-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
}
.access-strip .account-recharge-btn {
    flex: 0 0 auto;
    min-height: 30px;
    padding: 0 12px;
}
.access-key-panel {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: center;
}
.access-key-source { min-width: 0; }
.access-key-field {
    margin: 0 !important;
}
.access-key-field[hidden] { display: none !important; }
.access-key-field > span:not(.key-field-title) {
    display: block;
    margin-bottom: 6px;
    color: var(--muted-light);
    font-size: 11px;
}
.access-key-field .key-input {
    position: relative;
    display: block;
}
.access-key-field .key-input input {
    width: 100%;
    min-height: 36px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(5, 9, 18, .5);
    color: var(--text);
    padding: 0 58px 0 12px;
    font-size: 12px;
}
.access-key-field .key-input button {
    position: absolute;
    top: 4px;
    right: 4px;
    min-height: 28px;
    height: 28px;
    padding: 0 10px;
    border-radius: 8px;
    border: 0;
    background: rgba(255,255,255,.06);
    color: var(--muted-light);
    cursor: pointer;
    font-size: 11px;
}
.access-key-field small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.4;
}
.access-upgrade {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 9px;
    border: 1px solid var(--line);
    color: #ded9ff;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}
.access-upgrade:hover { border-color: rgba(145,129,255,.45); color: #fff; }
.custom-upload-only { min-width: 0; }
.custom-upload-only .field-title {
    display: block;
    margin-bottom: 8px;
    color: var(--muted-light);
    font-size: 12px;
    font-weight: 650;
}
.sample-storage-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
}
.sample-storage-label {
    color: var(--muted-light);
    font-size: 11px;
    font-weight: 650;
}
.sample-storage-switch {
    display: inline-flex;
    padding: 3px;
    border-radius: 12px;
    border: 1px solid rgba(145, 129, 255, .22);
    background: rgba(18, 20, 36, .55);
    gap: 2px;
}
.sample-storage-btn {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    padding: 7px 12px;
    border-radius: 9px;
    cursor: pointer;
    transition: .15s ease;
}
.sample-storage-btn:hover {
    color: #fff;
}
.sample-storage-btn.is-active {
    color: #1a1528;
    background: linear-gradient(135deg, #f7b955, #e89a3a);
    box-shadow: 0 4px 14px rgba(247, 185, 85, .22);
}
.sample-storage-btn.is-active[data-sample-storage="temporary"] {
    background: linear-gradient(135deg, #7c6df2, #5b8def);
    box-shadow: 0 4px 14px rgba(124, 109, 242, .25);
    color: #fff;
}
.sample-storage-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}
.sample-storage-hint {
    margin: 0 0 12px;
    padding: 8px 11px;
    border-radius: 10px;
    border: 1px solid rgba(145, 129, 255, .16);
    background: rgba(124, 109, 242, .06);
    color: var(--muted-light);
    font-size: 11px;
    line-height: 1.5;
}
.sample-storage-hint.is-temporary {
    border-color: rgba(247, 185, 85, .28);
    background: rgba(247, 185, 85, .08);
    color: #ffe0a8;
}
.sample-meta-block.is-optional .req-mark {
    display: none;
}
.sample-meta-block.is-collapsed {
    opacity: .72;
}
.upload-status {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(66, 211, 161, .22);
    background: rgba(66, 211, 161, .08);
    color: #b7f0d8;
    font-size: 12px;
    line-height: 1.45;
}
.upload-status.is-error {
    border-color: rgba(248, 113, 113, .28);
    background: rgba(248, 113, 113, .08);
    color: #fecaca;
}
.upload-status[hidden] { display: none !important; }
.local-preview {
    width: 100%;
    margin-top: 10px;
}

.mode-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.mode-tabs.is-custom-only { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
.mode-tab { position: relative; display: flex; align-items: center; gap: 13px; min-height: 78px; padding: 14px 17px; border: 1px solid var(--line); border-radius: 18px; color: var(--muted-light); text-align: left; background: rgba(14, 20, 36, .68); cursor: pointer; transition: border-color .2s, background .2s, transform .2s; }
.mode-tab:hover { transform: translateY(-1px); border-color: var(--line-bright); }
.mode-tab.is-active { border-color: rgba(145, 129, 255, .55); color: var(--text); background: linear-gradient(120deg, rgba(124, 109, 242, .16), rgba(16, 23, 41, .9)); box-shadow: inset 0 0 0 1px rgba(124, 109, 242, .08); }
.mode-tab .tab-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: var(--accent-bright); background: rgba(124, 109, 242, .12); font-size: 22px; }
.mode-tab b, .mode-tab small { display: block; }
.mode-tab b { margin-bottom: 4px; font-size: 14px; }
.mode-tab small { color: var(--muted); font-size: 11px; }
.mode-tab-locked-info { cursor: default; opacity: .72; pointer-events: none; border-style: dashed; }
.mode-tab-locked-info:hover { transform: none; border-color: var(--line); }
.lock-dot { position: absolute; top: 12px; right: 12px; padding: 3px 7px; border-radius: 999px; color: var(--warning); background: rgba(247,185,85,.1); font-size: 9px; font-style: normal; }
.library-locked-banner {
    margin: -6px 0 16px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(247, 185, 85, .28);
    background: rgba(247, 185, 85, .08);
    color: #ffe0a8;
    font-size: 12px;
    line-height: 1.55;
}
.library-locked-banner a {
    color: #ffd27a;
    font-weight: 700;
    margin-left: 6px;
    text-decoration: none;
}
.library-locked-banner a:hover { text-decoration: underline; }

.workspace { display: block; }
.work-main { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(12, 18, 32, .76); box-shadow: var(--shadow); }
.work-section { padding: 22px 24px; }
.work-section + .work-section { border-top: 1px solid var(--line); }
.section-heading, .section-heading > div, .settings-title { display: flex; align-items: center; }
.section-heading { justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.section-heading > div, .settings-title { gap: 12px; }
.section-heading h2, .settings-title h2 { margin: 0 0 4px; font-size: 18px; }
.section-heading p, .settings-title p { margin: 0; color: var(--muted); font-size: 11px; }
.step-number { display: grid; flex: 0 0 auto; place-items: center; width: 34px; height: 34px; border: 1px solid rgba(138, 123, 248, .28); border-radius: 11px; color: var(--accent-bright); background: rgba(124, 109, 242, .09); font-size: 10px; font-weight: 800; }

.voice-search-wrap { position: relative; }
.autofill-trap {
    position: absolute !important;
    left: -10000px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
.voice-search { display: flex; align-items: center; width: min(230px, 38vw); height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; background: rgba(5, 9, 18, .38); }
.voice-search span { color: var(--muted); font-size: 18px; }
.voice-search input { width: 100%; border: 0; outline: 0; padding: 0 7px; color: var(--text); background: transparent; font-size: 12px; }
.voice-search input::placeholder { color: #637087; }
/* 覆盖 Chrome 自动填充黄底，避免误以为是密码框 */
.voice-search input:-webkit-autofill,
.voice-search input:-webkit-autofill:hover,
.voice-search input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text);
    transition: background-color 99999s ease-in-out 0s;
    box-shadow: 0 0 0 1000px rgba(5, 9, 18, .38) inset;
}

.voice-category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: -6px 0 16px;
}
.voice-category-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted-light);
    background: rgba(255, 255, 255, .03);
    cursor: pointer;
    font-size: 12px;
    font-weight: 650;
    transition: border-color .18s, background .18s, color .18s;
}
.voice-category-tab i {
    min-width: 18px;
    padding: 1px 6px;
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255, 255, 255, .05);
    font-style: normal;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
}
.voice-category-tab:hover {
    border-color: var(--line-bright);
    color: var(--text);
}
.voice-category-tab.is-active {
    border-color: rgba(145, 129, 255, .55);
    color: var(--text);
    background: rgba(124, 109, 242, .16);
}
.voice-category-tab.is-active i {
    color: #efeaff;
    background: rgba(124, 109, 242, .35);
}

.voice-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    min-height: 268px;
    align-content: start;
}
.voice-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    min-height: 168px;
    padding: 10px 6px 8px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--text);
    background: rgba(19, 27, 47, .62);
    cursor: pointer;
    transition: transform .2s, border-color .2s, background .2s;
}
.voice-card:hover { transform: translateY(-1px); border-color: var(--line-bright); background: rgba(24, 33, 56, .78); }
.voice-card.is-selected { border-color: rgba(145, 129, 255, .72); background: linear-gradient(160deg, rgba(124, 109, 242, .18), rgba(20, 28, 48, .9)); box-shadow: inset 0 0 0 1px rgba(145, 129, 255, .12); }
.voice-card.is-locked { cursor: default; }
.voice-avatar {
    position: relative;
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
    border: 1.5px solid rgba(255,255,255,.09);
    border-radius: 50%;
    object-fit: cover;
    background: linear-gradient(145deg, #27304a, #171d30);
    box-shadow: 0 4px 12px rgba(0,0,0,.22);
}
.voice-card b {
    width: 100%;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    line-height: 1.25;
}
.voice-card small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.voice-card .voice-author {
    width: 100%;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.voice-note {
    display: -webkit-box;
    width: 100%;
    min-height: 26px;
    margin-top: 4px;
    overflow: hidden;
    color: rgba(219, 226, 245, .76);
    font-size: 9px;
    line-height: 1.4;
    text-align: center;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}
.voice-card .voice-type { margin-top: auto; }
.preview-button {
    position: absolute;
    top: 42px;
    right: calc(50% - 28px);
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 1.5px solid #121a2d;
    border-radius: 50%;
    color: #0b1020;
    background: var(--cyan);
    cursor: pointer;
    font-size: 8px;
    box-shadow: 0 3px 8px rgba(0,0,0,.3);
}
.favorite-button {
    position: absolute;
    top: 5px;
    left: 5px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 50%;
    color: #9aa6bc;
    background: rgba(8, 12, 22, .72);
    cursor: pointer;
    font-size: 11px;
    line-height: 1;
    transition: color .18s, background .18s, border-color .18s, transform .18s;
}
.favorite-button:hover {
    color: #ffd27a;
    border-color: rgba(247, 185, 85, .35);
    background: rgba(20, 16, 10, .82);
    transform: scale(1.06);
}
.favorite-button.is-active {
    color: #ffc857;
    border-color: rgba(247, 185, 85, .5);
    background: rgba(247, 185, 85, .14);
    text-shadow: 0 0 10px rgba(247, 185, 85, .35);
}
.voice-check {
    position: absolute;
    top: 6px;
    right: 6px;
    display: none;
    place-items: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    color: white;
    background: var(--accent);
    font-size: 9px;
}
.voice-card.is-selected .voice-check { display: grid; }
.voice-lock {
    position: absolute;
    inset: auto 4px 4px;
    padding: 3px 5px;
    border-radius: 6px;
    color: #f8c66e;
    background: rgba(9, 13, 24, .88);
    font-size: 8px;
    text-align: center;
}
.voice-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
}
.pager-btn {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text);
    background: rgba(255,255,255,.03);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}
.pager-btn:hover:not(:disabled) {
    border-color: rgba(145, 129, 255, .45);
    background: rgba(124, 109, 242, .12);
}
.pager-btn:disabled {
    opacity: .35;
    cursor: default;
}
.pager-label {
    min-width: 64px;
    color: var(--muted-light);
    font-size: 12px;
    font-weight: 650;
    text-align: center;
}
.empty-voices { grid-column: 1 / -1; padding: 30px; color: var(--muted); text-align: center; }

/* 账户条内的用量卡 */
.account-usage {
    min-width: 0;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(8, 12, 22, .55);
}
.account-usage .usage-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    font-size: 10px;
    color: var(--muted);
}
.account-usage .usage-card-head button {
    border: 0;
    background: transparent;
    color: #b8b0ff;
    cursor: pointer;
    font-size: 10px;
    padding: 0;
}
.account-usage .usage-numbers {
    display: flex;
    align-items: baseline;
    gap: 4px;
    line-height: 1.1;
}
.account-usage .usage-numbers strong {
    font-size: 16px;
    font-weight: 800;
}
.account-usage .usage-numbers span {
    font-size: 10px;
    color: var(--muted-light);
}
.account-usage .usage-progress {
    margin-top: 6px;
    height: 4px;
    border-radius: 99px;
    background: rgba(255,255,255,.06);
    overflow: hidden;
}
.account-usage .usage-progress i {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #7c6df2, #9b8cff);
}
.account-usage .usage-card-foot {
    margin-top: 5px;
    font-size: 10px;
    color: var(--muted);
}
.account-usage.is-warning .usage-progress i { background: linear-gradient(90deg, #d97706, #f59e0b); }
.account-usage.is-critical .usage-progress i { background: linear-gradient(90deg, #dc2626, #f87171); }
.account-recharge-btn { white-space: nowrap; }

/* 文案 → 生成 → 声音设置（纵向流） */
.compose-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}
.segment-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.compose-segment {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(8, 12, 22, .42);
}
.compose-segment.is-active {
    border-color: rgba(145, 129, 255, .4);
    box-shadow: 0 0 0 1px rgba(124, 109, 242, .12);
}
.segment-head {
    display: flex;
    align-items: center;
    gap: 10px;
}
.segment-title {
    font-size: 13px;
    letter-spacing: .02em;
}
.segment-char-count {
    margin-left: auto;
    color: var(--muted);
    font-size: 10px;
}
.segment-remove {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 4px 10px;
    color: #f0a0a0;
    background: rgba(255, 80, 80, .06);
    cursor: pointer;
    font-size: 11px;
}
.segment-remove:hover {
    border-color: rgba(255, 120, 120, .45);
    color: #ffd0d0;
}
.compose-segment .segment-text {
    display: block;
    width: 100%;
    min-height: 150px;
    resize: vertical;
    border: 1px solid var(--line);
    border-radius: 14px;
    outline: none;
    padding: 14px 16px;
    color: var(--text);
    background: rgba(5, 9, 18, .48);
    font-size: 14px;
    line-height: 1.75;
}
.compose-segment .segment-text:focus {
    border-color: rgba(145, 129, 255, .55);
    box-shadow: 0 0 0 3px rgba(124, 109, 242, .08);
}
.emotion-tags {
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.emotion-tags-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.emotion-tags-label {
    min-width: 28px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 650;
}
.emotion-tags button {
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted-light);
    background: rgba(255, 255, 255, .03);
    cursor: pointer;
    font-size: 11px;
    transition: border-color .15s, color .15s, background .15s;
}
.emotion-tags button:hover {
    border-color: rgba(145, 129, 255, .5);
    color: #fff;
    background: rgba(124, 109, 242, .16);
}
.instruction-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.instruction-block .field-label {
    margin: 0;
}
.instruction-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.instruction-presets button {
    padding: 5px 10px;
    border: 1px dashed rgba(145, 129, 255, .28);
    border-radius: 8px;
    color: var(--accent-bright);
    background: rgba(124, 109, 242, .08);
    cursor: pointer;
    font-size: 10px;
}
.instruction-presets button:hover {
    border-style: solid;
    border-color: rgba(145, 129, 255, .5);
    background: rgba(124, 109, 242, .18);
}
.segment-voice-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.segment-voice-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    flex: 1 1 180px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(5, 9, 18, .35);
}
.segment-voice-chip.is-override {
    border-color: rgba(94, 192, 255, .35);
}
.segment-voice-chip .mini-avatar {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    font-size: 11px;
}
.segment-voice-chip small {
    display: block;
    color: var(--muted);
    font-size: 10px;
}
.segment-voice-chip b {
    display: block;
    font-size: 12px;
}
.segment-add-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.add-segment-btn {
    min-height: 38px;
}
.segment-add-bar small {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.5;
}
.compose-generate-bar {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) minmax(160px, .7fr);
    gap: 10px;
    align-items: stretch;
}
.compose-generate-bar .selected-voice {
    margin: 0;
    min-height: 48px;
}
.compose-generate-bar .selected-voice.compact { padding: 8px 10px; }
.compose-generate-bar .generate-button {
    width: 100%;
    min-height: 48px;
    margin: 0;
}
.key-source-inline {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(8, 12, 22, .35);
}
.key-source-inline .key-source-title {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 10px;
    color: var(--muted);
}
.key-source-inline .key-source-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}
.key-source-inline .key-source-switch button {
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--muted-light);
    font-size: 11px;
    cursor: pointer;
}
.key-source-inline .key-source-switch button.is-active,
.key-source-inline .key-source-switch button[aria-pressed="true"] {
    border-color: rgba(145,129,255,.45);
    background: rgba(124,109,242,.22);
    color: #fff;
}
.compose-settings-row {
    display: grid;
    grid-template-columns: minmax(110px, .8fr) repeat(3, minmax(120px, 1fr));
    gap: 10px;
    align-items: end;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(8, 12, 22, .35);
}
.compose-settings-row .field-label,
.compose-settings-row .range-field {
    margin: 0;
    min-width: 0;
}
.compose-settings-row .field-label.compact span,
.compose-settings-row .range-field.compact span {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 11px;
    color: var(--muted-light);
}
.compose-settings-row .field-label.grow { min-width: 0; }
.compose-stack .usage-note {
    margin: 0;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.5;
}

/* 充值弹窗 */
.pay-modal[hidden] { display: none !important; }
.pay-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 20px;
}
.pay-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 6, 14, .72);
    backdrop-filter: blur(6px);
}
.pay-modal-card {
    position: relative;
    width: min(420px, 100%);
    padding: 18px;
    border-radius: 18px;
    border: 1px solid rgba(145,129,255,.28);
    background: linear-gradient(180deg, rgba(22, 26, 44, .98), rgba(12, 15, 28, .98));
    box-shadow: 0 24px 60px rgba(0,0,0,.45);
}
.pay-modal-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.pay-modal-head h3 {
    margin: 0 0 4px;
    font-size: 16px;
}
.pay-modal-head p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}
.pay-close {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--text);
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
}
.pay-pack-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}
.pay-pack {
    position: relative;
    padding: 12px 8px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,.03);
    color: var(--text);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}
.pay-pack b { font-size: 13px; }
.pay-pack span { color: #c4bbff; font-size: 12px; font-weight: 700; }
.pay-pack i {
    position: absolute;
    top: -7px;
    right: -4px;
    font-style: normal;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 99px;
    background: #7c6df2;
    color: #fff;
}
.pay-pack.is-active {
    border-color: rgba(145,129,255,.55);
    background: rgba(124,109,242,.18);
    box-shadow: inset 0 0 0 1px rgba(145,129,255,.25);
}
.pay-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.pay-method {
    height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(145,129,255,.35);
    background: rgba(124,109,242,.16);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}
.pay-method:hover { background: rgba(124,109,242,.28); }
.pay-empty { grid-column: 1 / -1; color: var(--muted); font-size: 12px; margin: 0; }
.pay-qr-box {
    min-height: 220px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    border: 1px dashed rgba(145,129,255,.35);
    background: rgba(255,255,255,.03);
    margin-bottom: 12px;
    overflow: hidden;
}
.pay-qr-box img {
    max-width: 200px;
    height: auto;
    display: block;
}
.pay-qr-box iframe {
    width: 100%;
    min-height: 260px;
    border: 0;
    background: #fff;
}
.pay-wait {
    text-align: center;
    color: var(--muted-light);
    font-size: 12px;
    margin: 0 0 12px;
}

@media (max-width: 720px) {
    .voice-category-tabs { gap: 6px; }
    .voice-category-tab { min-height: 30px; padding: 0 10px; font-size: 11px; }
}

.custom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.field-label { display: block; }
.field-title, .field-label > span { display: block; margin-bottom: 8px; color: var(--muted-light); font-size: 11px; font-weight: 650; }
.field-label > span i { margin-left: 4px; color: var(--muted); font-size: 9px; font-style: normal; font-weight: 500; }
.field-label input, .field-label select { width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 11px; outline: 0; padding: 0 12px; color: var(--text); background: rgba(7, 11, 21, .5); font-size: 12px; transition: border-color .2s; }
.field-label input:focus, .field-label select:focus { border-color: rgba(145,129,255,.6); }
.field-label small { display: block; margin-top: 8px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.key-input { position: relative; }
.key-input input { padding-right: 58px; }
.key-input button { position: absolute; top: 6px; right: 6px; height: 32px; border: 0; border-radius: 8px; color: var(--muted-light); background: rgba(255,255,255,.05); cursor: pointer; font-size: 10px; }
.key-field-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    color: var(--muted-light);
    font-size: 11px;
    font-weight: 650;
}
.key-apply-link {
    color: var(--accent-bright);
    font-size: 11px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    white-space: nowrap;
}
.key-apply-link:hover { color: #cfc7ff; }
.library-enroll-box {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid rgba(145, 129, 255, .22);
    border-radius: 12px;
    background: rgba(124, 109, 242, .08);
}
.library-enroll-box.is-ready {
    border-color: rgba(66, 211, 161, .28);
    background: rgba(66, 211, 161, .08);
}
.library-enroll-box.is-running {
    border-color: rgba(247, 185, 85, .3);
}
.library-enroll-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.library-enroll-row strong {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
}
.library-enroll-row p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.5;
}
.library-enroll-row .button {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 0 12px;
    white-space: nowrap;
}
.library-enroll-progress {
    height: 6px;
    margin-top: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .06);
    overflow: hidden;
}
.library-enroll-progress span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #7c6df2, #51d9d0);
    transition: width .25s ease;
}
.library-enroll-box > small {
    display: block;
    margin-top: 8px;
    color: var(--muted-light);
    font-size: 10px;
}
.req-mark {
    color: #ffb4a8;
    font-style: normal;
    font-size: 10px;
    font-weight: 700;
    margin-left: 4px;
}
.sample-meta-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(180px, .9fr);
    gap: 12px;
    margin-bottom: 12px;
}
.sample-name-field.is-invalid input,
.sample-avatar-field.is-invalid .avatar-preview-btn,
.upload-consent-required.is-invalid {
    border-color: rgba(248, 113, 113, .55) !important;
    box-shadow: 0 0 0 1px rgba(248, 113, 113, .18);
}
.upload-consent-required {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0 0 12px;
    padding: 10px 12px;
    border: 1px solid rgba(145, 129, 255, .18);
    border-radius: 12px;
    background: rgba(124, 109, 242, .06);
}
.upload-consent-required span {
    color: var(--muted-light);
    font-size: 11px;
    line-height: 1.5;
}
.upload-drop.is-blocked {
    opacity: .55;
    cursor: not-allowed;
}
.sample-name-field input {
    width: 100%;
}
.sample-avatar-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--muted-light);
    font-size: 11px;
    font-weight: 650;
}
.sample-avatar-title small {
    color: var(--muted);
    font-weight: 500;
}
.avatar-picker-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.avatar-picker-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    justify-content: flex-end;
}
.avatar-picker-tip {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.45;
}
.avatar-item.is-upload {
    border-style: dashed;
    border-color: rgba(247, 185, 85, .4);
    background: rgba(247, 185, 85, .08);
    color: #ffe0a8;
}
.avatar-item.is-upload .avatar-upload-icon {
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    margin-bottom: 4px;
    background: rgba(247, 185, 85, .12);
    font-size: 22px;
    font-weight: 700;
}
.avatar-item.is-custom-active {
    border-color: rgba(247, 185, 85, .55);
    background: rgba(247, 185, 85, .12);
}
.avatar-preview-btn {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    border: 1px solid rgba(145, 129, 255, .28);
    background: rgba(124, 109, 242, .1);
    color: var(--accent-bright);
    display: grid;
    place-items: center;
    overflow: hidden;
    cursor: pointer;
    padding: 0;
}
.avatar-preview-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.avatar-preview-btn span {
    font-size: 12px;
    font-weight: 700;
}
.avatar-picker {
    margin: 0 0 12px;
    padding: 12px;
    border: 1px solid rgba(145, 129, 255, .2);
    border-radius: 14px;
    background: rgba(10, 14, 24, .55);
}
.avatar-picker[hidden] { display: none !important; }
.avatar-picker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}
.avatar-picker-head strong {
    font-size: 12px;
    color: var(--text);
}
.avatar-picker-head input {
    flex: 1 1 auto;
    max-width: 220px;
    min-height: 34px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.04);
    color: var(--text);
    font-size: 12px;
}
.avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 8px;
    max-height: 220px;
    overflow: auto;
    padding-right: 2px;
}
.avatar-item {
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    background: rgba(255,255,255,.03);
    padding: 6px;
    cursor: pointer;
    text-align: center;
    color: var(--muted-light);
    transition: border-color .15s, background .15s, transform .15s;
}
.avatar-item:hover {
    border-color: rgba(145, 129, 255, .35);
    background: rgba(124, 109, 242, .1);
}
.avatar-item.is-active {
    border-color: rgba(247, 185, 85, .55);
    background: rgba(247, 185, 85, .12);
    color: #ffe0a8;
}
.avatar-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    margin-bottom: 4px;
    background: rgba(0,0,0,.2);
}
.avatar-item small {
    display: block;
    font-size: 9px;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.avatar-empty {
    grid-column: 1 / -1;
    padding: 18px 8px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
}

.upload-drop { display: grid; grid-template-columns: auto 1fr; align-items: center; min-height: 84px; padding: 15px; border: 1px dashed rgba(145, 129, 255, .34); border-radius: 14px; background: rgba(124,109,242,.055); cursor: pointer; transition: border-color .2s, background .2s, opacity .2s; }
.upload-drop.is-dragging { border-color: var(--accent-bright); background: rgba(124,109,242,.12); }
.upload-drop.is-uploading { opacity: .72; pointer-events: none; cursor: wait; }
.upload-drop.is-trim-locked { opacity: .55; pointer-events: none; }

@media (max-width: 720px) {
    .sample-meta-grid { grid-template-columns: 1fr; }
    .avatar-picker-head { flex-direction: column; align-items: stretch; }
    .avatar-picker-head input { max-width: none; }
}

.trim-panel {
    margin-top: 12px;
    padding: 14px;
    border: 1px solid rgba(247, 185, 85, .28);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(247, 185, 85, .08), rgba(124, 109, 242, .06));
}
.trim-panel[hidden] { display: none !important; }
.trim-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.trim-panel-head strong {
    display: block;
    font-size: 13px;
    color: var(--text);
}
.trim-panel-head p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.55;
}
.trim-range-label {
    flex: 0 0 auto;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(247, 185, 85, .28);
    background: rgba(247, 185, 85, .12);
    color: #ffd89a;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.trim-wave-wrap {
    position: relative;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(7, 11, 21, .55);
    overflow: hidden;
    touch-action: none;
    user-select: none;
}
.trim-waveform {
    display: block;
    width: 100%;
    height: 168px;
    cursor: grab;
}
.trim-waveform.is-dragging { cursor: grabbing; }
.trim-waveform.is-panning { cursor: grabbing; }
.trim-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 8px;
}
.trim-meta-row small {
    color: var(--muted-light);
    font-size: 10px;
    line-height: 1.4;
}
#trimViewLabel {
    color: #cfc7ff;
}
.trim-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}
.trim-actions-spacer { flex: 1 1 auto; min-width: 8px; }
.trim-actions .button {
    min-height: 34px;
    padding: 0 12px;
}
.trim-preview-audio { display: none; }

@media (max-width: 720px) {
    .trim-panel-head { flex-direction: column; }
    .trim-actions-spacer { display: none; }
    .trim-actions .button { flex: 1 1 calc(50% - 8px); }
    .trim-actions .button-primary { flex: 1 1 100%; }
}
.upload-drop input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.upload-icon { grid-row: 1 / 3; display: grid; place-items: center; width: 45px; height: 45px; margin-right: 12px; border-radius: 12px; color: var(--accent-bright); background: rgba(124,109,242,.13); font-size: 22px; }
.upload-drop b { align-self: end; font-size: 12px; }
.upload-drop small { align-self: start; margin-top: 4px; color: var(--muted); font-size: 9px; }
.local-preview { width: 100%; height: 34px; margin-top: 9px; }
.consent { display: flex; align-items: flex-start; gap: 9px; margin-top: 17px; color: var(--muted); font-size: 10px; line-height: 1.55; cursor: pointer; }
.consent input { flex: 0 0 auto; margin-top: 2px; accent-color: var(--accent); }

.script-heading-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.history-toggle {
    min-height: 30px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted-light);
    background: rgba(255, 255, 255, .03);
    cursor: pointer;
    font-size: 11px;
    font-weight: 650;
    transition: border-color .18s, background .18s, color .18s;
}
.history-toggle:hover,
.history-toggle.is-active {
    border-color: rgba(145, 129, 255, .5);
    color: var(--text);
    background: rgba(124, 109, 242, .14);
}
.history-panel {
    margin: 0 0 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(8, 12, 22, .55);
    overflow: hidden;
}
.history-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .05);
}
.history-panel-head strong {
    font-size: 12px;
    font-weight: 700;
}
.history-panel-head small {
    color: var(--muted);
    font-size: 10px;
}
.history-list {
    max-height: 220px;
    overflow: auto;
    padding: 8px;
}
.history-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px;
    align-items: stretch;
    margin-bottom: 6px;
}
.history-item:last-child {
    margin-bottom: 0;
}
.history-use {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--text);
    background: rgba(255, 255, 255, .03);
    cursor: pointer;
    text-align: left;
    transition: border-color .18s, background .18s;
}
.history-use:hover {
    border-color: rgba(145, 129, 255, .4);
    background: rgba(124, 109, 242, .1);
}
.history-use b {
    display: -webkit-box;
    width: 100%;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.45;
    white-space: normal;
}
.history-use small {
    color: var(--muted);
    font-size: 10px;
}
.history-delete {
    display: grid;
    place-items: center;
    width: 34px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--muted);
    background: rgba(255, 255, 255, .02);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}
.history-delete:hover {
    border-color: rgba(255, 120, 120, .35);
    color: #ff9b9b;
    background: rgba(255, 80, 80, .08);
}
.history-empty {
    padding: 18px 12px;
    color: var(--muted);
    text-align: center;
    font-size: 12px;
}
.script-compose-section textarea,
.script-section textarea { display: block; width: 100%; min-height: 210px; resize: vertical; border: 1px solid var(--line); border-radius: 15px; outline: none; padding: 18px; color: var(--text); background: rgba(5, 9, 18, .48); font-size: 14px; line-height: 1.8; transition: border-color .2s, box-shadow .2s; }
.script-compose-section textarea:focus,
.script-section textarea:focus { border-color: rgba(145,129,255,.55); box-shadow: 0 0 0 3px rgba(124,109,242,.08); }
.script-compose-section textarea::placeholder,
.script-section textarea::placeholder { color: #59667b; }
.char-count { color: var(--muted); font-size: 10px; }
.quick-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 12px; color: var(--muted); font-size: 10px; }
.quick-tags button { padding: 5px 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted-light); background: rgba(255,255,255,.025); cursor: pointer; font-size: 9px; }
.quick-tags button:hover { border-color: rgba(145,129,255,.45); color: var(--text); }

.settings-title { margin-bottom: 12px; }
.key-source-block { margin: -2px 0 12px; }
.key-source-title, .usage-card-head, .usage-card-foot { display: flex; align-items: center; justify-content: space-between; }
.key-source-title { margin-bottom: 8px; color: var(--muted-light); font-size: 10px; font-weight: 650; }
.key-source-title small { color: var(--accent-bright); font-size: 9px; }
.key-source-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: rgba(5,9,18,.42); }
.key-source-switch button { position: relative; min-height: 35px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; cursor: pointer; font-size: 10px; font-weight: 700; transition: color .2s, background .2s; }
.key-source-switch button.is-active { color: var(--text); background: linear-gradient(120deg, rgba(124,109,242,.28), rgba(124,109,242,.12)); box-shadow: 0 4px 14px rgba(0,0,0,.16); }
.key-source-switch button i { position: absolute; top: 2px; right: 3px; padding: 2px 4px; border-radius: 5px; color: var(--warning); background: rgba(247,185,85,.1); font-size: 7px; font-style: normal; }
.key-usage-card { margin-bottom: 18px; padding: 13px; border: 1px solid rgba(124,109,242,.2); border-radius: 13px; background: linear-gradient(145deg, rgba(124,109,242,.09), rgba(5,9,18,.32)); }
.key-usage-card.is-monitor { border-color: rgba(94, 192, 255, .28); }
.key-usage-card.is-warning { border-color: rgba(247, 185, 85, .45); background: linear-gradient(145deg, rgba(247, 185, 85, .12), rgba(5,9,18,.32)); }
.key-usage-card.is-critical { border-color: rgba(255, 120, 120, .5); background: linear-gradient(145deg, rgba(255, 90, 90, .12), rgba(5,9,18,.32)); }
.key-usage-card.is-warning .usage-progress i { background: linear-gradient(90deg, #f0b429, #ff8f3c); }
.key-usage-card.is-critical .usage-progress i { background: linear-gradient(90deg, #ff6b6b, #ff3b5c); }
.usage-card-head { margin-bottom: 10px; color: var(--muted-light); font-size: 10px; font-weight: 700; }
.usage-card-head button { border: 0; padding: 2px 0; color: var(--accent-bright); background: transparent; cursor: pointer; font-size: 9px; }
.usage-numbers { display: flex; align-items: baseline; gap: 5px; }
.usage-numbers strong { font-size: 22px; letter-spacing: -.03em; }
.usage-numbers span { color: var(--muted); font-size: 9px; }
.usage-progress { height: 4px; margin: 10px 0 9px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.09); }
.usage-progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--cyan)); transition: width .3s; }
.usage-card-foot { gap: 8px; color: var(--muted); font-size: 8px; line-height: 1.4; }
.usage-card-foot span { flex: 1; }
.usage-card-foot a { flex: 0 0 auto; color: var(--accent-bright); }
.range-field { display: block; margin: 18px 0; }
.range-field > span { display: flex; justify-content: space-between; margin-bottom: 10px; color: var(--muted-light); font-size: 11px; }
.range-field output { color: var(--accent-bright); font-size: 10px; }
.range-field input { width: 100%; height: 4px; margin: 0; appearance: none; border-radius: 5px; outline: 0; background: linear-gradient(90deg, var(--accent) var(--range, 33%), rgba(255,255,255,.11) var(--range, 33%)); }
.range-field input::-webkit-slider-thumb { width: 15px; height: 15px; appearance: none; border: 3px solid #c6bdff; border-radius: 50%; background: #6d5ee2; box-shadow: 0 2px 8px rgba(0,0,0,.35); cursor: pointer; }
.range-field input::-moz-range-thumb { width: 10px; height: 10px; border: 3px solid #c6bdff; border-radius: 50%; background: #6d5ee2; cursor: pointer; }
.selected-voice { display: flex; align-items: center; gap: 11px; min-height: 62px; margin: 22px 0 14px; padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: rgba(5,9,18,.3); }
.mini-avatar { display: grid; place-items: center; width: 40px; height: 40px; overflow: hidden; border-radius: 11px; color: var(--accent-bright); background: var(--accent-soft); font-size: 12px; }
.mini-avatar img { width: 100%; height: 100%; object-fit: cover; }
.selected-voice small, .selected-voice b { display: block; }
.selected-voice small { margin-bottom: 3px; color: var(--muted); font-size: 9px; }
.selected-voice b { max-width: 195px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.generate-button { width: 100%; min-height: 52px; justify-content: space-between; padding: 0 18px; }
.generate-button.is-loading i { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.35); border-top-color: white; border-radius: 50%; animation: spin .75s linear infinite; font-size: 0; }
.usage-note { margin: 11px 0 0; color: var(--muted); text-align: center; font-size: 9px; line-height: 1.5; }

.result-panel { margin-top: 18px; padding: 21px; }
.result-head, .result-head > div, .result-player { display: flex; align-items: center; }
.result-head { justify-content: space-between; margin-bottom: 16px; }
.result-head > div { gap: 10px; }
.result-check { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--success); background: rgba(66,211,161,.11); }
.result-head b, .result-head small { display: block; }
.result-head b { margin-bottom: 3px; font-size: 13px; }
.result-head small { color: var(--muted); font-size: 9px; }
.result-head > button { border: 0; color: var(--muted); background: transparent; cursor: pointer; font-size: 24px; }
.result-player { gap: 14px; min-height: 70px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 15px; background: rgba(5,9,18,.35); }
.result-player > button { display: grid; flex: 0 0 auto; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%; color: #fff; background: var(--accent); cursor: pointer; }
.fake-wave { flex: 1; height: 34px; opacity: .64; background: repeating-linear-gradient(90deg, #6f64c9 0 2px, transparent 2px 6px); mask-image: linear-gradient(180deg, transparent 0, #000 22%, #000 78%, transparent 100%); clip-path: polygon(0 44%, 3% 34%, 6% 56%, 9% 28%, 12% 62%, 15% 42%, 18% 20%, 21% 68%, 24% 35%, 27% 55%, 30% 25%, 33% 68%, 36% 40%, 39% 18%, 42% 63%, 45% 32%, 48% 58%, 51% 21%, 54% 65%, 57% 37%, 60% 54%, 63% 29%, 66% 70%, 69% 39%, 72% 19%, 75% 61%, 78% 33%, 81% 52%, 84% 26%, 87% 65%, 90% 39%, 93% 54%, 96% 32%, 100% 48%, 100% 52%, 0 52%); }
.result-player > span { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 10px; }
.button-download { min-height: 38px; border: 1px solid var(--line-bright); background: rgba(255,255,255,.04); font-size: 10px; }

#noticeRoot { position: fixed; z-index: 100; top: 88px; right: 22px; display: grid; gap: 9px; width: min(380px, calc(100vw - 44px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 13px 15px; border: 1px solid var(--line-bright); border-radius: 13px; color: var(--muted-light); background: rgba(15,22,39,.96); box-shadow: 0 18px 45px rgba(0,0,0,.35); animation: toast-in .25s ease-out; font-size: 11px; line-height: 1.55; }
.toast::before { content: "i"; display: grid; flex: 0 0 auto; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: var(--accent-bright); background: var(--accent-soft); font-weight: 800; }
.toast.is-error { border-color: rgba(255,118,133,.35); }
.toast.is-error::before { content: "!"; color: var(--danger); background: rgba(255,118,133,.1); }
.toast a { margin-left: 4px; color: var(--accent-bright); font-weight: 700; }

.site-footer { display: flex; align-items: center; justify-content: space-between; min-height: 78px; padding: 16px max(28px, calc((100vw - 1380px) / 2)); border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.site-footer nav { display: flex; gap: 20px; }
.site-footer a:hover { color: var(--text); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes toast-in { from { transform: translateY(-8px); opacity: 0; } }

@media (max-width: 1180px) {
    .voice-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); min-height: 250px; }
}

@media (max-width: 1050px) {
    .voice-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); min-height: 250px; }
    .compose-generate-bar { grid-template-columns: 1fr; }
    .compose-settings-row { grid-template-columns: 1fr 1fr; }
    .access-strip { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
    .studio { width: min(100% - 28px, 720px); padding-top: 44px; }
    .hero-copy { grid-template-columns: 1fr; gap: 18px; }
    .hero-copy > p { max-width: 620px; }
    .voice-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .custom-grid { grid-template-columns: 1fr; }
    .login-gate { grid-template-columns: auto 1fr; }
    .login-gate .button { grid-column: 1 / -1; }
}

@media (max-width: 590px) {
    .topbar { min-height: 68px; padding: 10px 14px; }
    .brand-mark { width: 37px; height: 37px; }
    .brand b { font-size: 14px; }
    .brand small, .model-pill, .user-name { display: none; }
    .top-actions { gap: 9px; }
    .studio { width: calc(100% - 20px); padding: 34px 0 48px; }
    .hero-copy h1 { font-size: 39px; }
    .hero-copy > p { font-size: 13px; }
    .access-strip { grid-template-columns: 1fr; }
    .mode-tabs { grid-template-columns: 1fr; }
    .work-section { padding: 20px 15px; }
    .section-heading { align-items: flex-start; flex-direction: column; }
    .section-heading > div { width: 100%; }
    .voice-search { width: 100%; }
    .voice-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); min-height: 220px; }
    .voice-card { min-height: 112px; }
    .script-compose-section textarea,
    .script-section textarea,
    .compose-segment .segment-text { min-height: 140px; }
    .segment-add-bar { flex-direction: column; align-items: flex-start; }
    .compose-settings-row { grid-template-columns: 1fr; }
    .result-player { flex-wrap: wrap; }
    .fake-wave { min-width: 55%; }
    .button-download { width: 100%; }
    .site-footer { align-items: flex-start; flex-direction: column; gap: 12px; padding: 20px 15px; }
    #noticeRoot { top: 76px; right: 10px; width: calc(100vw - 20px); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
