/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f0f2f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 标题区域 */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #2c3e50;
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.title {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

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

/* 模式切换区 */
.mode-switch {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.mode-btn {
    padding: 12px 24px;
    font-size: 1.1rem;
    border: 1px solid #ddd;
    cursor: pointer;
    background-color: white;
    color: #333;
    transition: all 0.3s ease;
}

.mode-btn:first-child {
    border-radius: 8px 0 0 8px;
}

.mode-btn:last-child {
    border-radius: 0 8px 8px 0;
}

.mode-btn.active {
    background-color: #2c3e50;
    color: white;
    font-weight: bold;
}

.mode-btn:hover:not(.active) {
    background-color: #e1e1e1;
}

/* 转换区域 */
.converter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.input-section, .result-section {
    flex: 1;
    min-width: 300px;
}

.input-label, .result-label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #2c3e50;
}

.input-area, .result-area {
    width: 100%;
    height: 200px;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.input-area:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.result-area {
    background-color: white;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

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

.control-btn {
    padding: 12px 24px;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    background-color: white;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background-color: #e1e1e1;
    transform: translateY(-2px);
}

.control-btn:active {
    transform: translateY(0);
}

/* 音频区域 */
.audio-section {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.audio-title {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #2c3e50;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.audio-btn {
    padding: 10px 20px;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    background-color: white;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.audio-btn:hover {
    background-color: #e1e1e1;
}

.audio-btn#pause-btn {
    background-color: #f1f1f1;
}

.audio-btn#pause-btn:hover {
    background-color: #e1e1e1;
}

.progress-container {
    flex: 1;
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: #2c3e50;
    width: 0%;
    transition: width 0.1s linear;
}

.current-morse {
    margin-top: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 8px;
    text-align: center;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.2rem;
}

.current-morse span:first-child {
    color: #666;
    font-weight: normal;
}

.current-morse span:last-child {
    color: #2c3e50;
    font-weight: bold;
    letter-spacing: 2px;
}

/* 对照表区域 */
.reference-section {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.reference-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #2c3e50;
    text-align: center;
}

.reference-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background-color: #f1f1f1;
    color: #333;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background-color: #2c3e50;
    color: white;
}

.tab-btn:hover:not(.active) {
    background-color: #e1e1e1;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.reference-table {
    width: 100%;
    border-collapse: collapse;
}

.reference-table td {
    padding: 12px;
    text-align: center;
    border: 1px solid #ddd;
}

.reference-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.reference-table tr:hover {
    background-color: #f1f1f1;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 20px;
    color: #777;
    font-size: 0.9rem;
}

.footer a {
    color: #777;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #555;
    text-decoration: none;
}

/* 通知提示 */
.notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    padding: 15px 25px;
    background-color: #2ecc71;
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
}

.notification.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.notification.error {
    background-color: #e74c3c;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }

    .converter-container {
        flex-direction: column;
    }

    .controls {
        flex-wrap: wrap;
    }

    .control-btn {
        flex: 1;
        min-width: 120px;
    }

    .audio-controls {
        flex-wrap: wrap;
    }

    .audio-btn {
        flex: 1;
        min-width: 120px;
        justify-content: center;
    }

    .progress-container {
        width: 100%;
        margin-top: 10px;
    }

    .reference-table td {
        padding: 8px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.8rem;
    }

    .mode-btn {
        padding: 10px 16px;
        font-size: 1rem;
    }

    .control-btn, .audio-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .reference-tabs {
        flex-wrap: wrap;
    }

    .tab-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

/* 隐藏类 */
.hidden {
    display: none;
}
