/* ===== 数独 ===== */
.sd-hero {
    background: linear-gradient(160deg, #eff6ff 0%, #f8fafc 100%);
    border: 1px solid #bfdbfe;
    border-radius: 22px;
    padding: 30px;
    margin-bottom: 26px;
    box-shadow: 0 12px 36px rgba(37, 99, 235, .08);
}

.sd-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.sd-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sd-logo {
    font-size: 28px;
    background: #dbeafe;
    border-radius: 14px;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sd-title {
    font-size: 20px;
    font-weight: 800;
    color: #1e3a8a;
}

.sd-sub {
    font-size: 13px;
    color: #60a5fa;
}

.sd-timer {
    background: #fff;
    border: 2px solid #bfdbfe;
    color: #1d4ed8;
    font-size: 20px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    border-radius: 12px;
    padding: 8px 18px;
    letter-spacing: 1px;
}

.sd-main {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 24px;
    align-items: start;
}

.sd-board-wrap {
    background: #fff;
    border-radius: 16px;
    padding: 10px;
    box-shadow: 0 8px 24px rgba(37, 99, 235, .12);
    display: inline-block;
}

.sd-board {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 0;
    width: 450px;
    height: 450px;
}

.sd-cell {
    border: 1px solid #cbd5e1;
    background: #fff;
    font-size: 22px;
    font-weight: 600;
    color: #1e40af;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background .15s;
    width: 50px;
    height: 50px;
    box-sizing: border-box;
}

.sd-cell:hover {
    background: #eff6ff;
}

.sd-cell.fixed {
    color: #1e293b;
    font-weight: 700;
    background: #f8fafc;
    cursor: default;
}

.sd-cell.selected {
    background: #dbeafe;
    box-shadow: inset 0 0 0 2px #3b82f6;
}

.sd-cell.error {
    color: #ef4444;
    background: #fef2f2;
}

.sd-cell.hint-given {
    color: #16a34a;
    font-weight: 700;
}

.sd-cell.done {
    animation: sd-flash .6s ease;
}

@keyframes sd-flash {
    0% { background: #bbf7d0; }
    100% { background: #fff; }
}

.sd-cell.row-border {
    border-top: 2px solid #64748b;
}

.sd-cell.col-border {
    border-left: 2px solid #64748b;
}

.sd-side {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 340px;
}

.sd-difficulty {
    display: flex;
    gap: 8px;
}

.sd-diff {
    flex: 1;
    border: 1px solid #bfdbfe;
    background: #fff;
    color: #1d4ed8;
    border-radius: 10px;
    padding: 9px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}

.sd-diff.active {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

.sd-numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.sd-numpad button {
    border: 1px solid #bfdbfe;
    background: #fff;
    color: #1e3a8a;
    border-radius: 10px;
    padding: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s;
}

.sd-numpad button:hover {
    background: #dbeafe;
}

.sd-numpad button.clear {
    color: #dc2626;
    font-size: 13px;
}

.sd-actions {
    display: flex;
    gap: 8px;
}

.sd-btn {
    flex: 1;
    border: 1px solid #bfdbfe;
    background: #fff;
    color: #1d4ed8;
    border-radius: 10px;
    padding: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}

.sd-btn:hover {
    background: #eff6ff;
}

.sd-btn.primary {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

.sd-btn.primary:hover {
    background: #2563eb;
}

.sd-status {
    background: #eff6ff;
    border-radius: 10px;
    padding: 12px;
    font-size: 13px;
    color: #1e40af;
    line-height: 1.6;
    min-height: 44px;
}

@media (max-width: 900px) {
    .sd-main { grid-template-columns: 1fr; }
    .sd-board { width: 100%; height: auto; aspect-ratio: 1; }
    .sd-cell { width: auto; height: auto; aspect-ratio: 1; font-size: 18px; }
    .sd-side { max-width: none; }
}

/* ===== 深色模式 ===== */
[data-theme="dark"] .sd-hero {
    background: linear-gradient(160deg, #172554 0%, #0f172a 100%);
    border-color: rgba(147, 197, 253, 0.16);
}
[data-theme="dark"] .sd-title { color: #eff6ff; }
[data-theme="dark"] .sd-sub,
[data-theme="dark"] .sd-tip { color: #93c5fd; }
[data-theme="dark"] .sd-board-wrap,
[data-theme="dark"] .sd-timer,
[data-theme="dark"] .sd-diff {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(147, 197, 253, 0.16);
}
[data-theme="dark"] .sd-status {
    background: rgba(59, 130, 246, 0.14);
    color: #bfdbfe;
}
[data-theme="dark"] .sd-cell {
    background: #16233c;
    border-color: #2a3b5c;
    color: #93c5fd;
}
[data-theme="dark"] .sd-cell.fixed { color: #e2e8f0; }
[data-theme="dark"] .sd-cell.selected { background: #1e3a8a; }
[data-theme="dark"] .sd-cell.error { color: #fca5a5; }
[data-theme="dark"] .sd-timer { color: #93c5fd; }
[data-theme="dark"] .sd-btn {
    background: rgba(255, 255, 255, 0.06);
    color: #bfdbfe;
    border-color: rgba(147, 197, 253, 0.22);
}
[data-theme="dark"] .sd-btn:hover { background: rgba(59, 130, 246, 0.18); }
[data-theme="dark"] .sd-btn.primary { background: #3b82f6; color: #fff; border-color: #3b82f6; }
[data-theme="dark"] .sd-diff button {
    background: rgba(255, 255, 255, 0.06);
    color: #93c5fd;
}
[data-theme="dark"] .sd-diff button.active { background: #3b82f6; color: #fff; }
[data-theme="dark"] .sd-numpad button {
    background: rgba(255, 255, 255, 0.06);
    color: #bfdbfe;
    border-color: rgba(147, 197, 253, 0.20);
}
[data-theme="dark"] .sd-numpad button:hover { background: rgba(59, 130, 246, 0.20); }
[data-theme="dark"] .sd-logo { background: rgba(59, 130, 246, 0.18); }
