:root {
    color-scheme: light;
    --bg: #eef3f1;
    --bg-deep: #dfe9e5;
    --panel: #ffffff;
    --ink: #16221c;
    --muted: #66746d;
    --line: #d9e1dc;
    --line-strong: #1f3028;
    --accent: #0f766e;
    --accent-dark: #0a524d;
    --accent-soft: #e0f2ee;
    --gold: #b7791f;
    --warn: #b8441f;
    --shadow: 0 22px 60px rgba(26, 45, 36, 0.12);
    --shadow-soft: 0 12px 34px rgba(26, 45, 36, 0.08);
}
/* ===== OCR Photo Upload Modal ===== */
.ocr-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(15, 34, 28, 0.55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s, visibility .2s;
}
.ocr-overlay.is-open {
    opacity: 1;
    visibility: visible;
}
.ocr-modal {
    background: var(--panel);
    border-radius: 16px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 460px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(12px);
    transition: transform .2s;
}
.ocr-overlay.is-open .ocr-modal {
    transform: translateY(0);
}
.ocr-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    background: var(--panel);
    z-index: 1;
}
.ocr-modal-head h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--ink);
}
.ocr-modal-close {
    border: 0;
    background: none;
    color: var(--muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    box-shadow: none;
}
.ocr-modal-close:hover {
    background: var(--bg-deep);
}
.ocr-modal-body {
    padding: 16px 20px 20px;
}
.ocr-upload-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.ocr-upload-btn {
    flex: 1;
    min-width: 100px;
    border: 2px dashed var(--line);
    border-radius: 10px;
    background: var(--bg);
    padding: 14px 8px;
    text-align: center;
    cursor: pointer;
    font-size: .82rem;
    font-weight: 700;
    color: var(--ink);
    transition: border-color .15s, background .15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.ocr-upload-btn svg {
    width: 24px;
    height: 24px;
    stroke: var(--accent);
    fill: none;
    stroke-width: 2;
}
.ocr-upload-btn:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}
.ocr-url-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.ocr-url-input {
    flex: 1;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: .85rem;
    color: var(--ink);
    background: var(--panel);
}
.ocr-url-input:focus {
    outline: 2px solid var(--accent);
    outline-offset: -1px;
}
.ocr-url-confirm {
    border: 0;
    border-radius: 8px;
    padding: 9px 16px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: .85rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(15, 118, 110, .18);
}
.ocr-url-confirm:hover {
    background: var(--accent-dark);
}
.ocr-status {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--bg);
    font-size: .85rem;
    color: var(--muted);
    margin-bottom: 12px;
}
.ocr-status.is-visible {
    display: flex;
}
.ocr-status.is-error {
    background: #fef2f2;
    color: #b91c1c;
}
.ocr-status.is-success {
    background: var(--accent-soft);
    color: var(--accent-dark);
}
.ocr-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: ocr-spin .6s linear infinite;
    flex-shrink: 0;
}
@keyframes ocr-spin { to { transform: rotate(360deg); } }
.ocr-preview {
    display: none;
    gap: 12px;
    margin-bottom: 12px;
}
.ocr-preview.is-visible {
    display: flex;
    flex-wrap: wrap;
}
.ocr-preview-item {
    flex: 1;
    min-width: 140px;
}
.ocr-preview-item img,
.ocr-preview-item canvas {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--line);
    display: block;
}
.ocr-preview-label {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--muted);
    margin-bottom: 4px;
    font-weight: 700;
}
.ocr-result {
    display: none;
    margin-bottom: 12px;
}
.ocr-result.is-visible {
    display: block;
}
.ocr-result-label {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--muted);
    margin-bottom: 6px;
}
.ocr-result-box {
    font-family: 'SF Mono', 'Courier New', monospace;
    font-size: .9rem;
    background: var(--ink);
    color: #d1fae5;
    border-radius: 8px;
    padding: 10px 14px;
    word-break: break-all;
    line-height: 1.5;
}
.ocr-actions {
    display: flex;
    gap: 10px;
}
.ocr-actions .ocr-btn-fill {
    flex: 1;
    border: 0;
    border-radius: 8px;
    padding: 11px 16px;
    background: var(--accent);
    color: #fff;
    font-weight: 800;
    font-size: .9rem;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(15, 118, 110, .2);
}
.ocr-actions .ocr-btn-fill:hover {
    background: var(--accent-dark);
}
.ocr-actions .ocr-btn-fill:disabled {
    opacity: .5;
    cursor: not-allowed;
}
.ocr-actions .ocr-btn-secondary {
    border: 0;
    border-radius: 8px;
    padding: 11px 16px;
    background: var(--bg-deep);
    color: var(--ink);
    font-weight: 700;
    font-size: .9rem;
    cursor: pointer;
}
.ocr-actions .ocr-btn-secondary:hover {
    background: var(--line);
}
.ocr-hidden-input {
    display: none;
}
@media (max-width: 480px) {
    .ocr-modal {
        max-width: 100%;
        border-radius: 12px;
    }
    .ocr-preview {
        flex-direction: column;
    }
    .ocr-upload-btn {
        min-width: 80px;
        font-size: .75rem;
    }
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background:
        linear-gradient(135deg, rgba(15, 118, 110, 0.1), transparent 34%),
        linear-gradient(315deg, rgba(183, 121, 31, 0.08), transparent 28%),
        var(--bg);
}

