:root {
    --paper: #f5f2e8;
    --surface: #fffcf3;
    --ink: #222f2d;
    --line: #cdd5c7;
    --accent: #1d6150;
    --tint: #deebdc;
    color-scheme: light;
}

html.dark {
    --paper: #192623;
    --surface: #253530;
    --ink: #f0efe6;
    --line: #4c6257;
    --accent: #b0d8bf;
    --tint: #344b41;
    color-scheme: dark;
}

html body {
    background: var(--paper) !important;
    color: var(--ink) !important;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

body > header,
body > footer {
    background: var(--surface) !important;
    border-color: var(--line) !important;
}

body > header {
    border-block-end: 3px solid var(--accent);
    box-shadow: none !important;
}

body > header .text-primary a {
    color: var(--accent);
    font-family: Georgia, "Songti SC", SimSun, serif;
    font-weight: 700;
    white-space: nowrap;
}

body main, body article, body section, body .grid > *, .jr-home > * { min-width: 0; }
body article, body aside > *, .entry-content { overflow-wrap: anywhere; }
.entry-content h2, .jr-home h1, .jr-home h2 {
    color: var(--accent);
    font-family: Georgia, "Songti SC", SimSun, serif;
    font-weight: 700;
}

.entry-content pre { white-space: pre-wrap; overflow-wrap: anywhere; }
img, video { max-width: 100%; }
main > a, article p a { color: var(--accent); }

.jr-wrap { width: min(72rem, 100% - 2rem); margin-inline: auto; }
.jr-section { margin-block: 2rem; }
.jr-hero { padding-block: clamp(1.8rem, 5vw, 4rem); background: var(--tint); border-block-end: 1px solid var(--line); }
.jr-hero h1 { margin-block: .75rem; font-size: clamp(1.8rem, 4vw, 3.5rem); line-height: 1.18; }
.jr-home h2 { font-size: clamp(1.35rem, 2.8vw, 2rem); }
.jr-home p { line-height: 1.8; }
.jr-hero-grid, .jr-grid-4, .jr-topic-grid, .jr-step-grid, .jr-faq-grid { display: grid; gap: 1rem; }
.jr-hero-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: center; }
.jr-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.jr-topic-grid, .jr-step-grid, .jr-faq-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.jr-home a { color: var(--accent); }
.jr-lab-card, .jr-grid-4 > a, .jr-topic-card, .jr-compare-card, .jr-steps-card, .jr-final,
.jr-help-strip, .jr-faq-grid > *, .jr-hero-actions > a {
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: .3rem;
}

.jr-hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-block-start: 1rem; }
.jr-topic-grid > *, .jr-step-grid > * { border-block-start: 1px solid var(--line); padding-block: .7rem; }
.jr-section-head, .jr-topic-top, .jr-steps-top, .jr-compare-head { margin-block-end: .85rem; }
.jr-meter { margin-block: .7rem; }
.jr-meter-head { display: flex; justify-content: space-between; gap: .5rem; }
.jr-bar { height: .25rem; background: var(--tint); }
.jr-bar i { display: block; height: 100%; background: var(--accent); }
.jr-final { margin-block: 2rem; }
.jr-home table, .entry-content table { width: 100%; border-collapse: collapse; }
.jr-home th, .jr-home td, .entry-content th, .entry-content td {
    padding: .5rem;
    vertical-align: top;
    text-align: start;
    overflow-wrap: anywhere;
    border: 1px solid var(--line);
}

.jr-home td small { display: block; }
.jr-home img { max-width: 100%; }
#search-modal[open] { display: block; opacity: 1; }
[data-search-results] { margin-block-start: 1rem; max-height: 45vh; overflow-y: auto; }
[data-search-results] a { display: block; padding: .5rem; color: var(--accent); }

