/* 2026-09-02 上线前候选：声纹词轨。只覆盖学习层级与跨端交互，不改后台数据样式。 */
:root {
    --primary: #2366d1;
    --primary-dark: #174b9c;
    --success: #2f9b69;
    --danger: #d85c50;
    --purple: #7157b8;
    --bg: #eaf2ef;
    --text: #13253a;
    --text-2: #52667a;
    --text-3: #708194;
    --line: #cad8d4;
    --soft: #f4f8f6;
    --soft-2: #e5eeeb;
    --keyboard: #d8e4e0;
    --focus: #7157b8;
    --paper: #ffffff;
    --ink: #13253a;
    --shadow: 0 16px 44px rgba(25, 62, 72, .10);
}

html, body {
    font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--focus) !important;
    outline-offset: 3px;
}

.big-word,
.fb-word,
.ci-word,
.daily-practice-word {
    font-family: "Trebuchet MS", "Aptos", sans-serif;
}

.phonetic-text,
.phoneme-line,
.hint-text,
.progress-stats,
.tab-badge {
    font-family: Bahnschrift, "Segoe UI", ui-monospace, monospace;
    font-variant-numeric: tabular-nums;
}

.topbar-title {
    color: var(--ink);
    letter-spacing: -.02em;
}

.progress-card {
    background: rgba(255, 255, 255, .76);
    border-color: rgba(35, 102, 209, .16);
    box-shadow: 0 8px 24px rgba(25, 62, 72, .06);
}

.progress-stats,
.daily-stats {
    color: #315a7c;
}

.mode-card,
.me-section,
.ebb-overview,
.range-bar {
    border-color: rgba(19, 37, 58, .10);
    box-shadow: 0 10px 28px rgba(25, 62, 72, .07);
}

.filter-bar,
.limit-bar {
    border-color: rgba(19, 37, 58, .08);
}

.learn-core {
    position: relative;
}

.learn-word-row {
    align-items: center;
}

.letter-map {
    appearance: none;
    border: 1px solid rgba(19, 37, 58, .10);
    color: var(--ink);
}

button.letter-map:not(.letter-map-static),
button.phoneme-chip {
    min-height: 44px;
}

button.letter-map:not(.letter-map-static) {
    width: auto;
    min-width: var(--letter-cell-width);
    padding-inline: 7px;
}

.phoneme-chip {
    appearance: none;
    font-family: Bahnschrift, "Segoe UI", ui-monospace, monospace;
}

.phoneme-chip.playing,
.phoneme-chip.phoneme-highlight,
.letter-map.playing,
.letter-map.active-pop {
    box-shadow: 0 0 0 3px rgba(113, 87, 184, .30), 0 7px 18px rgba(35, 102, 209, .18);
}

.learning-hint {
    margin: 12px 0;
    padding: 13px 14px;
    border: 1px solid rgba(35, 102, 209, .24);
    border-left: 4px solid var(--primary);
    border-radius: 12px;
    background: #f2f7ff;
    color: var(--text);
}

.learning-hint + .learning-hint {
    margin-top: -5px;
    border-left-color: var(--focus);
    background: #f6f3ff;
}

.learning-hint-title {
    display: block;
    margin-bottom: 3px;
    color: var(--ink);
    font-weight: 800;
}

.learning-hint p {
    line-height: 1.55;
}

.learning-hint-action {
    margin-top: 8px;
}

.fb-overlay.feedback-box {
    background: rgba(255, 255, 255, .98);
}

.fb-overlay .fb-result {
    width: min(100%, 720px);
    margin-inline: auto;
}

.fb-overlay .fb-actions {
    width: min(100%, 720px);
    margin-inline: auto;
}

.fb-overlay .fb-title {
    border-radius: 10px;
}

.fb-overlay.feedback-box.success .fb-title {
    background: #e7f6ee;
    color: #1f734e;
}

.fb-overlay.feedback-box.error .fb-title {
    background: #fff0ee;
    color: #9a3932;
}

