html,
body {
    margin: 0;
    overflow-x: hidden;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    padding: 40px 24px;
}

.section {
    position: relative;
    margin-top: 32px;
    margin-bottom: 32px;
    padding-top: 18px;
    padding-bottom: 24px;
}

.section:nth-of-type(odd)::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 100vw;
    transform: translateX(-50%);
    background-color: #f7fbff;
    z-index: -1;
}

.section h2 {
    margin-top: 10px;
    margin-bottom: 16px;
    font-size: 34px;
    line-height: 1.25;
}

.section h3 {
    margin-top: 28px;
    margin-bottom: 12px;
    font-size: 24px;
    line-height: 1.3;
}

.section ul {
    padding-left: 1.25em;
}

.section li + li {
    margin-top: 4px;
}

.buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 24px auto 32px;
}

.buttons .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    min-height: 40px;
    padding: 0 18px;
    border-radius: 5px;
    background-color: #1E6C93;
    color: #fff;
    font-size: 16px;
    line-height: 1;
    text-align: center;
    text-decoration: none;
}

.buttons .button:visited {
    color: #fff;
}

.buttons .button:hover {
    background-color: #15516f;
}

.buttons .button:focus-visible,
.opening-tab:focus-visible,
.strategy-tab:focus-visible,
.strategy-case-tab:focus-visible {
    outline: 2px solid #226E93;
    outline-offset: 2px;
}

.buttons .button.disabled {
    cursor: not-allowed;
    opacity: 0.55;
    pointer-events: none;
}

.figure-container {
    min-width: 260px;
}

.figure-container img {
    max-width: 520px;
    height: auto;
}

.figure-container .figure-wide {
    width: min(760px, 100%);
    max-width: 100%;
}

.subfigure-panel {
    margin: 22px auto;
    max-width: 1200px;
    text-align: center;
}

.subfigure-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}

.subfigure {
    margin: 0;
    min-width: 0;
}

.subfigure img {
    width: 100%;
    height: auto;
    max-height: 220px;
    object-fit: contain;
}

.subfigure figcaption {
    margin-top: 6px;
    font-size: 16px;
    font-weight: normal;
    line-height: 1.2;
}

.subfigure-panel > figcaption,
.table-panel > figcaption {
    margin-top: 12px;
    font-size: 18px;
    font-weight: bold;
    line-height: 1.35;
}

.table-panel > figcaption {
    margin-top: 0;
    margin-bottom: 6px;
}

.opening-winrate-panel {
    max-width: 1120px;
}

.opening-winrate-row {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    align-items: start;
}

.opening-winrate-row .subfigure img {
    max-height: 160px;
}

.opening-winrate-mode {
    border-left: 2px solid #555;
    padding-left: 14px;
}

.opening-tabs,
.strategy-tabs,
.strategy-case-tabs {
    margin: 24px 0;
    width: 100%;
}

.strategy-case-tabs {
    margin-top: 16px;
}

.opening-tab-selector,
.strategy-tab-selector {
    display: flex;
    justify-content: flex-start;
    gap: 5px;
    margin-bottom: -2px;
    overflow-x: auto;
    position: relative;
    z-index: 1;
}

.strategy-case-selector {
    display: inline-flex;
    justify-content: flex-start;
    gap: 2px;
    margin: 2px 0 0;
    padding: 3px;
    overflow-x: auto;
    border: 1px solid #d4e1e7;
    border-radius: 7px;
    background-color: #eef4f7;
}

.opening-tab,
.strategy-tab {
    flex: 0 0 auto;
    padding: 12px 26px;
    border: 2px solid #b7c4d8;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    background-color: #d6deea;
    color: #0f223d;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
}

.strategy-case-tab {
    flex: 0 0 auto;
    min-width: 96px;
    padding: 11px 22px;
    border: 0;
    border-radius: 5px;
    background-color: transparent;
    color: #425466;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    white-space: nowrap;
}

.strategy-case-tab:first-child {
    padding-left: 22px;
}

.strategy-case-tab:last-child {
    border-right: 0;
}

.opening-tab:hover,
.strategy-tab:hover {
    background-color: #c8d4e7;
}

.strategy-case-tab:hover {
    background-color: #f8fbfc;
    color: #226E93;
}

.opening-tab.active,
.strategy-tab.active {
    background-color: #fafafa;
    border-color: #ddd;
    color: #333;
}

.strategy-case-tab.active {
    background-color: #fff;
    color: #226E93;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(24, 52, 72, 0.16);
}

.opening-tab-box,
.strategy-tab-box {
    border: 2px solid #ddd;
    border-radius: 0 8px 8px 8px;
    padding: 30px;
    background-color: #fafafa;
}

.strategy-case-box {
    position: relative;
    padding: 24px 0 0;
    border: none;
    border-top: 1px solid transparent;
    border-radius: 0;
    background-color: transparent;
    box-shadow: none;
}

