.main {
    grid-template-columns: 320px minmax(0, 1fr);
}

.main .extra-panel {
    grid-column: 1 / -1;
    margin-top: 0;
}

.hint-line {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.8;
}

/* ---- 设置开关 ---- */
.check-line {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    user-select: none;
    padding: 6px 0;
}

.check-line input {
    width: 16px;
    height: 16px;
    accent-color: #667eea;
    cursor: pointer;
}

/* ---- 棋盘 ---- */
.board {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background:
        radial-gradient(circle at 18% 22%, rgba(102, 126, 234, 0.07), transparent 42%),
        radial-gradient(circle at 82% 74%, rgba(118, 75, 162, 0.07), transparent 46%),
        #fbfcfe;
    padding: 16px;
}

.board-scroll {
    overflow-x: auto;
    padding-bottom: 4px;
}

.board-inner {
    min-width: max-content;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.board-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 6px;
}

.board-label .tag {
    font-size: 11px;
    font-weight: 500;
    background: #eef2ff;
    color: #4338ca;
    border-radius: 999px;
    padding: 1px 8px;
}

.board-label .tag.locked {
    background: #f3f4f6;
    color: #6b7280;
}

.board-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: nowrap;
    min-height: 112px;
    align-items: flex-end;
}

.board-row.mid {
    min-height: 22px;
    align-items: center;
    gap: 10px;
}

.tick-cell {
    width: 48px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.tick-cell.ok { color: #16a34a; }
.tick-cell.bad { color: #ef4444; }

.board-status {
    margin-top: 14px;
    min-height: 22px;
    padding: 8px 12px;
    border-radius: 8px;
    background: #f9fafb;
    border: 1px solid #eef0f4;
    font-size: 13px;
    color: #6b7280;
    text-align: center;
    line-height: 1.5;
}

.board-status.st-play {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #4338ca;
    font-weight: 600;
}

.board-status.st-win {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #16a34a;
    font-weight: 600;
}

.board-status.st-lose {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
    font-weight: 600;
}

/* ---- 正确率面板 ---- */
.rate-panel {
    flex: 1 1 240px;
    min-width: 220px;
    background: #f9fafb;
    border: 1px solid #eef0f4;
    border-radius: 10px;
    padding: 8px 12px;
}

.rate-top {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.rate-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 600;
}

.rate-num {
    font-size: 20px;
    font-weight: 800;
    color: #4338ca;
    font-variant-numeric: tabular-nums;
}

.rate-pct {
    font-size: 12px;
    color: #4338ca;
    font-weight: 600;
}

.prog-track {
    height: 8px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
    margin-top: 8px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

.prog-fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.35s ease;
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.5);
}

.prog-fill.done {
    background: #16a34a;
    box-shadow: 0 0 8px rgba(22, 163, 74, 0.5);
}

.prog-fill.lose {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

/* ---- 瓶子 ---- */
.bottle {
    position: relative;
    width: 48px;
    height: 112px;
    flex: 0 0 auto;
    cursor: pointer;
    user-select: none;
    transition: transform 0.18s ease, filter 0.15s ease;
    filter: drop-shadow(0 6px 6px rgba(15, 30, 60, 0.16));
}

.bottle.fresh {
    animation: bottle-in 0.28s ease both;
}

.bottle:hover {
    transform: translateY(-4px);
    filter: drop-shadow(0 10px 8px rgba(15, 30, 60, 0.2));
}

.bottle:active {
    transform: translateY(-2px) scale(0.97);
}

/* 瓶盖（木塞） */
.bottle .cap {
    position: absolute;
    top: 0;
    left: 50%;
    margin-left: -11px;
    width: 22px;
    height: 12px;
    background: linear-gradient(180deg, #f0e0bb, #d5af74 55%, #bd9558);
    border-radius: 7px 7px 2px 2px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), inset -2px -2px 4px rgba(96, 66, 22, 0.35);
    z-index: 3;
}

.bottle .cap::after {
    content: '';
    position: absolute;
    left: 4px;
    right: 4px;
    bottom: 3px;
    height: 1px;
    background: rgba(96, 66, 22, 0.3);
    box-shadow: 0 2px 0 rgba(96, 66, 22, 0.15);
}

/* 瓶口金属圈 */
.bottle .ring {
    position: absolute;
    top: 11px;
    left: 50%;
    margin-left: -13px;
    width: 26px;
    height: 4px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.12));
    border-radius: 0 0 3px 3px;
    z-index: 2;
}

/* 瓶颈 */
.bottle .neck {
    position: absolute;
    top: 14px;
    left: 50%;
    margin-left: -8px;
    width: 16px;
    height: 22px;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.22), transparent 22%, transparent 78%, rgba(0, 0, 0, 0.1)),
        var(--c, #cbd5e1);
    clip-path: polygon(16% 0, 84% 0, 100% 100%, 0 100%);
}

