/* ==========================================================================
   r36s.org — hardware service manual
   Reference: printed documentation that ships with consumer electronics.
   Restrained ink, hairline rules, monospaced designators, information density.
   ========================================================================== */

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

/* --------------------------------------------------------------------------
   Tokens
   -------------------------------------------------------------------------- */

:root {
    /* Ground and ink */
    --paper: #faf9f7;
    --paper-sunk: #f2f0ec;
    --paper-raised: #ffffff;
    --ink: #17191d;
    --slate: #5a6472;
    --slate-quiet: #626a78;
    --rule: #e4e1db;
    --rule-strong: #cfcbc3;

    /* Signal — charge/power indicator on the device. Interactive states only. */
    --signal: #a8480d;
    --signal-lift: #96400a;
    --signal-wash: #f6ede4;
    --btn-ink: #ffffff;
    /* Hover DARKENS in light mode: --signal-lift must simultaneously carry
       white button ink (>=4.5) and act as link text on paper (>=4.5), and both
       of those want it darker, not lighter. */
    --border-control: #7f8692;
    --ok-lift: #2b6249;
    --caution-lift: #785d26;
    --stop-lift: #8e2c2b;

    /* Status. Deliberately muted so state never competes with navigation. */
    --ok: #2f6b4f;
    --ok-wash: #eef4f0;
    --caution: #86682a;
    --caution-wash: #f7f2e6;
    --stop: #99302f;
    --stop-wash: #f9edec;

    /* Roles */
    --text-primary: var(--ink);
    --text-secondary: var(--slate);
    --text-quiet: var(--slate-quiet);
    --border-color: var(--rule);
    --bg-body: var(--paper);
    --bg-section: var(--paper-sunk);
    --color-accent: var(--signal);
    --color-accent-hover: var(--signal-lift);

    /* Type */
    --face-text: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB",
                 "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
    --face-data: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
                 "Liberation Mono", monospace;

    --step--1: 0.8125rem;
    --step-0: 1rem;
    --step-1: 1.125rem;
    --step-2: 1.375rem;
    --step-3: 1.75rem;
    --step-4: 2.125rem;
    --step-5: 2.75rem;

    --measure: 68ch;

    /* Rhythm */
    --gap-xs: 0.5rem;
    --gap-sm: 0.875rem;
    --gap-md: 1.5rem;
    --gap-lg: 2.5rem;
    --gap-xl: 4rem;

    --shell: 1140px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --paper: #14161a;
        --paper-sunk: #1a1d22;
        --paper-raised: #1e2127;
        --ink: #e8e6e1;
        --slate: #a2a9b5;
        --slate-quiet: #868d99;
        --rule: #2b2f36;
        --rule-strong: #3d434c;

        --signal: #e08a3c;
        --signal-lift: #f0a662;
        --signal-wash: #2a2119;
        --btn-ink: #14161a;
        --border-control: #6a717c;
        --ok-lift: #7cc3a0;
        --caution-lift: #d9b96f;
        --stop-lift: #e79691;

        --ok: #5fae87;
        --ok-wash: #17231d;
        --caution: #c9a44e;
        --caution-wash: #241f14;
        --stop: #d9756f;
        --stop-wash: #251718;
    }
}

:root[data-theme="dark"] {
    --paper: #14161a;
    --paper-sunk: #1a1d22;
    --paper-raised: #1e2127;
    --ink: #e8e6e1;
    --slate: #a2a9b5;
    --slate-quiet: #868d99;
    --rule: #2b2f36;
    --rule-strong: #3d434c;

    --signal: #e08a3c;
    --signal-lift: #f0a662;
    --signal-wash: #2a2119;
    --btn-ink: #14161a;
    --border-control: #6a717c;
    --ok-lift: #7cc3a0;
    --caution-lift: #d9b96f;
    --stop-lift: #e79691;

    --ok: #5fae87;
    --ok-wash: #17231d;
    --caution: #c9a44e;
    --caution-wash: #241f14;
    --stop: #d9756f;
    --stop-wash: #251718;
}

