/* IndexTTS 语音克隆 - 前端样式（复用 RiPro-V2 主题组件） */

.ittc-wrap .card {
    border: 0;
    box-shadow: 0 0 10px rgba(29, 35, 41, 0.06);
    border-radius: 0.5rem;
}

.ittc-wrap .card-body {
    padding: 1.1rem 1.25rem;
}

.ittc-quota-bar {
    background: #fff;
    border: 1px solid #f0e9d8;
    border-left: 4px solid var(--primary, #1f80ff);
    border-radius: 0.5rem;
    font-size: 13px;
    color: #5e6d82;
    box-shadow: 0 0 10px rgba(29, 35, 41, 0.04);
}

.ittc-quota-bar b {
    color: #d48806;
}

.ittc-textarea {
    resize: vertical;
    min-height: 220px;
    background-color: #fbfcfe;
    font-size: 14px;
    line-height: 1.9;
}

.ittc-textarea:focus {
    background-color: #fff;
    border-color: var(--primary, #1f80ff);
    box-shadow: 0 0 0 0.2rem rgba(31, 128, 255, 0.12);
}

/* 任务列表 */
.ittc-task {
    border: 1px solid #eef1f5;
    border-radius: 0.5rem;
    padding: 12px 14px;
    margin-bottom: 10px;
    background: #fbfcfe;
}

.ittc-task:last-child {
    margin-bottom: 0;
}

.ittc-task-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}

.ittc-task-head .voice {
    font-weight: 600;
    color: #2b3a4a;
    max-width: 40%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ittc-task-head .meta {
    font-size: 12px;
    color: #909399;
}

.ittc-task-head .ops {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ittc-task-text {
    font-size: 13px;
    color: #5e6d82;
    line-height: 1.7;
    word-break: break-all;
    margin-bottom: 6px;
}

.ittc-task audio {
    width: 100%;
    height: 36px;
    margin-top: 4px;
}

.ittc-task .ittc-task-error {
    font-size: 12px;
    color: #f5222d;
    margin-top: 4px;
    word-break: break-all;
}

.ittc-badge {
    display: inline-block;
    font-size: 12px;
    line-height: 18px;
    padding: 0 8px;
    border-radius: 10px;
    background: #eef1f5;
    color: #5e6d82;
    white-space: nowrap;
}

.ittc-badge.is-queued {
    background: #fff7e6;
    color: #d48806;
}

.ittc-badge.is-dispatching,
.ittc-badge.is-processing {
    background: #e8f3ff;
    color: var(--primary, #1f80ff);
}

.ittc-badge.is-completed {
    background: #e9f7ef;
    color: #28a745;
}

.ittc-badge.is-failed {
    background: #ffecec;
    color: #f5222d;
}

.ittc-badge.is-canceled {
    background: #f2f3f5;
    color: #909399;
}

.ittc-pay {
    font-size: 12px;
    color: #909399;
}

.ittc-task-expired {
    font-size: 12px;
    color: #909399;
    margin-top: 4px;
}

/* 弹窗 */
.ittc-modal {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 10550;
    display: none;
}

.ittc-modal.is-open {
    display: block;
}

.ittc-modal-mask {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(20, 25, 35, 0.55);
}

.ittc-modal-dialog {
    position: relative;
    width: calc(100% - 32px);
    max-width: 520px;
    margin: 8vh auto 0;
    background: #fff;
    border-radius: 0.6rem;
    box-shadow: 0 16px 48px rgba(20, 25, 35, 0.22);
    overflow: hidden;
    animation: ittc-modal-in 0.18s ease-out;
}

.ittc-modal-dialog.ittc-modal-lg {
    max-width: 760px;
}

@keyframes ittc-modal-in {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ittc-modal-header {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid #eef1f5;
}

.ittc-modal-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #2b3a4a;
}

.ittc-modal-close {
    margin-left: auto;
    border: 0;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    color: #909399;
    cursor: pointer;
    padding: 0 4px;
}

.ittc-modal-close:hover {
    color: #2b3a4a;
}

.ittc-modal-body {
    padding: 16px 18px;
    max-height: 68vh;
    overflow-y: auto;
}

.ittc-modal-footer {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    border-top: 1px solid #eef1f5;
    background: #fbfcfe;
}

.ittc-exchange-tip {
    background: #fff7e6;
    border: 1px solid #ffe1a8;
    color: #ad6800;
    border-radius: 0.4rem;
    padding: 8px 12px;
    font-size: 13px;
    margin-bottom: 12px;
}

.ittc-exchange-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    font-size: 13px;
    color: #5e6d82;
    margin-bottom: 14px;
}

.ittc-exchange-meta b {
    color: #d48806;
}

.ittc-pack-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.ittc-pack-list .ittc-pack {
    width: 100%;
    border: 1px solid #dfe4ea;
    border-radius: 0.5rem;
    background: #fff;
    padding: 12px 10px;
    line-height: 1.5;
    font-size: 14px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ittc-pack-list .ittc-pack .coins {
    display: block;
    font-weight: 600;
    color: #2b3a4a;
}

.ittc-pack-list .ittc-pack .chars {
    display: block;
    font-size: 12px;
    color: #909399;
}

.ittc-pack-list .ittc-pack:hover {
    background: var(--primary, #1f80ff);
    border-color: var(--primary, #1f80ff);
}

.ittc-pack-list .ittc-pack:hover .coins,
.ittc-pack-list .ittc-pack:hover .chars {
    color: #fff;
}

.ittc-modal-note {
    font-size: 12px;
    color: #909399;
    margin: 12px 0 0;
}

.ittc-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 14px;
    font-size: 13px;
    color: #5e6d82;
}

body.ittc-modal-open {
    overflow: hidden;
}

/* 当前音色 */
.ittc-selected-voice {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f5f9ff;
    border: 1px solid #dbe8ff;
    border-radius: 0.5rem;
    padding: 10px 12px;
    margin-bottom: 10px;
}

.ittc-selected-info {
    min-width: 0;
    flex: 1;
}

.ittc-selected-info .label {
    display: block;
    font-size: 12px;
    color: #909399;
    line-height: 1.4;
}

.ittc-selected-info b {
    display: block;
    font-size: 14px;
    color: #2b3a4a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ittc-selected-ops {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.ittc-voice-choose {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.ittc-voice-choose .btn {
    width: 100%;
}

/* 音色列表（弹窗内） */
.ittc-voice-list {
    border: 1px solid #eef1f5;
    border-radius: 0.5rem;
    overflow: hidden;
}

.ittc-voice-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid #eef1f5;
    background: #fff;
}

.ittc-voice-row:last-child {
    border-bottom: 0;
}

.ittc-voice-row:nth-child(even) {
    background: #fbfcfe;
}

.ittc-voice-row-name {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    color: #2b3a4a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ================= API 调用 ================= */
.ittc-api-card {
    border: 1px solid rgba(47, 107, 255, .16);
    background: linear-gradient(180deg, rgba(47, 107, 255, .04), rgba(47, 107, 255, 0));
}

.ittc-api-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
}

.ittc-api-head-ops {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ittc-api-body {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.ittc-api-key {
    flex: 1 1 360px;
    max-width: 520px;
}

.ittc-api-meta {
    flex: 0 1 auto;
}

@media (max-width: 575.98px) {
    .ittc-api-key {
        flex: 1 1 100%;
        max-width: 100%;
    }

    .ittc-api-head-ops {
        width: 100%;
    }

    .ittc-api-head-ops .btn {
        flex: 1 1 auto;
    }
}

/* ================= API 说明 ================= */
.ittc-api-doc {
    font-size: 13px;
    color: #4b5563;
    line-height: 1.8;
}

.ittc-api-doc h6 {
    margin: 18px 0 8px;
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
}

.ittc-api-doc h6:first-of-type {
    margin-top: 0;
}

.ittc-api-doc p {
    margin-bottom: 8px;
}

.ittc-api-doc code {
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(47, 107, 255, .08);
    color: #2f6bff;
    font-size: 12px;
}

.ittc-api-doc pre {
    margin: 8px 0 12px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #111827;
    color: #e5e7eb;
    font-size: 12px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-all;
}

.ittc-api-doc pre code {
    padding: 0;
    background: transparent;
    color: inherit;
}

.ittc-api-tip {
    padding: 10px 12px;
    margin-bottom: 14px;
    border-radius: 8px;
    background: rgba(47, 107, 255, .08);
    color: #1e40af;
    font-size: 12px;
    line-height: 1.7;
}

.ittc-api-table {
    font-size: 12px;
}

.ittc-api-table th,
.ittc-api-table td {
    padding: 6px 8px !important;
}

.dark-open .ittc-api-doc {
    color: rgba(255, 255, 255, .68);
}

.dark-open .ittc-api-doc h6 {
    color: #fff;
}

.dark-open .ittc-api-table th,
.dark-open .ittc-api-table td {
    border-color: rgba(255, 255, 255, .1);
}

/* ================= 未登录落地页 ================= */
.ittc-guest {
    padding-top: 8px;
    padding-bottom: 16px;
}

.ittc-guest-hero {
    position: relative;
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 44px 48px;
    border-radius: 18px;
    overflow: hidden;
    background: radial-gradient(120% 160% at 88% 0%, rgba(255, 255, 255, .16) 0%, rgba(255, 255, 255, 0) 46%), linear-gradient(135deg, #1f2a44 0%, #111827 62%, #0b1020 100%);
    color: #fff;
    box-shadow: 0 18px 40px rgba(17, 24, 39, .18);
}

.ittc-guest-hero::before {
    content: "";
    position: absolute;
    right: -90px;
    bottom: -130px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: var(--primary-color, #2f6bff);
    filter: blur(90px);
    opacity: .45;
}

.ittc-guest-hero-text {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    min-width: 0;
}

.ittc-guest-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    margin-bottom: 16px;
    border-radius: 999px;
    font-size: 12px;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .18);
}

.ittc-guest-hero h1 {
    margin: 0 0 14px;
    color: #fff;
    font-size: clamp(24px, 3.2vw, 38px);
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: .5px;
}

.ittc-guest-sub {
    max-width: 580px;
    margin-bottom: 22px;
    color: rgba(255, 255, 255, .78);
    font-size: 14px;
    line-height: 1.85;
}

.ittc-guest-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.ittc-guest .ittc-guest-btn {
    display: inline-block;
    padding: 10px 22px;
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: #111827;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.6;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .18);
    transition: transform .2s, box-shadow .2s;
}

.ittc-guest .ittc-guest-btn:hover,
.ittc-guest .ittc-guest-btn:focus {
    background: #fff;
    color: #111827;
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, .24);
}

.ittc-guest .ittc-guest-ghost {
    display: inline-block;
    padding: 10px 22px;
    border: 1px solid rgba(255, 255, 255, .45);
    border-radius: 999px;
    background: transparent;
    color: #fff;
    font-size: 14px;
    line-height: 1.6;
    transition: background .2s;
}

.ittc-guest .ittc-guest-ghost:hover,
.ittc-guest .ittc-guest-ghost:focus {
    background: rgba(255, 255, 255, .12);
    color: #fff;
}

.ittc-guest-points {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin: 0;
    padding: 0;
    list-style: none;
    color: rgba(255, 255, 255, .8);
    font-size: 13px;
}

.ittc-guest-points i {
    margin-right: 6px;
    color: #4ade80;
}

.ittc-guest-hero-art {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    width: 200px;
}

.ittc-pulse {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 104px;
    height: 104px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 34px;
}

.ittc-pulse::before,
.ittc-pulse::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .35);
    animation: ittcPulse 2.6s ease-out infinite;
}

.ittc-pulse::after {
    animation-delay: 1.3s;
}

@keyframes ittcPulse {
    0% {
        transform: scale(1);
        opacity: .8;
    }
    100% {
        transform: scale(1.9);
        opacity: 0;
    }
}

.ittc-bars {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    height: 44px;
}

.ittc-bars span {
    width: 5px;
    border-radius: 3px;
    background: linear-gradient(180deg, #7dd3fc, #a78bfa);
    animation: ittcBar 1.1s ease-in-out infinite;
}

.ittc-bars span:nth-child(1) { height: 40%; animation-delay: 0s; }
.ittc-bars span:nth-child(2) { height: 70%; animation-delay: .18s; }
.ittc-bars span:nth-child(3) { height: 100%; animation-delay: .36s; }
.ittc-bars span:nth-child(4) { height: 62%; animation-delay: .54s; }
.ittc-bars span:nth-child(5) { height: 34%; animation-delay: .72s; }

@keyframes ittcBar {
    0%, 100% {
        transform: scaleY(.45);
    }
    50% {
        transform: scaleY(1);
    }
}

.ittc-guest-features {
    margin-top: 22px;
}

.ittc-guest-card {
    height: 100%;
    padding: 22px;
    border: 1px solid rgba(17, 24, 39, .06);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(17, 24, 39, .05);
    transition: transform .2s, box-shadow .2s;
}

.ittc-guest-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 28px rgba(17, 24, 39, .1);
}

.ittc-guest-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin-bottom: 12px;
    border-radius: 12px;
    background: rgba(47, 107, 255, .1);
    color: var(--primary-color, #2f6bff);
    font-size: 18px;
}

.ittc-guest-card h2 {
    margin-bottom: 6px;
    font-size: 15px;
}

.ittc-guest-card p {
    margin: 0;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.7;
}

.ittc-guest-steps {
    margin-top: 30px;
}

.ittc-guest-step {
    height: 100%;
    padding: 18px;
    border-radius: 14px;
    background: rgba(17, 24, 39, .03);
}

.ittc-guest-step b {
    display: block;
    margin-bottom: 8px;
    color: var(--primary-color, #2f6bff);
    font-size: 22px;
    font-weight: 800;
    opacity: .3;
}

.ittc-guest-step h3 {
    font-size: 14px;
}

.ittc-guest-step p {
    color: #6b7280;
    font-size: 12px;
    line-height: 1.7;
}

.ittc-guest-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 6px;
    padding: 26px 30px;
    border-radius: 16px;
    background: linear-gradient(135deg, #1f2a44, #111827);
    color: #fff;
    box-shadow: 0 12px 28px rgba(17, 24, 39, .16);
}

.ittc-guest-cta h2 {
    margin-bottom: 4px;
    color: #fff;
}

.ittc-guest-cta p {
    margin: 0;
    color: rgba(255, 255, 255, .72);
    font-size: 13px;
}

.dark-open .ittc-guest-card,
.dark-open .ittc-guest-step {
    border-color: rgba(255, 255, 255, .07);
    background: #1f2228;
}

.dark-open .ittc-guest-card p,
.dark-open .ittc-guest-step p {
    color: rgba(255, 255, 255, .6);
}

@media (max-width: 767.98px) {
    .ittc-guest-hero {
        flex-direction: column;
        align-items: flex-start;
        padding: 28px 22px;
        border-radius: 14px;
    }

    .ittc-guest-hero-art {
        flex-direction: row;
        gap: 16px;
        width: auto;
    }

    .ittc-pulse {
        width: 72px;
        height: 72px;
        font-size: 24px;
    }

    .ittc-bars {
        height: 32px;
    }

    .ittc-guest-hero h1 {
        font-size: 24px;
    }

    .ittc-guest-sub {
        font-size: 13px;
    }

    .ittc-guest-cta {
        padding: 22px;
    }

    .ittc-guest-cta .ittc-guest-btn {
        width: 100%;
        text-align: center;
    }
}

.ittc-voice-row-ops {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* 音色删除按钮 */
#ittc-delete-voice {
    color: #f5222d;
}

/* 提示文字 */
.ittc-wrap .custom-file-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ittc-wrap .custom-file-label::after {
    content: "浏览";
}

@media (max-width: 575.98px) {
    .ittc-wrap .card-body {
        padding: 1rem;
    }

    .ittc-task-head .voice {
        max-width: 100%;
    }

    .ittc-task-head .ops {
        width: 100%;
        margin-left: 0;
    }

    .ittc-pack-list {
        grid-template-columns: repeat(2, 1fr);
    }

    .ittc-modal-dialog {
        margin-top: 4vh;
    }

    .ittc-modal-body {
        max-height: 72vh;
        padding: 14px;
    }

    .ittc-exchange-meta {
        flex-direction: column;
        gap: 4px;
    }

    .ittc-voice-row {
        flex-wrap: wrap;
    }

    .ittc-voice-row-name {
        flex: 1 0 100%;
    }

    .ittc-voice-row-ops {
        width: 100%;
    }

    .ittc-voice-row-ops .btn {
        flex: 1;
    }
}
