* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    background: #f0f4f8;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: 'Segoe UI', Roboto, system-ui, sans-serif;
}
.card {
    background: white;
    border-radius: 32px;
    padding: 24px 28px 28px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.12), 0 8px 16px rgba(0,0,0,0.05);
    max-width: 1200px;
    width: 100%;
    transition: all 0.2s;
}
h1 {
    font-weight: 600;
    font-size: 1.7rem;
    letter-spacing: -0.01em;
    color: #0b1a33;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}
.sub {
    color: #2c3e66;
    font-size: 1rem;
    font-weight: 400;
    margin-bottom: 16px;
    border-left: 4px solid #3b7cff;
    padding-left: 16px;
    background: #f8faff;
    border-radius: 0 12px 12px 0;
    line-height: 1.5;
}
/* 左右分栏主容器 */
.main-row {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    gap: 18px;
    margin-bottom: 14px;
}
.svg-container {
    background: #ffffff;
    border-radius: 22px;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.02), 0 4px 12px rgba(0,20,40,0.06);
    padding: 6px 0 0 0;
}
svg {
    display: block;
    width: 100%;
    height: auto;
    background: white;
    border-radius: 20px;
}
/* 右侧证明面板 */
.proof-panel {
    display: flex;
    flex-direction: column;
    min-height: 480px;
}
.proof-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px 10px;
    border-bottom: 1px solid #e6edf6;
    margin-bottom: 12px;
}
.proof-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #0b1a33;
}
.proof-step-num {
    font-size: 0.85rem;
    color: #1f3a7a;
    background: #dce6f5;
    padding: 3px 12px;
    border-radius: 40px;
    font-weight: 600;
}
.proof-box {
    background: #f7faff;
    border-radius: 16px;
    padding: 16px 18px;
    border-left: 4px solid #3b7cff;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #0a1a33;
    flex: 1;
    overflow-y: auto;
    min-height: 200px;
}
.proof-box strong {
    color: #10316b;
}
.proof-box .formula {
    background: #fff;
    border: 1px solid #d0dcf2;
    border-radius: 8px;
    padding: 2px 8px;
    margin: 2px 3px;
    display: inline-block;
    font-family: 'Cambria Math', 'Times New Roman', serif;
}
/* 步骤导航按钮组 */
.proof-nav {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.proof-nav .btn {
    flex: 1;
    justify-content: center;
}
.btn {
    background: #eef2f9;
    border: 1px solid transparent;
    padding: 8px 14px;
    border-radius: 40px;
    font-weight: 500;
    font-size: 0.9rem;
    color: #1a2b4a;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.btn-primary {
    background: #1f3a7a;
    color: white;
    box-shadow: 0 4px 8px rgba(28, 55, 120, 0.2);
}
.btn-primary:hover:not(:disabled) {
    background: #16306a;
    transform: scale(1.02);
}
.btn-tts {
    background: #f97316;
    color: white;
    box-shadow: 0 4px 8px rgba(249, 115, 22, 0.25);
}
.btn-tts:hover:not(:disabled) {
    background: #ea580c;
    transform: scale(1.02);
}
.btn-tts.is-speaking {
    background: #dc2626;
    animation: pulse 1.2s infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 4px 8px rgba(220, 38, 38, 0.4); }
    50% { box-shadow: 0 4px 14px rgba(220, 38, 38, 0.7); }
}
.btn-outline {
    background: transparent;
    border: 1px solid #bcc9e0;
}
.btn-outline:hover:not(:disabled) {
    background: #e6edf8;
    border-color: #8aa0c4;
}
.btn:active:not(:disabled) {
    transform: scale(0.96);
}
/* 进度条 */
.progress-track {
    display: flex;
    gap: 4px;
    margin-top: 12px;
    padding: 0 4px;
}
.progress-dot {
    flex: 1;
    height: 6px;
    background: #d6dfee;
    border-radius: 3px;
    transition: background 0.2s;
}
.progress-dot.active {
    background: #1f3a7a;
}
.progress-dot.done {
    background: #3b7cff;
}
.control-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 14px 24px;
    margin: 10px 0 6px;
}
.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}
.slider-box {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #f3f7fe;
    padding: 4px 16px 4px 20px;
    border-radius: 40px;
}
.slider-box label {
    font-weight: 500;
    color: #1f3a7a;
    font-size: 0.9rem;
}
input[type="range"] {
    width: 140px;
    height: 4px;
    -webkit-appearance: none;
    background: #bacde5;
    border-radius: 10px;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #1f3a7a;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,20,50,0.2);
    border: 2px solid white;
}
.step-indicator {
    font-size: 0.9rem;
    font-weight: 500;
    color: #1f3a7a;
    min-width: 70px;
    text-align: center;
}
.legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px 24px;
    padding: 12px 10px 2px;
    border-top: 1px solid #e6edf6;
    margin-top: 12px;
    font-size: 0.85rem;
    color: #1f3355;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}
.color-dot {
    width: 16px;
    height: 16px;
    border-radius: 6px;
}
.footnote {
    font-size: 0.8rem;
    color: #4b6085;
    text-align: center;
    margin-top: 12px;
    border-top: 1px solid #eaf0f8;
    padding-top: 12px;
}
@media (max-width: 860px) {
    .main-row {
        grid-template-columns: 1fr;
    }
    .proof-panel {
        min-height: 280px;
    }
}
@media (max-width: 600px) {
    .card { padding: 16px; }
    .slider-box { flex-wrap: wrap; justify-content: center; padding: 6px 12px; }
    input[type="range"] { width: 100px; }
}

@keyframes flashFill {
    0%, 100% { fill-opacity: 0.35; stroke-opacity: 1; }
    50% { fill-opacity: 0.05; stroke-opacity: 0.4; }
}
.flash-fill {
    animation: flashFill 0.8s infinite;
    display: block !important;
}

@keyframes flashStroke {
    0%, 100% { stroke-opacity: 1; stroke-width: 4.5px; }
    50% { stroke-opacity: 0.3; stroke-width: 2px; }
}
.flash-stroke {
    animation: flashStroke 0.8s infinite;
}