body {
    margin: 0;
    min-height: 100%;
    color: var(--ink);
    font-family: Arial, "Microsoft YaHei", "PingFang SC", sans-serif;
}

button,
textarea,
.button-link {
    font: inherit;
}

.shell {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0 48px;
}

.tool {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(420px, 1.08fr);
    gap: 24px;
    align-items: end;
    margin-bottom: 24px;
}

.intro {
    padding: 0;
}

.intro h1 {
    margin: 8px 0 14px;
    font-size: clamp(36px, 6vw, 45px);
    line-height: 0.98;
    letter-spacing: 0;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--accent);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.eyebrow::before {
    content: "";
    width: 28px;
    height: 2px;
    border-radius: 99px;
    background: var(--accent);
}

.lede {
    max-width: 650px;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.75;
}

.technique-summary {
    max-width: 700px;
    margin: 14px 0 0;
    padding: 10px 10px;
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    color: #425149;
    background: rgba(255, 255, 255, 0.62);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.8;
}

.panel {
    border: 1px solid rgba(217, 225, 220, 0.9);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow-soft);
}

.form-panel {
    padding: 22px;
}

.form-panel label {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 800;
}

textarea {
    width: 100%;
    min-height: 118px;
    resize: vertical;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 15px;
    color: var(--ink);
    background: #fbfdfc;
    line-height: 1.6;
    word-break: break-all;
    box-shadow: inset 0 1px 0 rgba(22, 34, 28, 0.04);
}

textarea:focus {
    outline: 3px solid rgba(15, 118, 110, 0.16);
    border-color: var(--accent);
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 14px;
}

