/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 认证页面样式 */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.auth-box {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 450px;
    padding: 40px;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo-container {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.logo-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 12px;
    background: var(--bg-color);
    padding: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.auth-header h1 {
    font-size: 2em;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 1em;
}

.auth-form h2 {
    font-size: 1.5em;
    margin-bottom: 25px;
    color: var(--text-primary);
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95em;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1em;
    font-family: inherit;
    transition: var(--transition);
    background: var(--card-bg);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.form-hint {
    display: block;
    margin-top: 5px;
    font-size: 0.85em;
    color: var(--text-secondary);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

.btn-block {
    width: 100%;
    margin-top: 10px;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 0.95em;
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    margin-left: 5px;
    transition: var(--transition);
}

.auth-switch a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

:root {
    --primary-color: #4a90e2;
    --primary-hover: #357abd;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-left {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logo-container {
    flex-shrink: 0;
}

.header-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.header-title-group {
    flex: 1;
}

.header h1 {
    font-size: 2.2em;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

.header-right {
    display: flex;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    flex-wrap: wrap;
}

.user-balance {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95em;
}

.balance-label {
    opacity: 0.9;
}

.balance-points {
    font-weight: 700;
    color: #ffd700;
    font-size: 1.1em;
}

.member-badge {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #8b6914;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.user-name {
    font-weight: 600;
    font-size: 1em;
}

.user-menu {
    display: flex;
    gap: 10px;
}

/* 步骤指示器 */
.steps-indicator {
    display: flex;
    justify-content: space-between;
    padding: 30px 40px;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
}

.step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 60%;
    width: 80%;
    height: 2px;
    background: var(--border-color);
    z-index: 0;
}

.step.active:not(:last-child)::after {
    background: var(--primary-color);
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
    transition: var(--transition);
}

.step.active .step-number {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.step.completed .step-number {
    background: var(--success-color);
    color: white;
}

.step.completed .step-number::after {
    content: '✓';
}

.step-label {
    font-size: 0.9em;
    color: var(--text-secondary);
    transition: var(--transition);
}

.step.active .step-label {
    color: var(--primary-color);
    font-weight: 600;
}

/* 内容区域 */
.section {
    padding: 40px;
}

.section h2 {
    font-size: 1.8em;
    margin-bottom: 25px;
    color: var(--text-primary);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.dialogue-stats {
    display: flex;
    gap: 20px;
    font-size: 0.95em;
    color: var(--text-secondary);
}

.dialogue-stats strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* 输入框样式 */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-primary);
}

.text-input {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1em;
    font-family: inherit;
    resize: vertical;
    transition: var(--transition);
    background: var(--card-bg);
}

.text-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* 高级设置样式 */
.advanced-settings {
    margin-top: 30px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-color);
    overflow: hidden;
}

.advanced-settings-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    background: rgba(74, 144, 226, 0.05);
    cursor: pointer;
    user-select: none;
    transition: background 0.3s;
}

.advanced-settings-header:hover {
    background: rgba(74, 144, 226, 0.1);
}

.toggle-icon {
    font-size: 12px;
    color: var(--primary-color);
    transition: transform 0.3s;
}

.toggle-text {
    font-weight: 600;
    color: var(--text-primary);
}

.toggle-hint {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-secondary);
}

.advanced-settings-content {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.settings-item {
    margin-bottom: 20px;
}

.settings-item:last-child {
    margin-bottom: 0;
}

.settings-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95em;
}

.settings-input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
    background: var(--bg-color);
    color: var(--text-primary);
}

.settings-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.settings-input[type="number"] {
    width: 100%;
}

.settings-hint {
    margin-top: 5px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.optional-badge {
    display: inline-block;
    background: rgba(74, 144, 226, 0.1);
    color: var(--primary-color);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: normal;
    margin-left: 5px;
}

.settings-note {
    background: rgba(76, 175, 80, 0.1);
    border-left: 4px solid #4caf50;
    border-radius: 6px;
    padding: 12px 15px;
    margin-bottom: 20px;
}

.settings-note p {
    margin: 0;
    color: var(--text-primary);
    font-size: 0.95em;
    line-height: 1.6;
}

/* 音色选择相关样式 */
.voice-library-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.voice-count-hint {
    font-size: 0.9em;
    color: var(--text-secondary);
}

.voice-more-hint {
    padding: 10px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9em;
}

.voice-more-hint a {
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
}

.voice-more-hint a:hover {
    text-decoration: underline;
}

/* 音色库独立面板 */
.voice-library-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.voice-library-content {
    background: var(--bg-color);
    border-radius: 16px;
    width: 100%;
    max-width: 1200px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.voice-library-header-modal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    border-bottom: 2px solid var(--border-color);
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(74, 144, 226, 0.03) 100%);
}

