:root {
    --bg: #f7f8fb;
    --surface: #fff;
    --text: #20242b;
    --muted: #667085;
    --line: #e6e8ec;
    --accent: #3559e0;
    --accent-contrast: #fff;
    --accent2: #eef2ff;
    --header-bg: rgba(255, 255, 255, .94);
    --hero-start: #fff;
    --hero-end: #f1f4ff;
    --soft-text: #525866;
    --card-text: #606773;
    --answer-bg: #f3f6ff;
    --answer-line: #dce4ff;
    --table-head: #f7f8fa;
    --example-bg: #fafbff;
    --example-line: #cad4ff;
    --quiz-bg: #fff9e9;
    --quiz-line: #f2dfaa;
    --radius: 16px;
    --shadow: 0 10px 35px rgba(20, 30, 60, .06)
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #111318;
    --surface: #1b1f27;
    --text: #edf0f5;
    --muted: #a7afbd;
    --line: #343a46;
    --accent: #91a7ff;
    --accent-contrast: #111318;
    --accent2: #273252;
    --header-bg: rgba(20, 23, 29, .94);
    --hero-start: #1d222b;
    --hero-end: #202942;
    --soft-text: #bec5d0;
    --card-text: #b8c0cc;
    --answer-bg: #202a43;
    --answer-line: #35466f;
    --table-head: #242933;
    --example-bg: #20242d;
    --example-line: #526ba9;
    --quiz-bg: #302a1d;
    --quiz-line: #685a32;
    --shadow: 0 10px 35px rgba(0, 0, 0, .2)
}

* {
    box-sizing: border-box
}

html {
    scroll-behavior: smooth
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
    line-height: 1.75
}

.wrap {
    width: min(1120px, calc(100% - 32px));
    margin: auto
}

a {
    color: inherit
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--header-bg);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px)
}

.header-inner {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px
}

.header-tools {
    display: flex;
    align-items: center;
    gap: 18px
}

.theme-toggle {
    appearance: none;
    white-space: nowrap;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 12px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 12px;
    cursor: pointer
}

.brand {
    font-size: 20px;
    font-weight: 800;
    text-decoration: none
}

.site-header nav {
    display: flex;
    gap: 18px;
    flex-wrap: wrap
}

.site-header nav a {
    text-decoration: none;
    font-size: 14px;
    color: var(--muted)
}

.site-header nav a:hover {
    color: var(--accent)
}

main {
    padding: 20px 0 40px
}

.hero {
    padding: 24px 44px;
    margin-bottom: 24px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: linear-gradient(135deg, var(--hero-start), var(--hero-end));
    box-shadow: var(--shadow)
}

.eyebrow {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .08em;
    color: var(--accent);
    text-transform: uppercase
}

.hero h1 {
    font-size: clamp(34px, 6vw, 58px);
    line-height: 1.2;
    margin: .15em 0
}

.lead {
    font-size: 18px;
    max-width: 780px;
    color: var(--soft-text)
}

.hero-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 28px
}

.btn {
    display: inline-block;
    padding: 11px 18px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-contrast);
    text-decoration: none;
    font-weight: 700
}

.btn.ghost {
    background: var(--surface);
    color: var(--accent);
    border: 1px solid var(--line)
}

section {
    margin: 24px 0
}

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

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

.section-head>a {
    font-size: 14px;
    color: var(--accent);
    text-decoration: none
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow)
}

.card h3 {
    margin: 8px 0;
    font-size: 19px;
    line-height: 1.5
}

.card h3 a {
    text-decoration: none
}

.card h3 a:hover {
    color: var(--accent)
}

.card p {
    margin: 0;
    color: var(--card-text);
    font-size: 14px
}

.tag {
    display: inline-block;
    background: var(--accent2);
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    border-radius: 999px;
    padding: 3px 9px
}

.compact-list {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden
}

.compact-list a {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 18px;
    text-decoration: none;
    border-bottom: 1px solid var(--line)
}

.compact-list a:last-child {
    border-bottom: 0
}

.compact-list small {
    color: var(--muted)
}

.seo-box {
    padding: 30px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius)
}

.page-title {
    margin-top: 0
}

.page-title h1 {
    font-size: 38px;
    margin-bottom: 8px
}

.pager {
    display: flex;
    justify-content: center;
    gap: 22px;
    margin: 38px 0
}

.pager a {
    color: var(--accent)
}

.article-wrap {
    max-width: 1120px
}

.article {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: clamp(22px, 5vw, 48px);
    box-shadow: var(--shadow)
}

.breadcrumb {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 24px
}

.breadcrumb a {
    color: inherit
}

.article h1 {
    font-size: clamp(30px, 5vw, 45px);
    line-height: 1.35;
    margin: 10px 0 14px
}

.article-lead {
    font-size: 18px;
    color: var(--soft-text)
}

.article section {
    margin: 20px 0
}

.article h2 {
    font-size: 25px;
    line-height: 1.5;
    margin: 36px 0 4px
}