button,
.button-link {
    border: 0;
    border-radius: 8px;
    padding: 11px 18px;
    color: #fff;
    background: var(--accent);
    cursor: pointer;
    font-weight: 800;
    box-shadow: 0 10px 22px rgba(15, 118, 110, 0.2);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

button:hover,
.button-link:hover {
    background: var(--accent-dark);
}

button:disabled {
    cursor: wait;
    opacity: 0.68;
}

button.secondary,
.button-link.secondary {
    color: var(--ink);
    background: #e7eeeb;
    box-shadow: none;
}

button.secondary:hover,
.button-link.secondary:hover {
    background: #dbe6e1;
}

.counter {
    margin-left: auto;
    padding: 5px 9px;
    border-radius: 99px;
    color: var(--muted);
    background: #f1f5f3;
    font-size: 13px;
    font-weight: 700;
}

.hint {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

.hint code {
    padding: 2px 6px;
    border-radius: 5px;
    color: var(--accent-dark);
    background: var(--accent-soft);
}

.workspace {
    display: grid;
    grid-template-columns: minmax(320px, 540px) minmax(300px, 1fr);
    gap: 24px;
    align-items: stretch;
}

.board-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 540px;
}

.board-wrap {
    padding: 18px;
    border-radius: 8px;
    background: linear-gradient(160deg, #20342c, #15231e);
    box-shadow: var(--shadow);
}

.ad-slot {
    display: block;
    flex: 1 1 300px;
    min-height: 250px;
    width: 100%;
    margin: 0 auto;
}

.board-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    color: #d9e7e0;
}

.board-head span {
    font-size: 14px;
    font-weight: 800;
}

.board-head em {
    font-style: normal;
    color: #a9bbb2;
    font-size: 12px;
    font-weight: 700;
}

.coordinate-board {
    display: grid;
    grid-template-columns: 34px repeat(9, minmax(0, 1fr));
    grid-template-rows: 30px repeat(9, minmax(0, 1fr));
    width: 100%;
    aspect-ratio: 1;
}

.corner-label,
.axis-label {
    display: grid;
    place-items: center;
    min-width: 0;
    color: #d7e4de;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
}

.corner-label {
    border-right: 1px solid rgba(215, 228, 222, 0.16);
    border-bottom: 1px solid rgba(215, 228, 222, 0.16);
}

.col-label {
    border-bottom: 1px solid rgba(215, 228, 222, 0.16);
}

.row-label {
    border-right: 1px solid rgba(215, 228, 222, 0.16);
}

.sudoku-board,
.solution-board {
    background: transparent;
}

.cell,
.solution-cell {
    display: grid;
    place-items: center;
    min-width: 0;
    border-right: 1px solid #bfcbc4;
    border-bottom: 1px solid #bfcbc4;
    background: #fbfdfc;
    color: #6d7972;
    font-weight: 600;
    line-height: 1;
}

.cell.top-edge,
.solution-cell.top-edge {
    border-top: 3px solid var(--line-strong);
}

.cell.left-edge,
.solution-cell.left-edge {
    border-left: 3px solid var(--line-strong);
}

.cell {
    font-size: clamp(18px, 4.8vw, 34px);
}

.solution-cell {
    color: var(--ink);
    background: #f8fbfa;
    font-size: clamp(14px, 3.5vw, 23px);
    font-weight: 800;
}

.cell.given {
    color: var(--ink);
    background: #e5f1ee;
    font-weight: 900;
}

.cell.box-right,
.solution-cell.box-right {
    border-right: 3px solid var(--line-strong);
}

.cell.box-bottom,
.solution-cell.box-bottom {
    border-bottom: 3px solid var(--line-strong);
}

.cell.right-edge,
.solution-cell.right-edge {
    border-right: 3px solid var(--line-strong);
}

.cell.bottom-edge,
.solution-cell.bottom-edge {
    border-bottom: 3px solid var(--line-strong);
}

.result-panel {
    overflow: hidden;
    padding: 0;
}

.score-block {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 18px;
    align-items: end;
    padding: 24px 24px 22px;
    background: linear-gradient(135deg, #ffffff, #ecf6f3);
    border-bottom: 1px solid var(--line);
}

.score-block span {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.score-block strong {
    grid-row: span 2;
    color: var(--accent);
    font-size: clamp(58px, 9vw, 96px);
    line-height: 0.9;
}

.score-block em {
    align-self: start;
    width: fit-content;
    border-radius: 99px;
    padding: 6px 11px;
    color: var(--accent-dark);
    background: var(--accent-soft);
    font-style: normal;
    font-size: 18px;
    font-weight: 900;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
    padding: 18px;
}

.metrics div {
    min-width: 0;
    padding: 13px;
    border: 1px solid #edf1ef;
    border-radius: 8px;
    background: #f8faf9;
}

.metrics dt {
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 12px;
}

.metrics dd {
    margin: 0;
    font-size: 16px;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.solution {
    margin: 0 18px 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdfc;
}

.solution summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 14px;
    cursor: pointer;
    color: var(--ink);
    font-weight: 900;
    list-style: none;
}

.solution summary::-webkit-details-marker {
    display: none;
}

.solution summary::after {
    content: "+";
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: #fff;
    background: var(--accent);
    font-size: 18px;
    line-height: 1;
}

.solution[open] summary::after {
    content: "-";
}

.solution-board {
    width: min(100% - 28px, 360px);
    margin: 0 auto 16px;
}

.solution-coordinate-wrap {
    width: min(100% - 28px, 400px);
    margin: 0 auto 16px;
    padding: 10px;
    border-radius: 8px;
    background: linear-gradient(160deg, #20342c, #15231e);
}

.solution-coordinate-wrap .solution-board {
    width: 100%;
    margin: 0;
}

.notice,
.empty-state {
    display: grid;
    gap: 8px;
    margin: 18px;
    padding: 18px;
    border-radius: 8px;
    background: var(--accent-soft);
}

.notice.error {
    color: var(--warn);
    background: #fff1ec;
}

.notice strong,
.empty-state strong {
    color: var(--ink);
    font-size: 18px;
}

.notice span,
.empty-state span {
    color: var(--muted);
    line-height: 1.6;
}

.rating-guide {
    margin: 0 18px 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdfc;
}

.guide-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 14px;
    border-bottom: 1px solid var(--line);
}

.guide-head strong {
    font-size: 16px;
    font-weight: 900;
}

.guide-head span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.guide-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.guide-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 11px 14px;
    border-bottom: 1px solid #edf1ef;
    border-right: 1px solid #edf1ef;
}

.guide-item:last-child {
    border-bottom: 0;
}

/* 每行第二列去掉右边框 */
.guide-item:nth-child(2n) {
    border-right: 0;
}

/* 最后一行的两个去掉下边框 */
.guide-item:nth-last-child(-n+2) {
    border-bottom: 0;
}

.guide-item div {
    min-width: 0;
}

.guide-item strong {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 900;
}

.guide-item span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.guide-item em {
    min-width: 74px;
    border-radius: 99px;
    padding: 6px 8px;
    color: var(--accent-dark);
    background: var(--accent-soft);
    font-style: normal;
    font-size: 12px;
    font-weight: 900;
    text-align: center;
    white-space: nowrap;
}

/* 移动端：评分标准表恢复单列 */
@media (max-width: 640px) {
    .guide-list {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .guide-item {
        border-right: 0;
    }

    .guide-item:nth-child(2n) {
        border-right: 0;
    }

    .guide-item:nth-last-child(-n+2) {
        border-bottom: 1px solid #edf1ef;
    }

    .guide-item:last-child {
        border-bottom: 0;
    }
}

.steps-panel {
    margin-top: 24px;
    padding: 22px;
}

.section-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
}

.section-head h2 {
    margin: 0;
    font-size: 24px;
}

.section-head span {
    border-radius: 99px;
    padding: 5px 10px;
    color: var(--accent-dark);
    background: var(--accent-soft);
    font-size: 13px;
    font-weight: 800;
}

.steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
}

.steps li {
    position: relative;
    min-width: 0;
    padding: 15px 15px 15px 52px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(180deg, #ffffff, #f9fbfa);
    counter-increment: step;
}

.steps li::before {
    content: counter(step);
    position: absolute;
    left: 15px;
    top: 15px;
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    color: #fff;
    background: var(--accent);
    font-size: 12px;
    font-weight: 900;
}

.tag {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--accent-dark);
    font-size: 13px;
    font-weight: 900;
}

.steps p {
    margin: 0 0 8px;
    color: var(--ink);
    line-height: 1.6;
}

.steps small {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.seo-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
    gap: 22px;
    margin-top: 24px;
    padding: 22px;
}

.seo-copy h2,
.seo-copy h3,
.faq-list h2 {
    margin: 0 0 10px;
    line-height: 1.25;
}

.seo-copy h2,
.faq-list h2 {
    font-size: 22px;
}

.seo-copy h3 {
    margin-top: 18px;
    font-size: 17px;
}

.seo-copy p {
    margin: 0 0 12px;
    color: var(--muted);
    line-height: 1.75;
}

.faq-list {
    min-width: 0;
}

.faq-item {
    border-top: 1px solid var(--line);
}

.faq-item summary {
    cursor: pointer;
    padding: 13px 0;
    color: var(--ink);
    font-weight: 900;
    line-height: 1.45;
}

.faq-item p {
    margin: 0 0 14px;
    color: var(--muted);
    line-height: 1.65;
}

.site-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 14px;
    margin-top: 26px;
    padding: 18px 0 4px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.language-switcher {
    display: flex;
    flex-basis: 100%;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 10px;
    align-items: center;
    margin-bottom: 4px;
}

.language-switcher label {
    color: var(--muted);
    font-weight: 800;
}

.language-switcher select {
    min-width: 210px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px 12px;
    color: var(--ink);
    background: #fff;
    font: inherit;
    font-weight: 800;
}

.lang-dropdown {
    position: relative;
    display: inline-block;
}

.lang-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 210px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px 12px;
    color: var(--ink);
    background: #fff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: border-color .2s;
}

