/* 三原色混合实验室 /tool/color-mix-lab */

.cm-mode {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    background: var(--calc-soft, #f1f5f9);
    padding: 5px;
    border-radius: 12px;
}
.cm-mode button {
    flex: 1;
    padding: 10px 4px;
    border: none;
    border-radius: 9px;
    background: transparent;
    font-size: 15px;
    font-weight: 600;
    color: var(--calc-muted, #64748b);
    cursor: pointer;
    transition: all .2s;
}
.cm-mode button.is-active {
    background: #fff;
    color: #ea580c;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
}

.cm-picks { display: flex; gap: 10px; flex-wrap: wrap; }
.cm-pick {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 3px solid transparent;
    border-radius: 999px;
    background: var(--calc-soft, #f1f5f9);
    font-size: 16px;
    font-weight: 700;
    color: var(--calc-text, #334155);
    cursor: pointer;
    transition: all .15s;
}
.cm-pick i {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--c);
    border: 2px solid rgba(0, 0, 0, .1);
}
.cm-pick.is-active {
    border-color: var(--c);
    background: #fff;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}

/* 舞台 */
.cm-stage {
    position: relative;
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 16px;
    background: linear-gradient(160deg, #fff7ed, #ffedd5);
}
.cm-drop {
    position: absolute;
    width: 52px;
    height: 52px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    top: 40px;
    transition: all .5s ease;
    box-shadow: inset -6px -6px 12px rgba(0, 0, 0, .15);
    z-index: 2;
}
.cm-drop-a { left: 15%; background: #ef4444; }
.cm-drop-b { right: 15%; background: #fbbf24; }
.cm-pot {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: #e2e8f0;
    border: 4px dashed rgba(0, 0, 0, .1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 52px;
    transition: background .6s ease, transform .6s ease;
    position: relative;
    z-index: 1;
}
.cm-stage.is-mixing .cm-drop-a { left: calc(50% - 26px); top: 92px; transform: scale(.7); opacity: 0; }
.cm-stage.is-mixing .cm-drop-b { right: calc(50% - 26px); top: 92px; transform: scale(.7); opacity: 0; }
.cm-stage.is-mixing .cm-pot { animation: cmShake .5s ease infinite; }
.cm-stage.is-done .cm-pot { animation: cmPop .6s ease; }
@keyframes cmShake {
    0%, 100% { transform: rotate(-4deg) scale(1); }
    50% { transform: rotate(4deg) scale(1.04); }
}
@keyframes cmPop {
    0% { transform: scale(1); }
    40% { transform: scale(1.18); }
    100% { transform: scale(1); }
}
.cm-burst { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.cm-burst span {
    position: absolute;
    top: 30%;
    font-size: 26px;
    animation: cmFly 1.4s ease-out forwards;
}
@keyframes cmFly {
    0% { transform: translateY(0) scale(.4); opacity: 1; }
    100% { transform: translateY(-150px) scale(1.3) rotate(20deg); opacity: 0; }
}

.cm-result-name {
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    margin: 16px 0 6px;
    color: var(--calc-text, #334155);
    min-height: 30px;
}
.cm-result-fact {
    text-align: center;
    font-size: 15px;
    color: var(--calc-muted, #64748b);
    line-height: 1.7;
    margin: 0 auto;
    max-width: 420px;
}

/* 猜一猜 */
.cm-quiz-intro { font-size: 15px; line-height: 1.8; color: var(--calc-text, #334155); }
.cm-best { text-align: center; font-weight: 700; color: #ea580c; }
.cm-quiz-top {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    color: var(--calc-muted, #64748b);
    margin-bottom: 14px;
}
.cm-score b { color: #ea580c; font-size: 20px; }
.cm-question {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 18px 0;
}
.cm-q-dot {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 3px solid rgba(0, 0, 0, .08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 800;
    color: #94a3b8;
}
.cm-q-unknown { background: var(--calc-soft, #f1f5f9); border-style: dashed; }
.cm-q-op { font-size: 30px; font-weight: 800; color: var(--calc-muted, #64748b); }
.cm-feedback { text-align: center; font-weight: 700; min-height: 26px; color: var(--calc-text, #334155); }
.cm-answers { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.cm-ans {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border: 3px solid var(--calc-border, #e2e8f0);
    border-radius: 999px;
    background: #fff;
    font-size: 17px;
    font-weight: 700;
    color: var(--calc-text, #334155);
    cursor: pointer;
    transition: all .15s;
}
.cm-ans-dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(0, 0, 0, .1); }
.cm-ans:active { transform: scale(.95); }
.cm-ans.is-right { border-color: #22c55e; background: #f0fdf4; animation: cmPop .5s ease; }
.cm-ans.is-wrong { border-color: #ef4444; background: #fef2f2; opacity: .6; }

.cm-end-stars { text-align: center; font-size: 46px; letter-spacing: 6px; margin: 10px 0; }
.cm-end-score { text-align: center; font-size: 22px; font-weight: 800; color: var(--calc-text, #334155); }
.cm-end-comment { text-align: center; color: var(--calc-muted, #64748b); line-height: 1.7; }
.cm-end-btns { display: flex; gap: 10px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }

/* 图鉴 */
.cm-book-tip { text-align: center; font-weight: 700; color: #ea580c; margin-bottom: 14px; }
.cm-book-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.cm-book-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 8px;
    border-radius: 14px;
    background: var(--calc-soft, #f1f5f9);
    text-align: center;
    opacity: .75;
}
.cm-book-item.is-got { opacity: 1; background: #fff7ed; box-shadow: 0 3px 10px rgba(234, 88, 12, .12); }
.cm-book-dot {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #cbd5e1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    border: 3px solid rgba(0, 0, 0, .06);
}
.cm-book-item b { font-size: 17px; color: var(--calc-text, #334155); }
.cm-book-item small { color: var(--calc-muted, #64748b); font-size: 12px; }

@media (max-width: 640px) {
    .cm-book-grid { grid-template-columns: repeat(2, 1fr); }
    .cm-stage { height: 200px; }
    .cm-q-dot { width: 48px; height: 48px; }
}

/* 黑夜模式 */
body.dark-mode .cm-mode { background: #1e293b; }
body.dark-mode .cm-mode button { color: #94a3b8; }
body.dark-mode .cm-mode button.is-active { background: #0f172a; color: #fb923c; }
body.dark-mode .cm-pick { background: #1e293b; color: #e2e8f0; }
body.dark-mode .cm-pick.is-active { background: #0f172a; }
body.dark-mode .cm-stage { background: linear-gradient(160deg, #1e293b, #0f172a); }
body.dark-mode .cm-result-name { color: #e2e8f0; }
body.dark-mode .cm-result-fact,
body.dark-mode .cm-feedback,
body.dark-mode .cm-quiz-intro { color: #94a3b8; }
body.dark-mode .cm-quiz-top { color: #94a3b8; }
body.dark-mode .cm-ans { background: #1e293b; border-color: #334155; color: #e2e8f0; }
body.dark-mode .cm-ans.is-right { background: #052e16; border-color: #22c55e; }
body.dark-mode .cm-ans.is-wrong { background: #2a0a0a; border-color: #ef4444; }
body.dark-mode .cm-q-unknown { background: #1e293b; }
body.dark-mode .cm-end-score { color: #e2e8f0; }
body.dark-mode .cm-book-item { background: #1e293b; }
body.dark-mode .cm-book-item.is-got { background: #292018; }
body.dark-mode .cm-book-item b { color: #e2e8f0; }
body.dark-mode .cm-book-dot { background: #334155; }