.answer-box {
    background: var(--answer-bg);
    border: 1px solid var(--answer-line);
    border-radius: 15px;
    padding: 20px 24px
}

.answer-box h2 {
    font-size: 20px !important;
    margin-top: 0
}

.table-scroll {
    overflow-x: auto
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface)
}

th,
td {
    padding: 12px 14px;
    border: 1px solid var(--line);
    vertical-align: top;
    text-align: left
}

thead th {
    background: var(--table-head)
}

.examples {
    display: grid;
    gap: 14px
}

.example {
    border-left: 4px solid var(--example-line);
    background: var(--example-bg);
    padding: 14px 18px
}

.example p {
    margin: .35em 0
}

.example-main {
    font-weight: 700
}

.translation {
    color: var(--muted)
}

.quiz {
    background: var(--quiz-bg);
    border: 1px solid var(--quiz-line);
    border-radius: 16px;
    padding: 22px
}

.quiz-choices {
    display: flex;
    gap: 10px;
    flex-wrap: wrap
}

.quiz button {
    appearance: none;
    border: 1px solid #d6c278;
    background: var(--surface);
    color: var(--text);
    padding: 9px 16px;
    border-radius: 10px;
    cursor: pointer
}

.quiz-answer {
    display: none;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #e6d7aa
}

.quiz.show-answer .quiz-answer {
    display: block
}

.related {
    margin-top: 42px
}

.related>h2 {
    font-size: 25px
}

footer {
    background: var(--surface);
    border-top: 1px solid var(--line);
    padding: 36px 0;
    color: var(--muted);
    font-size: 14px
}

.copyright {
    color: var(--muted)
}

@media(max-width:850px) {
    .header-inner {
        align-items: flex-start;
        flex-direction: column;
        padding: 14px 0
    }

    .site-header {
        position: static
    }

    .site-header nav {
        gap: 10px 16px
    }

    .header-tools {
        width: 100%;
        align-items: flex-start;
        justify-content: space-between
    }

    .grid {
        grid-template-columns: 1fr 1fr
    }

    .hero {
        padding: 38px 26px
    }
}

@media(max-width:580px) {
    .wrap {
        width: min(100% - 22px, 1120px)
    }

    main {
        padding-top: 24px
    }

    .grid {
        grid-template-columns: 1fr
    }

    .hero {
        padding: 24px 20px
    }

    .lead {
        font-size: 16px
    }

    .article {
        padding: 22px 18px
    }

    .section-head h2 {
        font-size: 22px
    }

    .section-head {
        align-items: center
    }

    .compact-list a {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px
    }

    .article h2 {
        font-size: 22px
    }
}

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

.compact-list-columns a:nth-child(odd) {
    border-right: 1px solid var(--line)
}

.compact-list-columns a:nth-last-child(-n+2) {
    border-bottom: 0
}

@media(max-width:580px) {
    .compact-list-columns {
        grid-template-columns: 1fr
    }

    .compact-list-columns a:nth-child(odd) {
        border-right: 0
    }

    .compact-list-columns a:nth-last-child(-n+2) {
        border-bottom: 1px solid var(--line)
    }

    .compact-list-columns a:last-child {
        border-bottom: 0
    }
}

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

.language-columns section {
    min-width: 0
}

@media(max-width:700px) {
    .language-columns {
        grid-template-columns: 1fr;
        gap: 0
    }
}

.article-title-sub {
    display: block;
    margin-top: .35em;
    font-size: .58em;
    font-weight: 700;
    color: var(--muted)
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important
}

.site-search {
    display: flex;
    min-width: 210px
}

.site-search input,
.search-page-form input {
    min-width: 0;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    font: inherit
}

.site-search input {
    width: 150px;
    border-radius: 999px 0 0 999px;
    padding: 6px 11px;
    font-size: 13px
}

.site-search button,
.search-page-form button {
    border: 0;
    background: var(--accent);
    color: var(--accent-contrast);
    font: inherit;
    font-weight: 700;
    cursor: pointer
}

.site-search button {
    border-radius: 0 999px 999px 0;
    padding: 6px 11px;
    font-size: 12px
}

.search-page-form {
    display: flex;
    max-width: 640px;
    margin-top: 22px
}

.search-page-form input {
    flex: 1;
    border-radius: 10px 0 0 10px;
    padding: 11px 14px
}

.search-page-form button {
    border-radius: 0 10px 10px 0;
    padding: 11px 20px
}

@media(max-width:1050px) {
    .header-tools {
        flex-wrap: wrap;
        justify-content: flex-end
    }

    .site-search {
        order: 3
    }
}

@media(max-width:850px) {
    .header-tools {
        justify-content: flex-start
    }

    .site-search {
        order: 0
    }
}

@media(max-width:850px) {
    .header-inner {
        position: relative
    }

    .brand {
        padding-right: 120px
    }

    .header-tools {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px
    }

    .theme-toggle {
        position: absolute;
        top: 14px;
        right: 0
    }

    .site-search {
        width: min(100%, 360px)
    }

    .site-search input {
        flex: 1;
        width: auto
    }
}