.lang-dropdown-trigger:hover {
    border-color: var(--accent-dark, #0f766e);
}

.lang-dropdown-arrow {
    width: 16px;
    height: 16px;
    margin-left: auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .2s;
}

.lang-dropdown.open .lang-dropdown-arrow {
    transform: rotate(180deg);
}

.lang-dropdown-flag {
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
}

.lang-dropdown-menu {
    position: absolute;
    bottom: 100%;
    left: 0;
    z-index: 30;
    display: none;
    min-width: 220px;
    max-height: 360px;
    overflow-y: auto;
    margin-bottom: 4px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    padding: 4px 0;
}

.lang-dropdown.open .lang-dropdown-menu {
    display: block;
}

.lang-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    color: var(--ink);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s;
}

.lang-dropdown-item:hover {
    background: var(--bg, #f0fdfa);
}

.lang-dropdown-item.active {
    background: var(--accent, #0f766e);
    color: #fff;
    border-radius: 4px;
    margin: 0 4px;
    padding: 8px 10px;
}

.site-footer a {
    color: var(--accent-dark);
    font-weight: 800;
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

.quick-actions {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 20;
    display: grid;
    gap: 8px;
}

.quick-action {
    padding: 0;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(15, 118, 110, 0.2);
    border-radius: 50%;
    color: var(--accent-dark);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 28px rgba(15, 82, 77, 0.18);
    text-decoration: none;
    backdrop-filter: blur(8px);
    appearance: none;
    transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.quick-action:hover {
    color: #fff;
    background: var(--accent);
    box-shadow: 0 16px 34px rgba(15, 82, 77, 0.28);
    transform: translateY(-2px);
    text-decoration: none;
}

.quick-action svg {
    display: block;
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Floating puzzle preview: keeps the main grid in view while reading the solving path. */
.board-floater {
    position: fixed;
   left: 16px;
   bottom: 16px;
    width: clamp(190px, 30vw, 270px);
   z-index: 30;
    padding: 10px 10px 12px;
    border-radius: 12px;
    background: linear-gradient(160deg, #20342c, #15231e);
    box-shadow: 0 18px 44px rgba(15, 45, 36, 0.32);
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px) scale(0.96);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
}

.board-floater.is-visible {
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0s;
}

.board-floater-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.board-floater-title {
    color: #d9e7e0;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.board-floater-close {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    color: #0a2620;
    background: #cfe3da;
    font-size: 13px;
    line-height: 1;
    transition: background 0.15s ease, color 0.15s ease;
}

.board-floater-close:hover {
    color: #fff;
    background: var(--accent);
}

.board-floater-grid {
    display: grid;
    grid-template-columns: clamp(14px, 2.6vw, 22px) repeat(9, minmax(0, 1fr));
    grid-template-rows: clamp(12px, 2.2vw, 19px) repeat(9, minmax(0, 1fr));
    width: 100%;
    aspect-ratio: 1;
    cursor: pointer;
}

.board-floater-grid .cell {
    font-size: clamp(9px, 1.9vw, 15px);
    border-width: 1px;
}

.board-floater-grid .corner-label,
.board-floater-grid .axis-label {
    color: #d7e4de;
    font-size: clamp(7px, 1.3vw, 11px);
}

@media (max-width: 900px) {
    .shell {
        width: min(100% - 22px, 700px);
        padding-top: 22px;
    }

    .tool,
    .workspace,
    .steps,
    .seo-panel {
        grid-template-columns: 1fr;
    }

    .tool {
        align-items: stretch;
    }

    .board-column {
        gap: 14px;
    }

    .ad-slot {
        flex: none;
        min-width: 100%;
    }

    .intro h1 {
        font-size: 44px;
    }
}

@media (max-width: 540px) {
    .shell {
        width: min(100% - 18px, 520px);
        padding-bottom: 30px;
    }

    .form-panel,
    .steps-panel,
    .seo-panel {
        padding: 16px;
    }

    .form-row button,
    .form-row .button-link {
        width: 100%;
    }

    .counter {
        width: 100%;
        margin-left: 0;
        text-align: center;
    }

    .board-wrap {
        padding: 12px;
    }

    .quick-actions {
        right: 12px;
        bottom: 12px;
    }

    .quick-action {
        width: 40px;
        height: 40px;
    }

    .quick-action svg {
        width: 20px;
        height: 20px;
    }

    .cell {
        font-size: clamp(16px, 7vw, 28px);
    }

    .board-floater {
       left: 10px;
       bottom: 10px;
        width: clamp(150px, 46vw, 210px);
   }

    .board-floater-grid .corner-label,
    .board-floater-grid .axis-label {
        font-size: 8px;
    }
}