:root[data-theme="light"] {
    --paper: #faf9f7;
    --paper-sunk: #f2f0ec;
    --paper-raised: #ffffff;
    --ink: #17191d;
    --slate: #5a6472;
    --slate-quiet: #626a78;
    --rule: #e4e1db;
    --rule-strong: #cfcbc3;

    --signal: #a8480d;
    --signal-lift: #96400a;
    --signal-wash: #f6ede4;
    --btn-ink: #ffffff;
    /* Hover DARKENS in light mode: --signal-lift must simultaneously carry
       white button ink (>=4.5) and act as link text on paper (>=4.5), and both
       of those want it darker, not lighter. */
    --border-control: #7f8692;
    --ok-lift: #2b6249;
    --caution-lift: #785d26;
    --stop-lift: #8e2c2b;

    --ok: #2f6b4f;
    --ok-wash: #eef4f0;
    --caution: #86682a;
    --caution-wash: #f7f2e6;
    --stop: #99302f;
    --stop-wash: #f9edec;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--face-text);
    font-size: var(--step-0);
    line-height: 1.8;
    color: var(--text-primary);
    background-color: var(--bg-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    line-height: 1.2;
    text-wrap: balance;
    font-weight: 700;
}

h1 {
    font-size: var(--step-5);
    letter-spacing: -0.025em;
    font-weight: 800;
}

h2 {
    font-size: var(--step-4);
    letter-spacing: -0.02em;
    font-weight: 750;
    margin: var(--gap-xl) 0 var(--gap-md);
    padding-bottom: var(--gap-sm);
    border-bottom: 1px solid var(--rule-strong);
}

h3 {
    font-size: var(--step-2);
    letter-spacing: -0.01em;
    margin: var(--gap-lg) 0 var(--gap-sm);
}

h4 {
    font-size: var(--step-1);
    margin: var(--gap-md) 0 var(--gap-xs);
}

p {
    margin-bottom: 1.15rem;
    max-width: var(--measure);
    color: var(--text-secondary);
}

strong {
    color: var(--text-primary);
    font-weight: 650;
}

ul, ol {
    margin: 1rem 0 1.15rem 1.35rem;
    color: var(--text-secondary);
    max-width: var(--measure);
}

li {
    margin-bottom: 0.4rem;
}

li::marker {
    color: var(--text-quiet);
}

a {
    color: var(--signal);
    text-decoration: none;
    text-underline-offset: 0.18em;
    text-decoration-thickness: 1px;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--signal-lift);
    text-decoration: underline;
}

hr, .divider {
    border: 0;
    border-top: 1px solid var(--rule);
    margin: var(--gap-lg) 0;
    height: 0;
}

img {
    max-width: 100%;
    height: auto;
}

/* Monospaced designators: chip names, firmware, paths, slots. */
code {
    font-family: var(--face-data);
    font-size: 0.875em;
    background: var(--bg-section);
    border: 1px solid var(--rule);
    padding: 0.1em 0.4em;
    color: var(--text-primary);
}

pre {
    font-family: var(--face-data);
    background: var(--bg-section);
    border: 1px solid var(--rule);
    border-left: 2px solid var(--rule-strong);
    padding: 1.15rem 1.35rem;
    overflow-x: auto;
    margin: var(--gap-md) 0;
    font-size: var(--step--1);
    line-height: 1.65;
}

pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

body > header {
    background: var(--bg-body);
    border-bottom: 1px solid var(--rule);
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    max-width: var(--shell);
    margin: 0 auto;
    padding: 0 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    gap: var(--gap-md);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 700;
    font-size: var(--step-1);
    color: var(--text-primary);
    letter-spacing: -0.02em;
    flex-shrink: 0;
}

.logo:hover {
    color: var(--text-primary);
    text-decoration: none;
}

.logo img {
    width: 28px;
    height: 28px;
    transition: transform 0.2s ease;
}

.logo:hover img {
    transform: translateY(-1px);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0;
    list-style: none;
    margin: 0;
    max-width: none;
}

.nav-links li {
    margin: 0;
}

.nav-links a {
    display: flex;
    align-items: center;
    height: 60px;
    padding: 0 0.8rem;
    font-size: 0.9rem;
    font-weight: 550;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.nav-links a:hover {
    color: var(--text-primary);
    text-decoration: none;
    border-bottom-color: var(--rule-strong);
}

.nav-links a.active {
    color: var(--text-primary);
    border-bottom-color: var(--signal);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--rule);
    font-size: 1.1rem;
    line-height: 1;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.45rem 0.6rem;
}

/* Theme switch. Injected by main.js into the nav list, so it inherits the
   nav's desktop row and mobile stack without any per-page markup. Wears the
   same monospaced label as the other instrument-style controls. */
.theme-item {
    display: flex;
    align-items: center;
    margin-left: 0.35rem;
}

