/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info span {
    font-size: 0.9rem;
    color: #666;
}

/* 按钮样式 */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.btn-start {
    background: #4CAF50;
    color: white;
    font-size: 1.1rem;
    padding: 1rem 2rem;
    border-radius: 50px;
}

.btn-start:hover {
    background: #45a049;
    transform: scale(1.05);
}

.btn-stop {
    background: #f44336;
    color: white;
    font-size: 1.1rem;
    padding: 1rem 2rem;
    border-radius: 50px;
}

.btn-stop:hover {
    background: #da190b;
    transform: scale(1.05);
}

.btn-stop:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-small {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

/* 主要内容区域 */
.main-content {
    padding: 2rem 0;
}

/* 状态面板 */
.status-panel {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-text {
    font-weight: 500;
    color: #333;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #4CAF50;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.status-dot.recording {
    background: #f44336;
}

.status-dot.error {
    background: #ff9800;
}

.audio-level {
    width: 200px;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.audio-level-bar {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A, #CDDC39);
    width: 0%;
    transition: width 0.1s ease;
}

/* 控制面板 */
.control-panel {
    text-align: center;
    margin-bottom: 2rem;
}

.control-panel .btn {
    margin: 0 0.5rem;
}

/* 字幕容器 */
.subtitle-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.subtitle-panel {
    padding: 1.5rem;
}

.subtitle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.subtitle-header h3 {
    color: #333;
    font-size: 1.2rem;
}

.subtitle-controls {
    display: flex;
    gap: 0.5rem;
}

/* 字幕显示区域 */
.subtitle-display {
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.subtitle-item {
    margin-bottom: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.subtitle-original,
.subtitle-translation {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.subtitle-translation {
    margin-bottom: 0;
}

.language-tag {
    background: #667eea;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-right: 0.5rem;
    min-width: 30px;
    text-align: center;
}

.subtitle-translation .language-tag {
    background: #764ba2;
}

.subtitle-original .text {
    font-size: 1.1rem;
    color: #333;
}

.subtitle-translation .text {
    font-size: 1.1rem;
    color: #555;
    font-style: italic;
}

/* 设置面板 */
.settings-panel {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 1.5rem;
    margin-top: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.settings-panel h4 {
    margin-bottom: 1rem;
    color: #333;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.setting-item label {
    font-weight: 500;
    color: #555;
}

.setting-item select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
}

/* 模态框样式 */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #333;
}

.modal-content h2 {
    margin-bottom: 1.5rem;
    color: #333;
    text-align: center;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.register-link,
.login-link {
    text-align: center;
    margin-top: 1rem;
    color: #666;
}

.register-link a,
.login-link a {
    color: #667eea;
    text-decoration: none;
}

.register-link a:hover,
.login-link a:hover {
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .user-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .status-panel {
        flex-direction: column;
        gap: 1rem;
    }
    
    .audio-level {
        width: 100%;
    }
    
    .control-panel .btn {
        display: block;
        margin: 0.5rem auto;
        width: 200px;
    }
    
    .subtitle-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .modal-content {
        margin: 5% auto;
        width: 95%;
    }
}

/* 字体大小主题 */
.subtitle-display.font-small .text {
    font-size: 0.9rem;
}

.subtitle-display.font-medium .text {
    font-size: 1.1rem;
}

.subtitle-display.font-large .text {
    font-size: 1.3rem;
}

.subtitle-display.font-xlarge .text {
    font-size: 1.5rem;
}

/* 深色主题 */
body.theme-dark {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

.theme-dark .header,
.theme-dark .status-panel,
.theme-dark .subtitle-container,
.theme-dark .settings-panel {
    background: rgba(52, 73, 94, 0.9);
    color: #ecf0f1;
}

.theme-dark .subtitle-display {
    background: #34495e;
}

.theme-dark .subtitle-item {
    background: #2c3e50;
    color: #ecf0f1;
}

.theme-dark .status-text,
.theme-dark .subtitle-header h3 {
    color: #ecf0f1;
}

/* 高对比度主题 */
body.theme-high-contrast {
    background: #000;
}

.theme-high-contrast .header,
.theme-high-contrast .status-panel,
.theme-high-contrast .subtitle-container,
.theme-high-contrast .settings-panel {
    background: #fff;
    color: #000;
    border: 2px solid #000;
}

.theme-high-contrast .subtitle-display {
    background: #f0f0f0;
}

.theme-high-contrast .subtitle-item {
    background: #fff;
    color: #000;
    border: 1px solid #000;
}

.theme-high-contrast .language-tag {
    background: #000;
    color: #fff;
}