.strategy-case-box::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    pointer-events: none;
    background: #d9e4e9;
    box-shadow: rgba(0, 0, 0, 0.15) 2.4px 2.4px 3.2px;
}

.opening-tab-panel,
.strategy-tab-panel,
.strategy-case-panel {
    display: none;
}

.opening-tab-panel.active,
.strategy-tab-panel.active,
.strategy-case-panel.active {
    display: block;
}

.opening-tab-text,
.strategy-tab-text {
    margin: 0 0 14px;
    text-align: justify;
    line-height: 1.6;
}

.opening-tab-panel .subfigure-panel,
.strategy-subfigure-panel {
    margin-top: 0;
    margin-bottom: 0;
}

.opening-distribution-panel {
    max-width: 1040px;
}

.opening-distribution-group {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}

.opening-distribution-label {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-weight: bold;
    text-align: center;
    color: #226E93;
    white-space: nowrap;
}

.opening-distribution-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    align-items: start;
}

.opening-distribution-row .subfigure img {
    max-height: 180px;
}

.strategy-subfigure-panel {
    max-width: 1040px;
}

.strategy-subfigure-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    align-items: start;
}

.strategy-subfigure-row .subfigure img {
    max-height: 190px;
}

.strategy-passing-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    align-items: start;
}

.strategy-passing-row .subfigure img {
    max-height: 190px;
}

.table-panel {
    margin: 16px auto;
    max-width: 960px;
    text-align: center;
}

.table-scroll {
    overflow-x: auto;
    background-color: #fff;
}

.feature-table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
    border-top: 2px solid #222;
    border-bottom: 2px solid #222;
    font-size: 15px;
    line-height: 1.35;
}

.feature-table th,
.feature-table td {
    padding: 4px 8px;
    text-align: left;
    vertical-align: top;
}

.feature-table th:nth-child(2),
.feature-table td:nth-child(2) {
    text-align: right;
    white-space: nowrap;
}

.feature-table thead tr {
    border-bottom: 1.5px solid #222;
}

.feature-table .table-separator {
    border-top: 1px solid #666;
}

.win-rate-table {
    min-width: 760px;
}

.win-rate-table th,
.win-rate-table td,
.win-rate-table th:nth-child(2),
.win-rate-table td:nth-child(2) {
    text-align: center;
    white-space: nowrap;
}

.win-rate-table th:first-child,
.win-rate-table td:first-child {
    text-align: center;
    border-right: 1px solid #666;
}

.human-ai-table {
    min-width: 820px;
}

.human-ai-table th,
.human-ai-table td,
.human-ai-table th:nth-child(2),
.human-ai-table td:nth-child(2) {
    text-align: center;
    white-space: nowrap;
}

.human-ai-table th:first-child,
.human-ai-table td:first-child {
    text-align: center;
}

pre {
    overflow-x: auto;
    padding: 14px 16px;
    border: 1px solid #d9e3e8;
    border-radius: 5px;
    background: #fff;
    font-size: 15px;
    line-height: 1.45;
    text-align: left;
}

code {
    font-family: Consolas, Monaco, "Courier New", monospace;
}

@media (max-width: 640px) {
    body {
        margin: 0;
        padding: 24px 16px;
        font-size: 16px;
    }

    h1 {
        font-size: 34px;
    }

    .section {
        padding-top: 14px;
        padding-bottom: 18px;
    }

    .section h2 {
        font-size: 28px;
    }

    .section h3 {
        font-size: 21px;
    }

    .authors,
    .institutions {
        font-size: 18px;
    }

    .buttons .button {
        width: min(100%, 260px);
    }

    .figure-container {
        min-width: 0;
        width: 100%;
    }

    .figure-container figcaption,
    .subfigure-panel > figcaption,
    .table-panel > figcaption {
        font-size: 16px;
    }

    .subfigure-row,
    .opening-winrate-row,
    .opening-distribution-row,
    .strategy-subfigure-row,
    .strategy-passing-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .subfigure img {
        max-height: 190px;
    }

    .opening-winrate-mode {
        border-left: none;
        padding-left: 0;
    }

    .opening-tab,
    .strategy-tab,
    .strategy-case-tab {
        padding: 10px 18px;
        font-size: 13px;
    }

    .strategy-case-tab {
        min-width: 96px;
        padding: 10px 18px;
        font-size: 13px;
    }

    .opening-tab-box,
    .strategy-tab-box {
        padding: 20px;
    }

    .strategy-case-box {
        padding: 0;
    }

    .opening-distribution-group {
        grid-template-columns: 1fr;
    }

    .opening-distribution-label {
        writing-mode: horizontal-tb;
        transform: none;
        text-align: left;
    }
}

@media (max-width: 380px) {
    .subfigure-row,
    .opening-winrate-row,
    .opening-distribution-row,
    .strategy-subfigure-row,
    .strategy-passing-row {
        grid-template-columns: 1fr;
    }
}