.voice-library-header-modal h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.4em;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.close-voice-library {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.close-voice-library:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

.voice-library-filters {
    display: flex;
    gap: 12px;
    padding: 20px 28px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    align-items: center;
    background: var(--card-bg);
}

.filter-btn {
    padding: 6px 16px;
    border: 2px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-primary);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    transition: var(--transition);
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.voice-search {
    flex: 1;
    min-width: 200px;
    padding: 8px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.9em;
    background: var(--bg-color);
    color: var(--text-primary);
}

.voice-search:focus {
    outline: none;
    border-color: var(--primary-color);
}

.voice-library-list {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    background: var(--bg-color);
}

.voice-library-item {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    min-height: 200px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.voice-library-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 24px rgba(74, 144, 226, 0.2);
    transform: translateY(-4px);
}

.voice-library-item.favorite {
    /* 收藏音色只显示星形标识，不改变边框和背景 */
}

.voice-library-item.favorite::before {
    /* 移除伪元素，使用按钮显示星形 */
    display: none;
    font-size: 1.2em;
    opacity: 0.8;
}

.voice-library-item.unavailable {
    opacity: 0.6;
    cursor: not-allowed;
}

.voice-library-item.unavailable .voice-preview-btn,
.voice-library-item.unavailable .voice-select-btn {
    opacity: 0.5;
    cursor: not-allowed;
}

.voice-unavailable-hint {
    color: #ff9800;
    font-size: 0.85em;
    margin-top: 5px;
    text-align: center;
}

.voice-library-link {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.browse-voices-btn {
    width: 100%;
    padding: 12px 20px;
    font-size: 0.95em;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.browse-voices-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-color) 100%);
}

.browse-voices-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(74, 144, 226, 0.2);
}

.voice-library-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 10px;
}

.voice-favorite-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 1.3em;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: var(--transition);
    z-index: 10;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-favorite-btn:hover {
    background: rgba(255, 152, 0, 0.1);
    transform: scale(1.1);
}

.voice-favorite-btn.active {
    color: #ff9800;
}

.voice-favorite-btn:not(.active) {
    color: var(--text-secondary);
    opacity: 0.6;
}

.voice-preview-btn,
.voice-select-btn {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-primary);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.9em;
    transition: var(--transition);
}

.voice-preview-btn:hover,
.voice-select-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.voice-select-btn.selected {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.voice-library-info {
    flex: 1;
}

.voice-library-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 1.05em;
}

.voice-library-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.voice-gender-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    background: rgba(74, 144, 226, 0.1);
    color: var(--primary-color);
}

.voice-scenario {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
}

.voice-library-description {
    font-size: 0.9em;
    color: var(--text-secondary);
    line-height: 1.5;
}

.voice-library-preview {
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.9em;
    transition: var(--transition);
    align-self: flex-start;
}

.voice-library-preview:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .voice-library-list {
        grid-template-columns: 1fr;
    }
    
    .voice-library-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .voice-search {
        min-width: 100%;
    }
}


.settings-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .settings-row {
        grid-template-columns: 1fr;
    }
}

.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.char-count {
    color: var(--text-secondary);
    font-size: 0.9em;
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9em;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.section-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

/* 对话编辑器 */
.dialogue-editor {
    background: var(--bg-color);
    border-radius: var(--border-radius);
    padding: 20px;
}

.editor-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.dialogue-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.dialogue-item {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 15px;
    transition: var(--transition);
    position: relative;
}

.dialogue-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

.dialogue-item.editing {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.dialogue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.role-name {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1em;
}

.role-name-input {
    padding: 5px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1.1em;
    font-weight: 600;
    width: 150px;
}

.dialogue-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    padding: 6px 10px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9em;
}

.btn-icon:hover {
    background: var(--bg-color);
    border-color: var(--primary-color);
}

.btn-icon.danger:hover {
    background: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
}

.dialogue-content {
    margin-top: 10px;
}

.dialogue-content-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1em;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
}

.dialogue-content-display {
    padding: 10px;
    background: var(--bg-color);
    border-radius: 4px;
    line-height: 1.6;
}

