/* 拼音字母表 - 仅保留工具专属样式，通用样式复用 common.css */

/* 区块标题（声母 / 韵母 / 整体认读） */
.section {
    margin-bottom: 24px;
}

.section:last-of-type {
    margin-bottom: 0;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.section-icon {
    font-size: 20px;
}

.section-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #1f2937;
}

.section-desc {
    color: #9ca3af;
    font-size: 13px;
}

/* 字母卡片网格 */
.letter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
}

.letter-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 10px;
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.letter-card:hover {
    background: #6366f1;
    border-color: #6366f1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.letter-card:hover .letter-pinyin,
.letter-card:hover .letter-sound,
.letter-card:hover .letter-tones {
    color: #fff;
}

.letter-pinyin {
    font-size: 22px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
    transition: color 0.2s ease;
}

.letter-sound {
    font-size: 15px;
    color: #6b7280;
    transition: color 0.2s ease;
}

/* 头部操作按钮：固定高度与开关固定宽度，避免切换时布局抖动 */
.action-buttons .btn {
    height: 32px;
    box-sizing: border-box;
    border: 1px solid transparent;
    border-radius: 8px;
}

.settings-card .card-header .btn.sound-toggle {
    width: 106px;
}

/* 语速调节 */
.speed-control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.speed-label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
}

.speed-range {
    flex: 1;
    accent-color: #6366f1;
    cursor: pointer;
}

.speed-value {
    font-size: 13px;
    color: #6b7280;
    min-width: 36px;
    text-align: right;
}

/* 四声示范 */
.letter-tones {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 2px;
    letter-spacing: 1px;
    text-align: center;
    line-height: 1.3;
}

/* 打印样式 */
@media print {
    @page {
        size: A4;
        margin: 10mm;
    }

    body * {
        visibility: hidden;
    }

    .settings-card,
    .settings-card * {
        visibility: visible;
    }

    .settings-card {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        border: none;
        box-shadow: none;
        padding: 8mm;
        background: #fff !important;
    }

    .action-buttons,
    .tips-section,
    .speed-control {
        display: none;
    }

    .section {
        margin-bottom: 6mm;
    }

    .section-header {
        border-bottom: 1.5px solid #333;
        padding-bottom: 2mm;
        margin-bottom: 4mm;
    }

    .section-header h3 {
        font-size: 16pt;
        color: #000;
        margin: 0;
        display: inline;
    }

    .section-icon {
        display: none;
    }

    .section-desc {
        display: inline;
        font-size: 12pt;
        color: #666;
        padding-left: 1mm;
    }

    .letter-grid {
        grid-template-columns: repeat(8, 1fr);
        gap: 3mm;
    }

    .letter-card {
        padding: 4mm 2.5mm;
        background: #fff;
        border: 1px solid #ccc;
        border-radius: 2.5mm;
    }

    .letter-pinyin {
        font-size: 15pt;
        font-weight: bold;
        color: #000;
        margin: 0;
    }

    .letter-sound {
        font-size: 11pt;
        color: #666;
        margin: 0;
    }
}

/* ============ 深色模式 ============ */
body.dark .section-header {
    border-bottom-color: #495057;
}

body.dark .section-header h3 {
    color: #e0e0e0;
}

body.dark .section-desc {
    color: #9aa0a6;
}

body.dark .letter-card {
    background: #2b2f36;
    border-color: #495057;
}

body.dark .letter-card:hover {
    background: #6366f1;
    border-color: #6366f1;
}

body.dark .letter-pinyin {
    color: #e0e0e0;
}

body.dark .letter-sound {
    color: #9aa0a6;
}

body.dark .letter-card:hover .letter-pinyin,
body.dark .letter-card:hover .letter-sound,
body.dark .letter-card:hover .letter-tones {
    color: #fff;
}

body.dark .speed-control {
    border-bottom-color: #495057;
}

body.dark .speed-label {
    color: #e0e0e0;
}

body.dark .speed-value {
    color: #9aa0a6;
}

body.dark .letter-tones {
    color: #9aa0a6;
}