.theme-toggle {
    font-family: var(--face-data);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-quiet);
    background: none;
    border: 1px solid var(--border-control);
    padding: 0.22rem 0.5rem;
    line-height: 1.4;
    cursor: pointer;
    min-width: 4.4em;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.theme-toggle:hover {
    color: var(--signal);
    border-color: var(--signal);
}

/* --------------------------------------------------------------------------
   Breadcrumbs
   -------------------------------------------------------------------------- */

.breadcrumbs {
    max-width: var(--shell);
    margin: 0 auto;
    padding: 0.9rem 1.75rem 0;
}

.breadcrumbs ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0;
    max-width: none;
    font-family: var(--face-data);
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    color: var(--text-quiet);
}

.breadcrumbs li {
    margin: 0;
}

.breadcrumbs li::after {
    content: "/";
    margin-left: 0.4rem;
    color: var(--rule-strong);
}

.breadcrumbs li:last-child::after {
    content: "";
}

.breadcrumbs a {
    color: var(--text-quiet);
}

.breadcrumbs a:hover {
    color: var(--signal);
}

.breadcrumbs li[aria-current="page"] {
    color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
    max-width: var(--shell);
    margin: 0 auto;
    padding: var(--gap-xl) 1.75rem var(--gap-lg);
    border-bottom: 1px solid var(--rule);
}

/* Eyebrow carries the actual hardware designators — the most characteristic
   thing about the subject, stated before the headline. */
.hero-eyebrow {
    font-family: var(--face-data);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--signal);
    margin-bottom: 0.9rem;
    max-width: none;
}

.hero h1 {
    max-width: 20ch;
    margin-bottom: 1.15rem;
}

.hero p {
    font-size: var(--step-1);
    color: var(--text-secondary);
    max-width: 62ch;
}

.hero p strong {
    color: var(--text-primary);
    font-weight: 650;
}

.hero-subtitle {
    font-size: var(--step-1);
    max-width: 62ch;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.container {
    max-width: var(--shell);
    margin: 0 auto;
    padding: var(--gap-lg) 1.75rem var(--gap-xl);
    background: none;
}

.content-section {
    background: none;
    border: 0;
    padding: 0;
    margin-bottom: var(--gap-lg);
}

.content-section > h2:first-of-type,
.content-section > h1 + h2 {
    margin-top: var(--gap-lg);
}

.intro-text {
    font-size: var(--step-1);
    color: var(--text-secondary);
    max-width: 64ch;
    margin-bottom: var(--gap-md);
}

/* --------------------------------------------------------------------------
   Callouts — typographic label carries identity, colour only reinforces it.
   -------------------------------------------------------------------------- */

.highlight-box,
.warning-box,
.success-box,
.danger-box,
.info-box,
.alert-banner {
    background: var(--bg-section);
    border: 1px solid var(--rule);
    border-left: 2px solid var(--rule-strong);
    padding: 1.25rem 1.4rem;
    margin: var(--gap-md) 0;
    max-width: var(--measure);
}

.highlight-box > :last-child,
.warning-box > :last-child,
.success-box > :last-child,
.danger-box > :last-child,
.info-box > :last-child,
.alert-banner > :last-child {
    margin-bottom: 0;
}

.highlight-box h4,
.warning-box h4,
.success-box h4,
.danger-box h4,
.info-box h4,
.alert-banner h4,
.highlight-box h3,
.warning-box h3,
.success-box h3,
.danger-box h3,
.info-box h3 {
    font-family: var(--face-data);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    margin: 0 0 0.6rem;
    color: var(--text-quiet);
}

.highlight-box { border-left-color: var(--signal); background: var(--signal-wash); }
.highlight-box h4, .highlight-box h3 { color: var(--signal); }

.success-box { border-left-color: var(--ok); background: var(--ok-wash); }
.success-box h4, .success-box h3 { color: var(--ok); }

.warning-box { border-left-color: var(--caution); background: var(--caution-wash); }
.warning-box h4, .warning-box h3 { color: var(--caution); }

.danger-box { border-left-color: var(--stop); background: var(--stop-wash); }
.danger-box h4, .danger-box h3 { color: var(--stop); }

.info-box {
    border-left-color: var(--rule-strong);
    background: var(--bg-section);
}

/* Full-bleed banner for the one thing a new owner must do immediately. */
.alert-banner {
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-bottom: 1px solid var(--rule);
    background: var(--caution-wash);
}

.alert-banner .container {
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
}

.banner-label {
    flex-shrink: 0;
    align-self: flex-start;
    font-family: var(--face-data);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--caution);
    border: 1px solid currentColor;
    padding: 0.15rem 0.45rem;
    white-space: nowrap;
}

