/* ===== TTS 文字转语音 样式 ===== */

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    font-family: -apple-system, BlinkMacSystemFont, "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
    color: #333;
    min-height: 100vh;
}

/* ===== 顶栏导航 ===== */
.topbar {
    padding: 14px 0 4px;
}

.topbar-wrap {
    width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.brand {
    text-decoration: none;
    color: #333;
}

.brand-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #444;
}

.topbar-actions {
    display: flex;
    align-items: center;
}

.nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav a {
    text-decoration: none;
    color: #555;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 20px;
    transition: background 0.2s, color 0.2s;
}

.nav a:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.08);
}

/* ---- wrapper ---- */
.tts-wrapper {
    width: 1100px;
    margin: 20px auto 30px;
    padding: 0 16px;
}

h1 {
    text-align: center;
    color: #fff;
    font-size: 28px;
    margin: 0 0 6px;
    text-shadow: 0 2px 4px rgba(0,0,0,.2);
}

.tts-subtitle {
    text-align: center;
    color: rgba(255,255,255,.85);
    margin: 0 0 24px;
    font-size: 14px;
}

.tts-card {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,.1);
}

.tts-card h3 {
    margin: 0 0 12px;
    font-size: 16px;
    color: #444;
}

/* ---- 音色选择行 ---- */
.tts-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.tts-col {
    flex: 1;
    min-width: 120px;
}

.tts-col-btn {
    flex: 0 0 auto;
    min-width: 80px;
    display: flex;
    align-items: flex-end;
}

.tts-hint {
    margin: 0 0 16px;
    font-size: 12px;
    color: #999;
}

.tts-mode-row {
    margin-bottom: 16px;
}

.tts-mode-options {
    display: flex;
    gap: 12px;
}

.tts-mode-item {
    flex: 1;
    display: block;
    cursor: pointer;
}

.tts-mode-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.tts-mode-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    transition: border-color 0.2s, background 0.2s;
}

.tts-mode-item input[type="radio"]:checked + .tts-mode-body {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.06);
}

.tts-mode-body strong {
    font-size: 14px;
    color: #333;
}

.tts-mode-body small {
    font-size: 12px;
    color: #999;
    line-height: 1.4;
}

.tts-label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
    font-weight: 500;
}

.tts-select {
    width: 100%;
    height: 38px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    color: #333;
    outline: none;
    transition: border-color .2s;
}

.tts-select:focus {
    border-color: #667eea;
}

/* ---- 文本域 ---- */
.tts-textarea-group {
    margin-bottom: 12px;
}

.tts-textarea {
    width: 100%;
    min-height: 160px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    font-family: inherit;
    transition: border-color .2s;
}

.tts-textarea:focus {
    border-color: #667eea;
}

.tts-count {
    text-align: right;
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

.tts-count span {
    font-weight: 500;
    color: #667eea;
}

/* ---- 按钮 ---- */
.tts-btn {
    display: inline-block;
    height: 38px;
    line-height: 36px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all .2s;
    outline: none;
}

.tts-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.tts-btn-primary {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

.tts-btn-primary:hover:not(:disabled) {
    background: #5a6fd6;
}

.tts-btn-outline {
    background: #fff;
    color: #667eea;
    border-color: #667eea;
}

.tts-btn-outline:hover:not(:disabled) {
    background: #667eea;
    color: #fff;
}

.tts-btn-success {
    background: #52c41a;
    color: #fff;
    border-color: #52c41a;
}

.tts-btn-success:hover:not(:disabled) {
    background: #49b016;
}

/* ---- 信息 ---- */
.tts-info {
    font-size: 13px;
    color: #666;
    margin-bottom: 16px;
    padding: 8px 0;
}

.tts-info strong {
    color: #e65a41;
}

.tts-info-sep {
    margin: 0 8px;
    color: #ddd;
}

.tts-warn {
    color: #e65a41;
}

/* ---- 操作区 ---- */
.tts-actions {
    text-align: center;
}

.tts-actions .tts-btn {
    height: 44px;
    line-height: 42px;
    padding: 0 40px;
    font-size: 16px;
}

/* ---- 结果区 ---- */
.tts-result {
    margin-top: 16px;
    padding: 12px;
    background: #f6f8fa;
    border-radius: 6px;
    text-align: center;
}

.tts-result p {
    margin: 0 0 8px;
    font-size: 14px;
    color: #555;
}

/* ---- 试听区 ---- */
.tts-preview-info {
    font-size: 13px;
    color: #888;
    margin-bottom: 8px;
}

.tts-audio {
    width: 100%;
    height: 36px;
}

/* ---- 使用说明 ---- */
.tts-guide ol {
    margin: 0;
    padding-left: 20px;
    font-size: 14px;
    color: #555;
    line-height: 1.8;
}

.tts-note {
    margin: 8px 0 0;
    font-size: 12px;
    color: #999;
}

.tts-footer {
    display: flex;
    justify-content: center;
    padding: 20px 0 30px;
}

.tts-footer .contact-us {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    cursor: pointer;
    text-decoration: none;
}

.tts-footer .contact-us:hover {
    color: #fff;
    text-decoration: underline;
}

/* ==== 响应式 ==== */
@media (max-width: 1140px) {
    .tts-wrapper {
        width: auto;
    }

    .topbar-wrap {
        width: auto;
    }
}

@media (max-width: 600px) {
    .tts-wrapper {
        margin: 12px auto;
        padding: 0 10px;
    }

    h1 { font-size: 22px; }

    .topbar { padding: 8px 0 2px; }
    .topbar-wrap { padding: 0 10px; }
    .topbar-inner {
        flex-direction: column;
        gap: 8px;
        padding: 10px 14px;
    }
    .nav a { font-size: 12px; padding: 6px 10px; }

    .tts-card { padding: 16px; }

    .tts-row { gap: 8px; }

    .tts-col { min-width: 100px; }
    .tts-col-btn { min-width: 60px; }

    .tts-actions .tts-btn {
        width: 100%;
        padding: 0;
    }

    .tts-select { font-size: 13px; }
    .tts-textarea { font-size: 13px; min-height: 120px; }
}