@media (max-width: 640px) {
    .jr-hero-grid, .jr-grid-4, .jr-topic-grid, .jr-step-grid, .jr-faq-grid { grid-template-columns: minmax(0, 1fr); }
    .wp-block-table, .jr-table-wrap { max-width: 100% !important; overflow: visible !important; }
    body table, body table > tbody, body table > thead, body table > tfoot {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }
    body table tr {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr);
        margin-block: .65rem;
        border: 1px solid var(--line);
        border-radius: .3rem;
    }
    body table colgroup { display: none; }
    body table td, body table th {
        display: block !important;
        min-width: 0 !important;
        max-width: 100% !important;
        width: auto !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        border-width: 0 0 1px !important;
    }
    body table td[data-column]::before {
        content: attr(data-column);
        display: block;
        color: var(--accent);
        font-size: .8rem;
        font-weight: 700;
    }
    body table[data-vertical-labels] > thead,
    body table[data-vertical-labels] > tbody > tr[data-header-row] {
        position: absolute;
        width: 1px !important;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
    }
}

/* home blocks: missing jr-* rules */
.jr-home a.jr-help-strip, .jr-home a.jr-cat-card, .jr-home a.jr-topic-item { text-decoration: none; color: inherit; }
.jr-home a.jr-cat-card { display: block; }
.jr-cat-icon { font-size: 1.25rem; color: var(--accent); }
.jr-cat-more, .jr-topic-link { color: var(--accent); font-weight: 600; }
.jr-home a.jr-help-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-block: 1rem; }
.jr-help-icon, .jr-step-num, .jr-topic-num, .jr-check > b { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--tint); color: var(--accent); font-weight: 700; }
.jr-help-copy { display: block; flex: 1 1 16rem; min-width: 0; }
.jr-help-copy h3, .jr-help-copy p { display: block; margin: 0; }
.jr-help-btn { flex: none; color: var(--accent); font-weight: 700; }
.jr-home a.jr-topic-item { display: block; }
.jr-home a.jr-btn, .jr-home a.jr-mini-cta { display: inline-block; padding: .55rem 1rem; border: 1px solid var(--accent); border-radius: .3rem; text-decoration: none; font-weight: 600; }
.jr-home a.jr-btn-primary { background: var(--accent); color: var(--surface); }
.jr-check-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; margin: 0; }
.jr-method-grid { margin-block: 1rem; }
.jr-method-grid > .jr-panel { padding: 0; background: none; border: 0; }
.jr-check { display: flex; gap: .8rem; align-items: flex-start; padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: .3rem; }
.jr-check h3, .jr-check p { margin: 0 0 .25rem; }
.jr-radar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; margin-block: 1rem; }
.jr-radar-card, .jr-panel, .jr-avoid-box { padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: .3rem; }
.jr-radar-card { border-top: 4px solid var(--accent); }
.jr-radar-card.warn { border-top-color: #b7791f; }
.jr-radar-card.risk { border-top-color: #b2432f; }
.jr-radar-card .tag { display: inline-block; padding: .1rem .55rem; background: var(--tint); border-radius: 1rem; font-size: .85rem; }
.jr-two-col { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.jr-link-list { display: grid; gap: .55rem; }
.jr-home a.jr-link-item { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .35rem 1rem; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: .3rem; text-decoration: none; }
.jr-link-item b { min-width: 0; }
.jr-avoid-box ul { margin: .5rem 0 0; padding-inline-start: 1.2rem; list-style: disc; }
.jr-avoid-box li { margin-block: .45rem; }
@media (max-width: 760px) {
    .jr-check-list, .jr-radar, .jr-two-col { grid-template-columns: minmax(0, 1fr); }
}
.jr-home h3, .jr-home h4 { font-weight: 700; font-size: 1.05rem; line-height: 1.5; }

@media (min-width: 761px) { .jr-topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.jr-topic-top p, .jr-steps-top p { margin-block-end: .7rem; }
.jr-compare-card .jr-compare-foot { margin-block-start: .8rem; }