.highlight-box p:last-child,
.warning-box p:last-child,
.success-box p:last-child,
.danger-box p:last-child,
.info-box p:last-child {
    margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */

.feature-grid,
.guide-cards,
.journey-grid,
.featured-grid,
.articles-grid,
.priority-grid,
.comparison-grid,
.pros-cons-grid {
    display: grid;
    gap: 1px;
    margin: var(--gap-md) 0;
    list-style: none;
    background: var(--rule);
    border: 1px solid var(--rule);
    max-width: none;
}

.feature-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.guide-cards { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.journey-grid { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.featured-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.articles-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.priority-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.comparison-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.pros-cons-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.feature-card,
.guide-card,
.journey-card,
.article-card,
.pros-box,
.cons-box {
    background: var(--bg-body);
    border: 0;
    border-radius: 0;
    padding: 1.35rem 1.4rem;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: background-color 0.15s ease;
    position: relative;
}

a.guide-card,
a.journey-card,
a.feature-card {
    box-shadow: inset 0 0 0 0 var(--signal);
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

a.guide-card:hover,
a.journey-card:hover,
a.feature-card:hover {
    background: var(--paper-raised);
    box-shadow: inset 3px 0 0 0 var(--signal);
    text-decoration: none;
}

.feature-card h3, .feature-card h4,
.guide-card h3, .guide-card h4,
.journey-card h3, .journey-card h4,
.article-card h2, .article-card h3,
.pros-box h4, .cons-box h4 {
    margin: 0 0 0.4rem;
    font-size: var(--step-1);
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.feature-card p,
.guide-card p,
.journey-card p,
.article-card p {
    margin: 0 0 0.75rem;
    font-size: 0.925rem;
    color: var(--text-secondary);
    max-width: none;
    flex-grow: 1;
}

.guide-card ul,
.journey-card ul,
.feature-card ul {
    margin: 0 0 0.85rem;
    padding: 0;
    list-style: none;
    font-size: 0.875rem;
    color: var(--text-secondary);
    max-width: none;
}

.guide-card li,
.journey-card li,
.feature-card li {
    margin-bottom: 0.2rem;
}

.read-more,
.article-link {
    font-family: var(--face-data);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--signal);
    margin-top: auto;
}

a.guide-card:hover .read-more,
a.journey-card:hover .read-more {
    color: var(--signal-lift);
}

/* Journey icons were emoji set at 2.5rem — reduced to a quiet marker. */
.journey-icon {
    font-size: 1.15rem;
    line-height: 1;
    margin-bottom: 0.6rem;
    opacity: 0.75;
    filter: saturate(0.7);
}

.guide-cards-section,
.journey-section,
.featured-section {
    max-width: var(--shell);
    margin: 0 auto;
    padding: var(--gap-lg) 1.75rem;
    background: none;
}

.journey-section h2,
.featured-section h2,
.guide-cards-section h2 {
    margin-top: 0;
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */

.table-wrapper,
.comparison-table-wrapper {
    overflow-x: auto;
    margin: var(--gap-md) 0;
    border: 1px solid var(--rule);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-body);
    font-size: 0.925rem;
    font-variant-numeric: tabular-nums;
}

.table-wrapper table,
.comparison-table-wrapper table {
    border: 0;
    margin: 0;
}

th, td {
    padding: 0.7rem 0.95rem;
    text-align: left;
    border-bottom: 1px solid var(--rule);
    vertical-align: top;
}

th {
    background: var(--bg-section);
    font-family: var(--face-data);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-quiet);
    white-space: nowrap;
}

td {
    color: var(--text-secondary);
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover td {
    background: var(--bg-section);
}

/* --------------------------------------------------------------------------
   Articles
   -------------------------------------------------------------------------- */

.article-header {
    margin-bottom: var(--gap-md);
    padding-bottom: var(--gap-sm);
    border-bottom: 1px solid var(--rule);
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.7rem;
    font-family: var(--face-data);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-quiet);
    margin-bottom: 0.6rem;
}

.article-date {
    color: var(--text-quiet);
}

.article-category {
    color: var(--signal);
    border: 1px solid currentColor;
    padding: 0.1rem 0.45rem;
}

.article-footer {
    margin-top: var(--gap-lg);
    padding-top: var(--gap-md);
    border-top: 1px solid var(--rule);
    font-size: 0.875rem;
    color: var(--text-quiet);
}

.footer-feedback {
    margin-top: var(--gap-md);
    padding-top: var(--gap-md);
    border-top: 1px solid var(--rule);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.section-category {
    margin: var(--gap-lg) 0 var(--gap-md);
}

.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: var(--gap-md) 0;
    padding-bottom: var(--gap-sm);
    border-bottom: 1px solid var(--rule);
}

.category-filter a {
    font-family: var(--face-data);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--rule);
    color: var(--text-secondary);
}

.category-filter a:hover {
    border-color: var(--signal);
    color: var(--signal);
    text-decoration: none;
}

/* FAQ — previously unstyled, relied entirely on inline styles. */
.faq-section {
    margin: var(--gap-md) 0;
}

.faq-item {
    padding: var(--gap-sm) 0;
    border-bottom: 1px solid var(--rule);
    max-width: var(--measure);
}

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

.faq-item h3,
.faq-item h4 {
    margin-top: 0;
    margin-bottom: 0.45rem;
    font-size: var(--step-1);
}

.faq-item > :last-child {
    margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Table of contents
   -------------------------------------------------------------------------- */

.toc {
    background: var(--bg-section);
    border: 1px solid var(--rule);
    padding: 1.25rem 1.4rem;
    margin-bottom: var(--gap-lg);
    max-width: var(--measure);
}

.toc h3 {
    margin: 0 0 0.7rem;
    font-family: var(--face-data);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-quiet);
}

.toc ul {
    list-style: none;
    margin: 0;
    max-width: none;
}

.toc li {
    margin: 0;
    border-bottom: 1px solid var(--rule);
}

.toc li:last-child {
    border-bottom: 0;
}

.toc a {
    display: block;
    padding: 0.55rem 0;
    color: var(--text-secondary);
    font-size: 0.925rem;
}

.toc a:hover {
    color: var(--signal);
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   Buttons — square, instrument-like. Label does the work, fill confirms it.
   -------------------------------------------------------------------------- */

.btn,
.buy-link {
    display: inline-block;
    padding: 0.55rem 1.1rem;
    font-family: var(--face-data);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.35;
    text-decoration: none;
    border: 1px solid var(--signal);
    background: var(--signal);
    color: var(--btn-ink);
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    cursor: pointer;
}

.btn:hover,
.buy-link:hover {
    background: var(--signal-lift);
    border-color: var(--signal-lift);
    color: var(--btn-ink);
    text-decoration: none;
}

/* Store links read as secondary until hovered — they are outbound, not the
   primary action of the page. */
.buy-link,
.btn-ghost {
    background: none;
    color: var(--text-primary);
    border-color: var(--rule-strong);
}

.buy-link:hover,
.btn-ghost:hover {
    background: var(--signal);
    border-color: var(--signal);
    color: var(--btn-ink);
}

.btn-ok { background: var(--ok); border-color: var(--ok); }
.btn-ok:hover { background: var(--ok-lift); border-color: var(--ok-lift); }

.btn-caution { background: var(--caution); border-color: var(--caution); }
.btn-caution:hover { background: var(--caution-lift); border-color: var(--caution-lift); }

.btn-stop { background: var(--stop); border-color: var(--stop); }
.btn-stop:hover { background: var(--stop-lift); border-color: var(--stop-lift); }

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: var(--gap-sm) 0;
}

/* --------------------------------------------------------------------------
   Status chips
   -------------------------------------------------------------------------- */

.badge {
    display: inline-block;
    font-family: var(--face-data);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 0.15rem 0.45rem;
    border: 1px solid currentColor;
    white-space: nowrap;
}

.badge-excellent { color: var(--ok); }
.badge-good { color: var(--signal); }
.badge-mixed { color: var(--caution); }
.badge-poor { color: var(--stop); }

.price-display {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.7rem;
    margin: var(--gap-sm) 0;
}

.price-value {
    font-size: var(--step-4);
    font-weight: 750;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.price-details {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.performance-overview {
    margin: var(--gap-md) 0;
}

.warning {
    color: var(--stop);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

footer {
    background: var(--bg-section);
    border-top: 1px solid var(--rule);
    color: var(--text-secondary);
    padding: var(--gap-lg) 1.75rem;
    margin-top: var(--gap-xl);
}

.footer-content {
    max-width: var(--shell);
    margin: 0 auto;
}

.footer-content p {
    color: var(--text-quiet);
    font-size: 0.85rem;
    max-width: none;
    margin-bottom: 0.4rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.15rem;
    margin-bottom: var(--gap-md);
    padding-bottom: var(--gap-md);
    border-bottom: 1px solid var(--rule);
}

.footer-links a {
    font-size: 0.875rem;
    font-weight: 550;
    color: var(--text-secondary);
}

.footer-links a:hover {
    color: var(--signal);
}

/* --------------------------------------------------------------------------
   Scroll to top
   -------------------------------------------------------------------------- */

.scroll-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-body);
    color: var(--text-secondary);
    border: 1px solid var(--rule-strong);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: 900;
    font-size: 1rem;
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top:hover {
    color: var(--signal);
    border-color: var(--signal);
}

/* --------------------------------------------------------------------------
   Skip link
   -------------------------------------------------------------------------- */

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--ink);
    color: var(--paper);
    padding: 0.7rem 1.1rem;
    z-index: 2000;
    font-size: 0.9rem;
    font-weight: 600;
}

.skip-link:focus {
    left: 0.5rem;
    top: 0.5rem;
    text-decoration: none;
    color: var(--paper);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) and (min-width: 769px) {
    :root {
        --step-5: 2.375rem;
        --step-4: 1.875rem;
    }
}

@media (max-width: 768px) {
    :root {
        --step-5: 2rem;
        --step-4: 1.5rem;
        --step-3: 1.375rem;
        --step-2: 1.2rem;
        --gap-xl: 2.5rem;
        --gap-lg: 1.75rem;
    }

    nav {
        padding: 0 1.1rem;
        height: 54px;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-body);
        flex-direction: column;
        align-items: stretch;
        border-bottom: 1px solid var(--rule);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.25s ease;
    }

    .nav-links.active {
        max-height: calc(100dvh - 54px);
        overflow-y: auto;
    }

    .nav-links li {
        border-bottom: 1px solid var(--rule);
    }

    .nav-links li:last-child {
        border-bottom: 0;
    }

    .nav-links a {
        height: auto;
        padding: 0.9rem 1.1rem;
        border-bottom: 0;
        border-left: 2px solid transparent;
    }

    .nav-links a:hover,
    .nav-links a.active {
        background: var(--bg-section);
        border-bottom-color: transparent;
        border-left-color: var(--signal);
    }

    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
        padding: 0;
    }

    .theme-item {
        margin: 0;
        padding: 0.55rem 1.1rem;
        border-left: 2px solid transparent;
    }

    /* Reach the 44px minimum tap target inside the stacked menu. */
    .theme-toggle {
        min-height: 44px;
        padding: 0.5rem 0.9rem;
        font-size: 0.7rem;
    }

    .hero,
    .container,
    .breadcrumbs,
    .guide-cards-section,
    .journey-section,
    .featured-section,
    footer {
        padding-left: 1.1rem;
        padding-right: 1.1rem;
    }

    .hero {
        padding-top: var(--gap-lg);
    }

    .hero-eyebrow {
        font-size: 0.66rem;
        letter-spacing: 0.06em;
    }

    .banner-label {
        margin-bottom: 0.2rem;
    }

    .feature-grid,
    .guide-cards,
    .journey-grid,
    .featured-grid,
    .articles-grid,
    .priority-grid,
    .comparison-grid,
    .pros-cons-grid {
        grid-template-columns: 1fr;
    }

    th, td {
        padding: 0.6rem 0.7rem;
    }

    .scroll-top {
        bottom: 1rem;
        right: 1rem;
    }

    .footer-links {
        gap: 0.85rem 1.1rem;
    }
}

/* --------------------------------------------------------------------------
   Accessibility
   -------------------------------------------------------------------------- */

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--signal);
    outline-offset: 2px;
    border-radius: 1px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* --------------------------------------------------------------------------
   主题专题页与文章中心归档
   -------------------------------------------------------------------------- */

details.archive {
    border: 1px solid var(--rule);
    border-radius: 6px;
    padding: 1rem 1.25rem;
    background: var(--paper-raised);
}

details.archive summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-primary);
}

details.archive[open] summary {
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--rule);
    padding-bottom: 0.75rem;
}

.archive-list {
    list-style: none;
    padding: 0;
    columns: 2;
    column-gap: 2.5rem;
}

.archive-list li {
    padding: 0.2rem 0;
    break-inside: avoid;
    font-size: 0.92rem;
}

.topic-meta {
    color: var(--text-quiet);
    font-size: 0.85rem;
    font-weight: 400;
}

@media (max-width: 700px) {
    .archive-list { columns: 1; }
}