/* 音色选择 */
.voice-selection {
    margin-bottom: 20px;
}

.voice-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: var(--border-radius);
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #856404;
}

.warning-icon {
    font-size: 1.5em;
}

.role-voice-mapping {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.role-voice-item {
    background: var(--bg-color);
    border-radius: var(--border-radius);
    padding: 20px;
    border: 2px solid var(--border-color);
}

.role-voice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.role-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.role-gender {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.role-gender.male {
    background: #e3f2fd;
    color: #1976d2;
}

.role-gender.female {
    background: #fce4ec;
    color: #c2185b;
}

.voice-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.voice-option {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 15px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.voice-option:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.voice-option.selected {
    border-color: var(--primary-color);
    background: rgba(74, 144, 226, 0.1);
}

.voice-option.mismatch {
    border-color: var(--danger-color);
    background: rgba(220, 53, 69, 0.1);
}

.voice-option.unavailable {
    opacity: 0.6;
    cursor: not-allowed;
    position: relative;
}

.voice-option.unavailable::after {
    content: '⚠️ 未训练完成';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 152, 0, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    pointer-events: none;
    z-index: 5;
}

.voice-option.unavailable .voice-preview {
    opacity: 0.5;
    cursor: not-allowed;
}

.voice-option.favorite {
    /* 收藏音色只显示星形标识，不改变边框和背景 */
    position: relative;
}

.voice-favorite-btn-main {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: var(--transition);
    z-index: 10;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-favorite-btn-main:hover {
    background: rgba(255, 152, 0, 0.1);
    transform: scale(1.15);
}

.voice-favorite-btn-main.active {
    color: #ff9800;
}

.voice-favorite-btn-main:not(.active) {
    color: var(--text-secondary);
    opacity: 0.6;
}

.selected-voice-name {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    margin-left: 10px;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.voice-name {
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.voice-description {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.voice-preview {
    padding: 6px 12px;
    background: var(--bg-color);
    border-radius: 4px;
    font-size: 0.85em;
    color: var(--primary-color);
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.voice-preview:hover {
    background: var(--primary-color);
    color: white;
}

/* 音频生成 */
.audio-generation {
    margin-bottom: 20px;
}

.generation-progress {
    margin-bottom: 30px;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: var(--bg-color);
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #667eea);
    width: 0%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.85em;
    font-weight: 600;
}

.progress-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95em;
}

.audio-result {
    background: var(--bg-color);
    border-radius: var(--border-radius);
    padding: 30px;
}

.audio-player-container {
    margin-bottom: 20px;
}

audio {
    width: 100%;
    margin-bottom: 15px;
}

.audio-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.audio-meta {
    display: flex;
    gap: 20px;
    color: var(--text-secondary);
    font-size: 0.95em;
}

.audio-meta strong {
    color: var(--text-primary);
}

/* 加载遮罩 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: white;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.1em;
}

/* 提示消息 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--card-bg);
    padding: 15px 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-hover);
    z-index: 10000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 300px;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--danger-color);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8em;
    }
    
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .header-logo {
        width: 40px;
        height: 40px;
    }
    
    .logo-img {
        width: 60px;
        height: 60px;
    }
    
    .user-info {
        width: 100%;
        justify-content: space-between;
    }

    .steps-indicator {
        padding: 20px 15px;
    }

    .step-label {
        font-size: 0.8em;
    }

    .section {
        padding: 20px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .voice-options {
        grid-template-columns: 1fr;
    }

    .section-footer {
        flex-direction: column;
        gap: 10px;
    }

    .section-footer .btn {
        width: 100%;
    }
    
    .auth-box {
        padding: 30px 20px;
    }
    
    .auth-header h1 {
        font-size: 1.5em;
    }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* 弹窗样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

.modal-content.modal-large {
    max-width: 800px;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5em;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2em;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-color);
    color: var(--text-primary);
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.feature-list li {
    padding: 10px 0;
    color: var(--text-primary);
    line-height: 1.6;
}

.modal-hint {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    border-radius: 4px;
    margin-top: 20px;
    color: #856404;
}

/* 积分价格说明样式 */
.points-price-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.points-price-section h3 {
    margin: 0 0 16px 0;
    color: #333;
    font-size: 18px;
}

.price-info-box {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.price-exchange-rate {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rate-label {
    font-weight: 500;
    color: #666;
}

.rate-value {
    color: #2c3e50;
    font-weight: 600;
    font-size: 16px;
}

.points-price-detail {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.price-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.price-label {
    font-weight: 500;
    color: #666;
    flex-shrink: 0;
}

.price-value {
    color: #2c3e50;
    text-align: right;
}

.price-value .points-num {
    color: #e74c3c;
    font-weight: 600;
    font-size: 16px;
}

.price-value .price-num {
    color: #27ae60;
    font-weight: 500;
}

.price-note {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
}

.price-note .note-text {
    margin: 0;
    color: #666;
    font-size: 13px;
}

/* 会员中心样式 */
.membership-status {
    background: var(--bg-color);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 30px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.status-item:last-child {
    border-bottom: none;
}

.status-label {
    color: var(--text-secondary);
    font-size: 0.95em;
}

.status-value {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.1em;
}

.points-value {
    color: #ff6b6b;
    font-size: 1.3em;
}

.membership-section {
    margin-bottom: 30px;
}

.membership-section h3 {
    font-size: 1.3em;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.section-desc {
    color: var(--text-secondary);
    font-size: 0.95em;
    margin-bottom: 20px;
}

.membership-plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.plan-item {
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    transition: var(--transition);
}

.plan-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

.plan-header {
    text-align: center;
    margin-bottom: 20px;
}

.plan-header h4 {
    font-size: 1.2em;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.plan-price {
    font-size: 2em;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.price-unit {
    font-size: 0.5em;
    color: var(--text-secondary);
    font-weight: normal;
}

.plan-discount {
    background: var(--danger-color);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    display: inline-block;
    margin-top: 5px;
}

.plan-features {
    margin-bottom: 20px;
}

.feature-item {
    padding: 8px 0;
    color: var(--text-primary);
    font-size: 0.95em;
}

.recharge-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.recharge-item {
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.recharge-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.recharge-item.selected {
    border-color: var(--primary-color);
    background: rgba(74, 144, 226, 0.1);
}

.recharge-amount {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.recharge-points {
    color: var(--text-secondary);
    font-size: 0.9em;
}

.recharge-bonus {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--success-color);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
}

.custom-recharge {
    margin-top: 20px;
}

.custom-recharge label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-primary);
}

.custom-recharge-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-recharge-input span {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--text-primary);
}

.custom-recharge-input input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1em;
}

/* 卡密兑换样式 */
.redeem-section {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.05) 0%, rgba(74, 144, 226, 0.02) 100%);
    border: 2px solid rgba(74, 144, 226, 0.2);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 30px;
}

.redeem-header {
    text-align: center;
    margin-bottom: 25px;
}

.redeem-header h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.redeem-code-section {
    max-width: 600px;
    margin: 0 auto;
}

.redeem-input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.redeem-input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: all 0.3s;
    background: var(--bg-color);
}

.redeem-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.btn-large {
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
}

.btn-large span {
    margin-right: 5px;
}

.redeem-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 10px;
    padding: 10px 15px;
    background: rgba(74, 144, 226, 0.05);
    border-radius: 6px;
}

.hint-icon {
    font-size: 16px;
}

/* 卡密说明样式 */
.info-section {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 25px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    background: rgba(74, 144, 226, 0.03);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.info-item:hover {
    background: rgba(74, 144, 226, 0.08);
    transform: translateY(-2px);
}

.info-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.info-content h4 {
    font-size: 1em;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.info-content p {
    font-size: 0.9em;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.info-note {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 193, 7, 0.1);
    border-left: 4px solid #ffc107;
    border-radius: 6px;
}

.info-note p {
    margin: 5px 0;
    color: var(--text-primary);
    font-size: 0.95em;
    line-height: 1.6;
}

.info-note p:first-child {
    margin-top: 0;
}

.info-note p:last-child {
    margin-bottom: 0;
}

.custom-recharge-input input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.points-info {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-top: 30px;
}

.points-info h4 {
    margin-bottom: 20px;
    color: var(--text-primary);
    font-size: 1.2em;
}

.points-detail {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.points-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(74, 144, 226, 0.05);
    border-radius: 6px;
}

.points-label {
    font-weight: 600;
    color: var(--text-primary);
}

.points-value {
    color: var(--primary-color);
    font-weight: 600;
}

.points-tip {
    padding: 15px;
    background: rgba(76, 175, 80, 0.1);
    border-left: 4px solid #4caf50;
    border-radius: 6px;
}

.points-tip p {
    margin: 0;
    color: var(--text-primary);
    font-size: 0.95em;
    line-height: 1.6;
}