.fb-overlay .fb-actions .btn-danger {
    background: var(--primary);
}

.review-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: rgba(255, 255, 255, .72);
}

.review-tab {
    min-height: 42px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text-2);
    font-size: 14px;
    font-weight: 800;
}

.review-tab.active {
    background: var(--card);
    color: var(--primary);
    box-shadow: 0 3px 12px rgba(25, 62, 72, .10);
}

.review-pane {
    display: flex;
    flex: 1 0 auto;
    min-height: 0;
    flex-direction: column;
    gap: 10px;
}

.attempt-guidance {
    min-height: 20px;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 650;
}

.attempt-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.attempt-skip-btn {
    min-height: 38px;
    color: var(--text-2);
}

.settings-row {
    min-height: 48px;
}

.switch-label {
    width: 100%;
    justify-content: space-between;
}

.modal-content,
.sheet,
.badge-modal-content {
    border: 1px solid rgba(255, 255, 255, .34);
    box-shadow: 0 24px 64px rgba(10, 31, 50, .24);
}

.tabbar {
    border-top-color: rgba(19, 37, 58, .10);
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(14px);
}

.tab-btn {
    position: relative;
    color: #6c7f91;
}

.tab-btn.active::before {
    content: "";
    position: absolute;
    top: 5px;
    width: 24px;
    height: 3px;
    border-radius: 999px;
    background: var(--primary);
}

@media (max-width: 430px) {
    .topbar { padding-inline: 10px; }
    .progress-card { margin-inline: 10px; }
    .panel { padding-inline: 10px; }
    .filter-bar { gap: 7px; }
    .filter-select { max-width: 126px; }
    .fb-overlay.feedback-box { padding-inline: 14px; }
    .fb-overlay .fb-word { font-size: clamp(34px, 11vw, 48px); }
    .learning-hint { padding: 11px 12px; }
}

@media (max-height: 620px) {
    .progress-card { padding-block: 5px; margin-bottom: 5px; }
    .mode-panel { gap: 6px; }
    .practice-qbar, .ebb-qbar { padding-block: 6px; }
    .attempt-hint-btn, .attempt-skip-btn { min-height: 34px; padding-block: 5px; }
}

@media (min-width: 820px) {
    .learn-top {
        display: grid;
        grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
        gap: 20px;
        align-items: start;
    }
    .learn-details-scroll {
        max-height: 330px;
    }
}

@media (min-width: 1024px) and (pointer: fine) {
    .app {
        display: grid;
        grid-template-columns: 118px minmax(0, 1fr);
        grid-template-rows: auto auto minmax(0, 1fr);
        min-height: 100dvh;
        max-width: 1240px;
        padding-left: 118px;
    }
    .topbar,
    .progress-card,
    #panels {
        grid-column: 2;
    }
    .tabbar {
        position: fixed;
        inset: 0 auto 0 max(0px, calc((100vw - 1240px) / 2));
        width: 118px;
        max-width: none;
        transform: none;
        flex-direction: column;
        justify-content: center;
        gap: 8px;
        padding: 18px 12px;
        border: 0;
        border-right: 1px solid rgba(19, 37, 58, .10);
        box-shadow: 8px 0 30px rgba(25, 62, 72, .06);
    }
    .tab-btn {
        min-height: 70px;
        flex: 0 0 auto;
        border-radius: 14px;
    }
    .tab-btn.active {
        background: #edf4ff;
    }
    .tab-btn.active::before {
        top: auto;
        left: 7px;
        width: 3px;
        height: 28px;
    }
    .mode-panel {
        padding-bottom: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #10201e;
        --card: #1a2b2a;
        --soft: #203431;
        --soft-2: #29403c;
        --line: #3a514d;
    }
    .progress-card,
    .review-tabs,
    .tabbar { background: rgba(26, 43, 42, .94); }
    .learning-hint { background: #172c43; }
    .learning-hint + .learning-hint { background: #29243e; }
    .fb-overlay.feedback-box { background: rgba(26, 43, 42, .99); }
}