/* 瓶身 */
.bottle .body {
    position: absolute;
    top: 33px;
    left: 5px;
    right: 5px;
    bottom: 2px;
    border-radius: 14px 14px 9px 9px;
    background: linear-gradient(105deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.08) 32%, rgba(255, 255, 255, 0) 55%);
    box-shadow:
        inset 5px 8px 10px rgba(255, 255, 255, 0.22),
        inset -6px -8px 12px rgba(10, 24, 50, 0.22);
    overflow: hidden;
}

/* 瓶内液体 */
.bottle .fill {
    position: absolute;
    left: 0;
    right: 0;
    top: 6px;
    bottom: 0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.04) 30%, rgba(0, 0, 0, 0.14)),
        var(--c, #cbd5e1);
    border-radius: 0 0 7px 7px;
    transition: background 0.3s ease;
}

/* 瓶身高光 */
.bottle .goo {
    position: absolute;
    left: 6px;
    top: 10px;
    bottom: 16px;
    width: 7px;
    border-radius: 6px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.18));
    filter: blur(0.4px);
}

.bottle .qmark {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
    font-weight: 800;
    color: #334155;
    font-style: normal;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
    z-index: 2;
}

.bottle .good-badge {
    position: absolute;
    top: -7px;
    right: -7px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #16a34a;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    font-style: normal;
    line-height: 22px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(22, 163, 74, 0.45);
    z-index: 4;
    display: none;
}

/* 选中：浮起并轻轻上下浮动，展示选中状态 */
.bottle.sel {
    z-index: 5;
    filter: drop-shadow(0 14px 10px rgba(15, 30, 60, 0.28));
    animation: bottle-float 1.7s ease-in-out infinite;
}

@keyframes bottle-float {
    0%, 100% { transform: translateY(-16px); }
    50%      { transform: translateY(-25px); }
}

/* 已对齐标识 */
.bottle.good {
    filter: drop-shadow(0 6px 8px rgba(22, 163, 74, 0.35));
}

.bottle.good .body,
.bottle.good .neck {
    box-shadow: inset 5px 8px 10px rgba(255, 255, 255, 0.22), inset -6px -8px 12px rgba(10, 24, 50, 0.22), 0 0 0 3px #22c55e, 0 4px 12px rgba(22, 163, 74, 0.35);
}

.bottle.good .good-badge {
    display: block;
    animation: badge-pop 0.32s ease;
}

.bottle.locked {
    cursor: default;
}

.bottle.locked:hover {
    transform: none;
    filter: drop-shadow(0 6px 6px rgba(15, 30, 60, 0.14));
}

@keyframes bottle-in {
    0%   { transform: translateY(-18px) scale(0.96); opacity: 0; }
    60%  { transform: translateY(2px) scale(1.01);   opacity: 1; }
    100% { transform: translateY(0) scale(1);        opacity: 1; }
}

@keyframes badge-pop {
    0%   { transform: scale(0); }
    70%  { transform: scale(1.25); }
    100% { transform: scale(1); }
}

/* ---- 阶段操作 ---- */
.stage-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* ---- 成绩统计 ---- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.stat {
    background: #f9fafb;
    border: 1px solid #eef0f4;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
}

.stat b {
    display: block;
    font-size: 20px;
    color: #4338ca;
    font-variant-numeric: tabular-nums;
}

.stat span {
    font-size: 12px;
    color: #6b7280;
}

/* ---- 配色点（明细表内） ---- */
.swatch-row {
    display: inline-flex;
    gap: 4px;
    vertical-align: middle;
}

.swatch {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    display: inline-block;
}

/* ---- 本局记录 ---- */
.record-title {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin: 16px 0 6px;
}

.record-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed #f3f4f6;
    font-size: 13px;
    color: #4b5563;
}

.record-item .tick {
    font-weight: 600;
}

.record-item.ok .tick   { color: #16a34a; }
.record-item.fail .tick { color: #ef4444; }

@media (max-width: 900px) {
    .main {
        grid-template-columns: 1fr;
    }

    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .bottle {
        width: 40px;
        height: 94px;
    }

    .bottle .cap {
        width: 18px;
        height: 10px;
        margin-left: -9px;
        border-radius: 5px 5px 2px 2px;
    }

    .bottle .ring {
        top: 9px;
        width: 20px;
        margin-left: -10px;
        height: 3px;
    }

    .bottle .neck {
        top: 12px;
        width: 14px;
        margin-left: -7px;
        height: 19px;
    }

    .bottle .body {
        top: 28px;
        left: 4px;
        right: 4px;
        bottom: 1px;
        border-radius: 12px 12px 7px 7px;
    }

    .bottle .goo {
        left: 6px;
        width: 6px;
    }

    .bottle .qmark {
        font-size: 17px;
    }

    .tick-cell {
        width: 40px;
    }

    .board-row {
        min-height: 94px;
    }
}