/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* 顶部导航栏 */
.top-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 30px;
    border-bottom: 2px solid #e0e0e0;
}

.top-nav a {
    padding: 10px 30px;
    text-decoration: none;
    color: #667eea;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.top-nav a:hover,
.top-nav a.active {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

/* 头部 */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 600;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

/* 主内容区 */
main {
    padding: 30px;
}

/* 输入区 */
.input-section {
    margin-bottom: 30px;
}

.input-section label {
    display: block;
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 10px;
    color: #555;
}

.input-section textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s;
}

.input-section textarea:focus {
    outline: none;
    border-color: #667eea;
}

.char-count {
    text-align: right;
    margin-top: 8px;
    font-size: 0.9em;
    color: #888;
}

.char-count span {
    font-weight: 600;
    color: #667eea;
}

/* 控制按钮区 */
.controls-section {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

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

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #333;
}

.icon {
    font-size: 1.2em;
}

/* 状态区 */
.status-section {
    text-align: center;
    margin-bottom: 30px;
}

.status-indicator {
    font-size: 1.2em;
    margin-bottom: 10px;
    min-height: 30px;
}

.status-indicator.recording {
    color: #f5576c;
    animation: pulse 1.5s ease-in-out infinite;
}

.status-indicator.stopped {
    color: #4facfe;
}

.status-indicator.loading {
    color: #667eea;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.timer {
    font-size: 2em;
    font-weight: 600;
    color: #667eea;
    font-family: 'Courier New', monospace;
}

/* 错误消息 */
.error-message {
    background: #fee;
    border-left: 4px solid #f5576c;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    color: #c00;
}

/* 结果展示区 */
.results-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-section h2 {
    text-align: center;
    color: #667eea;
    margin-bottom: 30px;
    font-size: 2em;
}

/* 分数总结 */
.score-summary {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.score-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-width: 200px;
}

.score-card h3 {
    color: #555;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.score-value {
    font-size: 3em;
    font-weight: 700;
    margin: 15px 0;
}

.score-value.excellent {
    color: #4caf50;
}

.score-value.good {
    color: #ff9800;
}

.score-value.poor {
    color: #f44336;
}

.score-card p {
    color: #888;
    font-size: 0.9em;
}

/* 详细反馈 */
.detailed-feedback {
    background: white;
    border-radius: 15px;
    padding: 25px;
}

.detailed-feedback h3 {
    color: #555;
    margin-bottom: 10px;
}

.feedback-hint {
    color: #888;
    margin-bottom: 20px;
    font-size: 0.9em;
}

.word-details {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.word-item {
    padding: 10px 15px;
    border-radius: 8px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.word-item:hover {
    transform: scale(1.1);
}

.word-item.excellent {
    background: #e8f5e9;
    border: 2px solid #4caf50;
}

.word-item.good {
    background: #fff3e0;
    border: 2px solid #ff9800;
}

.word-item.poor {
    background: #ffebee;
    border: 2px solid #f44336;
}

.word-text {
    font-size: 1.5em;
    font-weight: 600;
}

.word-score {
    font-size: 0.9em;
    font-weight: 600;
}

/* 结果摘要样式 */
.result-summary-section {
    margin-top: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 15px;
    border-left: 4px solid #2196F3;
}

.result-summary-text {
    font-size: 16px;
    color: #333;
    line-height: 1.6;
    margin-bottom: 10px;
}

.result-level {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
}

.result-level.excellent {
    background-color: #4CAF50;
    color: white;
}

.result-level.good {
    background-color: #2196F3;
    color: white;
}

.result-level.poor {
    background-color: #ff9800;
    color: white;
}

/* 单词详情容器样式 */
.word-details-section {
    margin-top: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 15px;
}

.word-details-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.word-details-container .placeholder {
    color: #999;
    font-style: italic;
}

/* 改进建议样式 */
.suggestions-section {
    margin-top: 20px;
    padding: 15px;
    background-color: #fff9e6;
    border-radius: 15px;
    border-left: 4px solid #ffc107;
}

.suggestions-section h3 {
    color: #f57c00;
    margin-bottom: 10px;
}

.suggestions-list {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
}

.suggestions-list .placeholder {
    color: #999;
    font-style: italic;
}

.suggestion-item {
    padding: 10px 0;
    padding-left: 30px;
    position: relative;
    color: #555;
    line-height: 1.6;
}

.suggestion-item:before {
    content: "💡";
    position: absolute;
    left: 0;
    top: 10px;
    font-size: 18px;
}

.word-level {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 4px;
    background-color: #f0f0f0;
    color: #666;
}

/* 使用说明 */
.instructions {
    background: #e3f2fd;
    border-radius: 15px;
    padding: 25px;
}

.instructions h3 {
    color: #1976d2;
    margin-bottom: 15px;
}

.instructions ol {
    margin-left: 20px;
    line-height: 1.8;
}

.instructions li {
    margin-bottom: 8px;
}

.tips {
    margin-top: 20px;
    padding: 15px;
    background: white;
    border-radius: 10px;
}

.tips h4 {
    color: #1976d2;
    margin-bottom: 10px;
}

.tips ul {
    margin-left: 20px;
    line-height: 1.8;
}

/* 页脚 */
footer {
    background: #f5f5f5;
    padding: 20px;
    text-align: center;
    color: #888;
    font-size: 0.9em;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 1.8em;
    }

    main {
        padding: 20px;
    }

    .controls-section {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .score-summary {
        flex-direction: column;
    }

    .word-details {
        justify-content: center;
    }
}

/* 音频播放器区域样式 */
.audio-player-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.audio-player-section h3 {
    color: #555;
    margin-bottom: 15px;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.audio-player-section h3::before {
    content: "🎙️";
}

.audio-player-container {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.audio-player {
    flex: 1;
    min-width: 280px;
    height: 40px;
    border-radius: 8px;
}

.audio-download-link {
    text-decoration: none;
}

.audio-download-link .btn {
    padding: 10px 20px;
    font-size: 0.9em;
}

@media (max-width: 768px) {
    .audio-player-container {
        flex-direction: column;
        align-items: stretch;
    }
    .audio-player {
        width: 100%;
    }
}
