/* ================================================================
   Light — system.css
   Complete design system: reset, variables, layout, typography,
   forms, components, page layouts. No vendor dependencies.
   ================================================================ */

/* --- Reset & Base ------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
    --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;
    --sp-12: 48px; --sp-16: 64px;

    --ink: #0c1222;
    --ink-2: #1a2438;
    --ink-3: #3d4f6a;
    --ink-muted: #7e8fa8;
    --ink-faint: #b4c1d4;

    --canvas: #eef1f6;
    --surface: #ffffff;
    --surface-alt: #f6f8fb;
    --surface-sunken: #edf1f7;
    --surface-glass: rgba(255, 255, 255, 0.74);

    --border: #dce3ed;
    --border-strong: #bfc9d9;
    --border-focus: #5b8af5;

    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-soft: rgba(37, 99, 235, 0.08);
    --accent-2: #0891b2;
    --accent-2-soft: rgba(8, 145, 178, 0.08);

    --positive: #0d9668;
    --positive-soft: rgba(13, 150, 104, 0.08);
    --warning: #ca8a04;
    --warning-soft: rgba(202, 138, 4, 0.08);
    --negative: #dc2626;
    --negative-soft: rgba(220, 38, 38, 0.08);

    --font-body: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --font-mono: "SF Mono", "Cascadia Code", ui-monospace, "Menlo", monospace;

    --text-xs: 0.6875rem;
    --text-sm: 0.8125rem;
    --text-base: 0.875rem;
    --text-lg: 1rem;
    --text-xl: 1.125rem;
    --text-2xl: 1.375rem;
    --text-3xl: 1.75rem;
    --text-4xl: 2.1rem;

    --leading-tight: 1.35;
    --leading-base: 1.6;
    --leading-loose: 1.75;

    --radius: 4px;
    --radius-lg: 7px;
    --radius-pill: 999px;

    --shadow-xs: 0 1px 2px rgba(12, 18, 34, 0.04);
    --shadow-sm: 0 1px 4px rgba(12, 18, 34, 0.06);
    --shadow: 0 2px 6px rgba(12, 18, 34, 0.06);
    --shadow-lg: 0 4px 16px rgba(12, 18, 34, 0.08);

    --content-max: 1280px;
    --sidebar-w: 260px;
    --footer-h: 0px;
    --page-footer-gap: clamp(48px, 5vw, 72px);

    --df-screen-height: 100vh;
    --df-header-total: 0px;
    --df-footer-total: 0px;
    --df-workspace-height: 100vh;

    color-scheme: light;
}


/* Wiki reading layout: keep long-form content wide on medium desktops. */
@media (min-width: 1101px) and (max-width: 1400px) {
    body.theme-light[data-theme-area="frontend"].route-wiki-show .doc-index.wiki-doc-layout {
        grid-template-columns: minmax(0, 1fr) minmax(240px, 280px) !important;
    }

    body.theme-light[data-theme-area="frontend"].route-wiki-show .wiki-doc-layout > .wiki-doc-main {
        grid-column: 1 !important;
        grid-row: 1 !important;
    }

    body.theme-light[data-theme-area="frontend"].route-wiki-show .wiki-doc-layout > .wiki-doc-outline-rail {
        grid-column: 2 !important;
        grid-row: 1 !important;
    }

    body.theme-light[data-theme-area="frontend"].route-wiki-show .wiki-doc-layout > .wiki-doc-meta-rail {
        position: static !important;
        grid-column: 1 / -1 !important;
        grid-row: 2 !important;
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        width: 100%;
        max-width: 100%;
        max-height: none !important;
        overflow: visible !important;
    }
}

@media (min-width: 769px) and (max-width: 1100px) {
    body.theme-light[data-theme-area="frontend"].route-wiki-show .doc-index.wiki-doc-layout {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    body.theme-light[data-theme-area="frontend"].route-wiki-show .wiki-doc-layout > .wiki-doc-main,
    body.theme-light[data-theme-area="frontend"].route-wiki-show .wiki-doc-layout > .wiki-doc-outline-rail,
    body.theme-light[data-theme-area="frontend"].route-wiki-show .wiki-doc-layout > .wiki-doc-meta-rail {
        grid-column: 1 !important;
        grid-row: auto !important;
        width: 100%;
        max-width: 100%;
    }

    body.theme-light[data-theme-area="frontend"].route-wiki-show .wiki-doc-layout > .wiki-doc-main { order: 1; }
    body.theme-light[data-theme-area="frontend"].route-wiki-show .wiki-doc-layout > .wiki-doc-outline-rail { order: 2; }
    body.theme-light[data-theme-area="frontend"].route-wiki-show .wiki-doc-layout > .wiki-doc-meta-rail {
        position: static !important;
        order: 3;
        max-height: none !important;
        overflow: visible !important;
    }
}

/* RC3 detail polish: challenge list depth, contest spacing, clear avatar cropper. */
body.theme-light[data-theme-area="frontend"] .package-archive,
body.theme-light[data-theme-area="frontend"] .rect-challenge-list,
body.theme-light[data-theme-area="frontend"] .df-competition-archive {
    padding: 10px !important;
    border: 1px solid rgba(148, 163, 184, 0.22) !important;
    border-radius: 10px !important;
    background: rgba(248, 250, 252, 0.84) !important;
}

body.theme-light[data-theme-area="frontend"] .package-line,
body.theme-light[data-theme-area="frontend"] .rect-challenge-list .df-list-row {
    border: 1px solid rgba(148, 163, 184, 0.16) !important;
    background: rgba(255, 255, 255, 0.94) !important;
}

body.theme-light[data-theme-area="frontend"] .package-line + .package-line,
body.theme-light[data-theme-area="frontend"] .rect-challenge-list .df-list-row + .df-list-row {
    margin-top: 8px !important;
}

body.theme-light[data-theme-area="frontend"] .contests-rect-page .df-list-row,
body.theme-light[data-theme-area="frontend"] .contest-list-row,
body.theme-light[data-theme-area="frontend"] .contest-row {
    padding-right: 18px !important;
}

body.theme-light[data-theme-area="frontend"] .df-list-action,
body.theme-light[data-theme-area="frontend"] .contest-list-row .df-list-action,
body.theme-light[data-theme-area="frontend"] .contest-row .df-list-action {
    padding-inline-end: 8px !important;
    align-self: center !important;
}

body.theme-light[data-theme-area="frontend"] .df-status,
body.theme-light[data-theme-area="frontend"] .chip,
body.theme-light[data-theme-area="frontend"] .contest-detail-page .df-meta span,
body.theme-light[data-theme-area="frontend"] .contests-rect-page .df-meta span,
body.theme-light[data-theme-area="frontend"] .contest-detail-page .contest-status-card strong {
    white-space: nowrap !important;
}

body.theme-light[data-theme-area="frontend"] #cropperModal.cropper-modal {
    background: rgba(15, 23, 42, 0.46) !important;
    opacity: 1 !important;
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

body.theme-light[data-theme-area="frontend"] .cropper-dialog,
body.theme-light[data-theme-area="frontend"] .cropper-dialog * {
    opacity: 1 !important;
    filter: none !important;
    mix-blend-mode: normal !important;
}

body.theme-light[data-theme-area="frontend"] .cropper-canvas-wrap,
body.theme-light[data-theme-area="frontend"] .cropper-preview-box {
    background: #f8fafc !important;
}

body.theme-light[data-theme-area="frontend"] .cropper-container .cropper-modal {
    background: rgba(15, 23, 42, 0.18) !important;
    opacity: 1 !important;
}

body.theme-light[data-theme-area="frontend"] .cropper-face {
    opacity: 0 !important;
}

@media (max-width: 767.98px) {
    body.theme-light[data-theme-area="frontend"] .df-list-action,
    body.theme-light[data-theme-area="frontend"] .contest-list-row .df-list-action,
    body.theme-light[data-theme-area="frontend"] .contest-row .df-list-action {
        width: 100% !important;
        padding-inline-end: 0 !important;
    }

    body.theme-light[data-theme-area="frontend"] .df-list-action .df-button,
    body.theme-light[data-theme-area="frontend"] .contest-list-row .df-list-action .df-button {
        width: 100% !important;
        justify-content: center !important;
    }
}

body.theme-light[data-theme-area="frontend"] .writeups-rect-page .writeup-card,
body.theme-light[data-theme-area="frontend"] .writeups-rect-page .writeup-card-body,
body.theme-light[data-theme-area="frontend"] .writeups-rect-page .writeup-card-copy,
body.theme-light[data-theme-area="frontend"] .writeups-rect-page .catalog-head,
body.theme-light[data-theme-area="frontend"] .writeups-rect-page .writeup-card-meta {
    min-width: 0;
    max-width: 100%;
}

body.theme-light[data-theme-area="frontend"] .writeups-rect-page .catalog-head .chip {
    width: auto;
    max-width: 100%;
    min-width: 0;
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
}

body.theme-light[data-theme-area="frontend"] .df-typewriter-word-row,
body.theme-light[data-theme-area="frontend"] .df-typewriter-word-live,
body.theme-light[data-theme-area="frontend"] .df-typewriter-word,
body.theme-light[data-theme-area="frontend"] .df-typewriter-word-ghost {
    max-width: 100%;
    min-width: 0;
}

body.theme-light[data-theme-area="frontend"] .df-typewriter-word-ghost {
    display: block;
    width: 100%;
    overflow: hidden;
}

body.theme-light[data-theme-area="frontend"] .df-typewriter-word-live,
body.theme-light[data-theme-area="frontend"] .df-typewriter-word {
    overflow: hidden;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-base);
    color: var(--ink);
    background: transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

img, svg, video { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
strong, b { font-weight: 600; }
ul, ol { list-style: none; }
table { border-collapse: collapse; width: 100%; }
button { cursor: pointer; font: inherit; }
input, select, textarea, button { font: inherit; color: inherit; }
fieldset { border: none; }

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: var(--leading-tight);
    color: var(--ink);
}

/* --- App Shell --------------------------------------------------- */
.dfb-shell {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: var(--df-screen-height, 100vh);
    position: relative;
}

.dfb-shell-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
    background: var(--canvas);
}

.dfb-shell-bg::before {
    content: "";
    position: absolute;
    width: 600px; height: 600px;
    top: -120px; left: -160px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.10) 0%, transparent 70%);
    filter: blur(80px);
    animation: blob-drift-1 18s ease-in-out infinite alternate;
}

.dfb-shell-bg::after {
    content: "";
    position: absolute;
    width: 520px; height: 520px;
    bottom: -80px; right: -120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(8, 145, 178, 0.08) 0%, transparent 70%);
    filter: blur(80px);
    animation: blob-drift-2 22s ease-in-out infinite alternate;
}

@keyframes blob-drift-1 {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(60px, 40px) scale(1.08); }
    100% { transform: translate(-30px, 80px) scale(0.95); }
}

@keyframes blob-drift-2 {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-50px, -30px) scale(1.1); }
    100% { transform: translate(40px, -60px) scale(0.92); }
}

.dfb-grid-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(12, 18, 34, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(12, 18, 34, 0.02) 1px, transparent 1px);
    background-size: 64px 64px;
}

.dfb-particles { position: absolute; inset: 0; pointer-events: none; }
.dfb-particle-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* --- Header ------------------------------------------------------ */
.dfb-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--surface-glass);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    border-bottom: 1px solid var(--border);
}

.dfb-header-inner {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--sp-6);
    display: flex;
    align-items: center;
    height: 52px;
    gap: var(--sp-4);
}

.dfb-brand {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    text-decoration: none;
    color: var(--ink);
    flex-shrink: 0;
}

.dfb-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: var(--text-xs);
    border-radius: var(--radius);
    letter-spacing: 0.02em;
}

.dfb-brand-logo {
    width: 28px; height: 28px;
    border-radius: var(--radius);
    object-fit: contain;
}

.dfb-brand-image-fallback {
    display: none;
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    border: 1px solid rgba(37, 99, 235, 0.28);
    background: rgba(239, 246, 255, 0.92);
    color: #1d4ed8;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
}

.dfb-brand-image-fallback.is-visible {
    display: flex;
}

.dfb-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.dfb-brand-text strong {
    font-size: var(--text-sm);
    font-weight: 700;
    letter-spacing: 0.01em;
}

.dfb-brand-text span {
    font-size: var(--text-xs);
    color: var(--ink-muted);
}

.dfb-nav {
    display: flex;
    align-items: center;
    gap: var(--sp-1);
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
}

.dfb-nav::-webkit-scrollbar { display: none; }

.dfb-nav-link {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--ink-3);
    padding: var(--sp-2) var(--sp-3);
    border-radius: var(--radius);
    white-space: nowrap;
    text-decoration: none;
}

.dfb-nav-link:hover { color: var(--ink); background: var(--accent-soft); }
.dfb-nav-link.is-active { color: var(--accent); background: var(--accent-soft); }

.dfb-header-actions {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    flex-shrink: 0;
    margin-left: auto;
}

.dfb-mobile-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: transparent;
    color: var(--ink-3);
    margin-left: auto;
}

.dfb-mobile-toggle span {
    display: block;
    width: 18px; height: 2px;
    background: currentColor;
    position: relative;
    transition: background-color .16s ease, transform .16s ease;
}

.dfb-mobile-toggle span::before,
.dfb-mobile-toggle span::after {
    content: "";
    position: absolute;
    width: 100%; height: 100%;
    background: inherit;
    left: 0;
    transition: top .16s ease, transform .16s ease, background-color .16s ease;
}

.dfb-mobile-toggle span::before { top: -6px; }
.dfb-mobile-toggle span::after { top: 6px; }

/* --- Footer ------------------------------------------------------ */
.dfb-footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border);
    background:
        linear-gradient(180deg, rgba(255,255,255,.86), rgba(245,248,252,.96)),
        linear-gradient(120deg, rgba(37, 99, 235, .03), rgba(8, 145, 178, .03));
    padding: var(--sp-6) var(--sp-6) var(--sp-4);
    color: var(--ink-muted);
}

.dfb-footer-inner {
    max-width: var(--content-max);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(180px, .8fr) minmax(260px, .95fr) minmax(220px, .8fr);
    gap: var(--sp-5);
}

.dfb-footer h3 {
    font-size: var(--text-base);
    margin-bottom: var(--sp-3);
}

.dfb-footer-brand,
.dfb-footer-links,
.dfb-footer-support,
.dfb-footer-qrs {
    min-width: 0;
}

.dfb-footer-qrs {
    display: block;
    align-self: start;
}

.dfb-footer-brand-top {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin-bottom: var(--sp-2);
}

.dfb-footer-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.dfb-footer-brand-top h2 {
    font-size: var(--text-lg);
    margin-bottom: 2px;
}

.dfb-footer-brand-top p,
.dfb-footer-description,
.dfb-qr-copy span,
.dfb-footer-bottom,
.dfb-footer-link-grid a {
    font-size: var(--text-sm);
}

.dfb-footer-description {
    color: var(--ink-3);
}

.dfb-footer-link-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px var(--sp-3);
}

.dfb-footer-link-grid a {
    color: var(--ink-3);
}

.dfb-footer-link-grid a:hover {
    color: var(--accent);
}

.dfb-footer-subsection {
    margin-top: var(--sp-5);
    padding-top: var(--sp-4);
    border-top: 1px solid rgba(191, 201, 217, 0.65);
}

.dfb-footer-sponsor {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dfb-footer-sponsor-brand {
    margin-top: var(--sp-4);
}

.dfb-sponsor-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink-2);
    text-decoration: none;
    font-weight: 500;
    line-height: 1.5;
    flex-wrap: wrap;
    font-size: var(--text-xs);
}

.dfb-sponsor-link:hover {
    color: var(--accent);
}

.dfb-sponsor-logo {
    height: 18px;
    width: auto;
    display: block;
}

.dfb-support-list {
    display: grid;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.dfb-support-list li {
    position: relative;
    padding-left: 1rem;
    font-size: var(--text-sm);
    line-height: 1.7;
    color: var(--ink-3);
}

.dfb-support-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.72em;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    transform: translateY(-50%);
}

.dfb-footer-contact-list {
    display: grid;
    gap: 10px;
    margin-top: var(--sp-3);
}

.dfb-footer-contact-card {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.62);
}

.dfb-footer-contact-card strong {
    display: block;
    color: var(--ink);
    font-size: var(--text-sm);
    word-break: break-word;
}

.dfb-footer-label {
    display: block;
    margin-bottom: 4px;
    font-size: var(--text-xs);
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.dfb-footer-support-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    margin-top: var(--sp-3);
}

.dfb-footer-qr-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.dfb-qr-card {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.dfb-qr-media {
    aspect-ratio: 1 / 1;
    width: 100%;
    max-width: 104px;
    border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(180deg, #f8fbff, #edf3f9);
    border: 1px solid rgba(191, 201, 217, 0.7);
}

.dfb-qr-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dfb-footer-image-fallback {
    display: none;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--ink-muted);
}

.dfb-footer-image-fallback.is-visible {
    display: flex;
}

.dfb-footer-logo-fallback {
    width: 52px;
    height: 52px;
    flex: 0 0 auto;
    border-radius: 14px;
    border: 1px solid rgba(191, 201, 217, 0.75);
    background: rgba(255, 255, 255, 0.72);
    padding: 6px;
    font-size: 10px;
    line-height: 1.25;
}

.dfb-footer-partner-logo-fallback {
    min-width: 72px;
    min-height: 26px;
    flex: 0 0 auto;
    border-radius: 8px;
    border: 1px solid rgba(191, 201, 217, 0.72);
    background: rgba(255, 255, 255, 0.78);
    padding: 4px 6px;
    font-size: 10px;
    line-height: 1.2;
}

.dfb-record-icon-fallback {
    min-width: 78px;
    min-height: 24px;
    border-radius: 999px;
    border: 1px solid rgba(191, 201, 217, 0.72);
    background: rgba(255, 255, 255, 0.78);
    padding: 3px 7px;
    font-size: 10px;
    line-height: 1.2;
}

.dfb-public-image-fallback {
    display: none;
    width: 100%;
    min-width: 0;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border: 1px dashed rgba(88, 102, 126, 0.5);
    background: linear-gradient(135deg, rgba(242, 247, 252, 0.96), rgba(231, 240, 249, 0.96));
    color: #4b5c78;
    text-align: center;
    font-size: var(--text-sm);
    font-weight: 800;
    line-height: 1.35;
}

.dfb-public-image-fallback.is-visible {
    display: flex;
}

.dfb-public-image-fallback--tile {
    height: 100%;
    min-height: 100%;
}

.dfb-public-image-fallback--hero {
    aspect-ratio: 16 / 9;
}

.dfb-public-image-fallback--avatar-lg,
.dfb-public-image-fallback--avatar-md,
.dfb-public-image-fallback--avatar-top,
.dfb-public-image-fallback--avatar-list,
.dfb-public-image-fallback--avatar-sm,
.dfb-public-image-fallback--badge-lg,
.dfb-public-image-fallback--badge-md,
.dfb-public-image-fallback--badge-sm {
    flex: 0 0 auto;
    padding: 4px;
    font-size: 10px;
    line-height: 1.15;
}

.dfb-public-image-fallback--avatar-lg,
.dfb-public-image-fallback--avatar-md,
.dfb-public-image-fallback--avatar-top,
.dfb-public-image-fallback--avatar-list,
.dfb-public-image-fallback--avatar-sm {
    border-radius: 999px;
}

.dfb-public-image-fallback--avatar-lg {
    width: 88px;
    height: 88px;
    min-height: 88px;
}

.dfb-public-image-fallback--avatar-md {
    width: 72px;
    height: 72px;
    min-height: 72px;
}

.dfb-public-image-fallback--avatar-top {
    width: 54px;
    height: 54px;
    min-height: 54px;
}

.dfb-public-image-fallback--avatar-list {
    width: 44px;
    height: 44px;
    min-height: 44px;
}

.dfb-public-image-fallback--avatar-sm {
    width: 34px;
    height: 34px;
    min-height: 34px;
}

.dfb-public-image-fallback--badge-lg {
    width: 64px;
    height: 64px;
    min-height: 64px;
    border-radius: 14px;
}

.dfb-public-image-fallback--badge-md {
    width: 48px;
    height: 48px;
    min-height: 48px;
    border-radius: 12px;
}

.dfb-public-image-fallback--badge-sm {
    width: 28px;
    height: 28px;
    min-height: 28px;
    border-radius: 8px;
}

.dfb-qr-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-2);
    font-size: var(--text-xs);
    color: var(--ink-muted);
    text-align: center;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(240, 245, 252, 0.96));
}

.dfb-qr-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dfb-qr-copy strong {
    font-size: var(--text-sm);
    color: var(--ink);
}

.dfb-footer-bottom {
    max-width: var(--content-max);
    margin: var(--sp-4) auto 0;
    padding-top: var(--sp-3);
    border-top: 1px solid rgba(191, 201, 217, 0.7);
    display: grid;
    gap: var(--sp-2);
    font-size: var(--text-xs);
}

.dfb-footer-bottom-main {
    display: flex;
    justify-content: flex-start;
    gap: var(--sp-3);
    flex-wrap: wrap;
}

.dfb-footer-bottom-main span {
    position: relative;
}

.dfb-footer-bottom-main span + span {
    padding-left: var(--sp-3);
}

.dfb-footer-bottom-main span + span::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: rgba(126, 143, 168, 0.9);
    transform: translateY(-50%);
}

.dfb-footer-records {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--sp-3);
}

.dfb-record-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
    text-decoration: none;
}

.dfb-record-copy {
    min-width: 0;
    color: var(--ink-2);
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.dfb-footer-records > * + * {
    padding-left: 0;
}

.dfb-footer-records > * + *::before {
    display: none;
}

.dfb-beian-link img {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.dfb-record-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
    padding: 0.25rem 0.7rem;
    border: 1px solid rgba(191, 201, 217, 0.8);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.72);
    color: var(--ink-3);
}

.dfb-record-label {
    color: var(--ink-muted);
    letter-spacing: 0.05em;
}

.dfb-record-text,
.dfb-record-link,
.dfb-beian-link span:last-child {
    color: var(--ink-2);
    font-weight: 500;
}

.dfb-record-link:hover,
.dfb-beian-link:hover {
    color: var(--accent);
}

.dfb-record-text-muted {
    color: var(--ink-muted);
    font-weight: 400;
}

.dfb-beian-link img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
}

/* --- Flash Toast ------------------------------------------------- */
.df26-flash-stack {
    position: sticky;
    top: 68px;
    z-index: 80;
    display: grid;
    gap: var(--sp-2);
    padding-top: var(--sp-4);
}

.df26-flash-toast.notice-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    border: 1px solid var(--border);
    border-left-width: 3px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow-sm);
    color: var(--ink-2);
}

.df26-flash-toast.notice-bar.success {
    border-left-color: var(--positive);
}

.df26-flash-toast.notice-bar.danger {
    border-left-color: var(--negative);
}

.df26-flash-copy {
    flex: 1;
    min-width: 0;
    color: var(--ink-2);
}

.df26-flash-copy strong {
    color: var(--ink);
}

.df26-flash-close {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(191, 201, 217, 0.8);
    border-radius: 999px;
    background: rgba(246, 248, 251, 0.98);
    color: var(--ink-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
}

.df26-flash-close:hover {
    color: var(--ink);
    border-color: var(--border-strong);
}

/* --- Page Container ---------------------------------------------- */
.dfb-page {
    position: relative;
    z-index: 1;
    flex: 1;
}

.dfb-container {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--sp-6);
    width: 100%;
}

/* --- Buttons ----------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    padding: 0.48rem 0.82rem;
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: 1.4;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    outline: none;
}

.btn:focus-visible {
    box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--border-focus);
}

.btn:disabled, .btn.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }

.btn-outline {
    background: transparent;
    color: var(--accent);
    border-color: var(--border-strong);
}

.btn-outline:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.btn-ghost {
    background: transparent;
    color: var(--ink-3);
    border-color: transparent;
}

.btn-ghost:hover { background: var(--surface-sunken); color: var(--ink); }

.btn-sm { padding: var(--sp-1) var(--sp-3); font-size: var(--text-xs); }
.btn-lg { padding: var(--sp-3) var(--sp-6); font-size: var(--text-lg); }
.btn-block { width: 100%; }

/* --- Form Controls ----------------------------------------------- */
.field { display: flex; flex-direction: column; gap: var(--sp-1); }

.field-label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--ink-3);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.input, .select, .textarea {
    width: 100%;
    padding: var(--sp-2) var(--sp-3);
    font-size: var(--text-base);
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    outline: none;
}

.input:focus, .select:focus, .textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.input.is-invalid, .select.is-invalid, .textarea.is-invalid {
    border-color: var(--negative);
}

.input.is-invalid:focus, .select.is-invalid:focus, .textarea.is-invalid:focus {
    box-shadow: 0 0 0 3px var(--negative-soft);
}

.textarea { resize: vertical; min-height: 80px; }

.select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' stroke='%2394a3b8' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}

.field-error {
    font-size: var(--text-xs);
    color: var(--negative);
}

.check-row {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--text-sm);
    cursor: pointer;
}

.check-row input[type="checkbox"],
.check-row input[type="radio"] {
    width: 16px; height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

.auth-legal-consent {
    display: grid;
    gap: 8px;
}

.auth-legal-consent-label {
    align-items: flex-start;
    line-height: 1.6;
    color: var(--ink-subtle);
}

.auth-legal-consent-label span {
    display: inline;
}

.auth-legal-consent-label a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-legal-consent-label a:hover {
    color: var(--ink);
}

/* Bootstrap compatibility aliases */
.form-control,
.form-select {
    width: 100%;
    padding: var(--sp-2) var(--sp-3);
    font-size: var(--text-base);
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    outline: none;
}

.form-control:focus, .form-select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' stroke='%2394a3b8' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}

.form-label {
    display: block;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--ink-3);
    margin-bottom: var(--sp-1);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.form-check {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

.form-check-input {
    width: 16px; height: 16px;
    accent-color: var(--accent);
}

.form-check-label { font-size: var(--text-sm); }

.is-invalid { border-color: var(--negative) !important; }
.invalid-feedback { font-size: var(--text-xs); color: var(--negative); margin-top: var(--sp-1); }

/* --- Tags / Chips ------------------------------------------------ */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 1px var(--sp-2);
    font-size: var(--text-xs);
    font-weight: 500;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    color: var(--ink-3);
    background: var(--surface);
    line-height: 1.5;
    white-space: nowrap;
}

.tag.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.tag.positive { background: var(--positive-soft); color: var(--positive); border-color: transparent; }
.tag.warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.tag.negative { background: var(--negative-soft); color: var(--negative); border-color: transparent; }

/* Legacy chip alias */
.chip,
[class^="status-chip-"],
[class*=" status-chip-"] {
    display: inline-flex;
    align-items: center;
    padding: 1px var(--sp-2);
    font-size: var(--text-xs);
    font-weight: 500;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    color: var(--ink-3);
    background: var(--surface);
    line-height: 1.5;
    white-space: nowrap;
}

.chip.muted { color: var(--ink-muted); }
.chip.success { background: var(--positive-soft); color: var(--positive); border-color: transparent; }
.chip.warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.chip.danger { background: var(--negative-soft); color: var(--negative); border-color: transparent; }

/* --- Notice / Alert ---------------------------------------------- */
.notice {
    padding: var(--sp-3) var(--sp-4);
    font-size: var(--text-sm);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink-2);
}

.notice.info { border-left: 3px solid var(--accent); background: var(--accent-soft); }
.notice.success { border-left: 3px solid var(--positive); background: var(--positive-soft); }
.notice.warning { border-left: 3px solid var(--warning); background: var(--warning-soft); }
.notice.danger { border-left: 3px solid var(--negative); background: var(--negative-soft); }

/* Legacy notice-bar alias */
.notice-bar {
    padding: var(--sp-3) var(--sp-4);
    font-size: var(--text-sm);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink-2);
}

.notice-bar.info { border-left: 3px solid var(--accent); background: var(--accent-soft); }
.notice-bar.success { border-left: 3px solid var(--positive); background: var(--positive-soft); }
.notice-bar.warning { border-left: 3px solid var(--warning); background: var(--warning-soft); }
.notice-bar.danger { border-left: 3px solid var(--negative); background: var(--negative-soft); }

/* --- Progress ---------------------------------------------------- */
.progress {
    width: 100%;
    height: 6px;
    background: var(--surface-sunken);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    border-radius: var(--radius-pill);
    transition: width 0.4s ease;
}

/* --- Card / Surface ---------------------------------------------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card-body { padding: var(--sp-5); }

.surface {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--sp-6);
}

.surface-alt {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--sp-6);
}

.surface-muted {
    background: var(--surface-sunken);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--sp-6);
}

.surface-plain {
    padding: var(--sp-5);
}

.surface-pad { padding: var(--sp-5); }
.surface-pad-lg { padding: var(--sp-6); }
.compact-surface { padding: var(--sp-4); }

/* --- White Home Variant ----------------------------------------- */

/* --- Table ------------------------------------------------------- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.data-table th {
    font-weight: 600;
    color: var(--ink-3);
    text-align: left;
    padding: var(--sp-2) var(--sp-3);
    border-bottom: 2px solid var(--border);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.data-table td {
    padding: var(--sp-3);
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--surface-alt); }

.data-table .text-end { text-align: right; }
.data-table .fw-semibold { font-weight: 600; }
.data-table .summary { font-size: var(--text-xs); color: var(--ink-muted); }

/* admin-table alias */
.admin-table,
table.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.admin-table th {
    font-weight: 600;
    color: var(--ink-3);
    text-align: left;
    padding: var(--sp-2) var(--sp-3);
    border-bottom: 2px solid var(--border);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.admin-table td {
    padding: var(--sp-3);
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: var(--surface-alt); }
.admin-table .summary { font-size: var(--text-xs); color: var(--ink-muted); }

.table-responsive { overflow-x: auto; }

/* --- Typography & Prose ------------------------------------------ */
.prose {
    font-size: var(--text-base);
    line-height: var(--leading-loose);
    color: var(--ink-2);
}

.prose h1 { font-size: var(--text-3xl); margin: var(--sp-10) 0 var(--sp-4); }
.prose h2 { font-size: var(--text-2xl); margin: var(--sp-8) 0 var(--sp-3); }
.prose h3 { font-size: var(--text-xl); margin: var(--sp-6) 0 var(--sp-3); }
.prose h4 { font-size: var(--text-lg); margin: var(--sp-5) 0 var(--sp-2); }
.prose p { margin-bottom: var(--sp-4); }
.prose ul, .prose ol { padding-left: var(--sp-5); margin-bottom: var(--sp-4); }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: var(--sp-1); }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.prose blockquote {
    border-left: 3px solid var(--accent);
    padding: var(--sp-3) var(--sp-4);
    margin: var(--sp-4) 0;
    background: var(--accent-soft);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.prose code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    padding: 1px 5px;
    background: var(--surface-sunken);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow-wrap: anywhere;
    max-width: 100%;
}

.prose pre {
    padding: var(--sp-4);
    background: var(--ink);
    color: var(--ink-faint);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    margin: var(--sp-4) 0;
    font-size: var(--text-sm);
}

.prose pre code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
}

.prose img {
    border-radius: var(--radius-lg);
    margin: var(--sp-4) 0;
}

.prose table {
    width: 100%;
    margin: var(--sp-4) 0;
    border-collapse: collapse;
}

.prose th, .prose td {
    padding: var(--sp-2) var(--sp-3);
    border: 1px solid var(--border);
    text-align: left;
}

.prose th { background: var(--surface-alt); font-weight: 600; }

.compact-prose { font-size: var(--text-sm); }
.compact-prose h1 { font-size: var(--text-xl); }
.compact-prose h2 { font-size: var(--text-lg); }
.compact-prose h3 { font-size: var(--text-base); }

/* --- Page Head --------------------------------------------------- */
.pg-head {
    padding: var(--sp-8) 0 var(--sp-6);
}

.pg-kicker {
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--sp-2);
}

.pg-title {
    font-size: var(--text-3xl);
    font-weight: 700;
    margin-bottom: var(--sp-2);
    letter-spacing: -0.01em;
}

.pg-lead {
    font-size: var(--text-lg);
    color: var(--ink-3);
    max-width: 640px;
}

.pg-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
    margin-top: var(--sp-3);
    font-size: var(--text-sm);
    color: var(--ink-muted);
}

.pg-meta span::before {
    content: "·";
    margin-right: var(--sp-3);
    color: var(--ink-faint);
}

.pg-meta span:first-child::before { content: none; }

.pg-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    margin-top: var(--sp-3);
}

/* Legacy aliases */
.page-head,
header.page-head {
    padding: var(--sp-8) 0 var(--sp-6);
}

.page-head-compact,
header.page-head-compact {
    padding: var(--sp-6) 0 var(--sp-4);
}

.section-kicker {
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--sp-2);
}

.page-title {
    font-size: var(--text-3xl);
    font-weight: 700;
    margin-bottom: var(--sp-2);
    letter-spacing: -0.01em;
}

.page-lead {
    font-size: var(--text-lg);
    color: var(--ink-3);
    max-width: 640px;
}

.page-head-compact .page-lead {
    font-size: var(--text-base);
    max-width: 40rem;
}

.page-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
    margin-top: var(--sp-3);
    font-size: var(--text-sm);
    color: var(--ink-muted);
}

.page-meta span::before {
    content: "·";
    margin-right: var(--sp-3);
    color: var(--ink-faint);
}

.page-meta span:first-child::before { content: none; }

/* --- Breadcrumb -------------------------------------------------- */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--text-sm);
    color: var(--ink-muted);
    padding: var(--sp-4) 0 0;
}

.breadcrumbs a { color: var(--ink-3); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs strong { color: var(--ink); font-weight: 500; }

/* Legacy alias */
.breadcrumb-trail {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--text-sm);
    color: var(--ink-muted);
    padding: var(--sp-4) 0 0;
}

.breadcrumb-trail a { color: var(--ink-3); }
.breadcrumb-trail a:hover { color: var(--accent); }
.breadcrumb-trail strong { color: var(--ink); font-weight: 500; }

/* --- Section Stack ----------------------------------------------- */
.section-stack { display: flex; flex-direction: column; gap: var(--sp-6); }
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--sp-4);
    margin-bottom: var(--sp-4);
}

.section-title {
    font-size: var(--text-xl);
    font-weight: 600;
}

.section-summary {
    font-size: var(--text-sm);
    color: var(--ink-muted);
    margin-top: var(--sp-1);
}

.section-link {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    min-height: 2rem;
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: 1.35;
    color: var(--accent);
    overflow-wrap: anywhere;
    vertical-align: middle;
    white-space: normal;
    word-break: break-word;
}

.section-link:hover { color: var(--accent-hover); }

.catalog-title-link,
.card-title-link {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    min-height: 2rem;
    color: inherit;
    line-height: 1.35;
    overflow-wrap: anywhere;
    text-decoration: none;
    transition: color 0.18s ease;
    vertical-align: middle;
    word-break: break-word;
}

.catalog-title-link:hover,
.card-title-link:hover {
    color: var(--accent);
}

/* --- Catalog / List ---------------------------------------------- */
.catalog { display: flex; flex-direction: column; }

.catalog-line {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--sp-5);
    padding: var(--sp-4) 0;
    border-bottom: 1px solid var(--border);
}

.catalog-compact .catalog-line {
    gap: var(--sp-4);
    padding: var(--sp-3) 0;
}

.catalog-compact .catalog-title {
    font-size: var(--text-base);
}

.catalog-compact .catalog-summary {
    font-size: var(--text-sm);
}

.catalog-compact .catalog-side strong {
    font-size: var(--text-xl);
}

.catalog-line:last-child { border-bottom: none; }

.catalog-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2);
    margin-bottom: var(--sp-2);
}

.catalog-title {
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: var(--sp-1);
}

.catalog-summary {
    font-size: var(--text-sm);
    color: var(--ink-3);
}

.catalog-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
    font-size: var(--text-xs);
    color: var(--ink-muted);
    margin-top: var(--sp-1);
}

.catalog-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--sp-1);
    font-size: var(--text-sm);
    color: var(--ink-muted);
    text-align: right;
    flex-shrink: 0;
    min-width: 90px;
}

.catalog-side strong {
    font-size: var(--text-2xl);
    font-family: var(--font-mono);
    color: var(--ink);
}

.catalog-side-note {
    font-size: var(--text-xs);
    color: var(--ink-muted);
}

.catalog-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-1);
    margin-top: var(--sp-2);
}

.catalog-actions {
    display: flex;
    gap: var(--sp-2);
    margin-top: var(--sp-3);
}

.download-fetch-form {
    display: contents;
}

/* --- Two-column content shell ------------------------------------ */
.content-shell {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--sp-6);
    align-items: start;
}

.writeup-shell {
    grid-template-columns: minmax(0, 1.45fr) 280px;
}

.doc-index {
    display: grid;
    grid-template-columns: minmax(250px, 290px) minmax(0, 1fr);
    gap: var(--sp-6);
    align-items: start;
}

.aside-stack {
    display: flex;
    flex-direction: column;
    gap: var(--sp-5);
    position: sticky;
    top: 72px;
    align-self: start;
    max-height: calc(100vh - 88px);
    overflow-y: auto;
    scrollbar-width: thin;
}

/* --- Doc Index (wiki) -------------------------------------------- */
.doc-index.wiki-doc-layout {
    display: grid;
    grid-template-columns: minmax(240px, 280px) minmax(0, 1fr) minmax(260px, 300px);
    gap: var(--sp-6);
    align-items: start;
}

.doc-index.wiki-doc-layout > .wiki-doc-main {
    grid-column: 2;
    grid-row: 1;
    max-width: none;
}

.wiki-doc-outline-rail,
.wiki-doc-meta-rail {
    position: sticky;
    top: 72px;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
}

.wiki-doc-outline-rail {
    grid-column: 3;
    grid-row: 1;
    max-height: calc(100vh - 88px);
    overflow-y: auto;
    scrollbar-width: thin;
}

.wiki-doc-meta-rail {
    grid-column: 1;
    grid-row: 1;
}

@media (max-width: 1280px) {
    .doc-index.wiki-doc-layout {
        grid-template-columns: minmax(220px, 250px) minmax(0, 1fr) minmax(240px, 280px);
    }
}
.doc-meta-card {
    border-radius: var(--radius-lg);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}
.doc-meta-list {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    font-size: var(--text-sm);
}
.doc-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--sp-3);
}
.doc-meta-row-top {
    align-items: flex-start;
}
.doc-meta-key {
    color: var(--ink-muted);
}
.doc-category-list {
    justify-content: flex-end;
    row-gap: var(--sp-1);
}
.doc-source-link {
    font-weight: 500;
    max-width: 12rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.doc-meta-badge {
    font-size: var(--text-xs);
}
.doc-outline-panel {
    margin-bottom: 0;
}

.doc-rail {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
    position: sticky;
    top: 72px;
    align-self: start;
    max-height: calc(100vh - 88px);
    overflow-y: auto;
    scrollbar-width: thin;
}

.compact-doc-rail {
    gap: var(--sp-3);
}

.doc-rail h3,
.wiki-doc-outline-rail h3,
.wiki-doc-meta-rail h3 {
    font-size: var(--text-lg);
    font-weight: 600;
}

.doc-rail p,
.wiki-doc-outline-rail p,
.wiki-doc-meta-rail p {
    font-size: var(--text-sm);
    color: var(--ink-muted);
}

/* --- Content Outline --------------------------------------------- */
.content-outline {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
    text-align: left;
    min-width: 0;
}

.content-outline-link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    max-width: 100%;
    padding: 9px var(--sp-3);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--ink-muted);
    border-left: 2px solid transparent;
    border-radius: var(--radius);
    text-decoration: none;
    line-height: 1.45;
    text-align: left;
    overflow: hidden;
}

.content-outline-link:hover { color: var(--ink); background: var(--surface-alt); }
.content-outline-link.is-active { color: var(--accent); border-left-color: var(--accent); background: var(--accent-soft); }

.content-outline-link.depth-0 { color: var(--ink); --outline-indent: 0ch; }
.content-outline-link.depth-1 { color: var(--ink); --outline-indent: 2ch; }
.content-outline-link.depth-2,
.content-outline-link.depth-3 { --outline-indent: 3ch; }

.content-outline-text {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    padding-left: var(--outline-indent, 0);
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- Filter / Query Bar ------------------------------------------ */
.filter-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--sp-4) var(--sp-5);
    margin-bottom: var(--sp-5);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--sp-3);
    align-items: end;
}

.filter-actions {
    display: flex;
    gap: var(--sp-2);
    align-items: end;
}

/* Legacy aliases */
.query-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--sp-4) var(--sp-5);
    margin-bottom: var(--sp-5);
}

.compact-query-bar {
    padding: 12px 14px;
    margin-bottom: var(--sp-4);
}

.query-bar-light { background: var(--surface-alt); }

.query-grid, .archive-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--sp-3);
    align-items: end;
}

.query-grid-compact {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.query-control { display: flex; flex-direction: column; gap: var(--sp-1); }

.query-control label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--ink-3);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.compact-query-bar .query-control label {
    letter-spacing: 0.01em;
}

.span-keyword { grid-column: span 2; }
.archive-filter-actions { align-items: end; }

/* --- Hero -------------------------------------------------------- */
.hero {
    position: relative;
    padding: var(--sp-12) 0 var(--sp-8);
    overflow: hidden;
}

.hero-copy {
    max-width: 620px;
    margin-bottom: var(--sp-6);
}

.hero-tag {
    display: inline-flex;
    padding: var(--sp-1) var(--sp-3);
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: var(--radius-pill);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: var(--sp-4);
}

.hero-title {
    font-size: var(--text-4xl);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: var(--sp-3);
}

.hero-lead {
    font-size: var(--text-lg);
    color: var(--ink-3);
    line-height: var(--leading-loose);
}

.hero-entries {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-4);
}

.hero-entry {
    background: var(--surface-glass);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--sp-4);
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

.hero-entry h3 { font-size: var(--text-lg); font-weight: 600; }
.hero-entry p { font-size: var(--text-sm); color: var(--ink-3); flex: 1; }

/* Legacy hero aliases */
/* .df-hero { position: relative; padding: var(--sp-16) 0 var(--sp-12); overflow: hidden; display: grid; grid-template-columns: 1fr auto; gap: var(--sp-8); align-items: center; }
/* .df-hero-copy { max-width: 620px; position: relative; z-index: 1; } */
/* .df-hero-visual { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; } */
/* .df-hero-logo { width: 16rem; max-width: 100%; height: auto; object-fit: contain; filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.08)); } */
.df-hero-tag { display: inline-flex; padding: var(--sp-1) var(--sp-3); font-size: var(--text-xs); font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: var(--radius-pill); letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: var(--sp-4); }
.df-hero-title { font-size: var(--text-4xl); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; margin-bottom: var(--sp-3); }
.df-hero-lead { font-size: var(--text-lg); color: var(--ink-3); line-height: var(--leading-loose); }
/* .df-hero-entries { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); position: relative; z-index: 1; } */
.df-entry { background: var(--surface-glass); backdrop-filter: blur(8px); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-2); }

.df-entry > .chip {
    align-self: flex-start;
    width: fit-content;
}

.df-entry h3 { font-size: var(--text-lg); font-weight: 600; }
.df-entry p { font-size: var(--text-sm); color: var(--ink-3); flex: 1; }
.df-hero-entries {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-4);
    position: relative;
    z-index: 1;
    margin-bottom: var(--sp-6);
}
.df-hero {
    position: relative;
    padding: var(--sp-12) 0 var(--sp-8);
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--sp-6);
    align-items: center;
}

.df-hero-copy {
    max-width: 620px;
    position: relative;
    z-index: 1;
}

.df-hero-visual {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
}

.dfb-home-visual {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--sp-4);
}

.dfb-home-mark {
    width: clamp(420px, 44vw, 760px);
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 18px 30px rgba(37, 99, 235, 0.08));
}

.dfb-home-note {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--sp-2);
}

.dfb-home-note span {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 var(--sp-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.62);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--ink-3);
}

.df-hero-logo-live {
    width: clamp(500px, 42vw, 860px);
    min-height: 220px;
    position: relative;
    isolation: isolate;
    flex-shrink: 0;
    display: flex;
    align-items: stretch;
}

.df-hero-logo-live::before {
    content: "";
    position: absolute;
    inset: 8% 6%;
    pointer-events: none;
    background:
        radial-gradient(circle at 50% 50%, rgba(130, 210, 255, .16), transparent 38%),
        linear-gradient(120deg, rgba(37, 99, 235, .08), rgba(8, 145, 178, .04));
    filter: blur(22px);
    z-index: 0;
}

.df-typewriter-panel {
    width: 100%;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--sp-4) var(--sp-5);
    border-radius: 18px;
    border: 1px solid rgba(155, 172, 197, 0.44);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(245, 248, 252, 0.8)),
        linear-gradient(135deg, rgba(37, 99, 235, 0.04), rgba(8, 145, 178, 0.03));
    box-shadow:
        0 18px 36px rgba(37, 99, 235, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.65);
    overflow: hidden;
}

.df-typewriter-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(37, 99, 235, 0.03) 0, rgba(37, 99, 235, 0.03) 1px, transparent 1px, transparent 72px),
        linear-gradient(rgba(15, 23, 42, 0.025) 0, rgba(15, 23, 42, 0.025) 1px, transparent 1px, transparent 28px);
    opacity: .5;
    pointer-events: none;
}

.df-typewriter-head {
    position: relative;
    z-index: 1;
    display: flex;
    gap: var(--sp-2);
    margin-bottom: var(--sp-5);
}

.df-typewriter-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    box-shadow: 0 0 12px rgba(12, 18, 34, 0.08);
}

.df-typewriter-dot-red { background: #fb7185; }
.df-typewriter-dot-amber { background: #fbbf24; }
.df-typewriter-dot-green { background: #34d399; }

.df-typewriter-code {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--sp-3);
    min-height: 184px;
    font-family: var(--font-mono);
}

.df-typewriter-prompt-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    font-size: var(--text-sm);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.df-typewriter-prompt {
    color: var(--accent-2);
}

.df-typewriter-state {
    color: var(--ink-muted);
}

.df-typewriter-command-row {
    display: block;
}

.df-typewriter-word-row {
    position: relative;
    display: block;
    width: max-content;
    max-width: 100%;
    min-height: 1.4em;
    color: var(--ink);
    white-space: nowrap;
}

.df-typewriter-command {
    font-size: var(--text-base);
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.df-typewriter-word,
.df-typewriter-word-ghost {
    min-width: 1ch;
    font-size: clamp(2.1rem, 5vw, 4.4rem);
    line-height: 1.04;
    font-weight: 700;
    letter-spacing: -0.04em;
    white-space: nowrap;
}

.df-typewriter-word-ghost {
    visibility: hidden;
    display: inline-block;
    pointer-events: none;
}

.df-typewriter-word-live {
    position: absolute;
    top: 0;
    left: 0;
    display: inline-flex;
    align-items: baseline;
    gap: var(--sp-2);
    white-space: nowrap;
}

.df-typewriter-word {
    color: var(--ink);
    text-shadow: 0 0 18px rgba(96, 165, 250, 0.12);
}

.df-typewriter-caret {
    display: inline-block;
    width: 0.7ch;
    height: 0.95em;
    border-radius: 3px;
    background: linear-gradient(180deg, #7dd3fc, #2563eb);
    box-shadow: 0 0 14px rgba(37, 99, 235, 0.24);
    animation: dfTypeCaret 0.95s steps(1) infinite;
}

.df-typewriter-subline {
    font-size: var(--text-sm);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

.df-typewriter-subline-alt {
    font-size: var(--text-base);
    letter-spacing: 0.06em;
    text-transform: none;
    color: var(--ink-3);
}

.df-typewriter-subline-meta {
    font-size: var(--text-sm);
    letter-spacing: 0.08em;
    color: var(--ink-3);
}

@keyframes dfTypeCaret {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* @media (max-width: 980px) {
    .df-hero {
        grid-template-columns: 1fr;
        gap: var(--sp-6);
    }

    .df-hero-visual {
        justify-content: flex-start;
    }

    .df-hero-logo-live {
        width: min(100%, 680px);
    }
} */

@media (max-width: 980px) {
    .df-hero {
        grid-template-columns: 1fr;
        gap: var(--sp-6);
    }

    .df-hero-copy {
        max-width: none;
    }

    .df-hero-visual {
        order: 0;
        justify-content: center;
        margin-bottom: var(--sp-1);
    }

    .dfb-home-visual {
        align-items: center;
    }

    .dfb-home-mark {
        width: min(100%, 460px);
    }

    .dfb-home-note {
        justify-content: center;
    }
}


/* --- Homepage Panels --------------------------------------------- */
.df-panel-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: var(--sp-5);
    margin-bottom: var(--sp-5);
}

.df-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--sp-5);
}

.df-panel-soft {
    background: var(--surface-alt);
}

.df-side-stack { display: flex; flex-direction: column; gap: var(--sp-5); }

/* Homepage content uses independent vertical flows. Do not put the primary
   stream and reading stream in shared grid rows: their content lengths differ. */
.home-content-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(300px, 0.78fr);
    align-items: start;
    gap: var(--sp-6);
}

.home-primary-column,
.home-secondary-column {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: var(--sp-6);
}

.df-hero-entries { align-items: start; }

.df-hero-entries .df-entry {
    min-height: 0;
    padding: 9px 18px;
    gap: 3px;
}

.df-hero-entries .df-entry p { flex: initial; }

/* Home lists are rows inside a section surface, not a second card layer. */
.home-secondary-column .timeline-list,
.home-secondary-column .feature-bands { gap: 0; }

.home-secondary-column .timeline-item,
.home-secondary-column .feature-band {
    padding: var(--sp-4) 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.home-secondary-column .timeline-item + .timeline-item,
.home-secondary-column .feature-band + .feature-band { border-top: 1px solid var(--border); }

/* --- Timeline List ----------------------------------------------- */
.timeline-list { display: flex; flex-direction: column; gap: var(--sp-3); }

.timeline-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--sp-4);
    background: var(--surface);
}

.timeline-item h3 { font-size: var(--text-lg); font-weight: 600; margin-bottom: var(--sp-1); }
.timeline-item p { font-size: var(--text-sm); color: var(--ink-3); }

/* --- Bulletin List ----------------------------------------------- */
.bulletin-list { display: flex; flex-direction: column; gap: var(--sp-4); }

.bulletin-item {
    display: flex;
    gap: var(--sp-4);
    padding: var(--sp-4) 0;
    border-bottom: 1px solid var(--border);
}

.bulletin-item:last-child { border-bottom: none; }

.bulletin-date {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
    font-size: var(--text-xs);
    color: var(--ink-muted);
}

.bulletin-date strong {
    font-size: var(--text-xl);
    font-family: var(--font-mono);
    color: var(--ink);
}

.bulletin-body h3 { font-size: var(--text-lg); font-weight: 600; margin-bottom: var(--sp-1); }
.bulletin-body p { font-size: var(--text-sm); color: var(--ink-3); }

/* --- Feature Band ------------------------------------------------ */
.feature-bands { display: flex; flex-direction: column; gap: var(--sp-4); }

.feature-band {
    padding: var(--sp-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface-alt);
}

.feature-band h3 { font-size: var(--text-base); font-weight: 600; margin-bottom: var(--sp-1); }
.feature-band p { font-size: var(--text-sm); color: var(--ink-3); }

/* --- Package Archive --------------------------------------------- */
.package-archive { display: flex; flex-direction: column; gap: var(--sp-4); }

.package-line {
    display: flex;
    justify-content: space-between;
    gap: var(--sp-6);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--sp-5);
}

.compact-archive .package-line {
    gap: var(--sp-4);
    padding: var(--sp-4);
}

.compact-archive .package-title {
    font-size: var(--text-lg);
}

.compact-archive .package-line-aside {
    min-width: 88px;
}

.package-line-main { flex: 1; min-width: 0; }

.package-title { font-size: var(--text-xl); font-weight: 600; margin-bottom: var(--sp-1); }
.package-summary { font-size: var(--text-sm); color: var(--ink-3); margin-bottom: var(--sp-2); }
.package-facts {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
    font-size: var(--text-xs);
    color: var(--ink-muted);
}

.package-line-aside {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--sp-2);
    flex-shrink: 0;
    min-width: 100px;
}

.package-stat {
    text-align: right;
    font-size: var(--text-xs);
    color: var(--ink-muted);
}

.package-stat strong {
    display: block;
    font-size: var(--text-lg);
    font-family: var(--font-mono);
    color: var(--ink);
}

.package-start-link {
    width: 100%;
    justify-content: center;
    margin-top: 4px;
}

/* --- Competition / Challenge Show (v2 — three-column workspace) -- */

/* Hero */
.comp-hero {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--sp-5) var(--sp-6);
    margin-bottom: var(--sp-5);
}
.comp-hero-chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-2); }
.comp-hero-title { font-size: var(--text-2xl); font-weight: 700; margin-bottom: var(--sp-1); }
.comp-hero-lead { font-size: var(--text-sm); color: var(--ink-3); margin-bottom: var(--sp-2); }
.comp-hero-meta {
    display: flex; flex-wrap: wrap; gap: var(--sp-3);
    font-size: var(--text-xs); color: var(--ink-muted); font-family: var(--font-mono);
}

/* Workspace grid */
.comp-workspace {
    --comp-qnav-cell: 36px;
    --comp-qnav-gap: 3px;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) 320px;
    gap: var(--sp-5);
    align-items: start;
}

/* ── Left Rail ── */
.comp-rail {
    position: sticky;
    top: calc(56px + var(--sp-4));
    max-height: calc(100vh - 56px - var(--sp-4) * 2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.comp-rail-inner {
    display: flex; flex-direction: column; gap: var(--sp-4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--sp-4);
    height: 100%;
    overflow: hidden;
}

.comp-rail-title {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.25s ease;
}
.comp-rail-title.is-visible { max-height: 60px; opacity: 1; }
.comp-rail-title-text {
    font-size: var(--text-sm); font-weight: 600; color: var(--ink);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.comp-rail-stats {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); text-align: center;
    padding-bottom: var(--sp-3); border-bottom: 1px solid var(--border);
}
.comp-rail-stats .stat-val { display: block; font-size: var(--text-lg); font-weight: 700; font-family: var(--font-mono); color: var(--ink); }
.comp-rail-stats .stat-lbl { font-size: 10px; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.06em; }

.comp-rail-nav-window {
    max-height: calc((4 * var(--comp-qnav-cell)) + (3 * var(--comp-qnav-gap)));
    overflow-y: auto;
    padding-right: 2px;
    scrollbar-width: thin;
}

.comp-rail-nav {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--comp-qnav-gap);
}

.qnav-link {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: var(--comp-qnav-cell); min-height: var(--comp-qnav-cell);
    font-size: var(--text-xs); font-weight: 600; font-family: var(--font-mono);
    border-radius: var(--radius); border: 1px solid var(--border);
    background: var(--surface); color: var(--ink-3);
    text-decoration: none; transition: border-color 0.15s, background 0.15s;
}
.qnav-link:hover { border-color: var(--border-strong); background: var(--surface-alt); }
.qnav-link.is-active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.qnav-link.status-unanswered { background: var(--surface); color: var(--ink-muted); }
.qnav-link.status-draft { background: var(--warning-soft); color: var(--warning); border-color: var(--warning); }
.qnav-link.status-incorrect { background: var(--negative-soft); color: var(--negative); border-color: var(--negative); }
.qnav-link.status-correct { background: var(--positive-soft); color: var(--positive); border-color: var(--positive); }
.qnav-link.status-pending_review { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.qnav-link.status-submitted { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

.comp-rail-legend {
    display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3);
    font-size: 10px; color: var(--ink-muted);
}
.comp-rail-legend span { display: inline-flex; align-items: center; gap: 4px; }
.comp-rail-legend .dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot.unanswered { background: var(--ink-faint); }
.dot.draft { background: var(--warning); }
.dot.incorrect { background: var(--negative); }
.dot.correct { background: var(--positive); }

.comp-rail-progress { padding-top: var(--sp-3); border-top: 1px solid var(--border); }

.rail-info-block { padding-top: var(--sp-3); border-top: 1px solid var(--border); }
.rail-info-block .section-kicker { margin-bottom: var(--sp-2); }
.rail-facts { display: flex; flex-direction: column; gap: 2px; font-size: var(--text-xs); }
.rail-facts > div { display: flex; justify-content: space-between; padding: 2px 0; }
.rail-facts > div > span { color: var(--ink-muted); }
.rail-facts > div > strong { color: var(--ink); font-family: var(--font-mono); }
.rail-progress-bar { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 4px; border: 0; border-radius: 2px; background: var(--surface-sunken); overflow: hidden; }
.rail-progress-bar::-webkit-progress-bar { background: var(--surface-sunken); border-radius: 2px; }
.rail-progress-bar::-webkit-progress-value { background: var(--accent); border-radius: 2px; transition: width 0.4s ease; }
.rail-progress-bar::-moz-progress-bar { background: var(--accent); border-radius: 2px; }
.rail-progress-text { font-size: 10px; color: var(--ink-muted); font-family: var(--font-mono); margin-top: 4px; display: block; }

/* ── Center: Questions ── */
.comp-main { display: flex; flex-direction: column; gap: var(--sp-4); }

.comp-section-head { grid-column: 1 / -1; margin-bottom: var(--sp-1); }
.comp-section-tag {
    display: inline-block;
    font-size: var(--text-xs); font-weight: 600; color: var(--accent);
    background: var(--accent-soft); padding: 2px var(--sp-2); border-radius: var(--radius);
    letter-spacing: 0.02em;
}

.comp-question-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-4);
    margin-bottom: var(--sp-4);
}

/* ── Question Card (lightweight) ── */
.q-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    min-width: 0;
    padding: var(--sp-4);
    display: flex; flex-direction: column; gap: var(--sp-3);
    transition: border-color 0.15s;
    scroll-margin-top: 72px;
}
.q-card:hover { border-color: var(--border-strong); }

.q-card-head {
    display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2);
    font-size: var(--text-xs);
}
.q-num {
    font-weight: 700; font-family: var(--font-mono); font-size: var(--text-sm);
    color: var(--ink-2); min-width: 20px;
}
.q-type {
    color: var(--ink-muted); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1px 6px; font-size: 10px; font-weight: 500;
}
.q-tag.required { color: var(--warning); border-color: var(--warning); }
.q-tag.answer-unavailable { color: var(--ink-muted); border-color: var(--border-strong); background: var(--surface-alt); }
.q-pts {
    margin-left: auto; font-family: var(--font-mono); font-weight: 600; color: var(--ink-3);
}

.q-prompt { font-size: var(--text-sm); line-height: 1.65; color: var(--ink-2); overflow: hidden; overflow-wrap: break-word; word-break: break-word; min-width: 0; }
.q-prompt p:last-child { margin-bottom: 0; }
.q-prompt pre { overflow-x: auto; max-width: 100%; white-space: pre-wrap; }
.q-prompt img { max-width: 100%; height: auto; }

/* Status Chips */
[class*="status-chip-"] { font-size: var(--text-xs); }
.status-chip-unanswered { color: var(--ink-muted); }
.status-chip-draft { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.status-chip-incorrect { background: var(--negative-soft); color: var(--negative); border-color: transparent; }
.status-chip-correct { background: var(--positive-soft); color: var(--positive); border-color: transparent; }
.status-chip-pending_review { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.status-chip-submitted { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* Question Feedback */
.q-feedback {
    padding: var(--sp-2) var(--sp-3); font-size: var(--text-xs); border-radius: var(--radius);
}
.q-feedback:empty { display: none; }
.q-feedback.status-correct { background: var(--positive-soft); color: var(--positive); }
.q-feedback.status-incorrect { background: var(--negative-soft); color: var(--negative); }
.q-feedback.status-draft { background: var(--warning-soft); color: var(--warning); }
.q-feedback.status-pending_review { background: var(--accent-soft); color: var(--accent); }
.q-feedback.status-submitted { background: var(--accent-soft); color: var(--accent); }
.q-feedback.status-unanswered { background: var(--surface-sunken); color: var(--ink-muted); }
.q-feedback.status-answer_unavailable { background: var(--surface-sunken); color: var(--ink-muted); border: 1px solid var(--border); }

/* Answer Options */
.q-options { display: flex; flex-direction: column; gap: var(--sp-1); }
.q-form { display: flex; flex-direction: column; gap: var(--sp-3); }

.q-option {
    display: flex; align-items: flex-start; gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-3);
    border: 1px solid var(--border); border-radius: var(--radius);
    cursor: pointer; font-size: var(--text-sm); min-width: 0; max-width: 100%; transition: border-color 0.15s;
}
.q-option:hover { border-color: var(--border-strong); background: var(--surface-alt); }
.q-option.is-disabled { opacity: 0.6; cursor: not-allowed; }
.q-option input[type="radio"],
.q-option input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--accent); flex-shrink: 0; margin-top: 2px; }

.q-option-text {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}

.option-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; font-size: 10px; font-weight: 700;
    font-family: var(--font-mono); border-radius: var(--radius);
    background: var(--surface-sunken); color: var(--ink-3); flex-shrink: 0;
}

.q-textarea {
    width: 100%; min-height: 80px; resize: vertical;
    padding: var(--sp-2) var(--sp-3); font-size: var(--text-sm);
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); outline: none; font-family: inherit;
}
.q-textarea:focus { border-color: var(--border-focus); box-shadow: 0 0 0 2px var(--accent-soft); }

.q-input {
    width: 100%; padding: var(--sp-2) var(--sp-3);
    font-size: var(--text-sm); border: 1px solid var(--border);
    border-radius: var(--radius); background: var(--surface); outline: none;
}
.q-input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 2px var(--accent-soft); }

/* Question Action Row */
.q-actions {
    display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3);
    padding-top: var(--sp-2); border-top: 1px solid var(--border);
}
.q-meta { display: flex; flex-wrap: wrap; gap: var(--sp-2); font-size: 10px; color: var(--ink-muted); font-family: var(--font-mono); }
.q-btns { display: flex; gap: var(--sp-2); }
.btn-xs { font-size: var(--text-xs); padding: 3px 10px; }

.q-guest {
    padding: var(--sp-2) var(--sp-3); font-size: var(--text-xs);
    color: var(--ink-3); background: var(--surface-sunken); border-radius: var(--radius);
}

/* ── Right: Info Rail ── */
.comp-info {
    position: sticky; top: calc(56px + var(--sp-4));
    max-height: calc(100vh - 56px - var(--sp-4) * 2); overflow-y: auto; scrollbar-width: thin;
}
.comp-info-inner { display: flex; flex-direction: column; gap: var(--sp-4); }

.info-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--sp-4);
}

.info-facts { display: flex; flex-direction: column; gap: var(--sp-2); }
.info-facts > div {
    display: flex; justify-content: space-between; font-size: var(--text-sm); padding: var(--sp-1) 0;
}
.info-facts > div > span { color: var(--ink-muted); }
.info-facts > div > strong { color: var(--ink); font-family: var(--font-mono); font-size: var(--text-sm); }
.info-facts > div > a { font-weight: 500; }
.info-facts > div.info-fact-code {
    display: grid;
    gap: var(--sp-2);
    width: 100%;
}
.info-readonly-field {
    width: 100%;
    min-height: 38px;
    padding: var(--sp-2) var(--sp-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-sunken);
    color: var(--ink);
    font-size: var(--text-sm);
    line-height: 1.25;
    font-family: var(--font-mono);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    resize: none;
    outline: none;
}
/*.info-copy-row {*/
/*    display: flex;*/
/*    align-items: center;*/
/*    gap: var(--sp-2);*/
/*    background: var(--surface-sunken);*/
/*    border: 1px solid var(--border);*/
/*    border-radius: var(--radius);*/
/*    padding: var(--sp-2) var(--sp-3);*/
/*    width: 100%;*/
/*}*/
/*.info-copy-value {*/
/*    flex: 1;*/
/*    font-family: var(--font-mono);*/
/*    font-size: var(--text-sm);*/
/*    color: var(--ink);*/
/*    overflow: hidden;*/
/*    text-overflow: ellipsis;*/
/*    white-space: nowrap;*/
/*    background: none;*/
/*    border: none;*/
/*    padding: 0;*/
/*    user-select: all;*/
/*}*/
/*.btn-copy-inline {*/
/*    flex-shrink: 0;*/
/*    font-size: 0.72rem;*/
/*    font-weight: 600;*/
/*    letter-spacing: 0.02em;*/
/*    color: var(--accent);*/
/*    background: none;*/
/*    border: none;*/
/*    padding: 2px 4px;*/
/*    cursor: pointer;*/
/*    border-radius: 4px;*/
/*    transition: background 0.15s;*/
/*    white-space: nowrap;*/
/*}*/



/* 检材下载：整块撑满右侧卡片 */
.download-facts {
    display: grid;
    gap: 10px;
    width: 100%;
}

.info-facts.download-facts > .download-fact {
    display: grid;
    gap: 6px;
    width: 100%;
    padding: 0;
}

.download-fact-label {
    color: var(--ink-muted);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.info-link-card,
.info-copy-card {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.72), var(--surface-sunken));
    color: var(--ink);
    text-align: left;
    text-decoration: none;
    outline: none;
}

.info-copy-card {
    cursor: pointer;
}

.info-link-card:hover,
.info-copy-card:hover {
    border-color: rgba(37, 99, 235, 0.36);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(37, 99, 235, 0.06));
    color: var(--ink);
}

.info-link-card:focus-visible,
.info-copy-card:focus-visible {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.info-link-card.is-empty,
.info-copy-card.is-empty {
    cursor: default;
    color: var(--ink-muted);
    background: var(--surface-sunken);
}

.info-link-card.is-empty:hover,
.info-copy-card.is-empty:hover {
    border-color: var(--border);
    background: var(--surface-sunken);
}

.info-copy-value {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: inherit;
    user-select: text;
}

.info-link-card .info-copy-value {
    font-family: inherit;
    font-weight: 600;
}

.info-copy-action {
    flex-shrink: 0;
    color: var(--accent);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.02em;
}

.info-copy-card.copied {
    border-color: rgba(13, 150, 104, 0.36);
    background: var(--positive-soft);
}

.info-copy-card.copied .info-copy-action {
    color: var(--positive);
}



.btn-copy-inline:hover { background: var(--surface-tint, rgba(37,99,235,0.08)); }
.btn-copy-inline.copied { color: var(--positive, #16a34a); }

.info-actions { display: flex; flex-direction: column; gap: var(--sp-3); }
.rail-help { font-size: var(--text-xs); color: var(--ink-muted); margin-top: var(--sp-1); }
.competition-actions-card { gap: var(--sp-3); }
.competition-action-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
}
.competition-action-head strong {
    font-size: var(--text-xs);
    color: var(--ink-2);
}
.action-feedback {
    padding: var(--sp-2) var(--sp-3);
    border-radius: var(--radius);
    background: var(--surface-sunken);
}
.action-feedback.tone-success {
    color: var(--positive);
    background: var(--positive-soft);
}
.action-feedback.tone-danger {
    color: var(--negative);
    background: var(--negative-soft);
}
.action-feedback.tone-warning {
    color: var(--warning);
    background: var(--warning-soft);
}

.competition-writeup-modal {
    position: fixed;
    inset: 0;
    z-index: 140;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-4);
    background: rgba(15, 23, 42, 0.38);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.competition-writeup-dialog {
    width: min(560px, calc(100vw - var(--sp-8)));
    display: grid;
    gap: var(--sp-4);
    padding: var(--sp-5);
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.2);
}

.competition-writeup-dialog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--sp-4);
}

.competition-writeup-dialog-head h3 {
    font-size: var(--text-xl);
}

.competition-writeup-dialog-head p {
    margin-top: var(--sp-1);
    color: var(--ink-muted);
    font-size: var(--text-sm);
}

.competition-writeup-close {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    color: var(--ink-muted);
}

.competition-writeup-close:hover {
    background: rgba(148, 163, 184, 0.12);
    color: var(--ink);
}

.competition-writeup-form {
    display: grid;
    gap: var(--sp-3);
}

.competition-writeup-dialog-foot {
    display: flex;
    justify-content: flex-end;
    gap: var(--sp-2);
}

/* ── Responsive ── */
@media (max-width: 1199.98px) {
    .comp-workspace { grid-template-columns: 1fr; }
    .comp-rail { position: static; max-height: none; }
    .comp-rail-inner { flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--sp-3); height: auto; overflow: visible; }
    .comp-rail-title { display: none; }
    .comp-rail-stats { grid-template-columns: repeat(3, auto); gap: var(--sp-3); padding-bottom: 0; border-bottom: none; }
    .comp-rail-nav-window { max-height: none; overflow: visible; flex: 1 1 100%; padding-right: 0; }
    .comp-rail-nav { grid-template-columns: repeat(auto-fill, minmax(32px, 1fr)); flex: 1 1 100%; }
    .comp-rail-legend { display: none; }
    .comp-rail-progress { flex: 1 1 100%; padding-top: var(--sp-2); border-top: none; }
    .comp-info { position: static; max-height: none; }
    .comp-question-grid { grid-template-columns: 1fr; }
}
@media (max-width: 767.98px) {
    .comp-hero { padding: var(--sp-4); }
    .comp-hero-title { font-size: var(--text-xl); }
    .comp-rail-stats .stat-val { font-size: var(--text-base); }
    .q-card { padding: var(--sp-3); }
}

/* --- Auth Layout ------------------------------------------------- */
.auth-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100%;
    flex: 1 1 auto;
    align-items: stretch;
}

.frontend-chrome-minimal .auth-layout {
    min-height: 100vh;
}

.auth-aside {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--sp-12) var(--sp-10);
    background: var(--surface, var(--surface-alt, #f8fafc));
    color: var(--ink, #172033);
}

.auth-aside .section-kicker { color: var(--ink-muted, #64748b); }
.auth-aside .page-title { color: var(--ink, #172033); }
.auth-aside .page-lead { color: var(--ink-muted, #475569); }

.auth-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--sp-10) var(--sp-12);
    background: var(--surface, #ffffff);
}

.dfb-auth-hero {
    display: grid;
    gap: var(--sp-4);
    max-width: 34rem;
}

.dfb-auth-logo {
    width: min(100%, 360px);
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 14px 24px rgba(37, 99, 235, 0.1));
}

.dfb-auth-title {
    font-size: clamp(2rem, 3vw, 2.8rem);
    color: #fff;
    margin: 0;
}

.dfb-auth-lead {
    color: rgba(231, 235, 240, 0.82);
    max-width: 32rem;
}

.dfb-auth-meta {
    color: rgba(231, 235, 240, 0.68);
}

.dfb-auth-meta span::before {
    color: rgba(231, 235, 240, 0.38);
}

.dfb-auth-panel {
    gap: var(--sp-2);
}

.dfb-auth-note {
    color: var(--ink-muted);
    line-height: var(--leading-base);
    margin-bottom: var(--sp-3);
}

.dfb-auth-note-spaced {
    margin-bottom: var(--sp-4);
}

.dfb-auth-notice {
    margin-bottom: var(--sp-4);
}

/* --- Profile ----------------------------------------------------- */
.profile-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: var(--sp-4);
    margin-top: var(--sp-3);
    align-items: start;
}

.profile-main {
    display: grid;
    gap: var(--sp-4);
}

.profile-side {
    display: grid;
    gap: var(--sp-4);
    position: sticky;
    top: calc(56px + var(--sp-4));
}

.profile-fields {
    display: grid;
    gap: var(--sp-4);
}

.pf-row {
    display: grid;
    gap: var(--sp-4);
}

.pf-row-2 { grid-template-columns: 1fr 1fr; }
.pf-row-3 { grid-template-columns: 1fr 1fr 1fr; }

.field-hint {
    display: block;
    font-size: var(--text-xs);
    color: var(--ink-muted);
    margin-top: var(--sp-1);
}

.field-hint-warning { color: var(--warning); }

.field-optional {
    font-weight: 400;
    color: var(--ink-muted);
    font-size: 0.7em;
}

.profile-quick-links {
    display: grid;
    gap: var(--sp-2);
}

.btn-block { width: 100%; text-align: center; }

/* Avatar */
.avatar-zone {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
}

.avatar-preview-wrap {
    flex-shrink: 0;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--border);
    background: var(--surface-alt);
}

.avatar-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.avatar-actions {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

.avatar-hint {
    font-size: var(--text-xs);
    color: var(--ink-muted);
    line-height: var(--leading-base);
}

.avatar-status {
    font-size: var(--text-xs);
    line-height: var(--leading-base);
    color: var(--ink-muted);
    min-height: 1.25rem;
}

.avatar-status[data-tone="success"] { color: var(--positive); }

.avatar-status[data-tone="danger"] { color: var(--negative); }

.avatar-pick-btn { cursor: pointer; }

/* Cropper Modal */
.cropper-modal {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(12, 18, 34, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-5);
}

.cropper-dialog {
    background: var(--surface);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 860px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.cropper-dialog-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.cropper-dialog-head h3 {
    font-size: var(--text-lg);
    font-weight: 600;
}

.cropper-dialog-head p {
    margin: 0.35rem 0 0;
    color: var(--ink-muted);
    font-size: var(--text-xs);
    line-height: var(--leading-base);
}

.cropper-dialog-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: var(--sp-3);
    align-items: stretch;
    padding: 14px;
    background: linear-gradient(180deg, rgba(246, 248, 251, 0.96), rgba(255, 255, 255, 0.92));
}

.cropper-canvas-wrap {
    min-height: 360px;
    max-height: 480px;
    overflow: hidden;
    background: var(--surface-sunken);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 10px;
}

.cropper-canvas-wrap img {
    display: block;
    max-width: 100%;
}

.cropper-side-panel {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
}

.cropper-side-card {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    padding: 10px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.cropper-side-card small {
    color: var(--ink-muted);
    line-height: var(--leading-base);
}

.cropper-side-label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--ink);
}

.cropper-preview-box {
    width: 132px;
    height: 132px;
    border-radius: 50%;
    overflow: hidden;
    margin-inline: auto;
    border: 2px solid rgba(80, 148, 255, 0.22);
    background:
        radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.72), rgba(228, 235, 244, 0.88) 56%, rgba(208, 219, 236, 0.95)),
        linear-gradient(135deg, rgba(80, 148, 255, 0.12), rgba(0, 194, 168, 0.08));
}

.cropper-preview-box .cropper-view-box,
.cropper-preview-box .cropper-face {
    border-radius: 50%;
}

.cropper-side-card input[type="range"] {
    width: 100%;
}

.cropper-dialog-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--sp-3);
    padding: 12px 16px;
    border-top: 1px solid var(--border);
}

.cropper-feedback {
    font-size: var(--text-xs);
    color: var(--ink-muted);
    line-height: var(--leading-base);
}

.cropper-feedback[data-tone="danger"] { color: var(--negative); }

/* --- Dashboard --------------------------------------------------- */
.dash-hero {
    display: flex;
    align-items: center;
    gap: var(--sp-5);
    padding: var(--sp-5) var(--sp-6);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-top: var(--sp-4);
}

.dash-hero-compact {
    gap: var(--sp-4);
    padding: 16px 18px;
    margin-top: 0;
}

.dash-hero-avatar {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--border);
}

.dash-hero-compact .dash-hero-avatar {
    width: 64px;
    height: 64px;
}

.dash-hero-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.dash-hero-info { flex: 1; min-width: 0; }

.dash-hero-name {
    font-size: var(--text-2xl);
    font-weight: 700;
    margin-bottom: var(--sp-1);
}

.dash-hero-compact .dash-hero-name {
    font-size: var(--text-xl);
    margin-bottom: 4px;
}

.dash-hero-meta {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    font-size: var(--text-sm);
    color: var(--ink-muted);
}

.dash-hero-bio {
    margin-top: var(--sp-2);
    font-size: var(--text-sm);
    color: var(--ink-3);
    line-height: var(--leading-base);
}

.dash-hero-compact .dash-hero-bio {
    margin-top: 6px;
    font-size: var(--text-sm);
}

.dash-hero-actions {
    flex-shrink: 0;
    display: flex;
    gap: var(--sp-2);
}

.dash-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--sp-4);
    margin-top: var(--sp-4);
}

.dash-span-4  { grid-column: span 4; }
.dash-span-6  { grid-column: span 6; }
.dash-span-8  { grid-column: span 8; }
.dash-span-12 { grid-column: span 12; }

.dashboard-board {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--sp-5);
    margin-top: var(--sp-4);
}

.stat-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--sp-4);
}

.stat-row-compact {
    margin-top: var(--sp-4);
    gap: var(--sp-3);
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--sp-4) var(--sp-5);
}

.stat-row-compact .stat-card {
    padding: 12px 14px;
}

.stat-card h3 {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: var(--sp-2);
}

.stat-card .value {
    font-size: var(--text-3xl);
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--ink);
}

.stat-row-compact .stat-card .value {
    font-size: var(--text-2xl);
}

.dash-section-title {
    font-size: 1.05rem;
}

.dashboard-action-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--sp-2);
}

.dashboard-action-grid .quick-link-card {
    min-height: 0;
}

.workspace-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.panel-body { padding: 16px; }

.quick-link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--sp-3);
}

.quick-link-card {
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--ink);
}

.quick-link-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.quick-link-card strong { font-size: var(--text-base); }
.quick-link-card span { font-size: var(--text-xs); color: var(--ink-muted); }

.info-list { display: flex; flex-direction: column; }

.info-item {
    display: flex;
    justify-content: space-between;
    padding: var(--sp-2) 0;
    border-bottom: 1px solid var(--border);
    font-size: var(--text-sm);
}

.info-item:last-child { border-bottom: none; }
.info-item dt { color: var(--ink-muted); }
.info-item dd { text-align: right; font-weight: 500; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }

.btn-copy-hash {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: var(--text-xs);
    padding: 1px 6px;
    cursor: pointer;
    color: var(--ink-muted);
    margin-left: 2px;
    vertical-align: middle;
    transition: background 0.15s, color 0.15s;
}
.btn-copy-hash:hover { background: var(--accent-soft); color: var(--accent); }
.btn-copy-hash.copied { color: var(--positive); }

.dashboard-meter { margin-top: var(--sp-4); padding-top: var(--sp-4); border-top: 1px solid var(--border); }
.dashboard-meter-head { display: flex; justify-content: space-between; font-size: var(--text-sm); margin-bottom: var(--sp-2); }

.account-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--sp-4);
}

.summary-tile {
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
    padding: 12px 14px;
    background: var(--surface-alt);
    border-radius: var(--radius);
}

.summary-label { font-size: var(--text-xs); color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.summary-tile strong { font-size: var(--text-2xl); font-family: var(--font-mono); }
.summary-note { font-size: var(--text-xs); color: var(--ink-muted); }

/* --- Leaderboard ------------------------------------------------- */
.rank-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-4);
}

.rank-module {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--sp-5);
}

.rank-module h3 {
    font-size: var(--text-sm);
    font-weight: 600;
    margin-bottom: var(--sp-3);
    color: var(--ink-3);
}

.rank-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--sp-2) 0;
    border-bottom: 1px solid var(--border);
    font-size: var(--text-sm);
}

.rank-line:last-child { border-bottom: none; }

.data-number {
    font-size: var(--text-3xl);
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--ink);
}

/* --- Empty State ------------------------------------------------- */
.empty-state {
    text-align: center;
    padding: var(--sp-10) var(--sp-6);
}

.empty-state-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px; height: 48px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
    font-size: var(--text-lg);
    border-radius: var(--radius-lg);
    margin-bottom: var(--sp-3);
}

/* --- Search Shell ------------------------------------------------ */
.search-shell {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.search-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 148px;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
}

.search-input-wrap,
.search-target-wrap {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    min-width: 0;
    padding: 0.2rem 0.38rem 0.2rem 0.68rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 24px -24px rgba(15, 23, 42, 0.35);
}

.search-input-wrap .form-control,
.search-target-wrap .form-select {
    border: 0;
    background: transparent;
    box-shadow: none;
    padding-inline: 0;
}

.search-input-icon {
    color: var(--accent);
    font-size: 1.1rem;
    line-height: 1;
}

.search-target-label {
    font-size: var(--text-xs);
    color: var(--ink-muted);
    white-space: nowrap;
}

.search-target {
    width: 100%;
    min-width: 0;
}

/*.home-search-shell {*/
/*    align-items: stretch;*/
/*}*/

/*.home-search-main {*/
/*    grid-template-columns: minmax(0, 1fr) 126px;*/
/*}*/

/*.home-search-main .search-target-wrap {*/
/*    padding-left: 0.56rem;*/
/*    padding-right: 0.32rem;*/
/*}*/

/*.home-search-main .search-target-label {*/
/*    font-size: 11px;*/
/*}*/

/*.home-search-target {*/
/*    font-size: var(--text-sm);*/
/*}*/

/*.home-search-button {*/
/*    min-width: 110px;*/
/*}*/


/*这里是原先的搜索框*/


.writeup-list-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--sp-3);
    margin: var(--sp-5) 0 var(--sp-2);
}

.writeup-list-summary > div {
    display: grid;
    gap: 0.2rem;
    padding: var(--sp-4);
    border-radius: calc(var(--radius-lg) + 2px);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 248, 252, 0.92)),
        rgba(246, 248, 251, 0.94);
    border: 1px solid rgba(142, 163, 191, 0.18);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.05);
}

.writeup-list-summary strong {
    font-family: var(--font-mono);
    font-size: clamp(1.55rem, 2vw, 2.2rem);
    line-height: 1;
    color: var(--ink);
}

.writeup-list-summary span {
    font-size: var(--text-xs);
    color: var(--ink-muted);
}

.writeup-hub-shell {
    align-items: start;
}

.writeup-hub-panel {
    display: grid;
    gap: var(--sp-4);
}

.writeup-toolbar {
    display: block;
}

.writeup-filter-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: var(--sp-2);
    align-items: center;
    padding: var(--sp-2);
    border-radius: var(--radius-lg);
    background: rgba(247, 249, 252, 0.88);
    border: 1px solid rgba(142, 163, 191, 0.14);
}

.writeup-filter-notice {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    flex-wrap: wrap;
    margin: 0;
}

.writeup-card-stack {
    display: grid;
    gap: var(--sp-4);
}

.writeup-card {
    display: grid;
    gap: var(--sp-3);
    padding: var(--sp-4);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(142, 163, 191, 0.16);
    background:
        radial-gradient(circle at top right, rgba(80, 148, 255, 0.06), transparent 32%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 253, 0.96));
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.045);
}

.writeup-card-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--sp-4);
    align-items: start;
}

.writeup-card-copy {
    display: grid;
    gap: var(--sp-3);
    min-width: 0;
}

.writeup-card-title {
    margin: 0;
    font-size: var(--text-xl);
    line-height: 1.25;
}

.writeup-card-lead {
    margin: 0;
    max-width: 40rem;
    color: var(--ink-2);
    line-height: 1.65;
    font-size: var(--text-sm);
}

.writeup-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.9rem;
    color: var(--ink-muted);
    font-size: var(--text-sm);
}

.writeup-card-side {
    display: grid;
    gap: var(--sp-2);
    justify-items: end;
    align-content: start;
    min-width: 8.5rem;
}

.writeup-origin-tag,
.writeup-mini-note {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.05);
    color: var(--ink-muted);
    font-size: var(--text-xs);
    line-height: 1;
}

.writeup-inline-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.writeup-inline-link:hover {
    color: var(--accent-strong);
}

.writeup-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    flex-wrap: wrap;
    padding-top: var(--sp-3);
    border-top: 1px solid rgba(142, 163, 191, 0.16);
}

.writeup-side-stack {
    gap: var(--sp-4);
}

.writeup-index-panel,
.writeup-submit-panel,
.writeup-meta-card {
    border-radius: var(--radius-lg);
    border: 1px solid rgba(142, 163, 191, 0.16);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.045);
}

.writeup-index-intro p,
.writeup-submit-panel p {
    margin: 0;
    color: var(--ink-muted);
    line-height: 1.7;
}

.writeup-submit-panel h3 {
    margin: 0;
    font-size: var(--text-xl);
}

.writeup-index-list {
    display: grid;
    gap: var(--sp-3);
    margin-top: var(--sp-4);
}

.writeup-index-card {
    display: grid;
    gap: var(--sp-3);
    padding-bottom: var(--sp-3);
    border-bottom: 1px solid var(--border);
}

.writeup-index-card:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.writeup-index-head {
    display: flex;
    justify-content: space-between;
    gap: var(--sp-2);
    align-items: center;
}

.writeup-year-list {
    display: grid;
    gap: var(--sp-2);
}

.writeup-year-link {
    display: flex;
    justify-content: space-between;
    gap: var(--sp-3);
    align-items: center;
    padding: 0.65rem 0.8rem;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid transparent;
    color: inherit;
    text-decoration: none;
}

.writeup-year-link strong {
    font-family: var(--font-mono);
    font-size: var(--text-base);
}

.writeup-year-link span {
    color: var(--ink-muted);
    font-size: var(--text-xs);
}

.writeup-year-link.is-active {
    border-color: rgba(80, 148, 255, 0.35);
    background: rgba(80, 148, 255, 0.08);
}

.writeup-hero {
    margin-bottom: var(--sp-5);
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.writeup-hero-main {
    display: grid;
    gap: var(--sp-2);
}

.writeup-page-title {
    margin-bottom: var(--sp-2);
}

.writeup-page-lead {
    max-width: 42rem;
}

.writeup-detail-shell {
    display: grid;
    grid-template-columns: minmax(220px, 250px) minmax(0, 1fr) minmax(220px, 250px);
    gap: var(--sp-6);
    align-items: start;
}

.writeup-detail-rail {
    position: sticky;
    top: 72px;
    align-self: start;
    max-height: calc(100vh - 88px);
    overflow-y: auto;
    display: grid;
    gap: var(--sp-4);
    scrollbar-width: thin;
}

.writeup-meta-side {
    position: sticky;
    top: 72px;
    align-self: start;
    display: grid;
    gap: var(--sp-4);
    max-height: calc(100vh - 88px);
    overflow-y: auto;
    padding-right: 2px;
    scrollbar-width: thin;
}

.writeup-author-header {
    display: block;
}

.writeup-author-header h2,
.writeup-article-head h2 {
    margin: 0;
    font-size: var(--text-lg);
}

.writeup-author-header p {
    margin: 0.35rem 0 0;
    color: var(--ink-muted);
    font-size: var(--text-sm);
}

.writeup-credit-panel {
    margin-top: var(--sp-4);
    padding-top: var(--sp-4);
    border-top: 1px solid rgba(142, 163, 191, 0.16);
}

.writeup-meta-side .section-kicker {
    margin-bottom: 0.35rem !important;
    color: var(--ink-muted);
    font-size: 0.78rem;
    letter-spacing: 0;
    text-transform: none;
}

.writeup-meta-card {
    padding: 1.05rem !important;
}

.writeup-author-profile,
.writeup-meta-card .info-list {
    display: grid;
    gap: 0.45rem;
}

.writeup-meta-card .info-item,
.writeup-author-profile > div {
    display: grid;
    grid-template-columns: 4.8rem minmax(0, 1fr);
    gap: 0.75rem;
    align-items: start;
    padding: 0.42rem 0;
    border-bottom: 1px solid rgba(142, 163, 191, 0.14);
}

.writeup-meta-card .info-item:last-child,
.writeup-author-profile > div:last-child {
    border-bottom: 0;
}

.writeup-meta-card dt,
.writeup-author-profile dt {
    color: var(--ink-muted);
    font-size: 0.78rem;
}

.writeup-meta-card dd,
.writeup-author-profile dd {
    min-width: 0;
    margin: 0;
    text-align: right;
    overflow-wrap: anywhere;
}

.writeup-meta-link-group {
    display: grid;
    gap: var(--sp-2);
    margin-top: var(--sp-4);
    padding-top: var(--sp-4);
    border-top: 1px solid rgba(142, 163, 191, 0.16);
}

.writeup-meta-label {
    display: inline-flex;
    align-items: center;
    color: var(--ink-muted);
    font-size: var(--text-xs);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.writeup-credit-copy > *:first-child {
    margin-top: 0;
}

.writeup-credit-copy > *:last-child {
    margin-bottom: 0;
}

.writeup-source-link {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    word-break: break-all;
}

.writeup-outline-card {
    margin-top: 0;
}

.writeup-reading-document {
    max-width: none;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(142, 163, 191, 0.16);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.045);
}

.writeup-article-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    padding-bottom: var(--sp-4);
    margin-bottom: var(--sp-5);
    border-bottom: 1px solid rgba(142, 163, 191, 0.16);
}

.writeup-reference-box {
    display: grid;
    gap: var(--sp-4);
}

.writeup-reference-box h3 {
    margin: 0;
    font-size: var(--text-base);
    color: var(--ink);
}

.writeup-reference-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-4);
}

.writeup-reference-grid p {
    margin: 0.35rem 0 0;
    color: var(--ink-2);
}

/* --- Hash Text --------------------------------------------------- */
.hash-text {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    word-break: break-all;
    color: var(--ink-muted);
}

/* --- Learning Path Node ------------------------------------------ */
.path-node-card { position: relative; }
.path-node-card.is-completed { border-color: var(--positive); background: var(--positive-soft); }

/* --- Error Pages ------------------------------------------------- */
.error-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: calc(var(--df-workspace-height, 100vh) - var(--sp-8));
    padding: var(--sp-8) 0;
    gap: var(--sp-4);
}

.error-layout .empty-state {
    width: min(100%, 42rem);
}

.error-code {
    font-size: 5rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--ink-faint);
    line-height: 1;
}

/* --- Pagination -------------------------------------------------- */
/* Scoped to the paginator rather than to `nav[aria-label]`. The bare attribute
   selector matched every labelled nav on the site — tab strips, subnavs, the
   wiki docs sidebar, breadcrumbs — and turned each of their links into a 32px
   bordered pill, because it outranks a single-class rule such as
   `.notification-tabs a`. What it was written against is the Bootstrap 4
   paginator (a `> div` wrapper around a `span[aria-current="page"] > span`);
   both paginators here are `nav.df-pagination` and are styled by their own
   `.df-pagination .page-link` rules further down this file. Scoping keeps the
   one part that still matches — the admin paginator's meta row is a direct
   child div — and releases everything else. */
nav.df-pagination > div {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--sp-1);
}

nav.df-pagination span[aria-current="page"] > span,
nav.df-pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 var(--sp-2);
    font-size: var(--text-sm);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--ink-3);
}

nav.df-pagination span[aria-current="page"] > span {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

nav.df-pagination a:hover { background: var(--surface-alt); }

nav.df-pagination > div > div:first-child { display: none; }

/* --- Utility Classes --------------------------------------------- */
.d-none { display: none !important; }
.d-flex { display: flex; }
.d-grid { display: grid; }
.d-block { display: block; }
.flex-column { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-grow-1 { flex-grow: 1; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }

.gap-1 { gap: var(--sp-1); }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }

.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-3 { margin-bottom: var(--sp-3); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-5 { margin-bottom: var(--sp-5); }
.mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.ms-2 { margin-left: var(--sp-2); }
.mx-auto { margin-left: auto; margin-right: auto; }
.ps-3 { padding-left: var(--sp-3); }
.w-100 { width: 100%; }
.h5 { font-size: var(--text-lg); font-weight: 600; }
.small { font-size: var(--text-xs); }
.text-secondary { color: var(--ink-muted); }
.text-success { color: var(--positive); }
.text-danger { color: var(--negative); }
.text-positive { color: var(--positive); }
.text-negative { color: var(--negative); }
.text-end { text-align: right; }
.text-center { text-align: center; }
.text-white { color: #fff; }
.text-nowrap { white-space: nowrap; }
.fw-semibold { font-weight: 600; }
.overflow-hidden { overflow: hidden; }

.row {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--sp-3);
}

.g-3 { gap: var(--sp-3); }
.col-12 { grid-column: span 12; }
.col-md-6 { grid-column: span 6; }

.btn-outline-primary { background: transparent; color: var(--accent); border-color: var(--border-strong); }
.btn-outline-primary:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.btn-outline-secondary { background: transparent; color: var(--ink-3); border-color: var(--border-strong); }
.btn-outline-secondary:hover { background: var(--surface-sunken); color: var(--ink); }
.alert-dismissible { position: relative; padding-right: var(--sp-10); }
.btn-close {
    position: absolute;
    top: var(--sp-3);
    right: var(--sp-3);
    background: none;
    border: none;
    font-size: var(--text-lg);
    color: var(--ink-3);
    cursor: pointer;
    width: 20px; height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close::after { content: "\00D7"; }

.reading-document { max-width: 720px; }
.doc-source-footer {
    margin-top: var(--sp-8);
    padding-top: var(--sp-4);
    border-top: 1px solid var(--border);
    font-size: var(--text-sm);
    color: var(--ink-muted);
}

/* --- Responsive -------------------------------------------------- */
@media (max-width: 1024px) {
    .comp-shell, .competition-shell { grid-template-columns: 1fr; }
    .comp-nav, .competition-nav-rail { display: none; }
    .comp-info, .competition-info-rail { position: static; max-height: none; overflow-y: visible; }
    .competition-sticky-bar { display: none !important; }
    .content-shell { grid-template-columns: 1fr; }
    .doc-index { grid-template-columns: 1fr; }
    .doc-rail { position: static; max-height: none; overflow-y: visible; }
    .doc-index.wiki-doc-layout { grid-template-columns: 1fr; }
    .doc-index.wiki-doc-layout > .wiki-doc-main,
    .wiki-doc-outline-rail,
    .wiki-doc-meta-rail { grid-column: 1; grid-row: auto; }
    .wiki-doc-outline-rail,
    .wiki-doc-meta-rail { position: static; max-height: none; overflow-y: visible; }
    .aside-stack { position: static; max-height: none; overflow-y: visible; }
    .writeup-detail-shell { grid-template-columns: 1fr; }
    .writeup-detail-rail { position: static; max-height: none; overflow-y: visible; }
    .writeup-meta-side { position: static; }
    .auth-layout { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .df-panel-grid { grid-template-columns: 1fr; }
    .home-content-layout { grid-template-columns: 1fr; }
    .rank-strip { grid-template-columns: 1fr; }
    .profile-layout { grid-template-columns: 1fr; }
    .profile-side { position: static; }
    .dash-grid > * { grid-column: span 12 !important; }
    .dash-hero { flex-wrap: wrap; }
    .dash-hero-actions { width: 100%; }
    .dashboard-board > * { grid-column: span 12 !important; }
    .stat-row { grid-template-columns: repeat(2, 1fr); }
    .dfb-footer-inner { grid-template-columns: 1fr 1fr; }
    .dfb-footer-qrs { display: block; grid-column: span 2; }
    .hero-entries, .df-hero-entries { grid-template-columns: 1fr; }
    .df-hero { grid-template-columns: 1fr; }
    .df-hero-visual { justify-content: flex-start; }
    .df-hero-logo { width: 10rem; }
    .col-md-6 { grid-column: span 12; }
}
@media (max-width: 767.98px) {
    .comp-hero { padding: var(--sp-4); margin-bottom: var(--sp-4); }
    .comp-hero-chips { gap: var(--sp-1); }
    .comp-hero-meta { gap: var(--sp-2); }
    .comp-workspace { gap: var(--sp-4); }
    .comp-rail {
        position: sticky;
        top: calc(56px + var(--sp-2));
        z-index: 12;
    }
    .comp-rail-inner {
        padding: var(--sp-3);
        gap: var(--sp-3);
        background: color-mix(in srgb, var(--surface) 94%, white);
        box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
    }
    .comp-rail .rail-info-primary,
    .comp-rail .rail-info-extra {
        display: none;
    }
    .comp-rail-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: var(--sp-2);
        width: 100%;
    }
    .comp-rail-nav-window {
        max-height: none;
        overflow: visible;
        width: 100%;
    }
    .comp-rail-nav {
        grid-template-columns: repeat(auto-fit, minmax(34px, 1fr));
        gap: 4px;
    }
    .comp-rail-progress {
        width: 100%;
        padding-top: var(--sp-2);
    }
    .comp-info,
    .comp-info-inner {
        gap: var(--sp-3);
    }
    .info-block,
    .q-card {
        border-radius: calc(var(--radius-lg) + 2px);
    }
    .doc-index {
        gap: var(--sp-4);
    }
    .doc-meta-card,
    .reading-document {
        box-shadow: 0 14px 32px rgba(15, 23, 42, 0.07);
    }
    .doc-meta-row {
        align-items: flex-start;
    }
    .doc-source-link {
        max-width: 9.5rem;
    }
    .writeup-card-body,
    .writeup-reference-grid {
        grid-template-columns: 1fr;
    }
    .writeup-card-side {
        justify-items: start;
        min-width: 0;
    }
}

@media (max-width: 768px) {
    body.theme-light[data-theme-area="frontend"]:is(.route-wiki-show, .route-writeups-show) .dfb-container {
        overflow: visible !important;
    }

    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: clip;
        overflow-y: visible;
    }

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

    .dfb-page,
    .dfb-container,
    .dfb-header,
    .dfb-header-inner,
    .dfb-footer,
    .dfb-footer-inner {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .dfb-container {
        padding-inline: 14px !important;
        overflow-x: hidden;
    }

    .dfb-header {
        overflow-x: hidden;
    }

    .dfb-nav { display: none; }
    .dfb-mobile-toggle { display: flex; }
    .dfb-header-inner {
        height: 48px;
        padding: 0 12px;
        gap: 10px;
    }
    .dfb-brand,
    .dfb-brand-text {
        min-width: 0;
        overflow: hidden;
    }
    .dfb-brand {
        flex-shrink: 1;
    }
    .dfb-brand-text strong,
    .dfb-brand-text span {
        display: block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .dfb-header-actions {
        min-width: 0;
        max-width: 100%;
        flex-wrap: wrap;
    }
    .dfb-theme-switcher {
        max-width: 100%;
    }
    .dfb-theme-switcher-menu {
        max-width: calc(100vw - 28px) !important;
    }
    .stat-row { grid-template-columns: 1fr 1fr; }
    .pf-row-2, .pf-row-3 { grid-template-columns: 1fr; }
    .dfb-footer {
        padding: var(--sp-4) var(--sp-4) var(--sp-4);
        border-top-width: 1px;
    }
    .dfb-footer-inner {
        display: grid;
        grid-template-columns: 1fr;
        gap: var(--sp-4);
        justify-items: center;
        text-align: center;
    }
    .dfb-footer-links,
    .dfb-footer-sponsor-brand,
    .dfb-footer-qrs,
    .dfb-footer-support > h3,
    .dfb-footer-support > .dfb-footer-description,
    .dfb-footer-contact-list {
        display: none;
    }
    .dfb-footer-qrs { display: none; }
    .dfb-footer-link-grid,
    .dfb-footer-qr-grid { grid-template-columns: 1fr; }
    .dfb-footer-brand {
        display: flex;
        justify-content: center;
        width: 100%;
    }
    .dfb-footer-brand-top {
        margin-bottom: 0;
        gap: 12px;
    }
    .dfb-footer-brand-top > div {
        display: block;
        text-align: left;
    }
    .dfb-footer-brand-top h2 {
        font-size: 1rem;
        margin-bottom: 0;
    }
    .dfb-footer-brand-top p {
        display: none;
    }
    .dfb-footer-support {
        display: flex;
        justify-content: center;
        width: 100%;
    }
    .dfb-footer-support-actions {
        width: 100%;
        max-width: 360px;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-top: 0;
    }
    .dfb-footer-support-actions .btn {
        min-width: 0;
        width: 100%;
    }
    .dfb-footer-bottom-main,
    .dfb-footer-records {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--sp-2);
        width: 100%;
    }
    .dfb-footer-bottom-main span:not(:first-child) {
        display: none;
    }

    .dfb-footer-records {
        width: 100%;
    }

    .dfb-footer-records .dfb-record-item {
        width: 100%;
        display: grid;
        grid-template-columns: minmax(5.5rem, auto) minmax(0, 1fr);
        align-items: center;
        gap: 8px 12px;
        padding: 12px;
    }

    .dfb-footer-records .dfb-beian-link {
        grid-template-columns: 18px minmax(5.5rem, auto) minmax(0, 1fr);
    }

    .dfb-footer-records .dfb-beian-link img {
        margin-top: 0;
    }

    .dfb-footer-records .dfb-record-label {
        white-space: nowrap;
    }

    .dfb-footer-records .dfb-record-text,
    .dfb-footer-records .dfb-record-link,
    .dfb-footer-records .dfb-beian-link span:last-child {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .dfb-footer-bottom {
        margin-top: var(--sp-4);
        padding-top: var(--sp-4);
        border-top: 1px solid rgba(191, 201, 217, 0.78);
        align-items: center;
        gap: var(--sp-3);
    }
    .dfb-footer-bottom-main {
        justify-items: center;
        text-align: center;
    }
    .dfb-footer-bottom-main span + span {
        padding-left: 0;
    }
    .dfb-footer-bottom-main span + span::before {
        display: none;
    }
    .dfb-footer-records {
        gap: 10px;
    }
    .dfb-footer-records .dfb-record-item {
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.78);
    }
    .dfb-record-label {
        min-width: 4.9rem;
        justify-content: center;
    }

    .dfb-sponsor-logo {
        height: 20px;
    }
    .df26-flash-stack {
        top: 56px;
        padding-top: var(--sp-3);
    }
    .df26-flash-toast.notice-bar {
        padding: var(--sp-3);
    }
    .avatar-zone { flex-direction: column; text-align: center; }
    .cropper-dialog-body { grid-template-columns: 1fr; }
    .cropper-side-panel { order: -1; }
    .cropper-preview-box { width: 104px; height: 104px; }
    .cropper-dialog-foot {
        flex-direction: column;
        align-items: stretch;
    }
    .cropper-feedback { text-align: center; }
    .search-shell { flex-direction: column; gap: var(--sp-2); }
    .search-main,
    .home-search-main,
    .writeup-list-summary,
    .writeup-shell {
        grid-template-columns: 1fr;
    }
    .search-target { max-width: none; }
    /* Keep the scope control in the document flow on a narrow screen.  The
       desktop rule uses two classes, so match that specificity here rather
       than relying on an overflow clip. */
    .search-main.home-search-main { grid-template-columns: 1fr; }
    .home-search-button { width: 100%; }
    .df-hero { padding: var(--sp-8) 0 var(--sp-6); gap: var(--sp-4); }
    .df-hero-entries { margin-bottom: var(--sp-5); }
    .df-panel-grid { gap: var(--sp-4); margin-bottom: var(--sp-4); }
    .home-primary-column,
    .home-secondary-column { gap: var(--sp-4); }
    .df-panel { padding: var(--sp-4); }
    .timeline-item,
    .workspace-panel .panel-body { padding: var(--sp-4); }
    .stat-card .value { font-size: var(--text-2xl); }
    .page-head-compact,
    header.page-head-compact { padding: var(--sp-5) 0 var(--sp-3); }
    .dash-hero,
    .dash-hero-compact { padding: 14px; }
    .dashboard-action-grid { grid-template-columns: 1fr 1fr; }
    .writeup-filter-form,
    .writeup-article-head {
        grid-template-columns: 1fr;
    }
    .writeup-article-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .dfb-header.is-open .dfb-nav {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0; right: 0;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        padding: var(--sp-3);
        z-index: 200;
    }

    .dfb-header.is-open .dfb-header-actions {
        position: absolute;
        top: 100%;
        left: 0; right: 0;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        padding: var(--sp-3);
        z-index: 200;
        margin-top: -1px;
    }
}



/*新的搜索*/
/* 首页搜索框：输入框 + 下拉框一行，按钮单独换行 */
.search-shell.home-search-shell {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: stretch;
    width: min(680px, 100%);
}

/* 第一行：输入框 + 下拉框 */
.search-main.home-search-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 112px;
    gap: 10px;
    width: 100%;
    flex: none;
    min-width: 0;
}

/* 输入框外壳、下拉框外壳 */
.home-search-main .search-input-wrap,
.home-search-main .search-target-wrap {
    height: 48px;
    min-width: 0;
    padding: 0 12px;

    border: 1px solid rgba(37, 99, 235, 0.22);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.92);

    box-shadow: 0 10px 24px -22px rgba(15, 23, 42, 0.35);
}

/* 输入框 */
.home-search-main .search-input-wrap .form-control {
    width: 100%;
    min-width: 0;
    height: 100%;

    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;

    font-size: 15px;
}

/* 搜索图标 */
.home-search-main .search-input-icon {
    flex: 0 0 auto;
    color: var(--accent);
    font-size: 1rem;
}

/* 下拉框外壳 */
.home-search-main .search-target-wrap {
    padding-left: 6px;
    padding-right: 4px;
}

/* 下拉框前面的小字：范围 */
.home-search-main .search-target-label {
    font-size: 14px;
    white-space: nowrap;
    margin-right: 4px;
}

/* 下拉框 */
.home-search-target {
    width: 100%;
    min-width: 0;

    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0 14px 0 0;

    font-size: 12px;
}

/* 第二行：搜索按钮整行变宽 */
.home-search-button {
    width: 100%;
    min-width: 0;
    height: 50px;

    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
}

.df26-scanlines,
.df26-noise {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.df26-scanlines {
    background:
        linear-gradient(rgba(37, 99, 235, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37, 99, 235, 0.02) 1px, transparent 1px);
    background-size: 44px 44px;
    opacity: 0.42;
}

.df26-noise {
    background-image:
        radial-gradient(circle at 16% 18%, rgba(37, 99, 235, 0.05) 0 1px, transparent 1px),
        radial-gradient(circle at 82% 34%, rgba(8, 145, 178, 0.045) 0 1px, transparent 1px);
    background-size: 128px 128px, 176px 176px;
    opacity: 0.26;
}

body.theme-light[data-theme-area="frontend"] .df26-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.06fr) minmax(320px, 0.82fr);
    gap: clamp(18px, 3vw, 34px);
    align-items: center;
    min-height: 0;
    margin-bottom: var(--sp-6);
    padding: clamp(20px, 3.2vw, 38px);
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.08), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.94));
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

body.theme-light[data-theme-area="frontend"] .df26-hero::before {
    content: "";
    position: absolute;
    inset: 14px;
    border: 1px dashed rgba(37, 99, 235, 0.16);
    border-radius: 12px;
    pointer-events: none;
}

body.theme-light[data-theme-area="frontend"] .df26-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(8, 145, 178, 0.07), transparent 30%),
        linear-gradient(180deg, transparent, rgba(37, 99, 235, 0.055));
    pointer-events: none;
}

body.theme-light[data-theme-area="frontend"] .df26-hero-copy,
body.theme-light[data-theme-area="frontend"] .df26-hero-side {
    position: relative;
    z-index: 1;
    min-width: 0;
}

body.theme-light[data-theme-area="frontend"] .df26-hero-copy {
    display: grid;
    align-content: center;
    gap: clamp(12px, 2vw, 18px);
}

body.theme-light[data-theme-area="frontend"] .df26-hero-tag {
    display: inline-flex;
    width: fit-content;
    padding: 6px 10px;
    border: 1px solid rgba(37, 99, 235, 0.22);
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.04em;
}

body.theme-light[data-theme-area="frontend"] .df26-hero-title {
    margin: 0;
    color: var(--ink);
    font-size: clamp(2.1rem, 5.2vw, 4.1rem);
    font-weight: 850;
    line-height: 1;
}

body.theme-light[data-theme-area="frontend"] .df26-hero-lead {
    max-width: 38rem;
    margin: 0;
    color: #334155;
    font-size: clamp(0.95rem, 1.35vw, 1.08rem);
    line-height: 1.78;
}

body.theme-light[data-theme-area="frontend"] .df26-hero-stats {
    display: grid;
    width: min(100%, 720px);
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

body.theme-light[data-theme-area="frontend"] .df26-metric {
    display: grid;
    min-width: 0;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
    color: #334155;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

body.theme-light[data-theme-area="frontend"] .df26-metric:hover,
body.theme-light[data-theme-area="frontend"] .df26-metric:focus-visible {
    border-color: rgba(37, 99, 235, 0.36);
    background: rgba(255, 255, 255, 0.92);
    outline: none;
    transform: translateY(-1px);
}

body.theme-light[data-theme-area="frontend"] .df26-metric strong {
    color: #1d4ed8;
    font-size: 1.35rem;
    font-weight: 900;
    line-height: 1;
}

body.theme-light[data-theme-area="frontend"] .df26-metric span {
    overflow-wrap: anywhere;
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1.35;
}

body.theme-light[data-theme-area="frontend"] .df26-search-shell {
    width: min(100%, 720px);
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

body.theme-light[data-theme-area="frontend"] .df26-search-main {
    gap: 10px;
}

body.theme-light[data-theme-area="frontend"] .df26-search-button {
    min-width: 136px;
}

body.theme-light[data-theme-area="frontend"] .df26-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

body.theme-light[data-theme-area="frontend"] .df26-hero-actions .btn {
    min-height: 40px;
    border-radius: 999px;
    padding-inline: 16px;
}

body.theme-light[data-theme-area="frontend"] .df26-hero-logo-side {
    display: flex !important;
    align-items: stretch;
    justify-content: center;
}

body.theme-light[data-theme-area="frontend"] .df26-hero-logo-side .df-hero-logo-live {
    width: 100%;
    max-width: 100%;
    min-height: 220px;
}

body.theme-light[data-theme-area="frontend"] .df26-main-grid,
body.theme-light[data-theme-area="frontend"] .df26-bottom-grid {
    display: grid;
    gap: var(--sp-5);
}

body.theme-light[data-theme-area="frontend"] .df26-main-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
}

body.theme-light[data-theme-area="frontend"] .df26-side-stack {
    display: grid;
    gap: var(--sp-5);
}

body.theme-light[data-theme-area="frontend"] .df26-bottom-grid {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 0.85fr);
}

body.theme-light[data-theme-area="frontend"] .df26-panel {
    padding: var(--sp-4);
}

body.theme-light[data-theme-area="frontend"] .df26-ledger .catalog-line {
    padding: var(--sp-4);
}

@media (max-width: 1180px) {
    body.theme-light[data-theme-area="frontend"] .df26-hero,
    body.theme-light[data-theme-area="frontend"] .df26-main-grid,
    body.theme-light[data-theme-area="frontend"] .df26-bottom-grid {
        grid-template-columns: 1fr;
    }

    body.theme-light[data-theme-area="frontend"] .df26-hero-logo-side {
        order: -1;
    }
}

@media (max-width: 768px) {
    body.theme-light[data-theme-area="frontend"] .df26-hero {
        gap: 10px;
        margin-bottom: 20px;
        padding: 12px;
        border-radius: 16px;
    }

    body.theme-light[data-theme-area="frontend"] .df26-hero::before {
        inset: 8px;
    }

    body.theme-light[data-theme-area="frontend"] .df26-hero-tag {
        display: none;
    }

    body.theme-light[data-theme-area="frontend"] .df26-hero-title {
        font-size: 2.1rem;
        word-break: break-word;
    }

    body.theme-light[data-theme-area="frontend"] .df26-hero-lead {
        font-size: 0.9rem;
        line-height: 1.58;
    }

    body.theme-light[data-theme-area="frontend"] .df26-hero-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    body.theme-light[data-theme-area="frontend"] .df26-metric {
        padding: 10px;
        border-radius: 10px;
    }

    body.theme-light[data-theme-area="frontend"] .df26-metric strong {
        font-size: 1.1rem;
    }

    body.theme-light[data-theme-area="frontend"] .df26-metric span {
        font-size: 0.72rem;
    }

    body.theme-light[data-theme-area="frontend"] .df26-search-shell {
        padding: 6px;
    }

    body.theme-light[data-theme-area="frontend"] .df26-search-main {
        grid-template-columns: minmax(0, 1fr) 96px;
        gap: 6px;
    }

    body.theme-light[data-theme-area="frontend"] .df26-search-button {
        width: 100%;
        height: 42px;
    }

    body.theme-light[data-theme-area="frontend"] .df26-search-shell .search-recent-row {
        display: none !important;
    }

    body.theme-light[data-theme-area="frontend"] .df26-search-shell .search-input-wrap,
    body.theme-light[data-theme-area="frontend"] .df26-search-shell .search-target-wrap {
        height: 44px;
        border-radius: 9px;
    }

    body.theme-light[data-theme-area="frontend"] .df26-search-shell .search-target-label {
        display: none;
    }

    body.theme-light[data-theme-area="frontend"] .df26-hero-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    body.theme-light[data-theme-area="frontend"] .df26-hero-actions .btn {
        width: 100%;
        min-width: 0;
        min-height: 36px;
        padding-inline: 10px;
        font-size: 0.875rem;
    }

    body.theme-light[data-theme-area="frontend"] .df26-hero-logo-side .df-hero-logo-live {
        min-height: 148px;
    }

    body.theme-light[data-theme-area="frontend"] .df26-hero-logo-side .df-typewriter-panel {
        padding: 12px 14px;
    }

    body.theme-light[data-theme-area="frontend"] .df26-hero-logo-side .df-typewriter-head {
        margin-bottom: 8px;
    }

    body.theme-light[data-theme-area="frontend"] .df26-hero-logo-side .df-typewriter-code {
        min-height: 112px;
        gap: 6px;
    }

    body.theme-light[data-theme-area="frontend"] .df26-hero-logo-side :is(.df-typewriter-word, .df-typewriter-word-ghost) {
        font-size: 2.2rem;
        line-height: 1;
        letter-spacing: 0;
    }
}

.comp-rail-locked,
.competition-locked-panel {
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.88);
    border-radius: 22px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
}

.comp-rail-locked {
    padding: 1rem 1.1rem;
    display: grid;
    gap: 0.55rem;
    color: #334155;
}

.comp-rail-locked p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.6;
    color: #475569;
}

.competition-locked-panel {
    padding: clamp(1.5rem, 2.6vw, 2.2rem);
    display: grid;
    gap: 0.9rem;
}

.competition-locked-panel h2 {
    margin: 0;
    font-size: clamp(1.4rem, 2vw, 1.9rem);
}

.competition-locked-panel p {
    margin: 0;
    color: #475569;
    line-height: 1.75;
}

.competition-locked-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    color: #64748b;
    font-size: 0.92rem;
}

.competition-waiting-head {
    display: grid;
    justify-items: center;
    gap: 0.65rem;
}

.competition-waiting-head h2 {
    margin: 0;
    font-size: clamp(1.4rem, 2vw, 1.9rem);
}

.competition-waiting-head p {
    margin: 0;
    color: #475569;
    line-height: 1.75;
    max-width: 54ch;
}

.competition-waiting-grid {
    width: min(100%, 720px);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.competition-waiting-grid div {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
    padding: 0.8rem 0.9rem;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 14px;
    background: rgba(248, 250, 252, 0.72);
    text-align: left;
}

.competition-waiting-grid span {
    color: #64748b;
    font-size: 0.78rem;
}

.competition-waiting-grid strong {
    color: #0f172a;
    font-size: 0.98rem;
}

.competition-locked-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    align-items: center;
}

.competition-locked-actions form {
    margin: 0;
}

.competition-pending-room {
    display: grid;
    gap: 1rem;
    text-align: center;
    padding: clamp(2rem, 5vw, 4rem) clamp(1.5rem, 4vw, 3rem);
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.88);
    border-radius: 22px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
    justify-items: center;
}
.competition-pending-room h2 {
    margin: 0;
    font-size: clamp(1.4rem, 2vw, 1.9rem);
}
.competition-pending-room > p {
    margin: 0;
    color: #475569;
    line-height: 1.75;
    max-width: 44ch;
}
.competition-pending-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.25rem;
    color: #64748b;
    font-size: 0.92rem;
}
.competition-pending-summary {
    font-size: 0.92rem;
    color: #94a3b8;
    max-width: 48ch;
    text-align: center;
}
.competition-pending-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
    justify-content: center;
    align-items: center;
    margin-top: var(--sp-2);
}

.competition-notice-feed,
.competition-rank-list {
    display: grid;
    gap: 0.85rem;
}

.competition-notice-card,
.competition-rank-row {
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(248, 250, 252, 0.9);
    padding: 0.95rem 1rem;
}

.competition-notice-card p {
    margin: 0.45rem 0 0;
    color: #1e293b;
    line-height: 1.65;
}

.competition-notice-card.tone-danger {
    border-color: rgba(239, 68, 68, 0.28);
    background: rgba(254, 242, 242, 0.9);
}

.competition-notice-card.tone-warning {
    border-color: rgba(245, 158, 11, 0.28);
    background: rgba(255, 251, 235, 0.94);
}

.competition-notice-card.tone-success {
    border-color: rgba(34, 197, 94, 0.24);
    background: rgba(240, 253, 244, 0.94);
}

.competition-notice-meta,
.competition-rank-row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: flex-start;
}

.competition-notice-meta {
    color: #64748b;
    font-size: 0.8rem;
}

.competition-rank-main,
.competition-rank-score {
    display: grid;
    gap: 0.2rem;
}

.competition-rank-main span,
.competition-rank-score span {
    color: #64748b;
    font-size: 0.82rem;
}

.competition-rank-score {
    text-align: right;
}

.competition-rank-screen-link {
    display: block;
    color: inherit;
}

.competition-rank-screen-link:hover {
    color: inherit;
}

.competition-toast-stack {
    position: fixed;
    top: calc(56px + var(--sp-4));
    right: max(var(--sp-4), calc((100vw - var(--content-max)) / 2));
    z-index: 120;
    display: grid;
    gap: var(--sp-3);
    width: min(360px, calc(100vw - var(--sp-8)));
    pointer-events: none;
}

.competition-toast {
    pointer-events: auto;
    position: relative;
    display: grid;
    gap: var(--sp-2);
    padding: var(--sp-4);
    padding-right: calc(var(--sp-6) + var(--sp-4));
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.competition-toast.tone-danger {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(254, 242, 242, 0.97);
}

.competition-toast.tone-warning {
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(255, 251, 235, 0.97);
}

.competition-toast.tone-success {
    border-color: rgba(34, 197, 94, 0.26);
    background: rgba(240, 253, 244, 0.97);
}

.competition-toast-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--sp-3);
    padding-right: var(--sp-4);
}

.competition-toast-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--ink);
}

.competition-toast-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    font-size: var(--text-xs);
    color: var(--ink-muted);
}

.competition-toast-content {
    font-size: var(--text-sm);
    color: var(--ink-2);
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.competition-toast-close {
    position: absolute;
    top: var(--sp-3);
    right: var(--sp-3);
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    color: var(--ink-muted);
}

.competition-toast-close:hover {
    background: rgba(148, 163, 184, 0.12);
    color: var(--ink);
}

@media (max-width: 900px) {
    .competition-rank-row {
        flex-direction: column;
    }

    .competition-rank-score {
        text-align: left;
    }

    .competition-toast-stack {
        top: calc(48px + var(--sp-3));
        right: var(--sp-3);
        left: var(--sp-3);
        width: auto;
    }
}

@media (min-width: 1600px) {
    :root {
        --content-max: 1480px;
        --text-base: 0.9375rem;
        --text-lg: 1.0625rem;
        --text-xl: 1.1875rem;
        --text-2xl: 1.55rem;
        --text-3xl: 1.95rem;
        --text-4xl: 2.4rem;
    }

    .comp-workspace {
        grid-template-columns: 240px minmax(0, 1fr) 360px;
        gap: var(--sp-6);
    }

    .comp-question-grid {
        gap: var(--sp-5);
    }
}

@media (min-width: 1920px) {
    :root {
        --content-max: 1680px;
        --text-base: 1rem;
        --text-lg: 1.125rem;
        --text-xl: 1.25rem;
        --text-2xl: 1.7rem;
        --text-3xl: 2.05rem;
        --text-4xl: 2.55rem;
    }

    .comp-workspace {
        grid-template-columns: 260px minmax(0, 1fr) 380px;
    }

    .comp-hero {
        padding: var(--sp-6) var(--sp-8);
    }

    .q-card,
    .info-block,
    .comp-rail-inner {
        padding: var(--sp-5);
    }
}

@media (min-width: 2560px) {
    :root {
        --content-max: 2200px;
        --text-base: 1.0625rem;
        --text-lg: 1.1875rem;
        --text-xl: 1.3125rem;
        --text-2xl: 1.875rem;
        --text-3xl: 2.25rem;
        --text-4xl: 2.75rem;
        --sp-4: 18px;
        --sp-5: 22px;
        --sp-6: 28px;
    }

    .comp-workspace {
        grid-template-columns: 280px minmax(0, 1fr) 400px;
        gap: var(--sp-8);
    }

    .dfb-header-inner {
        height: 60px;
    }
}

/* ================================================================
   Light — Homepage hero responsive patch v3
   说明：基于当前最新 system.css 覆盖首页 Hero。
   目标：
   1) 32 寸/超宽屏时，整体横幅自然变宽，搜索区和终端区都变宽；
   2) 1280、1366、1440 等中等宽度不再截断右侧终端；
   3) 980px 以下自动单列；
   4) 只影响首页 .df-hero，不改题库、答题、文档页面布局。
   ================================================================ */

/* 防止 Grid/Flex 子项因为内部长文字撑破容器 */
.df-hero,
.df-hero-copy,
.df-hero-visual,
.df-hero-logo-live,
.df-typewriter-panel,
.df-typewriter-code,
.df-typewriter-word-row,
.df-typewriter-word-live {
    min-width: 0;
}

.df-hero {
    overflow: visible;
}

.df-hero-copy,
.df-hero-visual,
.df-hero-logo-live,
.df-typewriter-panel {
    max-width: 100%;
}

/* 原本 width:max-content 会让 DigiForensics 这一行在中小屏把面板撑出屏幕 */
.df-typewriter-word-row {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.df-typewriter-word-live {
    max-width: 100%;
}

.df-typewriter-subline,
.df-typewriter-subline-alt {
    overflow-wrap: anywhere;
}

/* 981px - 1279px：不要硬塞两列，改为上下排列，避免右侧终端截断 */
@media (min-width: 981px) and (max-width: 1279.98px) {
    .df-hero {
        width: 100%;
        max-width: min(100%, 920px);
        margin-inline: auto;
        padding-top: var(--sp-10);
        padding-bottom: var(--sp-8);
        grid-template-columns: 1fr;
        gap: var(--sp-6);
        align-items: center;
        justify-content: center;
    }

    .df-hero-copy {
        max-width: 680px;
        width: 100%;
        justify-self: center;
    }

    .df-hero-visual {
        order: 0;
        justify-content: center;
        width: 100%;
    }

    .df-hero-logo-live {
        width: min(100%, 760px);
        min-height: 230px;
    }

    .df-typewriter-panel {
        padding: 20px 26px;
    }

    .df-typewriter-word,
    .df-typewriter-word-ghost {
        font-size: clamp(2.7rem, 5vw, 4rem);
    }
}

/* 1280px - 1599px：两列布局，但收住最小宽度，保证不溢出 */
@media (min-width: 1280px) and (max-width: 1599.98px) {
    .df-hero {
        width: 100%;
        max-width: min(100%, 1440px);
        margin-inline: auto;
        padding-top: clamp(48px, 4vw, 72px);
        padding-bottom: clamp(36px, 3vw, 56px);
        display: grid;
        grid-template-columns: minmax(360px, 0.9fr) minmax(0, 1.1fr);
        column-gap: clamp(40px, 4vw, 72px);
        row-gap: var(--sp-6);
        align-items: center;
        justify-content: center;
    }

    .df-hero-copy {
        max-width: none;
        width: 100%;
        justify-self: stretch;
    }

    .df-hero-copy .w-100,
    .search-shell.home-search-shell {
        width: min(100%, 620px);
        max-width: 620px;
    }

    .search-main.home-search-main {
        grid-template-columns: minmax(0, 1fr) 140px;
    }

    .df-hero-visual {
        width: 100%;
        justify-content: stretch;
    }

    .df-hero-logo-live {
        width: 100%;
        min-height: 230px;
    }

    .df-typewriter-panel {
        padding: 20px 26px;
    }

    .df-typewriter-code {
        min-height: 188px;
    }

    .df-typewriter-word,
    .df-typewriter-word-ghost {
        font-size: clamp(2.65rem, 3.4vw, 3.65rem);
    }
}

/* 1600px - 1919px：开始放宽，不并拢，保持舒服间距 */
@media (min-width: 1600px) and (max-width: 1919.98px) {
    .df-hero {
        width: 100%;
        max-width: min(90vw, 1520px);
        margin-inline: auto;
        padding-top: clamp(56px, 4.4vw, 88px);
        padding-bottom: clamp(40px, 3vw, 64px);
        display: grid;
        grid-template-columns: minmax(470px, 0.92fr) minmax(0, 1.08fr);
        column-gap: clamp(64px, 5vw, 110px);
        row-gap: var(--sp-6);
        align-items: center;
        justify-content: center;
    }

    .df-hero-copy {
        max-width: none;
        width: 100%;
    }

    .df-hero-copy .w-100,
    .search-shell.home-search-shell {
        width: min(100%, 720px);
        max-width: 720px;
    }

    .search-main.home-search-main {
        grid-template-columns: minmax(0, 1fr) 150px;
    }

    .df-hero-visual {
        width: 100%;
        justify-content: stretch;
    }

    .df-hero-logo-live {
        width: 100%;
        min-height: clamp(240px, 14vw, 300px);
    }

    .df-typewriter-panel {
        padding: clamp(20px, 1.3vw, 28px) clamp(26px, 1.8vw, 36px);
    }

    .df-typewriter-code {
        min-height: clamp(190px, 11vw, 238px);
    }

    .df-typewriter-word,
    .df-typewriter-word-ghost {
        font-size: clamp(3.2rem, 3.15vw, 4.3rem);
    }
}

/* 1920px - 2559px：32 寸常见宽屏，整体更宽，但不贴边 */
@media (min-width: 1920px) and (max-width: 2559.98px) {
    .df-hero {
        width: 100%;
        max-width: min(88vw, 1760px);
        margin-inline: auto;
        padding-top: clamp(64px, 4.8vw, 96px);
        padding-bottom: clamp(44px, 3.2vw, 72px);
        display: grid;
        grid-template-columns: minmax(560px, 0.92fr) minmax(0, 1.08fr);
        column-gap: clamp(88px, 5.5vw, 140px);
        row-gap: var(--sp-6);
        align-items: center;
        justify-content: center;
    }

    .df-hero-copy {
        max-width: none;
        width: 100%;
    }

    .df-hero-copy .w-100,
    .search-shell.home-search-shell {
        width: min(100%, 820px);
        max-width: 820px;
    }

    .search-main.home-search-main {
        grid-template-columns: minmax(0, 1fr) 160px;
    }

    .df-hero-visual {
        width: 100%;
        justify-content: stretch;
    }

    .df-hero-logo-live {
        width: 100%;
        min-height: clamp(260px, 14vw, 330px);
    }

    .df-typewriter-panel {
        padding: clamp(22px, 1.45vw, 32px) clamp(30px, 2vw, 44px);
    }

    .df-typewriter-code {
        min-height: clamp(205px, 11vw, 270px);
    }

    .df-typewriter-word,
    .df-typewriter-word-ghost {
        font-size: clamp(3.6rem, 3.05vw, 5rem);
    }
}

/* 2560px 以上：超宽屏继续拉宽，但控制最大宽度 */
@media (min-width: 2560px) {
    .df-hero {
        width: 100%;
        max-width: min(84vw, 2040px);
        margin-inline: auto;
        padding-top: clamp(72px, 4.6vw, 112px);
        padding-bottom: clamp(52px, 3vw, 80px);
        display: grid;
        grid-template-columns: minmax(640px, 0.92fr) minmax(0, 1.08fr);
        column-gap: clamp(110px, 6vw, 180px);
        row-gap: var(--sp-6);
        align-items: center;
        justify-content: center;
    }

    .df-hero-copy {
        max-width: none;
        width: 100%;
    }

    .df-hero-copy .w-100,
    .search-shell.home-search-shell {
        width: min(100%, 900px);
        max-width: 900px;
    }

    .search-main.home-search-main {
        grid-template-columns: minmax(0, 1fr) 170px;
    }

    .df-hero-visual {
        width: 100%;
        justify-content: stretch;
    }

    .df-hero-logo-live {
        width: 100%;
        min-height: clamp(300px, 13vw, 380px);
    }

    .df-typewriter-word,
    .df-typewriter-word-ghost {
        font-size: clamp(4rem, 2.9vw, 5.6rem);
    }
}

/* 980px 以下继续走移动端单列，同时保证面板不撑出屏幕 */
@media (max-width: 980px) {
    .df-hero {
        width: 100%;
        max-width: none;
        grid-template-columns: 1fr;
        gap: var(--sp-6);
        overflow: visible;
    }

    .df-hero-copy {
        max-width: none;
        width: 100%;
        justify-self: stretch;
    }

    .df-hero-visual {
        order: 0;
        justify-content: center;
        width: 100%;
        margin-bottom: var(--sp-1);
    }

    .df-hero-visual .df-hero-logo-live {
        width: min(100%, 680px);
        min-height: 212px;
    }

    .df-typewriter-word,
    .df-typewriter-word-ghost {
        font-size: clamp(2.1rem, 8vw, 3.8rem);
    }
}

@media (max-width: 640px) {
    .df-hero-visual .df-hero-logo-live {
        width: min(100%, 420px);
    }

    .df-typewriter-panel {
        padding: var(--sp-4);
    }

    .df-typewriter-word,
    .df-typewriter-word-ghost {
        font-size: clamp(1.75rem, 9vw, 2.25rem);
    }

    .df-typewriter-prompt-row {
        font-size: 0.7rem;
        letter-spacing: 0.04em;
    }

    .df-typewriter-subline {
        font-size: 0.72rem;
        letter-spacing: 0.08em;
    }

    .df-typewriter-subline-alt {
        font-size: 0.78rem;
        letter-spacing: 0.03em;
    }
}

/* Wiki knowledge navigation remains a document structure in the light theme. */
body.theme-light[data-theme-area="frontend"].route-wiki-show .content-outline-link { background:none !important; border:0 !important; border-left:2px solid transparent !important; border-radius:0 !important; box-shadow:none !important; padding:5px 0 5px calc(var(--outline-indent, 0ch) + 9px) !important; }
body.theme-light[data-theme-area="frontend"].route-wiki-show .content-outline-link:hover { background:none !important; color:var(--link,#2563eb) !important; }
body.theme-light[data-theme-area="frontend"].route-wiki-show .content-outline-link.is-active { background:none !important; border-left-color:var(--link,#2563eb) !important; }
@media (min-width:1180px) {
    body.theme-light[data-theme-area="frontend"].route-wiki-show .doc-index.wiki-doc-layout { grid-template-columns:190px minmax(0,1fr) 228px !important; align-items:start; }
    body.theme-light[data-theme-area="frontend"].route-wiki-show .wiki-doc-layout > .wiki-doc-outline-rail { position:sticky; top:calc(var(--df-header-total, 0px) + 18px); grid-column:1 !important; grid-row:1 !important; max-height:calc(100vh - var(--df-header-total, 0px) - 36px); overflow:auto; }
    body.theme-light[data-theme-area="frontend"].route-wiki-show .wiki-doc-layout > .wiki-doc-main { grid-column:2 !important; grid-row:1 !important; }
    body.theme-light[data-theme-area="frontend"].route-wiki-show .wiki-doc-layout > .wiki-doc-meta-rail { position:sticky; top:calc(var(--df-header-total, 0px) + 18px); grid-column:3 !important; grid-row:1 !important; max-height:calc(100vh - var(--df-header-total, 0px) - 36px); overflow:auto; }
}

/* The answering workbench is not a reading document.  Keep its Markdown
   compact and local so long-form prose rules cannot alter question copy. */
body.theme-light[data-theme-area="frontend"] .question-workbench :is(.q-prompt, .q-option-text) {
    color: var(--ink);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: 0;
}

body.theme-light[data-theme-area="frontend"] .question-workbench :is(.q-prompt, .q-option-text) :is(p, li, blockquote, table, th, td, strong, em) {
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
}

body.theme-light[data-theme-area="frontend"] .question-workbench :is(.q-prompt, .q-option-text) :is(p, ul, ol, blockquote, pre, table) {
    margin-top: 0;
    margin-bottom: 8px;
}

body.theme-light[data-theme-area="frontend"] .question-workbench :is(.q-prompt, .q-option-text) > :last-child {
    margin-bottom: 0;
}

body.theme-light[data-theme-area="frontend"] .question-workbench .q-option {
    align-items: flex-start;
    min-height: 0;
    padding: var(--sp-2) var(--sp-3);
}


/* 检材下载：整体纵向铺满 */
.info-facts.download-facts {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    width: 100% !important;
}

.info-facts.download-facts > .download-fact {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 6px !important;
    width: 100% !important;
    padding: 0 !important;
}

/* 标签 */
.download-fact-label {
    display: block;
    color: var(--ink-muted);
    font-size: var(--text-xs);
    font-weight: 600;
}

/* 有内容的下载/复制条 */
.info-link-card,
.info-copy-card {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 42px;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    text-align: left;
    text-decoration: none;
    outline: none;
}

/* 有内容的才像可点击 */
.info-copy-card:not(.is-empty) {
    cursor: pointer;
}

.info-link-card:not(.is-empty):hover,
.info-copy-card:not(.is-empty):hover {
    border-color: rgba(37, 99, 235, 0.36);
    background: var(--surface-alt);
    color: var(--ink);
}

/* 未提供：不要做成小按钮，做成完整的空状态提示 */
.info-link-card.is-empty,
.info-copy-card.is-empty {
    width: 100% !important;
    min-height: 38px;
    justify-content: flex-start;
    cursor: default;
    border: 1px dashed rgba(126, 143, 168, 0.45);
    background: rgba(246, 248, 251, 0.72);
    color: var(--ink-muted);
    box-shadow: none;
}

.info-link-card.is-empty:hover,
.info-copy-card.is-empty:hover {
    border-color: rgba(126, 143, 168, 0.45);
    background: rgba(246, 248, 251, 0.72);
}

/* 文本 */
.info-copy-value {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--text-sm);
    color: inherit;
}

/* 只有真实提取码/密码才用等宽字体 */
.info-copy-card:not(.is-empty) .info-copy-value {
    font-family: var(--font-mono);
}

/* 未提供文字不要像代码 */
.info-copy-card.is-empty .info-copy-value,
.info-link-card.is-empty .info-copy-value {
    font-family: inherit;
    font-size: var(--text-sm);
}

/* 复制按钮文字 */
.info-copy-action {
    flex-shrink: 0;
    color: var(--accent);
    font-size: var(--text-xs);
    font-weight: 700;
}

.info-copy-card.copied {
    border-color: rgba(13, 150, 104, 0.42);
    background: rgba(13, 150, 104, 0.08);
}

.info-copy-card.copied .info-copy-action {
    color: var(--positive);
}


/* 文字块超过 8 行自动折叠：案件背景 / 背景资料 / 补充说明 */
.collapsible-prose-wrap {
    position: relative;
    width: 100%;
}

.collapsible-prose-body {
    position: relative;
    overflow: hidden;
    transition: max-height .22s ease;
}

.collapsible-prose-wrap.is-collapsed .collapsible-prose-body::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3.8em;
    pointer-events: none;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0),
        var(--surface) 78%
    );
}

.rail-info-block .collapsible-prose-wrap.is-collapsed .collapsible-prose-body::after,
.info-block .collapsible-prose-wrap.is-collapsed .collapsible-prose-body::after {
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0),
        var(--surface) 78%
    );
}

.collapsible-prose-toggle {
    display: none;
    width: 100%;
    margin-top: 10px;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-alt);
    color: var(--accent);
    font-size: var(--text-xs);
    font-weight: 700;
    text-align: center;
    cursor: pointer;
}

.collapsible-prose-toggle:hover {
    border-color: rgba(37, 99, 235, 0.34);
    background: var(--accent-soft);
}

.collapsible-prose-wrap.is-collapsible .collapsible-prose-toggle {
    display: block;
}

.collapsible-prose-wrap:not(.is-collapsed) .collapsible-prose-toggle {
    margin-top: 12px;
}

/* frontend theme switcher */
.dfb-theme-switcher {
    position: relative;
}

.dfb-theme-switcher-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--accent);
}

.dfb-theme-switcher-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 168px;
    display: grid;
    gap: 6px;
    padding: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
    transition: opacity .14s ease, transform .14s ease;
    z-index: 40;
}

.dfb-theme-switcher:hover .dfb-theme-switcher-menu,
.dfb-theme-switcher.is-open .dfb-theme-switcher-menu,
.dfb-theme-switcher:focus-within .dfb-theme-switcher-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.dfb-theme-switcher-menu form {
    margin: 0;
}

.dfb-theme-switcher-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    background: var(--surface-alt);
    color: var(--ink-3);
    text-align: left;
}

.dfb-theme-switcher-item.is-active {
    border-color: var(--border-focus);
    color: var(--accent);
    background: var(--accent-soft);
}

.dfb-theme-switcher-icon {
    width: 18px;
    text-align: center;
}

/* final footer polish */
.dfb-footer-sponsor-brand {
    margin-top: 18px !important;
}

.dfb-footer-sponsor-brand .dfb-sponsor-link {
    width: fit-content;
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.3;
}

.dfb-footer-sponsor-brand .dfb-sponsor-logo {
    width: auto;
    height: 16px;
    max-width: 96px;
    object-fit: contain;
}

.dfb-footer-records > * + *::before {
    display: none !important;
    content: none !important;
}

.dfb-record-item {
    display: inline-grid !important;
    grid-template-columns: 18px auto minmax(0, auto);
    align-items: center;
    gap: 8px;
}

.dfb-record-icon,
.dfb-record-icon-spacer {
    width: 18px;
    height: 18px;
    display: inline-block;
}

.dfb-record-icon {
    object-fit: contain;
}

.dfb-record-icon-spacer {
    opacity: 0;
}

.dfb-record-label {
    min-width: 4.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.dfb-record-copy {
    min-width: 0;
    overflow-wrap: anywhere;
    text-align: left;
}

@media (max-width: 720px) {
    .dfb-footer {
        padding: 22px 16px 18px !important;
        border-top-width: 1px !important;
    }

    .dfb-footer-inner {
        width: min(100%, 420px) !important;
        grid-template-columns: 1fr !important;
        gap: 14px !important;
        justify-items: center !important;
        margin: 0 auto !important;
        text-align: center !important;
    }

    .dfb-footer-links,
    .dfb-footer-sponsor-brand,
    .dfb-footer-qrs,
    .dfb-footer-contact-list,
    .dfb-footer-support > h3,
    .dfb-footer-support > .dfb-footer-description {
        display: none !important;
    }

    .dfb-footer-brand,
    .dfb-footer-support {
        width: 100% !important;
        max-width: 380px !important;
        align-items: center !important;
        text-align: center !important;
    }

    .dfb-footer-brand-top {
        justify-content: center !important;
        gap: 10px !important;
        margin: 0 !important;
    }

    .dfb-footer-logo {
        width: 44px !important;
        height: 44px !important;
    }

    .dfb-footer-brand-top > div {
        display: grid !important;
        gap: 2px !important;
        text-align: left !important;
    }

    .dfb-footer-brand-top h2 {
        margin: 0 !important;
        font-size: 1.05rem !important;
        line-height: 1.1 !important;
    }

    .dfb-footer-brand-top p {
        display: block !important;
        max-width: 220px !important;
        margin: 0 !important;
        font-size: 0.75rem !important;
        line-height: 1.35 !important;
        color: var(--ink-muted) !important;
    }

    .dfb-footer-support-actions {
        width: min(100%, 340px) !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: center !important;
        gap: 10px !important;
        margin: 4px auto 0 !important;
    }

    .dfb-footer-support-actions .btn {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        min-height: 38px !important;
        justify-content: center !important;
        padding: 9px 10px !important;
        border-radius: 999px !important;
        white-space: nowrap !important;
    }

    .dfb-footer-bottom {
        width: min(100%, 390px) !important;
        display: grid !important;
        gap: 10px !important;
        justify-items: center !important;
        margin: 16px auto 0 !important;
        padding-top: 14px !important;
        border-top: 1px solid rgba(191, 201, 217, 0.74) !important;
        text-align: center !important;
    }

    .dfb-footer-bottom-main {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        gap: 0 !important;
    }

    .dfb-footer-bottom-main span:first-child {
        display: inline-flex !important;
        color: var(--ink-muted) !important;
        font-size: 12px !important;
    }

    .dfb-footer-bottom-main span:not(:first-child) {
        display: none !important;
    }

    .dfb-footer-records {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        justify-items: stretch !important;
    }

    .dfb-footer-records .dfb-record-item {
        width: 100% !important;
        box-sizing: border-box !important;
        display: grid !important;
        grid-template-columns: 20px 4.9rem minmax(0, 1fr) !important;
        justify-content: stretch !important;
        align-items: center !important;
        gap: 8px !important;
        padding: 9px 10px !important;
        border: 1px solid rgba(191, 201, 217, 0.74) !important;
        border-radius: 14px !important;
        background: rgba(255, 255, 255, 0.76) !important;
        text-decoration: none !important;
    }

    .dfb-footer-records .dfb-record-icon,
    .dfb-footer-records .dfb-record-icon-spacer {
        width: 18px !important;
        height: 18px !important;
        justify-self: center !important;
    }

    .dfb-footer-records .dfb-record-label {
        min-width: 0 !important;
        justify-content: flex-start !important;
        color: var(--ink) !important;
        font-size: 12px !important;
        line-height: 1.35 !important;
    }

    .dfb-footer-records .dfb-record-copy,
    .dfb-footer-records .dfb-record-text,
    .dfb-footer-records .dfb-record-link {
        width: 100% !important;
        color: var(--ink-muted) !important;
        font-size: 12px !important;
        line-height: 1.35 !important;
        text-align: left !important;
        white-space: normal !important;
    }
}

@media (max-width: 390px) {
    .dfb-footer-records .dfb-record-item {
        grid-template-columns: 18px 4.55rem minmax(0, 1fr) !important;
        gap: 7px !important;
        padding: 9px !important;
    }

    .dfb-footer-records .dfb-record-label,
    .dfb-footer-records .dfb-record-copy,
    .dfb-footer-records .dfb-record-text,
    .dfb-footer-records .dfb-record-link {
        font-size: 11.5px !important;
    }
}

/* commercial footer refinement */
.dfb-footer-partners {
    margin-top: 22px !important;
    padding-top: 18px !important;
    border-top: 1px solid rgba(191, 201, 217, 0.78);
}

.dfb-footer-partners-title {
    margin-bottom: 10px;
    color: var(--ink-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.dfb-footer-partner-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.dfb-footer-partner-item {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border: 1px solid rgba(191, 201, 217, 0.86);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--ink);
    text-decoration: none;
    transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.dfb-footer-partner-item:hover {
    border-color: rgba(37, 99, 235, 0.42);
    background: #ffffff;
    color: var(--accent);
    transform: translateY(-1px);
}

.dfb-footer-partner-logo {
    width: auto;
    height: 18px;
    max-width: 94px;
    object-fit: contain;
    flex: 0 0 auto;
}

.dfb-footer-partner-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.dfb-footer-partner-copy strong {
    color: inherit;
    font-size: 12px;
    line-height: 1.2;
}

.dfb-footer-partner-copy span {
    color: var(--ink-muted);
    font-size: 11px;
    line-height: 1.25;
}

.dfb-footer-bottom {
    align-items: center !important;
}

.dfb-footer-bottom-main {
    align-items: center !important;
}

.dfb-footer-records {
    align-items: center !important;
    gap: 10px 18px !important;
}

.dfb-footer-records .dfb-record-item {
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.dfb-footer-records .dfb-record-label {
    min-width: 4.4rem;
    justify-content: flex-start;
    color: var(--ink-muted);
    font-size: 12px;
    font-weight: 700;
}

.dfb-footer-records .dfb-record-copy,
.dfb-footer-records .dfb-record-text,
.dfb-footer-records .dfb-record-link {
    color: var(--ink-2);
    font-size: 12px;
    line-height: 1.45;
}

@media (max-width: 720px) {
    .dfb-footer-partners {
        display: none !important;
    }

    .dfb-footer-bottom {
        width: min(100%, 360px) !important;
        gap: 9px !important;
        border-top-color: rgba(191, 201, 217, 0.72) !important;
    }

    .dfb-footer-records {
        gap: 6px !important;
    }

    .dfb-footer-records .dfb-record-item {
        grid-template-columns: 18px 4.55rem minmax(0, 1fr) !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
    }

    .dfb-footer-records .dfb-record-label {
        color: var(--ink-muted) !important;
    }

    .dfb-footer-records .dfb-record-copy,
    .dfb-footer-records .dfb-record-text,
    .dfb-footer-records .dfb-record-link {
        color: var(--ink-2) !important;
    }
}

/* legal bar: copyright, ICP and MPS in one line */
.dfb-footer-bottom {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px 18px !important;
    flex-wrap: wrap !important;
}

.dfb-footer-bottom-main {
    flex: 0 0 auto !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0 !important;
    padding-right: 18px;
    border-right: 1px solid rgba(191, 201, 217, 0.86);
}

.dfb-footer-bottom-main span {
    display: inline-flex !important;
    align-items: center;
}

.dfb-footer-bottom-main span + span {
    margin-left: 10px !important;
    padding-left: 10px !important;
    border-left: 1px solid rgba(191, 201, 217, 0.86);
}

.dfb-footer-bottom-main span + span::before {
    display: none !important;
    content: none !important;
}

.dfb-footer-records {
    flex: 1 1 auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 0 !important;
    min-width: min(100%, 520px);
}

.dfb-footer-records .dfb-record-item {
    width: auto !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    min-width: 0 !important;
    white-space: nowrap !important;
}

.dfb-footer-records .dfb-record-item + .dfb-record-item {
    margin-left: 16px !important;
    padding-left: 16px !important;
    border-left: 1px solid rgba(191, 201, 217, 0.86) !important;
}

.dfb-footer-records .dfb-record-icon-spacer {
    display: none !important;
}

.dfb-footer-records .dfb-record-icon {
    width: 16px !important;
    height: 16px !important;
}

.dfb-footer-records .dfb-record-label {
    min-width: 0 !important;
    font-weight: 700;
}

.dfb-footer-records .dfb-record-copy {
    width: auto !important;
}

@media (max-width: 720px) {
    .dfb-footer-bottom {
        width: min(100%, 390px) !important;
        display: flex !important;
        justify-content: center !important;
        gap: 7px 10px !important;
    }

    .dfb-footer-bottom-main {
        flex-wrap: wrap !important;
        justify-content: center !important;
        padding-right: 0 !important;
        border-right: 0 !important;
    }

    .dfb-footer-bottom-main span {
        display: inline-flex !important;
    }

    .dfb-footer-bottom-main span + span {
        margin-left: 8px !important;
        padding-left: 8px !important;
        border-left: 1px solid rgba(191, 201, 217, 0.86) !important;
    }

    .dfb-footer-records {
        flex: 0 1 auto !important;
        width: auto !important;
        min-width: 0 !important;
        display: flex !important;
        justify-content: center !important;
        gap: 7px 12px !important;
        flex-wrap: wrap !important;
    }

    .dfb-footer-records .dfb-record-item {
        width: auto !important;
        display: inline-flex !important;
        grid-template-columns: none !important;
        gap: 5px !important;
        white-space: nowrap !important;
    }

    .dfb-footer-records .dfb-record-item + .dfb-record-item {
        margin-left: 0 !important;
        padding-left: 0 !important;
        border-left: 0 !important;
    }
}

/* premium markdown reading system */
.reading-document {
    position: relative;
    overflow: hidden;
}

.prose,
.prose-reading {
    --md-ink: #182238;
    --md-ink-soft: #46556f;
    --md-ink-muted: #7e8fa8;
    --md-line: rgba(191, 201, 217, 0.92);
    --md-line-soft: rgba(191, 201, 217, 0.64);
    --md-panel: rgba(255, 255, 255, 0.82);
    --md-panel-strong: #ffffff;
    --md-accent: #2563eb;
    --md-accent-2: #0891b2;
    --md-accent-3: #0d9668;
    color: var(--md-ink);
    font-size: 16.5px;
    line-height: 1.86;
    letter-spacing: 0.005em;
    word-break: break-word;
}

.prose > *:first-child { margin-top: 0 !important; }
.prose > *:last-child { margin-bottom: 0 !important; }

.prose p,
.prose blockquote,
.prose ul,
.prose ol,
.prose dl,
.prose table,
.prose details,
.prose .dfb-code-block {
    margin: 1.05rem 0;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
    position: relative;
    scroll-margin-top: calc(var(--df-header-total, 76px) + 24px);
    margin: 2.25rem 0 0.9rem;
    color: var(--md-ink);
    font-weight: 900;
    line-height: 1.22;
    letter-spacing: -0.02em;
}

.prose h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    padding-bottom: 0.7rem;
    background: linear-gradient(110deg, #111827 0%, var(--md-accent) 48%, var(--md-accent-2) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.prose h2 {
    font-size: clamp(1.55rem, 3.5vw, 2.25rem);
    padding-left: 1rem;
    background: linear-gradient(110deg, #111827 0%, #2563eb 52%, #0891b2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.prose h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.18em;
    bottom: 0.15em;
    width: 4px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--md-accent), var(--md-accent-2));
    box-shadow: 0 0 18px rgba(37, 99, 235, 0.2);
}

.prose h3 {
    font-size: clamp(1.25rem, 2.7vw, 1.62rem);
    color: #111827;
}

.prose h3::after {
    content: "";
    display: block;
    width: 58px;
    height: 2px;
    margin-top: 0.55rem;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--md-accent), transparent);
}

.prose h4 { font-size: 1.15rem; color: #1f2a44; }
.prose h5 { font-size: 1.02rem; color: var(--md-accent); text-transform: uppercase; letter-spacing: 0.08em; }
.prose h6 { font-size: 0.92rem; color: var(--md-ink-muted); text-transform: uppercase; letter-spacing: 0.14em; }

.prose p {
    color: var(--md-ink);
    max-width: 76ch;
}

.prose strong { color: #111827; font-weight: 800; }
.prose em { color: #24324d; }
.prose del { color: var(--md-ink-muted); text-decoration-color: rgba(37, 99, 235, 0.52); }
.prose mark {
    padding: 0.08em 0.32em;
    border-radius: 0.35em;
    background: linear-gradient(120deg, rgba(37, 99, 235, 0.16), rgba(8, 145, 178, 0.12));
    color: #111827;
}

.prose a {
    color: var(--md-accent);
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px solid rgba(37, 99, 235, 0.34);
    transition: color .16s ease, border-color .16s ease, background .16s ease;
}

.prose a:hover {
    color: var(--md-accent-2);
    border-bottom-color: rgba(8, 145, 178, 0.72);
    background: rgba(37, 99, 235, 0.07);
}

.prose hr {
    height: 1px;
    margin: 2rem 0;
    border: 0;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.48), rgba(8, 145, 178, 0.44), transparent);
}

.prose blockquote {
    position: relative;
    padding: 1rem 1.1rem 1rem 1.35rem;
    border: 1px solid var(--md-line);
    border-left: 4px solid var(--md-accent);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(8, 145, 178, 0.06));
    color: #24324d;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.prose blockquote p { margin: 0.5rem 0; color: inherit; }

.prose ul,
.prose ol {
    padding-left: 1.35rem;
}

.prose li {
    margin: 0.42rem 0;
    padding-left: 0.2rem;
}

.prose li::marker {
    color: var(--md-accent);
    font-weight: 900;
}

.prose ul.contains-task-list,
.prose .contains-task-list {
    padding-left: 0;
    list-style: none;
}

.prose .task-list-item,
.prose li:has(> input[type="checkbox"]) {
    list-style: none;
    padding-left: 0;
}

.prose input[type="checkbox"] {
    width: 1.05em;
    height: 1.05em;
    margin-right: 0.55em;
    accent-color: var(--md-accent);
    vertical-align: -0.15em;
}

.prose code:not(pre code) {
    padding: 0.18em 0.42em;
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 0.48em;
    background: rgba(37, 99, 235, 0.08);
    color: #1746a2;
    font-family: var(--font-mono);
    font-size: 0.9em;
}

.dfb-code-block {
    overflow: hidden;
    border: 1px solid rgba(191, 201, 217, 0.92);
    border-radius: 18px;
    background: #0f172a;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.dfb-code-block:hover {
    transform: translateY(-2px);
    border-color: rgba(37, 99, 235, 0.44);
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(37, 99, 235, 0.08);
}

.dfb-code-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(71, 85, 105, 0.72);
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.22), rgba(8, 145, 178, 0.14));
}

.dfb-code-language {
    color: #93c5fd;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.14em;
}

.dfb-code-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    height: 28px;
    padding: 0 10px;
    border: 1px solid rgba(147, 197, 253, 0.4);
    border-radius: 999px;
    background: rgba(147, 197, 253, 0.1);
    color: #bfdbfe;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: transform .16s ease, background .16s ease, color .16s ease;
}

.dfb-code-copy:hover,
.dfb-code-copy.is-copied {
    transform: translateY(-1px);
    background: #93c5fd;
    color: #0f172a;
}

.dfb-code-body {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    overflow: auto;
}

.dfb-code-lines {
    min-width: 3.35rem;
    margin: 0;
    padding: 1rem 0.7rem;
    border-right: 1px solid rgba(71, 85, 105, 0.72);
    background: rgba(255, 255, 255, 0.035);
    color: #64748b;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.7;
    list-style: none;
    text-align: right;
    user-select: none;
    counter-reset: code-line;
}

.dfb-code-lines li {
    margin: 0;
    padding: 0;
    counter-increment: code-line;
}

.dfb-code-lines li::before {
    content: counter(code-line);
}

.prose .dfb-code-block pre {
    margin: 0 !important;
    padding: 1rem 1.1rem !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible;
}

.prose .dfb-code-block pre code {
    color: #e2e8f0;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.7;
    tab-size: 4;
    white-space: pre;
}

.prose table {
    width: 100%;
    display: table;
    overflow: hidden;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--md-line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.78);
}

.prose th,
.prose td {
    padding: 0.82rem 0.95rem;
    border-right: 1px solid var(--md-line-soft);
    border-bottom: 1px solid var(--md-line-soft);
    vertical-align: top;
}

.prose th:last-child,
.prose td:last-child { border-right: 0; }
.prose tr:last-child td { border-bottom: 0; }
.prose th {
    background: rgba(37, 99, 235, 0.08);
    color: #111827;
    font-weight: 900;
}

.prose tbody tr {
    transition: background .16s ease;
}

.prose tbody tr:hover {
    background: rgba(37, 99, 235, 0.05);
}

.prose img,
.prose video {
    max-width: 100%;
    height: auto;
    border-radius: 18px;
    border: 1px solid var(--md-line);
    box-shadow: 0 22px 52px rgba(15, 23, 42, 0.12);
}

.prose figure {
    margin: 1.4rem 0;
}

.prose figcaption {
    margin-top: 0.55rem;
    color: var(--md-ink-muted);
    font-size: 0.9rem;
    text-align: center;
}

.prose details {
    border: 1px solid var(--md-line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.82);
    overflow: hidden;
}

.prose summary {
    padding: 0.9rem 1rem;
    color: #111827;
    font-weight: 900;
    cursor: pointer;
}

.prose details[open] summary {
    border-bottom: 1px solid var(--md-line);
    background: rgba(37, 99, 235, 0.07);
}

.prose details > *:not(summary) {
    margin-left: 1rem;
    margin-right: 1rem;
}

.prose kbd {
    padding: 0.16em 0.42em;
    border: 1px solid rgba(37, 99, 235, 0.26);
    border-bottom-width: 3px;
    border-radius: 0.45em;
    background: #ffffff;
    color: #111827;
    font-family: var(--font-mono);
    font-size: 0.84em;
}

.prose sup,
.prose sub {
    font-size: 0.75em;
}

.prose .footnotes {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--md-line);
    color: var(--md-ink-soft);
    font-size: 0.92rem;
}

.prose .math,
.prose .language-math {
    overflow-x: auto;
    padding: 0.75rem 1rem;
    border: 1px solid var(--md-line);
    border-radius: 14px;
    background: rgba(8, 145, 178, 0.06);
}

@media (max-width: 720px) {
    .prose,
    .prose-reading {
        font-size: 15.5px;
        line-height: 1.78;
    }

    .dfb-code-toolbar {
        padding: 9px 10px;
    }

    .dfb-code-lines {
        min-width: 2.75rem;
        padding: 0.9rem 0.55rem;
        font-size: 12px;
    }

    .prose .dfb-code-block pre {
        padding: 0.9rem !important;
    }
}

/* markdown scope + readability correction */
.prose:not(.df-md-reading) {
    font-size: var(--text-base) !important;
    line-height: 1.7 !important;
    letter-spacing: normal !important;
}

.prose:not(.df-md-reading) h1,
.prose:not(.df-md-reading) h2,
.prose:not(.df-md-reading) h3,
.prose:not(.df-md-reading) h4,
.prose:not(.df-md-reading) h5,
.prose:not(.df-md-reading) h6 {
    padding-left: 0 !important;
    background: none !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
    color: var(--ink) !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.prose:not(.df-md-reading) h2::before,
.prose:not(.df-md-reading) h3::after {
    display: none !important;
}

.prose:not(.df-md-reading) p,
.prose:not(.df-md-reading) ul,
.prose:not(.df-md-reading) ol,
.prose:not(.df-md-reading) blockquote,
.prose:not(.df-md-reading) table,
.prose:not(.df-md-reading) pre,
.prose:not(.df-md-reading) details {
    margin: 0 0 var(--sp-4) !important;
}

.prose:not(.df-md-reading) a {
    color: var(--accent) !important;
    text-decoration: underline !important;
    text-underline-offset: 2px !important;
    border-bottom: 0 !important;
    background: transparent !important;
}

.prose:not(.df-md-reading) blockquote {
    padding: var(--sp-3) var(--sp-4) !important;
    border: 1px solid var(--border) !important;
    border-left: 3px solid var(--accent) !important;
    border-radius: var(--radius) !important;
    background: var(--surface-alt) !important;
    box-shadow: none !important;
}

.prose:not(.df-md-reading) code:not(pre code) {
    padding: 0.12em 0.35em !important;
    border: 1px solid var(--border) !important;
    border-radius: 0.35em !important;
    background: var(--surface-alt) !important;
    color: var(--ink) !important;
    font-size: 0.9em !important;
}

.prose:not(.df-md-reading) table {
    border-radius: var(--radius) !important;
    background: transparent !important;
}

.prose:not(.df-md-reading) th {
    background: var(--surface-alt) !important;
    color: var(--ink) !important;
}

.prose:not(.df-md-reading) img,
.prose:not(.df-md-reading) video {
    border-radius: var(--radius) !important;
    box-shadow: none !important;
}

.df-md-reading {
    --md-ink: #1f2937;
    --md-ink-soft: #475569;
    --md-ink-muted: #7c8ca5;
    --md-border: rgba(192, 203, 220, 0.88);
    --md-border-soft: rgba(192, 203, 220, 0.62);
    --md-surface: rgba(255, 255, 255, 0.88);
    --md-surface-strong: #111827;
    --md-accent: #2563eb;
    --md-accent-cool: #0f7490;
    color: var(--md-ink) !important;
    font-family: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif !important;
    font-size: 15.5px !important;
    line-height: 1.78 !important;
    letter-spacing: 0 !important;
}

.df-md-reading > *:first-child { margin-top: 0 !important; }
.df-md-reading > *:last-child { margin-bottom: 0 !important; }

.df-md-reading p,
.df-md-reading ul,
.df-md-reading ol,
.df-md-reading blockquote,
.df-md-reading table,
.df-md-reading details,
.df-md-reading .dfb-code-block {
    margin: 1rem 0 !important;
}

.df-md-reading h1,
.df-md-reading h2,
.df-md-reading h3,
.df-md-reading h4,
.df-md-reading h5,
.df-md-reading h6 {
    position: relative;
    margin: 1.9rem 0 0.78rem !important;
    padding: 0 !important;
    background: none !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
    color: #111827 !important;
    font-family: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif !important;
    font-weight: 780 !important;
    line-height: 1.32 !important;
    letter-spacing: -0.01em !important;
    scroll-margin-top: calc(var(--df-header-total, 76px) + 22px);
}

.df-md-reading h1 {
    font-size: clamp(1.72rem, 3.6vw, 2.22rem) !important;
    padding-bottom: 0.72rem !important;
    border-bottom: 1px solid var(--md-border) !important;
}

.df-md-reading h2 {
    font-size: clamp(1.36rem, 2.6vw, 1.72rem) !important;
    padding-left: 0.72rem !important;
}

.df-md-reading h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.18em;
    bottom: 0.18em;
    width: 3px;
    border-radius: 999px;
    background: var(--md-accent);
    box-shadow: none;
}

.df-md-reading h3 {
    font-size: clamp(1.12rem, 2vw, 1.32rem) !important;
    color: #1f2937 !important;
}

.df-md-reading h3::after {
    content: "";
    display: block;
    width: 42px;
    height: 2px;
    margin-top: 0.46rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.68);
}

.df-md-reading h4 { font-size: 1.04rem !important; color: #24324b !important; }
.df-md-reading h5 { font-size: 0.95rem !important; color: var(--md-accent) !important; letter-spacing: 0.04em !important; text-transform: none !important; }
.df-md-reading h6 { font-size: 0.9rem !important; color: var(--md-ink-muted) !important; letter-spacing: 0.04em !important; text-transform: none !important; }

.df-md-reading p {
    max-width: 74ch;
    color: var(--md-ink) !important;
}

.df-md-reading a {
    color: var(--md-accent) !important;
    border-bottom: 1px solid rgba(37, 99, 235, 0.26) !important;
    background: transparent !important;
}

.df-md-reading a:hover {
    color: var(--md-accent-cool) !important;
    border-bottom-color: rgba(15, 116, 144, 0.58) !important;
}

.df-md-reading strong { color: #111827 !important; font-weight: 760 !important; }
.df-md-reading em { color: #24324b !important; }

.df-md-reading blockquote {
    padding: 0.92rem 1rem 0.92rem 1.1rem !important;
    border: 1px solid var(--md-border) !important;
    border-left: 3px solid var(--md-accent) !important;
    border-radius: 12px !important;
    background: rgba(37, 99, 235, 0.045) !important;
    box-shadow: none !important;
}

.df-md-reading ul,
.df-md-reading ol {
    padding-left: 1.28rem !important;
}

.df-md-reading li {
    margin: 0.34rem 0 !important;
}

.df-md-reading li::marker {
    color: var(--md-accent) !important;
    font-weight: 700 !important;
}

.df-md-reading code:not(pre code) {
    padding: 0.14em 0.36em !important;
    border: 1px solid rgba(37, 99, 235, 0.16) !important;
    border-radius: 0.36em !important;
    background: rgba(37, 99, 235, 0.07) !important;
    color: #1d4ed8 !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace !important;
    font-size: 0.88em !important;
}

.df-md-reading .dfb-code-block {
    overflow: hidden;
    border: 1px solid var(--md-border) !important;
    border-radius: 14px !important;
    background: var(--md-surface-strong) !important;
    box-shadow: none !important;
    transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.df-md-reading .dfb-code-block:hover {
    transform: translateY(-1px);
    border-color: rgba(37, 99, 235, 0.42) !important;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.14) !important;
}

.df-md-reading .dfb-code-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px !important;
    border-bottom: 1px solid rgba(71, 85, 105, 0.64) !important;
    background: #172033 !important;
}

.df-md-reading .dfb-code-language {
    color: #9fb2cc !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em !important;
}

.df-md-reading .dfb-code-copy {
    min-width: 54px;
    height: 28px;
    border: 1px solid rgba(226, 232, 240, 0.26) !important;
    border-radius: 8px !important;
    background: rgba(226, 232, 240, 0.08) !important;
    color: #e2e8f0 !important;
    font-size: 12px !important;
    font-weight: 700 !important;
}

.df-md-reading .dfb-code-copy:hover,
.df-md-reading .dfb-code-copy.is-copied {
    background: #e2e8f0 !important;
    border-color: #e2e8f0 !important;
    color: #111827 !important;
}

.df-md-reading .dfb-code-body {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    overflow: auto;
}

.df-md-reading .dfb-code-lines {
    display: grid !important;
    align-content: start;
    min-width: 3rem !important;
    margin: 0 !important;
    padding: 0.9rem 0.72rem !important;
    border-right: 1px solid rgba(71, 85, 105, 0.64) !important;
    background: rgba(255, 255, 255, 0.035) !important;
    color: #8593a8 !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace !important;
    font-size: 12.5px !important;
    line-height: 1.68 !important;
    list-style: none !important;
    text-align: right;
    user-select: none;
}

.df-md-reading .dfb-code-lines span {
    display: block;
    height: 1.68em;
    margin: 0 !important;
    padding: 0 !important;
}

.df-md-reading .dfb-code-lines span::before,
.df-md-reading .dfb-code-lines span::marker,
.df-md-reading .dfb-code-lines li::before,
.df-md-reading .dfb-code-lines li::marker {
    content: none !important;
}

.df-md-reading .dfb-code-block pre {
    margin: 0 !important;
    padding: 0.9rem 1rem !important;
    background: transparent !important;
    border: 0 !important;
    overflow: visible !important;
}

.df-md-reading .dfb-code-block pre code {
    color: #e2e8f0 !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace !important;
    font-size: 12.5px !important;
    line-height: 1.68 !important;
    letter-spacing: 0 !important;
    white-space: pre !important;
}

.df-md-reading .dfb-code-block pre code::selection,
.df-md-reading .dfb-code-block pre::selection {
    background: rgba(147, 197, 253, 0.34) !important;
    color: #ffffff !important;
}

.df-md-reading table {
    border-radius: 12px !important;
    border-color: var(--md-border) !important;
    background: rgba(255, 255, 255, 0.84) !important;
}

.df-md-reading th {
    background: rgba(37, 99, 235, 0.06) !important;
    color: #111827 !important;
}

.df-md-reading td,
.df-md-reading th {
    padding: 0.68rem 0.78rem !important;
    border-color: var(--md-border-soft) !important;
}

.df-md-reading img,
.df-md-reading video {
    border-radius: 12px !important;
    box-shadow: none !important;
}

@media (max-width: 720px) {
    .df-md-reading {
        font-size: 15px !important;
        line-height: 1.72 !important;
    }

    .df-md-reading h1 { font-size: 1.68rem !important; }
    .df-md-reading h2 { font-size: 1.34rem !important; }
    .df-md-reading h3 { font-size: 1.12rem !important; }

    .df-md-reading .dfb-code-lines {
        min-width: 2.7rem !important;
        padding: 0.82rem 0.55rem !important;
    }

    .df-md-reading .dfb-code-block pre {
        padding: 0.82rem 0.9rem !important;
    }
}

/* refined theme switcher */
.dfb-theme-switcher {
    position: relative;
    z-index: 60;
    padding-bottom: 10px;
    margin-bottom: -10px;
}

.dfb-theme-switcher-toggle {
    width: auto !important;
    min-width: 96px;
    height: 38px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 12px !important;
    border: 1px solid var(--border) !important;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.84) !important;
    color: var(--ink-2) !important;
    box-shadow: none;
    transition: border-color .16s ease, background .16s ease, color .16s ease;
}

.dfb-theme-switcher-toggle:hover,
.dfb-theme-switcher.is-open .dfb-theme-switcher-toggle {
    border-color: rgba(37, 99, 235, 0.38) !important;
    background: #ffffff !important;
    color: var(--ink) !important;
}

.dfb-theme-switcher-current-icon {
    width: 16px;
    color: var(--accent);
    font-size: 13px;
    line-height: 1;
    text-align: center;
}

.dfb-theme-switcher-current {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.dfb-theme-switcher-caret {
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    opacity: 0.72;
}

.dfb-theme-switcher::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 12px;
}

.dfb-theme-switcher-menu {
    top: calc(100% + 2px) !important;
    right: 0;
    min-width: 132px !important;
    gap: 4px !important;
    padding: 6px !important;
    border: 1px solid var(--border) !important;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.12);
    transform: translateY(4px) !important;
}

.dfb-theme-switcher:hover .dfb-theme-switcher-menu,
.dfb-theme-switcher.is-open .dfb-theme-switcher-menu,
.dfb-theme-switcher:focus-within .dfb-theme-switcher-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) !important;
}

.dfb-theme-switcher-item {
    min-height: 34px;
    padding: 7px 9px !important;
    border: 0 !important;
    border-radius: 10px;
    background: transparent !important;
    color: var(--ink-3) !important;
    text-decoration: none;
}

.dfb-theme-switcher-item:hover {
    background: rgba(37, 99, 235, 0.07) !important;
    color: var(--ink) !important;
}

.dfb-theme-switcher-item.is-active {
    background: var(--accent-soft) !important;
    color: var(--accent) !important;
}

.dfb-theme-switcher-icon {
    width: 16px !important;
    color: inherit;
    font-family: inherit !important;
    font-size: 12px;
}


.writeup-reading-document {
    padding-top: clamp(26px, 3vw, 38px) !important;
    padding-bottom: clamp(30px, 4vw, 48px) !important;
}

.writeup-reading-document .df-md-reading > :first-child {
    margin-top: 0 !important;
}

.writeup-reading-document .df-md-reading > h1:first-child {
    margin-bottom: 1.15rem !important;
    padding-bottom: .6em !important;
    border-bottom: 1px solid var(--border) !important;
}

/* Page-to-footer spacing is owned by the page container. Applying a second
   margin to its last child doubles the empty area on short list pages. */
.dfb-page { padding-bottom: 0 !important; }

.dfb-page > .dfb-container > :last-child { margin-bottom: 0 !important; }

@media (max-width: 720px) {
    .df-hero-tag {
        display: none !important;
    }

    .df-hero-title { display: block !important; }

    .df-hero-lead {
        margin-top: 0 !important;
    }

    .dfb-header {
        overflow: visible !important;
    }

    .dfb-theme-switcher-menu {
        position: fixed !important;
        top: 58px !important;
        left: 14px !important;
        right: 14px !important;
        width: auto !important;
        min-width: 0 !important;
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
        padding: 8px !important;
        z-index: 1000 !important;
    }

    .dfb-theme-switcher.is-open .dfb-theme-switcher-menu,
    .dfb-theme-switcher:focus-within .dfb-theme-switcher-menu {
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        transform: none !important;
    }

    .dfb-theme-switcher-item {
        justify-content: center !important;
        min-height: 40px !important;
    }

    .writeup-reading-document {
        padding-top: 20px !important;
        padding-bottom: 26px !important;
    }

    .dfb-page { padding-bottom: 0 !important; }

    .dfb-page > .dfb-container > :last-child { margin-bottom: 0 !important; }
}

/* Desktop width sync: keep light and dark themes on the same content rhythm. */
@media (min-width: 981px) {
    body.theme-light {
        --content-max: 1440px;
    }

    body.theme-light .dfb-header-inner,
    body.theme-light .dfb-container,
    body.theme-light .dfb-footer-inner {
        max-width: 1440px !important;
    }

    body.theme-light .comp-hero,
    body.theme-light .comp-workspace,
    body.theme-light .notice-bar {
        width: 100% !important;
        max-width: 100% !important;
        margin-inline: 0 !important;
    }

    body.theme-light .comp-workspace {
        grid-template-columns: 240px minmax(0, 1fr) 320px !important;
        gap: 18px !important;
    }
}

/* Wiki / WP reading polish */
body.theme-light .wiki-index-layout {
    grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
    gap: 28px;
}

body.theme-light .wiki-index-list {
    min-height: 0;
}

body.theme-light .doc-index.wiki-doc-layout,
body.theme-light .writeup-doc-layout {
    grid-template-columns: minmax(230px, 270px) minmax(0, 1fr) minmax(250px, 290px);
    gap: 24px;
}

body.theme-light .doc-current-card h2 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.45;
    color: var(--ink);
    overflow-wrap: anywhere;
}

body.theme-light .doc-current-card p {
    margin: 8px 0 0;
    color: var(--ink-muted);
    font-size: 0.8125rem;
    line-height: 1.65;
}

body.theme-light .writeup-doc-layout .writeup-meta-side {
    grid-column: 1;
    grid-row: 1;
}

body.theme-light .writeup-doc-layout .writeup-reading-document {
    grid-column: 2;
    grid-row: 1;
}

body.theme-light .writeup-doc-layout .wiki-doc-outline-rail {
    grid-column: 3;
    grid-row: 1;
}

body.theme-light .writeup-doc-layout .writeup-meta-card {
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
}

@media (max-width: 1180px) {
    body.theme-light .doc-index.wiki-doc-layout,
    body.theme-light .writeup-doc-layout {
        grid-template-columns: minmax(210px, 250px) minmax(0, 1fr);
    }

    body.theme-light .doc-index.wiki-doc-layout > .wiki-doc-main,
    body.theme-light .writeup-doc-layout .writeup-reading-document {
        grid-column: 2;
    }

    body.theme-light .wiki-doc-outline-rail {
        display: none;
    }
}

/* Sidebar overflow guardrails */
body.theme-light .content-shell > *,
body.theme-light .doc-index > *,
body.theme-light .writeup-shell > *,
body.theme-light .writeup-doc-layout > *,
body.theme-light .comp-workspace > *,
body.theme-light .competition-shell > * {
    min-width: 0;
}

body.theme-light .aside-stack,
body.theme-light .doc-rail,
body.theme-light .wiki-doc-outline-rail,
body.theme-light .wiki-doc-meta-rail,
body.theme-light .writeup-meta-side,
body.theme-light .writeup-detail-rail,
body.theme-light .comp-info,
body.theme-light .competition-info-sticky{
    min-width: 0;
    overflow-x: hidden;
}

body.theme-light .aside-stack > *,
body.theme-light .doc-rail > *,
body.theme-light .wiki-doc-outline-rail > *,
body.theme-light .wiki-doc-meta-rail > *,
body.theme-light .writeup-meta-side > *,
body.theme-light .writeup-detail-rail > *,
body.theme-light .comp-info > *{
    min-width: 0;
    max-width: 100%;
}

body.theme-light .aside-stack .section-link,
body.theme-light .doc-rail .section-link,
body.theme-light .wiki-doc-meta-rail .section-link,
body.theme-light .wiki-doc-outline-rail .section-link,
body.theme-light .writeup-meta-side .section-link,
body.theme-light .catalog-side .section-link {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
}

body.theme-light .info-list,
body.theme-light .info-item,
body.theme-light .doc-meta-list,
body.theme-light .doc-meta-row,
body.theme-light .writeup-author-profile,
body.theme-light .writeup-author-profile > div,
body.theme-light .catalog-side,
body.theme-light .catalog-line {
    min-width: 0;
}

body.theme-light .info-item dd,
body.theme-light .doc-meta-row strong,
body.theme-light .doc-meta-row a,
body.theme-light .doc-current-card h2,
body.theme-light .doc-current-card p,
body.theme-light .writeup-meta-card h2,
body.theme-light .writeup-meta-card p,
body.theme-light .writeup-author-profile dd,
body.theme-light .hash-text,
body.theme-light .doc-source-link,
body.theme-light .writeup-source-link,
body.theme-light .catalog-side strong,
body.theme-light .catalog-side span,
body.theme-light .compact-prose {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

body.theme-light .doc-source-link,
body.theme-light .writeup-source-link {
    white-space: normal;
    text-overflow: clip;
}

@media (max-width: 980px) {
    body.theme-light .wiki-index-layout,
    body.theme-light .doc-index.wiki-doc-layout,
    body.theme-light .writeup-doc-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    body.theme-light .doc-index.wiki-doc-layout > .wiki-doc-main,
    body.theme-light .writeup-doc-layout .writeup-reading-document,
    body.theme-light .wiki-doc-outline-rail,
    body.theme-light .wiki-doc-meta-rail {
        grid-column: 1;
        grid-row: auto;
    }

    body.theme-light .wiki-doc-meta-rail {
        order: 1;
    }

    body.theme-light .wiki-doc-main,
    body.theme-light .writeup-reading-document {
        order: 2;
    }

body.theme-light .wiki-doc-outline-rail {
        display: flex;
        order: 3;
    }
}

/* Modular Markdown blocks for /more pages */
body.theme-light .more-content {
    color: #1f2937;
    line-height: 1.8;
}

body.theme-light .more-pages-content.about-us-page {
    width: min(100%, 1120px) !important;
}

body.theme-light .df-md-hero {
    text-align: center;
    padding: 72px 20px 64px;
}

body.theme-light .df-md-hero h1 {
    margin: 0 0 18px;
    font-size: clamp(34px, 4vw, 42px);
    font-weight: 900;
    color: #111827;
    letter-spacing: -1px;
}

body.theme-light .df-md-hero h2 {
    margin: 0 0 12px;
    font-size: clamp(22px, 2.4vw, 26px);
    line-height: 1.35;
    font-weight: 800;
    color: #2478ff;
}

body.theme-light .df-md-hero p {
    max-width: 820px;
    margin: 22px auto 0;
    font-size: 16px;
    line-height: 1.9;
    color: #64748b;
}

body.theme-light .df-md-section-title {
    margin: 64px 0 36px;
    text-align: center;
}

body.theme-light .df-md-section-title p {
    margin: 0;
    font-size: clamp(26px, 3vw, 32px);
    line-height: 1.4;
    font-weight: 900;
    color: #2478ff;
}

body.theme-light .df-md-card-grid {
    display: grid;
    gap: 24px;
    margin: 32px auto 72px;
}

body.theme-light .df-md-card-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.theme-light .df-md-card-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.theme-light .df-md-card-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.theme-light .df-md-card {
    min-height: 180px;
    padding: 30px 24px;
    text-align: center;
    background: #ffffff;
    border: 1px solid rgba(219, 226, 239, 0.86);
    border-radius: 20px;
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

body.theme-light .df-md-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 42px rgba(37, 99, 235, 0.14);
}

body.theme-light .df-md-card p:first-child strong {
    display: block;
    margin-bottom: 14px;
    font-size: 34px;
    line-height: 1;
}

body.theme-light .df-md-card h3 {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 800;
    color: #1f2937;
}

body.theme-light .df-md-card p {
    margin: 0;
    font-size: 14px;
    line-height: 1.8;
    color: #64748b;
}

body.theme-light .df-md-quote-card {
    max-width: 760px;
    margin: 40px auto 72px;
    padding: 28px 36px;
    text-align: center;
    color: #475569;
    background: rgba(255, 255, 255, 0.78);
    border-left: 4px solid #3b82f6;
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(37, 99, 235, 0.06);
}

body.theme-light .df-md-quote-card p {
    margin: 0;
}

@media (max-width: 1024px) {
    body.theme-light .df-md-card-grid-4,
    body.theme-light .df-md-card-grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    body.theme-light .df-md-hero {
        padding: 48px 12px 40px;
    }

    body.theme-light .df-md-card-grid-2,
    body.theme-light .df-md-card-grid-3,
    body.theme-light .df-md-card-grid-4 {
        grid-template-columns: 1fr;
    }

body.theme-light .df-md-card {
        min-height: auto;
    }
}

/* Auth pages: keep the left visual panel on desktop/tablet, hide only on phones. */
body.theme-light .auth-layout {
    grid-template-columns: minmax(300px, 0.82fr) minmax(0, 1.18fr);
    gap: 24px;
    align-items: stretch;
}

body.theme-light .auth-aside {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 520px;
    overflow: hidden;
    padding: 52px var(--sp-10) var(--sp-12);
    border: 1px solid var(--border);
    border-radius: 26px;
    background:
        linear-gradient(155deg, #ffffff 0%, #f8fafc 60%, #f0f4f8 100%);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.7) inset,
        0 20px 56px rgba(15, 23, 42, 0.07);
    color: var(--ink);
}

body.theme-light .auth-aside::before {
    content: "";
    position: absolute;
    inset: 18px;
    border: 1px solid rgba(37, 99, 235, 0.10);
    border-radius: 20px;
    pointer-events: none;
}

body.theme-light .auth-aside > * {
    position: relative;
    z-index: 1;
}

body.theme-light .auth-aside-brand {
    width: 110px;
    height: 110px;
    margin-bottom: 1.75rem;
    padding: 18px;
    border-radius: 26px;
    background: linear-gradient(145deg, rgba(37, 99, 235, 0.10), rgba(37, 99, 235, 0.04));
    color: var(--accent);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.6) inset,
        0 12px 32px rgba(37, 99, 235, 0.12);
}

body.theme-light .auth-aside-brand svg {
    width: 100%;
    height: 100%;
}

body.theme-light .auth-aside .section-kicker {
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 0.04em;
}

body.theme-light .auth-aside .page-title {
    color: var(--ink);
    font-size: clamp(2.4rem, 3.4vw, 3.2rem);
    line-height: 1.08;
    letter-spacing: -0.025em;
}

body.theme-light .auth-aside .page-lead {
    max-width: 34rem;
    color: var(--ink-muted);
    line-height: 1.7;
}

body.theme-light .auth-panel {
    min-height: 520px;
    border: 1px solid rgba(203, 213, 225, 0.76);
    border-radius: 24px;
    box-shadow: 0 20px 56px rgba(15, 23, 42, 0.08);
    justify-self: center;
    align-self: center;
    width: 100%;
    max-width: 520px;
}

@media (min-width: 768px) and (max-width: 1024px) {
    body.theme-light .auth-layout {
        grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
    }

    body.theme-light .auth-aside {
        display: flex !important;
        min-height: 0;
        padding: 32px 28px;
    }

    body.theme-light .auth-aside .page-title {
        font-size: clamp(1.8rem, 3.2vw, 2.3rem);
    }

    body.theme-light .auth-aside .page-lead {
        font-size: 0.9rem;
    }
}

@media (max-width: 767.98px) {
    body.theme-light .auth-layout {
        grid-template-columns: 1fr;
    }

    body.theme-light .auth-aside {
        display: none !important;
    }

    body.theme-light .auth-panel {
        min-height: auto;
        border-radius: 18px;
        padding: 24px !important;
    }
}

/* Flash/toast messages */
body.theme-light .df26-flash-stack {
    position: fixed;
    top: 76px;
    right: max(18px, calc((100vw - var(--content-max, 1280px)) / 2 + 18px));
    z-index: 1200;
    display: grid;
    width: min(420px, calc(100vw - 32px));
    gap: 12px;
    padding: 0;
    pointer-events: none;
}

body.theme-light .df26-flash-toast.notice-bar {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    overflow: hidden;
    margin: 0;
    padding: 15px 16px 15px 18px;
    color: #172033;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(203, 213, 225, 0.92);
    border-radius: 18px;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(18px);
    pointer-events: auto;
}

body.theme-light .df26-flash-toast.notice-bar::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: #2563eb;
}

body.theme-light .df26-flash-toast.notice-bar.success::before {
    background: #16a34a;
}

body.theme-light .df26-flash-toast.notice-bar.warning::before {
    background: #f59e0b;
}

body.theme-light .df26-flash-toast.notice-bar.danger::before {
    background: #ef4444;
}

body.theme-light .df26-flash-copy {
    min-width: 0;
    font-size: 0.94rem;
    line-height: 1.65;
}

body.theme-light .df26-flash-copy strong {
    display: block;
    margin: 0 0 6px;
    color: #0f172a;
    font-weight: 800;
}

body.theme-light .df26-flash-copy ul {
    margin: 0;
    padding-left: 18px;
}

body.theme-light .df26-flash-close {
    display: inline-grid;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    place-items: center;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid rgba(203, 213, 225, 0.9);
    border-radius: 999px;
    line-height: 1;
    transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

body.theme-light .df26-flash-close:hover {
    color: #0f172a;
    border-color: rgba(37, 99, 235, 0.4);
    transform: translateY(-1px);
}

@media (max-width: 640px) {
    body.theme-light .df26-flash-stack {
        top: 64px;
        right: 12px;
        left: 12px;
        width: auto;
    }
}

/* Auth pages: true horizontal and vertical centering */
body.theme-light:is(.route-login, .route-register, .route-password-request, .route-password-reset, .route-verification-notice, .route-open-auth-show) .dfb-page {
    display: flex;
    align-items: center;
    min-height: calc(100svh - 74px);
    padding-block: clamp(28px, 5vw, 64px);
}

body.theme-light:is(.route-login, .route-register, .route-password-request, .route-password-reset, .route-verification-notice, .route-open-auth-show) .dfb-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

body.theme-light:is(.route-login, .route-register, .route-password-request, .route-password-reset, .route-verification-notice, .route-open-auth-show) .auth-layout {
    width: min(1040px, 100%);
    margin: 0 auto;
}

@media (max-width: 767.98px) {
    body.theme-light:is(.route-login, .route-register, .route-password-request, .route-password-reset, .route-verification-notice, .route-open-auth-show) .dfb-page {
        min-height: calc(100svh - 62px);
        padding-block: 22px;
    }

    body.theme-light:is(.route-login, .route-register, .route-password-request, .route-password-reset, .route-verification-notice, .route-open-auth-show) .auth-layout {
        width: min(440px, 100%);
    }
}

/* Modern modular Markdown blocks for /more/about-us */
body.theme-light .more-pages-content:is(.about-us-page, .modular-page) {
    width: min(100%, 1120px) !important;
    padding: clamp(32px, 4vw, 56px) !important;
    border-radius: 30px;
}

body.theme-light .more-pages-content:is(.about-us-page, .modular-page) > .catalog-head,
body.theme-light .more-pages-content:is(.about-us-page, .modular-page) > .page-title,
body.theme-light .more-pages-content:is(.about-us-page, .modular-page) > .page-lead {
    display: none;
}

body.theme-light .more-pages-content:is(.about-us-page, .modular-page) .more-content {
    margin-top: 0 !important;
}

body.theme-light .more-content .df-md-hero {
    position: relative;
    overflow: hidden;
    margin: 0 0 clamp(60px, 7vw, 84px);
    padding: clamp(56px, 7vw, 88px) clamp(24px, 5vw, 72px);
    text-align: center;
    background:
        radial-gradient(circle at 20% 18%, rgba(59, 130, 246, 0.14), transparent 34%),
        radial-gradient(circle at 82% 76%, rgba(14, 165, 233, 0.12), transparent 36%),
        linear-gradient(135deg, #ffffff 0%, #f7fbff 48%, #edf6ff 100%);
    border: 1px solid rgba(191, 219, 254, 0.9);
    border-radius: 34px;
    box-shadow: 0 24px 70px rgba(37, 99, 235, 0.13);
}

body.theme-light .more-content .df-md-hero::after {
    content: "";
    position: absolute;
    inset: 18px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 24px;
    pointer-events: none;
}

body.theme-light .more-content .df-md-hero-title,
body.theme-light .more-content .df-md-hero h1 {
    position: relative;
    z-index: 1;
    margin: 0 0 18px;
    color: #0f172a;
    font-size: clamp(2.7rem, 6vw, 4.8rem);
    font-weight: 950;
    line-height: 1.02;
    letter-spacing: -0.07em;
}

body.theme-light .more-content .df-md-hero-subtitle,
body.theme-light .more-content .df-md-hero h2 {
    position: relative;
    z-index: 1;
    margin: 0 auto 12px;
    color: #2563eb;
    font-size: clamp(1.2rem, 2.4vw, 1.72rem);
    font-weight: 850;
    line-height: 1.45;
}

body.theme-light .more-content .df-md-hero-desc,
body.theme-light .more-content .df-md-hero > p:not(.df-md-hero-subtitle) {
    position: relative;
    z-index: 1;
    max-width: 760px;
    margin: 24px auto 0;
    color: #64748b;
    font-size: 1.03rem;
    line-height: 1.95;
}

body.theme-light .more-content .df-md-section-title {
    margin: clamp(58px, 7vw, 86px) 0 30px;
    text-align: center;
}

body.theme-light .more-pages-content.modular-page .more-content > h1,
body.theme-light .more-pages-content.modular-page .more-content > h2,
body.theme-light .more-pages-content.about-us-page .more-content > h1,
body.theme-light .more-pages-content.about-us-page .more-content > h2 {
    margin: clamp(52px, 7vw, 78px) 0 30px !important;
    color: #2563eb !important;
    font-size: clamp(1.8rem, 3vw, 2.45rem) !important;
    font-weight: 900 !important;
    line-height: 1.25 !important;
    text-align: center !important;
    letter-spacing: -0.04em !important;
}

body.theme-light .more-content .df-md-section-title p {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    margin: 0;
    color: #2563eb;
    font-size: clamp(1.65rem, 3vw, 2.35rem);
    font-weight: 900;
    line-height: 1.25;
    letter-spacing: -0.04em;
}

body.theme-light .more-content .df-md-section-title p::before,
body.theme-light .more-content .df-md-section-title p::after {
    content: "";
    width: 38px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.58));
}

body.theme-light .more-content .df-md-section-title p::after {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.58), transparent);
}

body.theme-light .more-content .df-md-card-grid {
    display: grid;
    gap: 24px;
    margin: 30px auto clamp(68px, 7vw, 92px);
}

body.theme-light .more-content .df-md-card-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.theme-light .more-content .df-md-card-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.theme-light .more-content .df-md-card-grid-4 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.theme-light .more-content .df-md-card {
    min-height: 210px;
    padding: 30px;
    text-align: left;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid rgba(203, 213, 225, 0.78);
    border-radius: 26px;
    box-shadow: 0 16px 42px rgba(37, 99, 235, 0.09);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

body.theme-light .more-content .df-md-card:hover {
    transform: translateY(-6px);
    border-color: rgba(96, 165, 250, 0.62);
    box-shadow: 0 22px 54px rgba(37, 99, 235, 0.14);
}

body.theme-light .more-content .df-md-card-icon {
    display: inline-grid;
    width: 58px;
    height: 58px;
    margin: 0 0 22px;
    place-items: center;
    color: #2563eb;
    background: linear-gradient(135deg, #eef6ff, #dbeafe);
    border: 1px solid rgba(147, 197, 253, 0.68);
    border-radius: 20px;
    font-size: 1.65rem;
    line-height: 1;
}

body.theme-light .more-content .df-md-card-title,
body.theme-light .more-content .df-md-card h3 {
    margin: 0 0 12px;
    color: #111827;
    font-size: 1.12rem;
    font-weight: 850;
    line-height: 1.35;
    letter-spacing: -0.02em;
}

body.theme-light .more-content .df-md-card-body,
body.theme-light .more-content .df-md-card p {
    margin: 0;
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.85;
}

body.theme-light .more-content .df-md-card-body > :first-child {
    margin-top: 0;
}

body.theme-light .more-content .df-md-card-body > :last-child {
    margin-bottom: 0;
}

body.theme-light .more-content .df-md-quote-card {
    max-width: 860px;
    margin: 38px auto 12px;
    padding: clamp(28px, 4vw, 42px);
    text-align: center;
    color: #334155;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.92));
    border: 1px solid rgba(191, 219, 254, 0.88);
    border-left: 5px solid #2563eb;
    border-radius: 26px;
    box-shadow: 0 18px 46px rgba(37, 99, 235, 0.1);
}

body.theme-light .more-content .df-md-quote-card p {
    margin: 0;
    font-size: clamp(1.02rem, 2vw, 1.22rem);
    line-height: 1.9;
    font-weight: 700;
}

@media (max-width: 1100px) {
    body.theme-light .more-content .df-md-card-grid-4,
    body.theme-light .more-content .df-md-card-grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    body.theme-light .more-pages-content:is(.about-us-page, .modular-page) {
        padding: 22px !important;
        border-radius: 22px;
    }

    body.theme-light .more-content .df-md-hero {
        margin-bottom: 48px;
        padding: 46px 18px;
        border-radius: 24px;
    }

    body.theme-light .more-content .df-md-section-title p::before,
    body.theme-light .more-content .df-md-section-title p::after {
        display: none;
    }

    body.theme-light .more-content .df-md-card-grid-2,
    body.theme-light .more-content .df-md-card-grid-3,
    body.theme-light .more-content .df-md-card-grid-4 {
        grid-template-columns: 1fr;
    }

    body.theme-light .more-content .df-md-card {
        min-height: auto;
        padding: 24px;
    }
}

/* More-page composition: rail (目录) + content side by side by default. */
body.theme-light .more-pages-layout {
    display: grid;
    grid-template-columns: minmax(220px, 270px) minmax(0, 1fr);
    gap: clamp(24px, 3vw, 42px);
    align-items: start;
}

@media (max-width: 860px) {
    body.theme-light .more-pages-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Modular more-page composition */
body.theme-light .more-pages-layout.has-modular-page {
    grid-template-columns: minmax(230px, 280px) minmax(0, 1120px) !important;
    justify-content: center;
    gap: clamp(28px, 4vw, 56px) !important;
}

body.theme-light .more-pages-layout.has-modular-page .more-pages-content {
    justify-self: center !important;
    width: min(100%, 1120px) !important;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.96));
    border: 1px solid rgba(203, 213, 225, 0.72);
    box-shadow: 0 26px 80px rgba(15, 23, 42, 0.08);
}

body.theme-light .more-pages-layout.has-modular-page .more-content {
    width: 100%;
    max-width: 100%;
}

body.theme-light .more-pages-layout.has-modular-page .df-md-hero {
    max-width: 980px;
    margin-inline: auto;
}

body.theme-light .more-pages-layout.has-modular-page .df-md-card-grid {
    width: 100%;
    max-width: 1040px;
}

body.theme-light .more-pages-layout.has-modular-page .df-md-card-grid-2 {
    max-width: 780px;
}

body.theme-light .more-pages-layout.has-modular-page .df-md-card {
    display: flex;
    min-height: 220px;
    flex-direction: column;
}

body.theme-light .more-pages-layout.has-modular-page .df-md-card-body {
    flex: 1;
}

@media (max-width: 991.98px) {
    body.theme-light .more-pages-layout.has-modular-page {
        grid-template-columns: 1fr !important;
    }
}

/* Modular more pages: restrained forensic dossier style */
body.theme-light {
    --df-md-page-bg: #eef3f9;
    --df-md-panel-bg: rgba(246, 249, 253, 0.92);
    --df-md-card-bg: rgba(255, 255, 255, 0.72);
    --df-md-card-bg-hover: rgba(255, 255, 255, 0.9);
    --df-md-border: rgba(85, 117, 160, 0.24);
    --df-md-border-hover: rgba(37, 99, 235, 0.38);
    --df-md-title: #0f172a;
    --df-md-muted: #5f7088;
    --df-md-accent: #2563eb;
    --df-md-icon-bg: rgba(219, 234, 254, 0.48);
    --df-md-icon-border: rgba(96, 165, 250, 0.28);
    --df-md-card-shadow: 0 8px 20px rgba(15, 23, 42, 0.045);
}

body.theme-light .dfb-header-inner {
    height: 52px;
    gap: var(--sp-4);
}

body.theme-light .dfb-brand-logo {
    width: 28px;
    height: 28px;
}

body.theme-light .dfb-brand-text strong {
    font-size: 1.08rem;
    line-height: 1.05;
}

body.theme-light .dfb-brand-text span {
    font-size: 0.78rem;
    line-height: 1.25;
}

body.theme-light .dfb-nav-link {
    padding: 9px 13px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 650;
}

/* Light theme active highlight: subtle neutral pill (V1-style, not a deep fill). */
body.theme-light .dfb-nav-link.is-active {
    background: var(--surface-alt);
    color: var(--accent);
}

body.theme-light .dfb-header-actions .btn,
body.theme-light .dfb-header-actions button {
    font-size: 0.9rem;
}

body.theme-light .more-pages-layout.has-modular-page {
    grid-template-columns: minmax(220px, 270px) minmax(0, 1140px) !important;
    gap: clamp(24px, 3vw, 42px) !important;
    align-items: start;
}

body.theme-light .more-pages-layout.has-modular-page .more-pages-rail {
    padding: 22px 18px !important;
    border-radius: 16px !important;
    background: rgba(248, 251, 255, 0.74) !important;
    border: 1px solid rgba(203, 213, 225, 0.78) !important;
    box-shadow: none !important;
}

body.theme-light .more-pages-layout.has-modular-page .more-pages-rail h3 {
    margin-bottom: 14px !important;
    font-size: 1rem !important;
}

body.theme-light .more-pages-layout.has-modular-page .more-page-link {
    min-height: 44px !important;
    padding: 9px 12px !important;
    border-radius: 10px !important;
}

body.theme-light .more-pages-layout.has-modular-page .more-page-link .catalog-title {
    font-size: 1rem !important;
}

body.theme-light .more-pages-layout.has-modular-page .more-pages-content {
    width: min(100%, 1140px) !important;
    padding: clamp(28px, 3.4vw, 44px) !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

body.theme-light .more-pages-layout.has-modular-page .more-content {
    --df-md-content-max: 1120px;
    width: min(100%, var(--df-md-content-max));
    max-width: var(--df-md-content-max);
    margin: 0 auto !important;
    color: var(--df-md-title);
}

body.theme-light .more-pages-layout.has-modular-page .df-md-hero {
    max-width: 100%;
    min-height: 0;
    margin: 0 auto 60px !important;
    padding: clamp(38px, 5vw, 56px) clamp(28px, 4vw, 48px) !important;
    border: 1px solid var(--df-md-border) !important;
    border-radius: 18px !important;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.09), rgba(14, 165, 233, 0.035)),
        linear-gradient(180deg, rgba(248, 251, 255, 0.94), rgba(240, 246, 253, 0.92)) !important;
    box-shadow: none !important;
}

body.theme-light .more-pages-layout.has-modular-page .df-md-hero::after {
    inset: 12px;
    border-color: rgba(96, 165, 250, 0.16);
    border-radius: 12px;
}

body.theme-light .more-pages-layout.has-modular-page .df-md-hero-title,
body.theme-light .more-pages-layout.has-modular-page .df-md-hero h1 {
    margin-bottom: 16px !important;
    color: var(--df-md-title) !important;
    font-size: clamp(2.35rem, 4.6vw, 3.35rem) !important;
    font-weight: 850 !important;
    line-height: 1.12 !important;
    letter-spacing: -0.045em !important;
}

body.theme-light .more-pages-layout.has-modular-page .df-md-hero-subtitle,
body.theme-light .more-pages-layout.has-modular-page .df-md-hero h2 {
    margin-bottom: 10px !important;
    color: var(--df-md-accent) !important;
    font-size: clamp(1.24rem, 2.1vw, 1.72rem) !important;
    font-weight: 720 !important;
}

body.theme-light .more-pages-layout.has-modular-page .df-md-hero-desc,
body.theme-light .more-pages-layout.has-modular-page .df-md-hero > p:not(.df-md-hero-subtitle) {
    max-width: 760px;
    margin-top: 18px !important;
    color: var(--df-md-muted) !important;
    font-size: 0.98rem !important;
    line-height: 1.86 !important;
}

body.theme-light .more-pages-layout.has-modular-page .df-md-section-title {
    margin: 54px 0 24px !important;
}

body.theme-light .more-pages-layout.has-modular-page .df-md-section-title p,
body.theme-light .more-pages-layout.has-modular-page .more-content > h1,
body.theme-light .more-pages-layout.has-modular-page .more-content > h2 {
    display: block !important;
    margin: 0 0 24px !important;
    color: var(--df-md-title) !important;
    font-size: clamp(1.85rem, 3vw, 2.38rem) !important;
    font-weight: 820 !important;
    line-height: 1.2 !important;
    text-align: center !important;
    letter-spacing: -0.035em !important;
}

body.theme-light .more-pages-layout.has-modular-page .df-md-section-title p::before,
body.theme-light .more-pages-layout.has-modular-page .df-md-section-title p::after {
    display: none !important;
}

body.theme-light .more-pages-layout.has-modular-page .df-md-section-title p::before {
    content: "";
    display: block !important;
    width: 42px;
    height: 2px;
    margin: 0 auto 14px;
    border-radius: 999px;
    background: var(--df-md-accent);
    opacity: 0.74;
}

body.theme-light .more-pages-layout.has-modular-page .df-md-card-grid {
    display: grid;
    width: 100%;
    max-width: 100%;
    gap: 22px !important;
    margin: 24px auto 60px !important;
}

body.theme-light .more-pages-layout.has-modular-page .df-md-card-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

body.theme-light .more-pages-layout.has-modular-page .df-md-card-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

body.theme-light .more-pages-layout.has-modular-page .df-md-card-grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)) !important;
}

body.theme-light .more-pages-layout.has-modular-page .df-md-card {
    min-height: 168px !important;
    padding: 24px 24px 25px !important;
    border: 1px solid var(--df-md-border) !important;
    border-radius: 16px !important;
    background: var(--df-md-card-bg) !important;
    box-shadow: var(--df-md-card-shadow) !important;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease !important;
}

body.theme-light .more-pages-layout.has-modular-page .df-md-card:hover {
    transform: translateY(-2px) !important;
    border-color: var(--df-md-border-hover) !important;
    background: var(--df-md-card-bg-hover) !important;
    box-shadow: var(--df-md-card-shadow) !important;
}

body.theme-light .more-pages-layout.has-modular-page .df-md-card-icon {
    display: inline-grid;
    width: 38px !important;
    height: 38px !important;
    margin: 0 0 16px !important;
    place-items: center;
    border: 1px solid var(--df-md-icon-border) !important;
    border-radius: 10px !important;
    background: var(--df-md-icon-bg) !important;
    font-size: 1.15rem !important;
}

body.theme-light .more-pages-layout.has-modular-page .df-md-card-title,
body.theme-light .more-pages-layout.has-modular-page .df-md-card h3 {
    margin: 0 0 10px !important;
    color: var(--df-md-title) !important;
    font-size: 1.12rem !important;
    font-weight: 760 !important;
    line-height: 1.42 !important;
}

body.theme-light .more-pages-layout.has-modular-page .df-md-card-body,
body.theme-light .more-pages-layout.has-modular-page .df-md-card p {
    color: var(--df-md-muted) !important;
    font-size: 0.92rem !important;
    line-height: 1.78 !important;
}

body.theme-light .more-pages-layout.has-modular-page .df-md-quote-card {
    max-width: 820px;
    margin: 28px auto 0 !important;
    padding: 24px 28px !important;
    border: 1px solid var(--df-md-border) !important;
    border-left: 3px solid var(--df-md-accent) !important;
    border-radius: 16px !important;
    background: rgba(248, 251, 255, 0.82) !important;
    box-shadow: none !important;
}

body.theme-light .more-pages-layout.has-modular-page .df-md-quote-card p {
    color: #334155 !important;
    font-size: 1rem !important;
    font-weight: 650 !important;
}

@media (max-width: 1024px) {
    body.theme-light .more-pages-layout.has-modular-page .df-md-card-grid-3,
    body.theme-light .more-pages-layout.has-modular-page .df-md-card-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 640px) {
    body.theme-light .dfb-header-inner {
        height: 56px;
    }

    body.theme-light .dfb-brand-text strong {
        font-size: 0.98rem;
    }

    body.theme-light .dfb-brand-text span {
        font-size: 0.72rem;
    }

    body.theme-light .more-pages-layout.has-modular-page .more-pages-content {
        padding: 18px !important;
    }

    body.theme-light .more-pages-layout.has-modular-page .df-md-hero {
        margin-bottom: 44px !important;
        padding: 34px 20px !important;
    }

    body.theme-light .more-pages-layout.has-modular-page .df-md-card-grid-2,
    body.theme-light .more-pages-layout.has-modular-page .df-md-card-grid-3,
    body.theme-light .more-pages-layout.has-modular-page .df-md-card-grid-4 {
        grid-template-columns: 1fr !important;
    }
}

/* Challenge chip rows should stay compact and left aligned instead of spreading to card edges. */
body.theme-light[class*="route-challenges-"] .catalog-head {
    justify-content: flex-start !important;
    align-items: center !important;
}

body.theme-light[class*="route-challenges-"] .package-archive .package-line .catalog-head {
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

body.theme-light[class*="route-challenges-"] .package-archive .package-line .catalog-head .chip {
    flex: 0 0 auto;
}

body.theme-light[class*="route-challenges-"] .package-title,
body.theme-light[class*="route-challenges-"] .compact-archive .package-title {
    font-size: clamp(1.32rem, 1.45vw, 1.55rem) !important;
    line-height: 1.28;
}

body.theme-light[class*="route-challenges-"] .package-title-link {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    min-height: 2rem;
    color: inherit;
    line-height: 1.35;
    overflow-wrap: anywhere;
    text-decoration: none;
    vertical-align: middle;
    word-break: break-word;
}

body.theme-light[class*="route-challenges-"] .package-title-link:hover {
    color: var(--accent);
}

body.theme-light[class*="route-challenges-"] .package-summary {
    font-size: 1rem;
    line-height: 1.76;
}

body.theme-light[class*="route-challenges-"] .package-facts {
    font-size: 0.9rem;
}

body.theme-light[class*="route-challenges-"] .package-line .chip {
    font-size: 0.82rem;
}

body.theme-light[class*="route-challenges-"] .package-stat {
    font-size: 0.9rem;
}

body.theme-light[class*="route-challenges-"] .package-stat strong {
    font-size: 1.45rem;
    line-height: 1.15;
}

/* Raw HTML mode for /more pages. It intentionally avoids prose/card styling. */
body.theme-light .more-pages-layout.has-html-page {
    grid-template-columns: minmax(230px, 240px) minmax(0, 1120px) !important;
    justify-content: center;
    gap: clamp(24px, 4vw, 52px);
}

/* V1 parity: currently-selected more-page link uses the accent highlight */
body.theme-light .more-page-link.is-active {
    border-color: var(--accent) !important;
    background: rgba(37, 99, 235, 0.08) !important;
}

body.theme-light .more-pages-layout.has-html-page .more-pages-content.html-page,
body.theme-light .more-pages-content.html-page {
    width: min(100%, 1120px) !important;
    max-width: 1120px;
    justify-self: center;
    padding: clamp(16px, 3vw, 32px) !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: var(--ink);
}

body.theme-light .df-html-page {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    color: var(--ink);
    overflow-wrap: anywhere;
}

body.theme-light .df-html-page img {
    max-width: 100%;
    height: auto;
}

body.theme-light .df-html-page table {
    width: 100%;
    border-collapse: collapse;
    display: block;
    overflow-x: auto;
}

body.theme-light .df-html-page pre {
    overflow-x: auto;
}

@media (max-width: 767.98px) {
    body.theme-light .more-pages-layout.has-html-page {
        grid-template-columns: 1fr !important;
    }

    body.theme-light .more-pages-content.html-page {
        padding: 14px !important;
    }
}

/* Typography normalization: keep preview/summary text on one calm scale. */
body.theme-light {
    --df-ui-summary-size: 0.92rem;
    --df-ui-meta-size: 0.8rem;
    --df-ui-chip-size: 0.76rem;
}

body.theme-light :is(
    .catalog-summary,
    .package-summary,
    .section-summary,
    .summary-note,
    .empty-state-description,
    .archive-filter-summary,
    .writeup-card-lead,
    .writeup-card-summary,
    .timeline-item p,
    .bulletin-body p,
    .feature-band p,
    .hero-entry p,
    .df-entry p,
    .more-pages-lead
) {
    font-size: var(--df-ui-summary-size) !important;
    line-height: 1.72 !important;
}

body.theme-light :is(
    .catalog-meta,
    .package-facts,
    .page-meta,
    .writeup-card-meta,
    .comp-hero-meta,
    .dash-hero-meta,
    .archive-filter-meta,
    .competition-locked-meta
) {
    font-size: var(--df-ui-meta-size) !important;
    line-height: 1.65 !important;
}

body.theme-light :is(.chip, .package-line .chip, .catalog-head .chip) {
    font-size: var(--df-ui-chip-size) !important;
}

body.theme-light[class*="route-challenges-"] :is(.package-title, .compact-archive .package-title) {
    font-size: clamp(1.2rem, 1.28vw, 1.38rem) !important;
}

@media (max-width: 640px) {
    body.theme-light .competition-waiting-grid {
        grid-template-columns: 1fr;
    }

    body.theme-light :is(.competition-pending-actions, .competition-locked-actions) {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    body.theme-light :is(
        .competition-pending-actions form,
        .competition-pending-actions .btn,
        .competition-locked-actions form,
        .competition-locked-actions .btn
    ) {
        width: 100%;
    }
}

body.theme-light[class*="route-challenges-"] .package-stat {
    font-size: var(--df-ui-meta-size) !important;
}

body.theme-light[class*="route-challenges-"] .package-stat strong {
    font-size: 1.28rem !important;
}

/* Site-wide type scale. One rhythm for navigation, cards, forms, tables and content previews. */
body.theme-light {
    --df-type-caption: 0.72rem;
    --df-type-meta: 0.78rem;
    --df-type-small: 0.82rem;
    --df-type-body: 0.9rem;
    --df-type-lead: 0.96rem;
    --df-type-control: 0.88rem;
    --df-type-card-title: 1.02rem;
    --df-type-section-title: clamp(1.28rem, 1.7vw, 1.58rem);
    --df-type-page-title: clamp(1.56rem, 2.3vw, 2.02rem);
    --df-type-hero-title: clamp(1.95rem, 3.8vw, 2.9rem);
    font-size: var(--df-type-body);
}

body.theme-light :is(
    .dfb-nav-link,
    .dfb-actions .btn,
    .btn,
    .form-control,
    .form-select,
    .form-label,
    .input-group-text,
    .dropdown-item,
    .admin-nav-link
) {
    font-size: var(--df-type-control) !important;
}

body.theme-light .dfb-brand-text strong {
    font-size: 1rem !important;
}

body.theme-light :is(
    .dfb-brand-text span,
    .small,
    small,
    .text-secondary,
    .section-kicker,
    .admin-table th,
    .admin-table .summary,
    .admin-table td .meta,
    .admin-mini-kpi span,
    .admin-kpi h3,
    .summary-label,
    .competition-notice-meta,
    .competition-rank-main span,
    .competition-rank-score span,
    .q-meta,
    .rail-help,
    .rail-facts
) {
    font-size: var(--df-type-meta) !important;
    line-height: 1.62 !important;
}

body.theme-light :is(
    .chip,
    .badge,
    .package-line .chip,
    .catalog-head .chip,
    .permission-chip-row .chip,
    .status-chip,
    [class*="status-chip-"]
) {
    font-size: var(--df-type-caption) !important;
    line-height: 1.35 !important;
}

body.theme-light :is(
    .card-text,
    .catalog-summary,
    .package-summary,
    .section-summary,
    .summary-note,
    .empty-state-description,
    .archive-filter-summary,
    .writeup-card-lead,
    .writeup-card-summary,
    .timeline-item p,
    .bulletin-body p,
    .feature-band p,
    .hero-entry p,
    .df-entry p,
    .more-pages-lead,
    .competition-locked-panel p,
    .competition-notice-card p,
    .comp-rail-locked p,
    .admin-page-head p,
    .admin-sidebar p,
    .admin-identity-copy p,
    .editor-help
) {
    font-size: var(--df-type-body) !important;
    line-height: 1.72 !important;
}

body.theme-light :is(
    .lead,
    .hero-subtitle,
    .hero-lead,
    .df-hero-lead,
    .comp-hero-lead,
    .page-lead,
    .archive-hero-lead,
    .markdown-page-content > p:first-child
) {
    font-size: var(--df-type-lead) !important;
    line-height: 1.75 !important;
}

body.theme-light :is(
    .card-title,
    .package-title,
    .writeup-card-title,
    .catalog-title,
    .quick-link-card strong,
    .timeline-item h3,
    .bulletin-body h3,
    .feature-band h3,
    .competition-rank-main strong,
    .admin-identity-copy strong,
    .role-preset-card h3
) {
    font-size: var(--df-type-card-title) !important;
    line-height: 1.38 !important;
}

body.theme-light :is(
    .section-title,
    .admin-page-head h2,
    .admin-toolbar h2,
    .more-pages-title,
    .df-md-section-title p,
    .panel-title
) {
    font-size: var(--df-type-section-title) !important;
    line-height: 1.28 !important;
}

body.theme-light :is(
    .page-title,
    .df-title,
    .hero-title,
    .archive-hero-title,
    .comp-hero-title,
    .admin-page-head h1,
    .competition-locked-panel h2
) {
    font-size: var(--df-type-page-title) !important;
    line-height: 1.22 !important;
}

body.theme-light :is(.df-hero-title, .df-md-hero-title, .home-hero-title, .auth-hero-title) {
    font-size: var(--df-type-hero-title) !important;
    line-height: 1.12 !important;
}

body.theme-light :is(.admin-mini-kpi strong, .admin-kpi .value, .summary-tile strong, .package-stat strong) {
    font-size: 1.16rem !important;
    line-height: 1.18 !important;
}

body.theme-light[class*="route-challenges-"] :is(.package-title, .compact-archive .package-title) {
    font-size: clamp(1.14rem, 1.22vw, 1.3rem) !important;
}

body.theme-light[class*="route-challenges-"] .package-stat strong {
    font-size: 1.14rem !important;
}

/* Mobile reading and answering fixes */
body.theme-light :is(
    .prose,
    .prose-reading,
    .q-prompt,
    .writeup-reading-document,
    .wiki-doc-main,
    .reading-document
) {
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
}

body.theme-light :is(
    .prose img,
    .prose video,
    .prose iframe,
    .prose svg,
    .q-prompt img,
    .q-prompt video,
    .q-prompt iframe,
    .q-prompt svg
) {
    max-width: 100%;
    height: auto;
}

body.theme-light :is(
    .prose pre,
    .prose code,
    .q-prompt pre,
    .q-prompt code,
    .prose .dfb-code-body,
    .prose .math,
    .prose .language-math,
    .katex-display
) {
    max-width: 100%;
    overflow-x: auto;
    word-break: normal;
}

body.theme-light :is(
    .doc-source-footer,
    .writeup-source-link,
    .doc-source-link,
    .writeup-author-profile dd,
    .info-list dd
) {
    overflow-wrap: anywhere;
}

@media (max-width: 767.98px) {
    body.theme-light :is(
        .content-shell,
        .writeup-shell,
        .doc-index,
        .doc-index.wiki-doc-layout,
        .writeup-doc-layout
    ) {
        display: grid;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 1rem !important;
    }

    body.theme-light :is(
        .doc-index.wiki-doc-layout > .wiki-doc-main,
        .writeup-doc-layout .writeup-reading-document,
        .wiki-doc-outline-rail,
        .wiki-doc-meta-rail,
        .writeup-meta-side,
        .aside-stack,
        .doc-rail,
        .compact-doc-rail
    ) {
        grid-column: 1 !important;
        grid-row: auto !important;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        position: static !important;
        top: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    body.theme-light :is(.wiki-doc-meta-rail, .writeup-meta-side) {
        order: 1;
    }

    body.theme-light :is(.wiki-doc-main, .writeup-reading-document) {
        order: 2;
    }

    body.theme-light .wiki-doc-outline-rail {
        display: flex;
        order: 3;
    }

    body.theme-light :is(.surface-pad-lg, .writeup-hero, .reading-document) {
        padding: 1rem !important;
    }

    body.theme-light :is(.page-title, .writeup-page-title) {
        overflow-wrap: anywhere;
    }

    body.theme-light :is(
        .page-meta,
        .catalog-head,
        .doc-meta-row,
        .writeup-author-profile .info-item,
        .info-list .info-item
    ) {
        min-width: 0;
        flex-wrap: wrap;
    }

    body.theme-light .doc-meta-row {
        align-items: flex-start;
    }

    body.theme-light .doc-source-link {
        max-width: 100%;
        white-space: normal;
        text-overflow: clip;
    }

    body.theme-light :is(.prose, .prose-reading) {
        font-size: 15px;
        line-height: 1.72;
    }

    body.theme-light .prose h1 { font-size: 1.65rem; }
    body.theme-light .prose h2 { font-size: 1.38rem; }
    body.theme-light .prose h3 { font-size: 1.18rem; }

    body.theme-light :is(.prose table, .q-prompt table) {
        display: block !important;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        white-space: nowrap;
    }

    body.theme-light :is(.prose pre, .q-prompt pre) {
        white-space: pre;
    }

    body.theme-light :is(
        .q-card,
        .question-stage,
        .q-form,
        .q-options,
        .question-stage-content
    ) {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    body.theme-light :is(.q-card-head, .question-stage-head, .q-actions, .question-action-row) {
        flex-direction: column;
        align-items: stretch;
    }

    body.theme-light .q-pts {
        margin-left: 0;
    }

    body.theme-light :is(.q-option, .answer-option-row) {
        width: 100%;
        min-width: 0;
        align-items: flex-start;
    }

    body.theme-light :is(.q-option > span:last-child, .answer-option-row > span:last-child) {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    body.theme-light :is(
        .q-btns,
        .question-action-row,
        .writeup-form-actions,
        .competition-writeup-dialog-foot
    ) {
        width: 100%;
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    body.theme-light :is(.q-btns .btn, .writeup-form-actions .btn, .competition-writeup-dialog-foot .btn) {
        width: 100%;
    }

    body.theme-light :is(.q-input, .q-textarea, .form-control, .form-select) {
        min-width: 0;
        font-size: 16px !important;
    }

    body.theme-light .competition-writeup-modal {
        padding: 0.75rem;
        align-items: flex-start;
        overflow-y: auto;
    }

    body.theme-light .competition-writeup-dialog {
        width: 100%;
        max-width: 100%;
        max-height: none;
    }

    body.theme-light .writeup-form-row {
        flex-direction: column;
    }
}

/* Frontend usability refinements */
body.theme-light .comp-rail-nav-window {
    display: grid;
    gap: 0.65rem;
    max-height: calc((6 * var(--comp-qnav-cell, 36px)) + (5 * var(--comp-qnav-gap, 4px)) + 6rem) !important;
}

body.theme-light .qnav-group {
    display: grid;
    gap: 0.4rem;
}

body.theme-light .qnav-group-title {
    color: var(--ink-muted);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

body.theme-light .feature-bands {
    gap: 0.75rem !important;
}

body.theme-light .feature-band {
    padding: 0.85rem !important;
}

body.theme-light .feature-band p {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

body.theme-light .writeup-side-stack {
    max-height: none !important;
    overflow: visible !important;
    scrollbar-width: thin;
    min-width: 0;
}

body.theme-light .writeup-index-panel,
body.theme-light .writeup-submit-panel {
    padding: 1rem !important;
    min-width: 0;
}

body.theme-light .writeup-index-panel {
    display: flex;
    flex-direction: column;
    max-height: min(58vh, 520px);
    overflow: hidden;
}

body.theme-light .writeup-index-intro {
    display: none;
}

body.theme-light .writeup-index-list {
    flex: 1 1 auto;
    gap: 0.75rem;
    margin-top: 0.75rem;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.2rem;
    scrollbar-width: thin;
}

body.theme-light .writeup-index-card {
    gap: 0.65rem;
    padding-bottom: 0.75rem;
    min-width: 0;
}

body.theme-light .writeup-index-head {
    min-width: 0;
}

body.theme-light .writeup-index-head .section-link {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.45;
}

body.theme-light .writeup-index-head .chip {
    flex: 0 0 auto;
}

body.theme-light .writeup-year-list {
    grid-template-columns: repeat(auto-fit, minmax(5.4rem, 1fr));
}

body.theme-light .writeup-year-link {
    min-height: 2.3rem;
    padding: 0.45rem 0.55rem !important;
    min-width: 0;
}

body.theme-light .writeup-year-link strong,
body.theme-light .writeup-year-link span {
    min-width: 0;
}

@media (max-width: 1180px) {
    body.theme-light .writeup-shell.writeup-hub-shell {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    body.theme-light .writeup-side-stack {
        max-height: none;
        overflow: visible;
    }

    body.theme-light .writeup-index-panel {
        max-height: none;
        overflow: visible;
    }

    body.theme-light .writeup-index-list {
        overflow: visible;
        padding-right: 0;
    }
}

@media (min-width: 1101px) and (max-width: 1400px) {
    body.theme-light .doc-index.wiki-doc-layout.writeup-doc-layout {
        grid-template-columns: minmax(0, 1fr) minmax(240px, 280px) !important;
    }

    body.theme-light .writeup-doc-layout .writeup-reading-document {
        grid-column: 1 !important;
        grid-row: 1 !important;
    }

    body.theme-light .writeup-doc-layout .wiki-doc-outline-rail {
        grid-column: 2 !important;
        grid-row: 1 !important;
    }

    body.theme-light .writeup-doc-layout .writeup-meta-side {
        position: static !important;
        grid-column: 1 / -1 !important;
        grid-row: 2 !important;
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        width: 100%;
        max-width: 100%;
        max-height: none !important;
        overflow: visible !important;
    }
}

@media (max-width: 1100px) {
    body.theme-light .doc-index.wiki-doc-layout.writeup-doc-layout {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    body.theme-light .writeup-doc-layout .writeup-reading-document,
    body.theme-light .writeup-doc-layout .writeup-meta-side,
    body.theme-light .writeup-doc-layout .wiki-doc-outline-rail {
        grid-column: 1 !important;
        grid-row: auto !important;
        width: 100%;
        max-width: 100%;
    }

    body.theme-light .writeup-doc-layout .writeup-reading-document {
        order: 1;
    }

    body.theme-light .writeup-doc-layout .wiki-doc-outline-rail {
        display: flex;
        order: 2;
    }

    body.theme-light .writeup-doc-layout .writeup-meta-side {
        position: static !important;
        order: 3;
        max-height: none;
        overflow: visible !important;
    }
}

/* Final sidebar overflow guardrails */
body.theme-light .content-shell > *,
body.theme-light .doc-index > *,
body.theme-light .writeup-shell > *,
body.theme-light .writeup-doc-layout > *,
body.theme-light .comp-workspace > *,
body.theme-light .competition-shell > * {
    min-width: 0 !important;
}

body.theme-light .aside-stack,
body.theme-light .doc-rail,
body.theme-light .wiki-doc-outline-rail,
body.theme-light .wiki-doc-meta-rail,
body.theme-light .writeup-meta-side,
body.theme-light .writeup-detail-rail,
body.theme-light .comp-info,
body.theme-light .competition-info-sticky{
    min-width: 0 !important;
    overflow-x: hidden !important;
}

body.theme-light .aside-stack > *,
body.theme-light .doc-rail > *,
body.theme-light .wiki-doc-outline-rail > *,
body.theme-light .wiki-doc-meta-rail > *,
body.theme-light .writeup-meta-side > *,
body.theme-light .writeup-detail-rail > *,
body.theme-light .comp-info > *{
    min-width: 0 !important;
    max-width: 100% !important;
}

body.theme-light .aside-stack .section-link,
body.theme-light .doc-rail .section-link,
body.theme-light .wiki-doc-meta-rail .section-link,
body.theme-light .wiki-doc-outline-rail .section-link,
body.theme-light .writeup-meta-side .section-link,
body.theme-light .catalog-side .section-link {
    min-width: 0 !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
}

body.theme-light .info-list,
body.theme-light .info-item,
body.theme-light .doc-meta-list,
body.theme-light .doc-meta-row,
body.theme-light .writeup-author-profile,
body.theme-light .writeup-author-profile > div,
body.theme-light .catalog-side,
body.theme-light .catalog-line {
    min-width: 0 !important;
}

body.theme-light .info-item dd,
body.theme-light .doc-meta-row strong,
body.theme-light .doc-meta-row a,
body.theme-light .doc-current-card h2,
body.theme-light .doc-current-card p,
body.theme-light .writeup-meta-card h2,
body.theme-light .writeup-meta-card p,
body.theme-light .writeup-author-profile dd,
body.theme-light .hash-text,
body.theme-light .doc-source-link,
body.theme-light .writeup-source-link,
body.theme-light .catalog-side strong,
body.theme-light .catalog-side span,
body.theme-light .compact-prose {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-wrap: anywhere;
    word-break: break-word;
}

body.theme-light .doc-source-link,
body.theme-light .writeup-source-link {
    white-space: normal !important;
    text-overflow: clip !important;
}

body.theme-light .prose img,
body.theme-light .df-md-reading img {
    cursor: zoom-in;
}

body.theme-light .df-md-reading img[data-df-lazy-image] {
    min-height: 120px;
    object-fit: contain;
    background: rgba(241, 245, 249, 0.9);
    opacity: 0.72;
    transition: opacity 0.18s ease, filter 0.18s ease;
}

body.theme-light .df-md-reading img[data-df-lazy-image="loaded"],
body.theme-light .df-md-reading img.is-loaded {
    min-height: 0;
    opacity: 1;
}

body.theme-light .df-md-reading img.is-error {
    min-height: 120px;
    opacity: 0.82;
    filter: grayscale(0.35);
}

body.theme-light .df-md-reading .df-md-image-error {
    display: block;
    margin: 0.45rem 0 1rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid rgba(220, 38, 38, 0.22);
    border-radius: 8px;
    background: rgba(254, 242, 242, 0.92);
    color: #b91c1c;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.5;
}

body.df-image-lightbox-open {
    overflow: hidden;
}

.df-image-lightbox[hidden] {
    display: none !important;
}

.df-image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2400;
    display: grid;
    place-items: center;
    padding: clamp(12px, 3vw, 28px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s ease;
}

.df-image-lightbox.is-open {
    opacity: 1;
    pointer-events: auto;
}

.df-image-lightbox-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(5, 10, 24, 0.82);
    backdrop-filter: blur(14px);
    cursor: zoom-out;
}

.df-image-lightbox-panel {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: min(1180px, 100%);
    height: min(86vh, 920px);
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.2);
    border-radius: 14px;
    background: rgba(12, 18, 34, 0.92);
    box-shadow: 0 26px 80px rgba(0, 0, 0, 0.42);
}

.df-image-lightbox-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 10px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.14);
}

.df-image-lightbox-toolbar button {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 34px;
    border: 1px solid rgba(226, 232, 240, 0.22);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    font-size: 1rem;
    line-height: 1;
}

.df-image-lightbox-toolbar button:hover:not(:disabled),
.df-image-lightbox-toolbar button:focus-visible {
    border-color: rgba(96, 165, 250, 0.72);
    background: rgba(59, 130, 246, 0.24);
    outline: none;
}

.df-image-lightbox-toolbar button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.df-image-lightbox-counter {
    min-width: 58px;
    color: #cbd5e1;
    font-size: 0.86rem;
    text-align: center;
}

.df-image-lightbox-spacer {
    flex: 1;
    min-width: 8px;
}

.df-image-lightbox-stage {
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 0;
    overflow: auto;
    padding: 16px;
}

.df-image-lightbox-img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    opacity: 0;
    transform-origin: center center;
    transition: opacity 0.16s ease, transform 0.12s ease;
}

.df-image-lightbox-img.is-ready {
    opacity: 1;
}

.df-image-lightbox[data-zoomed="true"] .df-image-lightbox-img {
    max-width: none;
    max-height: none;
    cursor: zoom-out;
}

.df-image-lightbox-caption {
    min-height: 38px;
    padding: 9px 14px 12px;
    border-top: 1px solid rgba(226, 232, 240, 0.12);
    color: #dbeafe;
    font-size: 0.88rem;
    overflow-wrap: anywhere;
}

.df-image-lightbox-caption[hidden] {
    display: block;
    visibility: hidden;
}

@media (max-width: 640px) {
    .df-image-lightbox {
        padding: 0;
    }

    .df-image-lightbox-panel {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .df-image-lightbox-toolbar {
        gap: 6px;
        padding: 8px;
    }

    .df-image-lightbox-toolbar button {
        width: 34px;
        height: 32px;
    }

    .df-image-lightbox-counter {
        min-width: 48px;
        font-size: 0.8rem;
    }

    .df-image-lightbox-stage {
        padding: 10px;
    }
}

body.theme-light .download-action-panel,
body.theme-light .download-detail-panel {
    overflow: hidden;
}

body.theme-light .download-action-panel {
    border-color: rgba(37, 99, 235, 0.18);
    background:
        linear-gradient(180deg, rgba(37, 99, 235, 0.06), rgba(255, 255, 255, 0) 62%),
        var(--surface);
}

body.theme-light .download-action-summary {
    display: grid;
    gap: 10px;
    margin-top: 2px;
    padding: 14px;
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-radius: var(--radius-lg);
    background: rgba(37, 99, 235, 0.05);
}

body.theme-light .download-action-summary > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

body.theme-light .download-action-summary span,
body.theme-light .download-action-summary p {
    color: var(--ink-muted);
    font-size: var(--text-sm);
}

body.theme-light .download-action-summary p {
    margin: 0;
    line-height: 1.55;
}

body.theme-light .download-action-summary strong {
    color: var(--accent);
    font-size: var(--text-3xl);
    font-weight: 800;
    line-height: 1;
}

body.theme-light .download-primary-action {
    margin-top: 14px;
}

body.theme-light .download-primary-action .btn,
body.theme-light .download-fetch-form,
body.theme-light .download-fetch-form .btn {
    width: 100%;
}

body.theme-light .download-denied-actions {
    display: grid;
    gap: 10px;
    width: 100%;
}

body.theme-light .download-unavailable {
    display: grid;
    gap: 4px;
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(220, 38, 38, 0.18);
    border-radius: var(--radius-lg);
    background: rgba(220, 38, 38, 0.06);
    color: #b42318;
    font-size: var(--text-sm);
    line-height: 1.55;
}

body.theme-light .download-unavailable strong {
    color: inherit;
    font-weight: 800;
}

body.theme-light .download-detail-panel .info-item {
    display: grid;
    grid-template-columns: minmax(76px, auto) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 10px 0;
}

body.theme-light .download-detail-panel .info-item dt {
    line-height: 1.7;
}

body.theme-light .download-detail-panel .info-item dd {
    min-width: 0;
    justify-content: flex-end;
    line-height: 1.7;
}

body.theme-light .download-hash-cell {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px !important;
}

body.theme-light .download-hash {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    padding: 3px 7px;
    border: 1px solid rgba(126, 143, 168, 0.2);
    border-radius: var(--radius);
    background: var(--surface-alt);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.theme-light .btn-copy-hash {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 26px;
    padding: 0 9px;
    border-radius: var(--radius);
    background: var(--surface);
    line-height: 1;
}

body.theme-light .btn-copy-hash.is-copied,
body.theme-light .btn-copy-hash.copied {
    border-color: rgba(13, 150, 104, 0.32);
    background: var(--positive-soft);
    color: var(--positive);
}

@media (max-width: 640px) {
    body.theme-light .download-detail-panel .info-item {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    body.theme-light .download-detail-panel .info-item dd {
        justify-content: flex-start;
        text-align: left;
    }
}

/* DigiForensics V2 Frontend System Phase 1 */
body.theme-light {
    --df-system-container: 1440px;
    --df-system-gap: 16px;
    --df-system-border: rgba(126, 143, 168, 0.24);
    --df-system-surface: var(--surface, #ffffff);
    --df-system-surface-alt: var(--surface-alt, #f8fafc);
    --df-system-ink: var(--ink, #0f172a);
    --df-system-muted: var(--ink-muted, #64748b);
    --df-system-primary: #2563eb;
}

body.theme-light .dfb-container,
body.theme-light .container {
    width: min(var(--df-system-container), calc(100% - 48px));
    max-width: var(--df-system-container);
}

body.theme-light .df-page {
    display: grid;
    gap: 18px;
    min-width: 0;
}

body.theme-light .df-page-head,
body.theme-light .page-head,
body.theme-light .page-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 0;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--df-system-border);
}

body.theme-light .df-eyebrow,
body.theme-light .section-kicker {
    color: var(--df-system-muted);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

body.theme-light .df-title {
    margin: 4px 0 6px;
    font-size: var(--df-type-page-title);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.045em;
}

body.theme-light .df-subtitle {
    max-width: 780px;
    margin: 0;
    color: var(--df-system-muted);
    overflow-wrap: anywhere;
}

body.theme-light .df-toolbar,
body.theme-light .df-filter-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

body.theme-light .df-button,
body.theme-light .df-page .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--df-system-border);
    border-radius: var(--radius, 8px);
    font-weight: 800;
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}

body.theme-light .df-button-primary,
body.theme-light .df-page .btn-primary {
    border-color: var(--df-system-primary);
    background: var(--df-system-primary);
    color: #ffffff;
}

body.theme-light .df-button-secondary,
body.theme-light .df-page .btn-outline-primary,
body.theme-light .df-page .btn-outline-secondary {
    background: var(--df-system-surface);
    color: var(--df-system-ink);
}

body.theme-light .df-button-sm {
    min-height: 32px;
    padding-inline: 10px;
    font-size: 0.85rem;
}

body.theme-light .df-filter-bar,
body.theme-light .compact-filter {
    padding: 12px;
    border: 1px solid var(--df-system-border);
    background: var(--df-system-surface);
}

body.theme-light .df-filter-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) auto;
    gap: 10px;
    align-items: end;
}

body.theme-light .df-filter-form label {
    display: grid;
    gap: 4px;
    min-width: 0;
}

body.theme-light .df-filter-form .query-control {
    display: grid;
    gap: 4px;
    min-width: 0;
}

body.theme-light .df-filter-form label > span,
body.theme-light .df-filter-form .query-control label,
body.theme-light .df-filter-bar .form-label {
    color: var(--df-system-muted);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

body.theme-light .df-page .form-control,
body.theme-light .df-page .form-select {
    min-height: 38px;
    border-radius: var(--radius, 8px);
}

body.theme-light .df-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

body.theme-light .df-stat {
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--df-system-border);
    background: var(--df-system-surface);
}

body.theme-light .df-stat span {
    display: block;
    color: var(--df-system-muted);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

body.theme-light .df-stat strong {
    display: block;
    margin-top: 4px;
    color: var(--df-system-ink);
    font-size: 1.35rem;
    line-height: 1.1;
}

body.theme-light .df-panel {
    border: 1px solid var(--df-system-border);
    background: var(--df-system-surface);
    color: var(--df-system-ink);
    padding: 16px;
}

body.theme-light .df-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

body.theme-light .df-panel-head h2 {
    margin: 2px 0 0;
    font-size: 1.15rem;
}

body.theme-light .df-panel-body {
    min-width: 0;
}

body.theme-light .df-list {
    display: grid;
    gap: 10px;
}

body.theme-light .df-list-row {
    display: grid;
    grid-template-columns: 98px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--df-system-border);
    background: var(--df-system-surface);
    min-width: 0;
}

body.theme-light .df-list-main {
    min-width: 0;
}

body.theme-light .df-list-main h2,
body.theme-light .df-list-main p {
    overflow-wrap: anywhere;
}

body.theme-light .df-list-main h2 {
    margin: 4px 0;
    font-size: 1.1rem;
}

body.theme-light .df-list-main p {
    margin: 0 0 8px;
    color: var(--df-system-muted);
}

body.theme-light .df-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    color: var(--df-system-muted);
    font-size: 0.84rem;
}

body.theme-light .df-list-action {
    display: flex;
    justify-content: flex-end;
}

body.theme-light .df-status,
body.theme-light .chip {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 24px;
    padding: 0 8px;
    border: 1px solid rgba(126, 143, 168, 0.28);
    border-radius: 999px;
    background: var(--df-system-surface-alt);
    color: var(--df-system-muted);
    font-size: 0.75rem;
    font-weight: 800;
}

body.theme-light .df-status-success,
body.theme-light .chip.success {
    border-color: rgba(22, 163, 74, 0.28);
    background: rgba(34, 197, 94, 0.12);
    color: #166534;
}

body.theme-light .df-status-info,
body.theme-light .chip.info {
    border-color: rgba(37, 99, 235, 0.28);
    background: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
}

body.theme-light .df-status-warning,
body.theme-light .chip.warning {
    border-color: rgba(245, 158, 11, 0.34);
    background: rgba(245, 158, 11, 0.12);
    color: #92400e;
}

body.theme-light .df-status-muted,
body.theme-light .chip.muted {
    color: var(--df-system-muted);
}

body.theme-light .df-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 16px;
    align-items: start;
}

body.theme-light .df-main-column,
body.theme-light .df-side-column {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    min-width: 0;
}

body.theme-light .df-table-wrap {
    width: 100%;
    overflow-x: auto;
}

body.theme-light .df-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

body.theme-light .df-table th,
body.theme-light .df-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(126, 143, 168, 0.18);
    text-align: left;
    vertical-align: middle;
}

body.theme-light .df-table th {
    color: var(--df-system-muted);
    font-size: 0.76rem;
    text-transform: uppercase;
}

body.theme-light .df-table td strong,
body.theme-light .df-table td span {
    display: block;
    overflow-wrap: anywhere;
}

body.theme-light .df-table td span {
    color: var(--df-system-muted);
    font-size: 0.86rem;
}

body.theme-light .df-info-list,
body.theme-light .contest-compact-facts {
    display: grid;
    gap: 8px;
    margin: 0;
}

body.theme-light .df-info-list div,
body.theme-light .contest-compact-facts div {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 8px;
}

body.theme-light .df-info-list dt,
body.theme-light .contest-compact-facts dt {
    color: var(--df-system-muted);
    font-size: 0.78rem;
    font-weight: 800;
}

body.theme-light .df-info-list dd,
body.theme-light .contest-compact-facts dd {
    margin: 0;
    overflow-wrap: anywhere;
}

body.theme-light .df-pagination {
    margin-top: 14px;
}

body.theme-light .df-pagination nav,
body.theme-light .pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

body.theme-light .df-avatar,
body.theme-light .df-avatar-round,
body.theme-light .dash-hero-avatar,
body.theme-light .public-user-card img,
body.theme-light .top-contributor img,
body.theme-light .contributor-person img,
body.theme-light .compact-contributor-list img {
    border-radius: 50% !important;
    overflow: hidden;
}

body.theme-light .dash-hero-avatar img,
body.theme-light .public-user-card img {
    object-fit: cover !important;
    padding: 0 !important;
}

body.theme-light .badge-wall-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 12px;
}

body.theme-light .achievement-card {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    min-height: 120px;
    padding: 14px;
    border: 1px solid var(--df-system-border);
    background: var(--df-system-surface);
}

body.theme-light .achievement-card.is-locked {
    opacity: 0.68;
    background: var(--df-system-surface-alt);
}

/* 徽章主色。卡片通过内联自定义属性 --df-badge-color 带入（见 partials/badge-card.blade.php），
   不写内联颜色，暗色主题跟得住。

   只染描边和底色，不染文字：这个颜色由管理员在后台填写，明暗不可控，
   拿它染 h3 会在浅色主题下把徽章名变成看不清的字。
   描边是纯装饰、底色只有 6% 混入，任何色值都不会压过正文对比度。

   未获得（is-locked）的徽章刻意不染色，保持既有的置灰处理，
   让「已点亮」和「未点亮」不读文字也能分辨。

   这一段写在 body.theme-light 里即可同时作用于 light-new 和 dark-new：
   两者 body 都带 theme-light，暗色只覆盖变量（--df-system-surface 随 --surface 变深）。 */
body.theme-light .achievement-card.is-earned {
    border-top: 3px solid var(--df-badge-color, #2563eb);
    background: color-mix(in srgb, var(--df-badge-color, #2563eb) 6%, var(--df-system-surface));
}

body.theme-light .recent-badge {
    border-left: 3px solid var(--df-badge-color, #2563eb);
}

body.theme-light .achievement-card img {
    width: 54px;
    height: 54px;
    object-fit: contain;
}

body.theme-light .df-badge-img {
    display: block;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

body.theme-light .df-badge-img-sm {
    width: 28px;
    height: 28px;
}

body.theme-light .df-badge-img-md {
    width: 40px;
    height: 40px;
}

body.theme-light .df-badge-img-profile {
    width: 48px;
    height: 48px;
}

body.theme-light .df-badge-img-lg {
    width: 64px;
    height: 64px;
}

body.theme-light .df-badge-img-preview {
    width: 80px;
    height: 80px;
}

body.theme-light .df-badge-image-wrap {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    overflow: hidden;
}

body.theme-light .df-badge-image-wrap-lg {
    width: 64px;
    height: 64px;
}

body.theme-light .achievement-card .df-badge-image-wrap-lg,
body.theme-light .achievement-card .df-badge-img-lg {
    width: 64px;
    height: 64px;
    max-width: 64px;
    max-height: 64px;
    object-fit: contain;
}

body.theme-light .recent-badge-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

body.theme-light .recent-badge-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
}

body.theme-light .recent-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 220px;
    padding: 8px 10px;
    border: 1px solid var(--df-system-border);
    background: var(--df-system-surface);
    color: var(--df-system-ink);
}

body.theme-light .recent-badge strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .9rem;
}

@media (max-width: 767.98px) {
    body.theme-light .recent-badge-strip {
        align-items: flex-start;
        flex-direction: column;
    }

    body.theme-light .recent-badge-list {
        justify-content: flex-start;
        width: 100%;
    }
}

body.theme-light .achievement-card.is-locked img {
    filter: grayscale(1);
}

body.theme-light .achievement-card h3,
body.theme-light .achievement-card p {
    overflow-wrap: anywhere;
}

body.theme-light .achievement-card h3 {
    margin: 0 0 4px;
    font-size: 1rem;
}

body.theme-light .achievement-card p {
    margin: 0 0 8px;
    color: var(--df-system-muted);
    font-size: 0.9rem;
}

body.theme-light .df-category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

body.theme-light .df-category-tabs a {
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid var(--df-system-border);
    background: var(--df-system-surface);
    color: var(--df-system-ink);
    text-decoration: none;
    font-weight: 800;
}

body.theme-light .df-category-tabs a.is-active {
    border-color: var(--df-system-primary);
    color: var(--df-system-primary);
}

body.theme-light .contest-list-state {
    display: grid;
    gap: 4px;
    padding: 10px;
    background: var(--df-system-surface-alt);
    border-left: 4px solid var(--df-system-primary);
}

body.theme-light .contest-list-state strong {
    font-size: 1.5rem;
    line-height: 1;
}

body.theme-light .contest-list-state small {
    color: var(--df-system-muted);
    font-weight: 800;
    text-transform: uppercase;
}

body.theme-light .contest-action-panel {
    display: grid;
    align-content: start;
    gap: 12px;
    min-width: 280px;
}

body.theme-light .contest-action-panel strong {
    font-size: 1.15rem;
}

body.theme-light .contest-action-panel p,
body.theme-light .df-muted {
    color: var(--df-system-muted);
}

body.theme-light .content-shell,
body.theme-light .dash-grid {
    gap: 16px;
    align-items: start;
}

body.theme-light .df-empty-state {
    border: 1px solid var(--df-system-border);
    background: color-mix(in srgb, var(--df-system-surface) 88%, transparent);
    color: var(--df-system-muted);
    padding: 16px;
    display: grid;
    gap: 6px;
}

body.theme-light .df-empty-state strong {
    color: var(--df-system-ink);
}

body.theme-light .df-empty-state p {
    margin: 0;
}

body.theme-light .dash-grid > .workspace-panel,
body.theme-light .content-shell > .surface,
body.theme-light .content-shell > .workspace-panel {
    align-self: start;
}

@media (max-width: 1024px) {
    body.theme-light .df-content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    body.theme-light .dfb-container,
    body.theme-light .container {
        width: min(100% - 32px, var(--df-system-container));
    }

    body.theme-light .df-page-head,
    body.theme-light .page-head,
    body.theme-light .page-heading,
    body.theme-light .df-list-row,
    body.theme-light .df-filter-form {
        display: grid;
        grid-template-columns: 1fr;
    }

    body.theme-light .df-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.theme-light .df-list-action,
    body.theme-light .df-filter-actions {
        justify-content: flex-start;
    }

    body.theme-light .df-list-action .df-button,
    body.theme-light .df-toolbar .df-button {
        width: 100%;
    }
}

@media (max-width: 430px) {
    body.theme-light .dfb-container,
    body.theme-light .container {
        width: min(100% - 24px, var(--df-system-container));
    }

    body.theme-light .df-stat-grid,
    body.theme-light .badge-wall-grid {
        grid-template-columns: 1fr;
    }

    body.theme-light .df-panel,
    body.theme-light .df-list-row {
        padding: 12px;
    }
}

/* Frontend Hotfix Phase 1: restore frontend spacing after RC compaction. */
body.theme-light[data-theme-area="frontend"] .page-wrap > .container {
    width: 100%;
    max-width: 1320px;
    padding-inline: 32px;
    padding-top: 36px;
    padding-bottom: 48px;
    margin-inline: auto;
}

body.theme-light[data-theme-area="frontend"] .dfb-page > .dfb-container {
    width: 100%;
    max-width: 1320px;
    padding-inline: 32px !important;
    margin-inline: auto;
}

body.theme-light[data-theme-area="frontend"] .df-page {
    gap: 24px;
}

body.theme-light[data-theme-area="frontend"] .df-page-head,
body.theme-light[data-theme-area="frontend"] .page-head,
body.theme-light[data-theme-area="frontend"] .page-heading,
body.theme-light[data-theme-area="frontend"] .df-panel-head,
body.theme-light[data-theme-area="frontend"] .section-head,
body.theme-light[data-theme-area="frontend"] .surface-head {
    text-align: left !important;
}

body.theme-light[data-theme-area="frontend"] .df-page-head,
body.theme-light[data-theme-area="frontend"] .page-head,
body.theme-light[data-theme-area="frontend"] .page-heading {
    align-items: flex-end;
    gap: 20px;
    padding-bottom: 20px;
}

body.theme-light[data-theme-area="frontend"] .df-title,
body.theme-light[data-theme-area="frontend"] .page-title,
body.theme-light[data-theme-area="frontend"] .df-subtitle,
body.theme-light[data-theme-area="frontend"] .page-lead,
body.theme-light[data-theme-area="frontend"] .df-panel-head h2,
body.theme-light[data-theme-area="frontend"] .df-panel-head h3 {
    text-align: left !important;
}

body.theme-light[data-theme-area="frontend"] .df-subtitle,
body.theme-light[data-theme-area="frontend"] .page-lead {
    margin-inline: 0;
}

body.theme-light[data-theme-area="frontend"] .df-panel {
    padding: 20px;
}

body.theme-light[data-theme-area="frontend"] .df-panel-head {
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

body.theme-light[data-theme-area="frontend"] .df-filter-bar,
body.theme-light[data-theme-area="frontend"] .compact-filter,
body.theme-light[data-theme-area="frontend"] .query-bar {
    padding: 16px;
}

body.theme-light[data-theme-area="frontend"] .df-empty-state {
    text-align: left;
}

body.theme-light[data-theme-area="frontend"] .df-avatar,
body.theme-light[data-theme-area="frontend"] .user-avatar,
body.theme-light[data-theme-area="frontend"] .avatar-img {
    border-radius: 50%;
    object-fit: cover;
}

@media (max-width: 991.98px) {
    body.theme-light[data-theme-area="frontend"] .page-wrap > .container {
        padding-inline: 24px;
        padding-top: 28px;
        padding-bottom: 40px;
    }

    body.theme-light[data-theme-area="frontend"] .dfb-page > .dfb-container {
        padding-inline: 24px !important;
    }
}

@media (max-width: 575.98px) {
    body.theme-light[data-theme-area="frontend"] .page-wrap > .container {
        width: 100%;
        padding-inline: 16px;
        padding-top: 22px;
        padding-bottom: 32px;
    }

    body.theme-light[data-theme-area="frontend"] .dfb-page > .dfb-container {
        width: 100%;
        padding-inline: 16px !important;
    }

    body.theme-light[data-theme-area="frontend"] .df-page {
        gap: 16px;
    }

    body.theme-light[data-theme-area="frontend"] .df-page-head,
    body.theme-light[data-theme-area="frontend"] .page-head,
    body.theme-light[data-theme-area="frontend"] .page-heading,
    body.theme-light[data-theme-area="frontend"] .df-panel-head {
        align-items: flex-start;
        gap: 12px;
    }

    body.theme-light[data-theme-area="frontend"] .df-panel {
        padding: 16px;
    }
}

/* Normal public pages end where their content ends. Dedicated full-height
   shells (Wiki reading and authentication) retain their explicit rules. */
body.theme-light[data-theme-area="frontend"] .dfb-shell {
    display: block;
    min-height: 0;
}

body.theme-light[data-theme-area="frontend"] .dfb-page { flex: none; }

body.theme-light[data-theme-area="frontend"] .dfb-footer { margin-top: 0; }

body.theme-light[data-theme-area="frontend"] .dfb-page > .dfb-container {
    width: min(100%, 1320px);
    padding-top: 36px !important;
    padding-bottom: var(--page-footer-gap) !important;
}

body.theme-light[data-theme-area="frontend"] .rect-page {
    display: grid;
    gap: 24px;
    min-height: 0;
}

body.theme-light[data-theme-area="frontend"] .rect-page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin: 0 0 2px;
    text-align: left !important;
}

body.theme-light[data-theme-area="frontend"] .df-page-head-main,
body.theme-light[data-theme-area="frontend"] .rect-page-head > div:first-child,
body.theme-light[data-theme-area="frontend"] .rect-page h1,
body.theme-light[data-theme-area="frontend"] .rect-page h2,
body.theme-light[data-theme-area="frontend"] .rect-page h3,
body.theme-light[data-theme-area="frontend"] .df-title,
body.theme-light[data-theme-area="frontend"] .df-eyebrow,
body.theme-light[data-theme-area="frontend"] .df-subtitle,
body.theme-light[data-theme-area="frontend"] .rect-page .page-title,
body.theme-light[data-theme-area="frontend"] .rect-page .section-title,
body.theme-light[data-theme-area="frontend"] .rect-page .catalog-title {
    text-align: left !important;
}

body.theme-light[data-theme-area="frontend"] .df-title {
    margin: 0;
    font-size: var(--df-type-page-title);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.045em;
}

body.theme-light[data-theme-area="frontend"] .df-subtitle {
    max-width: 760px;
    margin: 10px 0 0;
}

body.theme-light[data-theme-area="frontend"] .df-page-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

body.theme-light[data-theme-area="frontend"] .rect-filter-bar,
body.theme-light[data-theme-area="frontend"] .rect-list-panel,
body.theme-light[data-theme-area="frontend"] .rect-page .df-panel {
    padding: 16px;
    border-radius: 8px;
}

body.theme-light[data-theme-area="frontend"] .rect-list-row,
body.theme-light[data-theme-area="frontend"] .rect-page .catalog-line,
body.theme-light[data-theme-area="frontend"] .rect-page .package-line,
body.theme-light[data-theme-area="frontend"] .rect-page .writeup-card,
body.theme-light[data-theme-area="frontend"] .rect-page .bulletin-item {
    padding: 14px 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--line);
}

body.theme-light[data-theme-area="frontend"] .rect-list-row:last-child,
body.theme-light[data-theme-area="frontend"] .rect-page .catalog-line:last-child,
body.theme-light[data-theme-area="frontend"] .rect-page .package-line:last-child,
body.theme-light[data-theme-area="frontend"] .rect-page .writeup-card:last-child,
body.theme-light[data-theme-area="frontend"] .rect-page .bulletin-item:last-child {
    border-bottom: 0;
}

body.theme-light[data-theme-area="frontend"] .rect-two-column,
body.theme-light[data-theme-area="frontend"] .writeup-hub-shell.rect-two-column {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
    align-items: start;
    gap: 24px;
}

body.theme-light[data-theme-area="frontend"] .more-pages-layout.rect-two-column {
    display: grid;
    grid-template-columns: minmax(230px, 240px) minmax(0, 1fr);
    align-items: start;
    gap: 24px;
}

body.theme-light[data-theme-area="frontend"] .rect-html-page,
body.theme-light[data-theme-area="frontend"] .rect-html-page *,
body.theme-light[data-theme-area="frontend"] .more-pages-content.modular-page .more-content,
body.theme-light[data-theme-area="frontend"] .more-pages-content.modular-page .more-content * {
    text-align: left !important;
}

body.theme-light[data-theme-area="frontend"] .more-pages-content.modular-page .more-content h1,
body.theme-light[data-theme-area="frontend"] .more-pages-content.modular-page .more-content h2,
body.theme-light[data-theme-area="frontend"] .more-pages-content.modular-page .more-content h3 {
    margin: 24px 0 12px;
    font-size: clamp(1.35rem, 2vw, 1.8rem);
    line-height: 1.25;
}

body.theme-light[data-theme-area="frontend"] .more-pages-content.modular-page .more-content .df-md-hero {
    padding: 0 0 18px;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

body.theme-light[data-theme-area="frontend"] .more-pages-content.modular-page .more-content .df-md-hero h1 {
    margin: 0 0 12px;
    font-size: clamp(1.65rem, 2.2vw, 2.1rem);
}

body.theme-light[data-theme-area="frontend"] .more-pages-content.modular-page .more-content .df-md-hero h2 {
    margin: 0 0 8px;
    font-size: clamp(1.15rem, 1.7vw, 1.45rem);
}

body.theme-light[data-theme-area="frontend"] .more-pages-content.modular-page .more-content .df-md-hero p {
    margin: 12px 0 0;
}

body.theme-light[data-theme-area="frontend"] .more-pages-content.modular-page .more-content .df-md-card-grid {
    gap: 14px;
    margin: 16px 0 28px;
}

body.theme-light[data-theme-area="frontend"] .more-pages-content.modular-page .more-content .df-md-card {
    min-height: 0;
    padding: 18px;
    border-radius: 8px;
    box-shadow: none;
}

body.theme-light[data-theme-area="frontend"] .more-pages-content.modular-page .more-content .df-md-card:hover {
    transform: none;
    box-shadow: none;
}

body.theme-light[data-theme-area="frontend"] .rect-html-page .df-md-hero {
    padding: 16px 0 24px;
}

body.theme-light[data-theme-area="frontend"] .rect-html-page .df-md-section-title {
    margin: 28px 0 16px;
}

body.theme-light[data-theme-area="frontend"] .rect-html-page .df-md-card-grid {
    gap: 14px;
    margin: 16px 0 28px;
}

body.theme-light[data-theme-area="frontend"] .rect-html-page .df-md-card,
body.theme-light[data-theme-area="frontend"] .rect-html-page .df-md-quote-card {
    min-height: 0;
    padding: 18px;
    border-radius: 8px;
    box-shadow: none;
}

@media (max-width: 991.98px) {
    body.theme-light[data-theme-area="frontend"] .dfb-page > .dfb-container {
        padding-top: 28px !important;
        padding-bottom: 44px !important;
    }

    body.theme-light[data-theme-area="frontend"] .rect-two-column,
    body.theme-light[data-theme-area="frontend"] .writeup-hub-shell.rect-two-column,
    body.theme-light[data-theme-area="frontend"] .more-pages-layout.rect-two-column {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    body.theme-light[data-theme-area="frontend"] .dfb-page > .dfb-container {
        padding-top: 20px !important;
        padding-bottom: 36px !important;
    }

    body.theme-light[data-theme-area="frontend"] .rect-page {
        gap: 16px;
    }

    body.theme-light[data-theme-area="frontend"] .rect-page-head {
        display: grid;
        gap: 12px;
    }

    body.theme-light[data-theme-area="frontend"] .df-page-actions {
        justify-content: flex-start;
    }
}

/* Frontend Index Rectification Phase 3 */
body.theme-light[data-theme-area="frontend"] .rect-index-filter,
body.theme-light[data-theme-area="frontend"] .rect-index-panel,
body.theme-light[data-theme-area="frontend"] .rect-index-aside {
    padding: 16px;
    border-radius: 8px;
}

body.theme-light[data-theme-area="frontend"] .rect-index-list {
    gap: 0;
}

body.theme-light[data-theme-area="frontend"] .rect-index-row {
    min-height: 0;
    padding: 12px 0;
}

body.theme-light[data-theme-area="frontend"] .rect-doc-list .df-list-row.rect-index-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: flex-start;
    width: 100%;
}

body.theme-light[data-theme-area="frontend"] .rect-doc-list .df-list-row.rect-index-row .df-list-main {
    width: 100%;
}

body.theme-light[data-theme-area="frontend"] .rect-challenge-list .df-list-row.rect-index-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: flex-start;
    width: 100%;
}

body.theme-light[data-theme-area="frontend"] .rect-challenge-list .package-line-main {
    width: 100%;
    min-width: 0;
}

body.theme-light[data-theme-area="frontend"] .writeup-card.df-list-row.rect-index-row {
    display: block;
    width: 100%;
}

body.theme-light[data-theme-area="frontend"] .writeups-rect-page .writeup-card,
body.theme-light[data-theme-area="frontend"] .writeups-rect-page .writeup-card-body,
body.theme-light[data-theme-area="frontend"] .writeups-rect-page .writeup-card-copy,
body.theme-light[data-theme-area="frontend"] .writeups-rect-page .catalog-head {
    min-width: 0;
    max-width: 100%;
}

body.theme-light[data-theme-area="frontend"] .writeups-rect-page .writeup-card-title,
body.theme-light[data-theme-area="frontend"] .writeups-rect-page .writeup-card-title a,
body.theme-light[data-theme-area="frontend"] .writeups-rect-page .writeup-card-lead,
body.theme-light[data-theme-area="frontend"] .writeups-rect-page .writeup-card-meta,
body.theme-light[data-theme-area="frontend"] .writeups-rect-page .catalog-head .chip {
    overflow-wrap: anywhere;
    word-break: break-word;
}

body.theme-light[data-theme-area="frontend"] .writeups-rect-page .catalog-head .chip {
    white-space: normal;
}

body.theme-light[data-theme-area="frontend"] .rect-index-row .catalog-title,
body.theme-light[data-theme-area="frontend"] .rect-index-row .package-title,
body.theme-light[data-theme-area="frontend"] .rect-index-row .writeup-card-title,
body.theme-light[data-theme-area="frontend"] .rect-index-row h2,
body.theme-light[data-theme-area="frontend"] .rect-index-row h3 {
    margin-top: 4px;
    margin-bottom: 4px;
    font-size: clamp(1.02rem, 1.4vw, 1.22rem);
    line-height: 1.3;
    text-align: left !important;
}

body.theme-light[data-theme-area="frontend"] .rect-index-row .catalog-summary,
body.theme-light[data-theme-area="frontend"] .rect-index-row .package-summary,
body.theme-light[data-theme-area="frontend"] .rect-index-row .writeup-card-lead,
body.theme-light[data-theme-area="frontend"] .rect-index-row p {
    margin-top: 4px;
    margin-bottom: 0;
    line-height: 1.55;
}

body.theme-light[data-theme-area="frontend"] .rect-index-row .catalog-meta,
body.theme-light[data-theme-area="frontend"] .rect-index-row .package-facts,
body.theme-light[data-theme-area="frontend"] .rect-index-row .writeup-card-meta,
body.theme-light[data-theme-area="frontend"] .rect-index-row .df-meta {
    margin-top: 8px;
}

body.theme-light[data-theme-area="frontend"] .rect-index-stats {
    gap: 10px;
}

body.theme-light[data-theme-area="frontend"] .rect-index-stats > *,
body.theme-light[data-theme-area="frontend"] .df-stat-grid.rect-index-stats .df-stat {
    min-height: 0;
    padding: 12px 14px;
}


body.theme-light[data-theme-area="frontend"] .contribution-type-card.rect-index-row,
body.theme-light[data-theme-area="frontend"] .learning-track-row.rect-index-row {
    min-height: 0;
    padding: 14px;
}

body.theme-light[data-theme-area="frontend"] .points-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    align-items: start;
    gap: 20px;
}

@media (max-width: 991.98px) {
    body.theme-light[data-theme-area="frontend"] .points-content-grid {
        grid-template-columns: 1fr;
    }
}

/* RC visual usability hotfix overrides. */
body.theme-light[data-theme-area="frontend"] .dfb-nav {
    gap: 4px;
}

body.theme-light[data-theme-area="frontend"] .dfb-nav-link {
    padding-inline: 9px;
    white-space: nowrap;
}

body.theme-light[data-theme-area="frontend"] .df-pagination {
    width: 100%;
    margin-top: 14px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

body.theme-light[data-theme-area="frontend"] .df-pagination .pagination,
body.theme-light[data-theme-area="frontend"] .df-pagination-list {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    padding-left: 0;
    margin: 0;
    list-style: none;
}

body.theme-light[data-theme-area="frontend"] .df-pagination .page-item {
    display: inline-flex !important;
    flex: 0 0 auto;
    margin: 0;
}

body.theme-light[data-theme-area="frontend"] .df-pagination .page-link {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 32px;
    padding: 6px 10px;
    border-radius: 6px;
    line-height: 1;
    white-space: nowrap;
}

body.theme-light.route-register .auth-layout {
    width: min(1180px, calc(100vw - 32px));
    margin-inline: auto;
    display: grid;
    grid-template-columns: minmax(360px, .82fr) minmax(0, 1.18fr);
    gap: 32px;
    align-items: center;
}

body.theme-light.route-register .auth-aside {
    min-height: 560px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 34px;
}

body.theme-light.route-register .auth-panel {
    width: 100%;
    max-width: 680px;
    justify-self: center;
    align-self: center;
    padding: 20px !important;
}

body.theme-light.route-register .auth-register-form,
body.theme-light.route-register .df26-register-form {
    --bs-gutter-y: .5rem;
}

body.theme-light.route-register .auth-panel .form-label {
    margin-bottom: .2rem;
    font-size: .88rem;
}

body.theme-light.route-register .auth-panel .section-title {
    margin-bottom: .5rem;
}

body.theme-light.route-register .auth-panel .section-kicker {
    margin-bottom: .35rem;
}

body.theme-light.route-register .auth-panel .form-control {
    min-height: 36px;
    padding-block: .44rem;
}

body.theme-light.route-register .auth-panel .editor-help {
    margin-top: .18rem;
    font-size: .76rem;
    line-height: 1.4;
}

body.theme-light.route-register .registration-access-notice {
    padding: .6rem .8rem !important;
}

body.theme-light.route-register .registration-access-notice p {
    margin-top: .15rem !important;
}

body.theme-light[data-theme-area="frontend"] .cropper-modal {
    position: fixed;
    inset: 0;
    z-index: 1080;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, .58);
    backdrop-filter: blur(2px);
}

body.theme-light[data-theme-area="frontend"] .cropper-dialog {
    width: min(920px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    overflow: auto;
    border-radius: 10px;
}

body.theme-light[data-theme-area="frontend"] .cropper-dialog-head,
body.theme-light[data-theme-area="frontend"] .cropper-dialog-foot {
    display: flex;
    gap: 16px;
    padding: 18px 20px;
}

body.theme-light[data-theme-area="frontend"] .cropper-dialog-head {
    align-items: flex-start;
    justify-content: space-between;
}

body.theme-light[data-theme-area="frontend"] .cropper-dialog-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 20px;
    padding: 20px;
}

body.theme-light[data-theme-area="frontend"] .cropper-canvas-wrap {
    min-height: 420px;
    max-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

body.theme-light[data-theme-area="frontend"] .cropper-canvas-wrap img {
    max-width: 100%;
    max-height: 420px;
}

body.theme-light[data-theme-area="frontend"] .cropper-side-panel {
    display: grid;
    gap: 14px;
    align-content: start;
}

body.theme-light[data-theme-area="frontend"] .cropper-preview-box {
    width: 116px;
    height: 116px;
    margin-inline: auto;
    overflow: hidden;
    border-radius: 999px;
    background: #f8fafc;
}

body.theme-light[data-theme-area="frontend"] .avatar-preview-img,
body.theme-light[data-theme-area="frontend"] .profile-avatar,
body.theme-light[data-theme-area="frontend"] .user-avatar,
body.theme-light[data-theme-area="frontend"] .nav-avatar,
body.theme-light[data-theme-area="frontend"] .cropper-canvas-wrap img,
body.theme-light[data-theme-area="frontend"] .cropper-container img,
body.theme-light[data-theme-area="frontend"] .cropper-view-box img,
body.theme-light[data-theme-area="frontend"] .cropper-preview-box img,
body.theme-light[data-theme-area="frontend"] .cropper-preview-box canvas {
    opacity: 1 !important;
    filter: none !important;
    mix-blend-mode: normal !important;
}

body.theme-light[data-theme-area="frontend"] #cropperModal.cropper-modal {
    opacity: 1 !important;
}

body.theme-light[data-theme-area="frontend"] .cropper-container {
    background: #f8fafc;
}

body.theme-light[data-theme-area="frontend"] .cropper-container .cropper-modal {
    background-color: rgba(15, 23, 42, .32) !important;
    opacity: 1 !important;
}

body.theme-light[data-theme-area="frontend"] .cropper-face {
    background-color: transparent !important;
    opacity: 0 !important;
}

body.theme-light[data-theme-area="frontend"] .cropper-dialog-foot {
    align-items: center;
    justify-content: space-between;
}

body.theme-light[data-theme-area="frontend"] .cropper-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

body.theme-light[data-theme-area="frontend"] .admin-table-wrap,
body.theme-light[data-theme-area="frontend"] .table-responsive {
    max-width: 100%;
    overflow-x: auto;
}

@media (max-width: 991.98px) {
    body.theme-light.route-register .auth-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    body.theme-light.route-register .auth-panel {
        order: 1;
        max-width: min(680px, 100%);
        justify-self: center;
    }

    body.theme-light.route-register .auth-aside {
        order: 2;
        min-height: auto;
        padding: 24px;
    }

    body.theme-light[data-theme-area="frontend"] .cropper-dialog-body {
        grid-template-columns: 1fr;
    }

    body.theme-light[data-theme-area="frontend"] .cropper-canvas-wrap {
        min-height: min(70vw, 360px);
        max-height: min(70vw, 360px);
    }
}

@media (max-width: 575.98px) {
    body.theme-light[data-theme-area="frontend"] .df-pagination .pagination,
    body.theme-light[data-theme-area="frontend"] .df-pagination-list {
        flex-wrap: wrap;
        overflow-x: visible;
        padding-bottom: 2px;
    }

    body.theme-light.route-register .auth-layout {
        width: min(100%, calc(100vw - 24px));
    }

    body.theme-light.route-register .auth-panel,
    body.theme-light.route-register .auth-aside {
        padding: 20px;
    }

    body.theme-light[data-theme-area="frontend"] .cropper-modal {
        padding: 16px;
    }

    body.theme-light[data-theme-area="frontend"] .cropper-dialog {
        width: calc(100vw - 32px);
        max-height: calc(100vh - 32px);
    }

    body.theme-light[data-theme-area="frontend"] .cropper-dialog-foot {
        align-items: stretch;
        flex-direction: column;
    }

    body.theme-light[data-theme-area="frontend"] .cropper-actions {
        width: 100%;
    }

    body.theme-light[data-theme-area="frontend"] .cropper-actions .btn {
        flex: 1;
    }
}

/* RC3 final specificity guard. */
body.theme-light[data-theme-area="frontend"] .rect-challenge-list {
    background: rgba(248, 250, 252, 0.84) !important;
}

body.theme-light[data-theme-area="frontend"] .rect-challenge-list .df-list-row {
    background: rgba(255, 255, 255, 0.94) !important;
}

body.theme-light[data-theme-area="frontend"] #cropperModal.cropper-modal {
    background: rgba(15, 23, 42, 0.46) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Final release lock: cropper canvas and dialog in this theme. */
body.theme-light[data-theme-area="frontend"] .cropper-canvas-wrap {
    height: clamp(300px, 46vw, 430px);
    min-height: 300px !important;
    max-height: 430px !important;
    padding: 0 !important;
    background: #f8fafc !important;
}

body.theme-light[data-theme-area="frontend"] .cropper-container .cropper-modal {
    background: rgba(15, 23, 42, 0.12) !important;
}

body.theme-light[data-theme-area="frontend"] .cropper-view-box {
    outline: 2px solid rgba(37, 99, 235, 0.88) !important;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9) inset !important;
}

body.theme-light[data-theme-area="frontend"] .cropper-preview-box {
    background: #ffffff !important;
}

body.theme-light[data-theme-area="frontend"] .announcement-info-panel {
    position: sticky;
    top: 88px;
}

@media (max-width: 767.98px) {

    body.theme-light[data-theme-area="frontend"] .announcement-info-panel {
        position: static;
    }
}

/* Final release lock: native avatar cropper canvas. */
body.theme-light[data-theme-area="frontend"] .avatar-crop-canvas {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    cursor: grab;
    touch-action: none;
    opacity: 1 !important;
    filter: none !important;
    mix-blend-mode: normal !important;
}

body.theme-light[data-theme-area="frontend"] .avatar-crop-canvas:active {
    cursor: grabbing;
}

body.theme-light[data-theme-area="frontend"] .avatar-crop-preview-canvas {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    opacity: 1 !important;
    filter: none !important;
    mix-blend-mode: normal !important;
}

body.theme-light[data-theme-area="frontend"] .community-page {
    --community-surface: var(--dfb-surface, #ffffff);
    --community-surface-alt: #f8fafc;
    --community-border: rgba(148, 163, 184, .24);
    --community-ink: #0f172a;
    --community-muted: #64748b;
}
body.theme-light[data-theme-area="frontend"] .community-stats { display:grid; gap:10px; grid-template-columns:repeat(5,minmax(0,1fr)); margin-bottom:20px; }
body.theme-light[data-theme-area="frontend"] .community-stat{ background:var(--community-surface); border:1px solid var(--community-border); color:var(--community-ink); }
body.theme-light[data-theme-area="frontend"] .community-stat { padding:12px 14px; min-width:0; }
body.theme-light[data-theme-area="frontend"] .community-stat span { display:block; color:var(--community-muted); font-size:.78rem; font-weight:800; letter-spacing:.04em; text-transform:uppercase; }
body.theme-light[data-theme-area="frontend"] .community-stat strong { display:block; margin-top:6px; font-size:1.35rem; line-height:1; }
body.theme-light[data-theme-area="frontend"] .community-main{ display:grid; gap:16px; min-width:0; }
body.theme-light[data-theme-area="frontend"] .community-feed-body { min-width:0; }
body.theme-light[data-theme-area="frontend"] .community-feed-body h3 { margin:6px 0 4px; font-size:1rem; overflow-wrap:anywhere; }
body.theme-light[data-theme-area="frontend"] .community-feed-body p{ color:var(--community-muted); overflow-wrap:anywhere; }

body.theme-light[data-theme-area="frontend"] .df-assist-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 18px;
    padding: 10px 12px;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 8px;
    background: rgba(255, 255, 255, .82);
    box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
}

body.theme-light[data-theme-area="frontend"] .df-assist-title {
    flex: 0 0 auto;
    color: var(--ink-muted);
    font-size: .74rem;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
    white-space: nowrap;
}

body.theme-light[data-theme-area="frontend"] .df-assist-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

body.theme-light[data-theme-area="frontend"] .df-assist-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 6px 12px;
    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: 999px;
    background: rgba(248, 250, 252, .92);
    color: var(--ink-3);
    font-size: .82rem;
    font-weight: 750;
    line-height: 1.1;
    text-decoration: none;
    white-space: nowrap;
}

body.theme-light[data-theme-area="frontend"] .df-assist-links a:hover {
    border-color: rgba(37, 99, 235, .34);
    background: rgba(37, 99, 235, .08);
    color: #1d4ed8;
}

body.theme-light[data-theme-area="frontend"] .df-assist-links a:focus-visible,
body.theme-light[data-theme-area="frontend"] .df-assist-links a.is-active {
    border-color: rgba(37, 99, 235, .44);
    background: #2563eb;
    color: #ffffff;
    outline: none;
}

body.theme-light[data-theme-area="frontend"] .activation-redeem-account,
body.theme-light[data-theme-area="frontend"] .activation-rule-card {
    display: grid;
    gap: 4px;
    padding: 13px 14px;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 8px;
    background: rgba(255, 255, 255, .78);
}

body.theme-light[data-theme-area="frontend"] .activation-redeem-account {
    margin-top: 18px;
}

body.theme-light[data-theme-area="frontend"] .activation-redeem-card .activation-redeem-account {
    margin: 0 0 18px;
}

body.theme-light[data-theme-area="frontend"] .activation-redeem-account span,
body.theme-light[data-theme-area="frontend"] .activation-rule-card span {
    color: var(--ink-muted);
    font-size: .76rem;
    font-weight: 850;
}

body.theme-light[data-theme-area="frontend"] .activation-redeem-account strong,
body.theme-light[data-theme-area="frontend"] .activation-rule-card strong {
    color: var(--ink);
    font-size: .94rem;
    overflow-wrap: anywhere;
}

body.theme-light[data-theme-area="frontend"] .activation-redeem-account small {
    color: var(--ink-muted);
    overflow-wrap: anywhere;
}

body.theme-light[data-theme-area="frontend"] .activation-code-input {
    text-transform: uppercase;
    font-family: var(--font-mono);
    letter-spacing: .04em;
}

body.theme-light[data-theme-area="frontend"] .activation-redeem-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

body.theme-light[data-theme-area="frontend"] .activation-rule-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

body.theme-light[data-theme-area="frontend"] .activation-rule-link:hover {
    border-color: rgba(37, 99, 235, .34);
    background: rgba(37, 99, 235, .08);
}

@media (max-width: 991.98px) {
    body.theme-light[data-theme-area="frontend"] .community-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
    body.theme-light[data-theme-area="frontend"] .activation-rule-grid { grid-template-columns: 1fr; }
}

@media (max-width: 575.98px) {
    body.theme-light[data-theme-area="frontend"] .community-stats{ grid-template-columns:1fr; }
    body.theme-light[data-theme-area="frontend"] .df-assist-strip {
        align-items: center;
        flex-direction: row;
        min-height: 50px;
        overflow: hidden;
        padding-block: 7px;
    }
    body.theme-light[data-theme-area="frontend"] .df-assist-title {
        display: none;
    }
    body.theme-light[data-theme-area="frontend"] .df-assist-links {
        justify-content: flex-start;
        width: 100%;
        flex-wrap: nowrap !important;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scrollbar-width: none;
        scroll-snap-type: x proximity;
    }
    body.theme-light[data-theme-area="frontend"] .df-assist-links::-webkit-scrollbar {
        display: none;
    }
    body.theme-light[data-theme-area="frontend"] .df-assist-links a {
        min-width: max-content;
        min-height: 44px;
        flex: 0 0 auto;
        scroll-snap-align: start;
    }
}

@media (max-width: 767.98px) {
    body.theme-light[data-theme-area="frontend"] :is(a.btn, button.btn, summary.btn) {
        min-height: 44px;
    }

    body.theme-light[data-theme-area="frontend"] .auth-panel :is(.form-check, .auth-legal-consent-label) {
        min-height: 44px;
    }

    body.theme-light[data-theme-area="frontend"] .auth-secondary-link a {
        display: inline-flex;
        min-height: 44px;
        align-items: center;
    }

    body.theme-light[data-theme-area="frontend"] .df-pagination .page-link {
        min-width: 44px;
        min-height: 44px;
        padding: 10px 12px;
    }

    body.theme-light[data-theme-area="frontend"] :is(.btn-sm, .df-button-sm) {
        min-height: 44px;
        padding-block: 10px;
    }

    body.theme-light[data-theme-area="frontend"] :is(.security-preference-options, .notification-preferences-form) .form-check {
        min-height: 44px;
        padding-block: 8px;
        cursor: pointer;
    }

    body.theme-light[data-theme-area="frontend"].route-search-go .search-shell > .btn,
    body.theme-light[data-theme-area="frontend"].route-search-go .search-assist a,
    body.theme-light[data-theme-area="frontend"].route-search-go .search-term-row a,
    body.theme-light[data-theme-area="frontend"].route-search-go .search-suggestion-row a,
    body.theme-light[data-theme-area="frontend"].route-search-go .search-results .section-link {
        min-height: 44px;
    }

    body.theme-light[data-theme-area="frontend"].route-search-go :is(.search-assist a, .search-term-row a, .search-suggestion-row a) {
        justify-content: center;
        padding-block: 8px;
    }
}

/* Mobile navigation remains reachable without squeezing account actions into the header. */
@media (max-width: 768px) {
    body.theme-light[data-theme-area="frontend"] .dfb-header { overflow: visible !important; }
    body.theme-light[data-theme-area="frontend"] .dfb-header.is-open { position: relative !important; }
    body.theme-light[data-theme-area="frontend"] .dfb-header-inner {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 40px !important;
        width: 100% !important;
        height: auto !important;
        min-height: 64px;
        padding-inline: 12px !important;
        padding-block: 6px !important;
        gap: 10px !important;
    }
    body.theme-light[data-theme-area="frontend"] .dfb-brand {
        grid-row: 1 !important;
        grid-column: 1 !important;
        display: flex !important;
        min-width: 0 !important;
        width: auto !important;
        max-width: 100% !important;
        align-items: center !important;
        gap: 8px !important;
    }
    body.theme-light[data-theme-area="frontend"] .dfb-brand-logo {
        flex: 0 0 28px !important;
        width: 28px !important;
        height: 28px !important;
    }
    body.theme-light[data-theme-area="frontend"] .dfb-brand-text {
        min-width: 0 !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }
    body.theme-light[data-theme-area="frontend"] .dfb-brand-text strong,
    body.theme-light[data-theme-area="frontend"] .dfb-brand-text span {
        display: block !important;
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }
    body.theme-light[data-theme-area="frontend"] .dfb-header-actions { display: none !important; }
    body.theme-light[data-theme-area="frontend"] .dfb-mobile-toggle {
        display: flex !important;
        width: 40px !important;
        height: 40px !important;
        margin: 0 !important;
        grid-row: 1 !important;
        grid-column: 2 !important;
    }
    body.theme-light[data-theme-area="frontend"] .dfb-header.is-open .dfb-nav {
        position: static !important;
        grid-row: 2 !important;
        grid-column: 1 / -1 !important;
        z-index: 210 !important;
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        width: 100% !important;
        max-width: none !important;
        gap: 6px !important;
        padding: 12px !important;
        overflow: visible !important;
        border: 1px solid var(--border) !important;
        background: rgba(255, 255, 255, .98) !important;
        box-shadow: 0 18px 42px rgba(15, 23, 42, .18) !important;
    }
    body.theme-light[data-theme-area="frontend"] .dfb-header.is-open .dfb-nav-link {
        display: inline-flex;
        min-height: 40px;
        align-items: center;
        justify-content: center;
        padding: 8px 6px !important;
        text-align: center;
    }
    body.theme-light[data-theme-area="frontend"] .dfb-header.is-open .dfb-header-actions {
        position: static !important;
        grid-row: 3 !important;
        grid-column: 1 / -1 !important;
        z-index: 209 !important;
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        width: 100% !important;
        max-width: none !important;
        align-items: stretch !important;
        justify-content: stretch !important;
        padding: 10px 12px !important;
        gap: 8px !important;
        border: 1px solid var(--border) !important;
        background: rgba(255, 255, 255, .98) !important;
        box-shadow: 0 18px 42px rgba(15, 23, 42, .14) !important;
    }
    body.theme-light[data-theme-area="frontend"] .dfb-header.is-open .dfb-theme-switcher {
        grid-column: 1 / -1 !important;
        width: 100% !important;
    }
    body.theme-light[data-theme-area="frontend"] .dfb-header.is-open .dfb-theme-switcher-toggle {
        width: 100% !important;
        min-height: 40px !important;
        justify-content: space-between !important;
        padding-inline: 12px !important;
    }
    body.theme-light[data-theme-area="frontend"] .dfb-header.is-open .dfb-theme-switcher-current-label {
        position: static !important;
        width: auto !important;
        height: auto !important;
        margin: 0 !important;
        overflow: visible !important;
        clip: auto !important;
        clip-path: none !important;
        white-space: nowrap !important;
    }
    body.theme-light[data-theme-area="frontend"] .dfb-header.is-open .dfb-mobile-toggle span {
        background: transparent !important;
    }
    body.theme-light[data-theme-area="frontend"] .dfb-header.is-open .dfb-mobile-toggle span::before,
    body.theme-light[data-theme-area="frontend"] .dfb-header.is-open .dfb-mobile-toggle span::after {
        top: 0 !important;
        background: currentColor !important;
    }
    body.theme-light[data-theme-area="frontend"] .dfb-header.is-open .dfb-mobile-toggle span::before {
        transform: rotate(45deg);
    }
    body.theme-light[data-theme-area="frontend"] .dfb-header.is-open .dfb-mobile-toggle span::after {
        transform: rotate(-45deg);
    }
    body.theme-light[data-theme-area="frontend"] .dfb-header.is-open .dfb-header-actions .btn,
    body.theme-light[data-theme-area="frontend"] .dfb-header.is-open .dfb-header-actions button:not(.dfb-theme-switcher-toggle) {
        width: 100% !important;
        min-height: 40px !important;
        justify-content: center !important;
    }
    body.theme-light[data-theme-area="frontend"] .dfb-header.is-open .dfb-header-actions form {
        display: contents !important;
    }
}

body.theme-light[data-theme-area="frontend"] .writeups-rect-page .writeup-card,
body.theme-light[data-theme-area="frontend"] .writeups-rect-page .writeup-card-body,
body.theme-light[data-theme-area="frontend"] .writeups-rect-page .writeup-card-copy,
body.theme-light[data-theme-area="frontend"] .writeups-rect-page .catalog-head,
body.theme-light[data-theme-area="frontend"] .writeups-rect-page .writeup-card-meta {
    min-width: 0;
    max-width: 100%;
}

body.theme-light[data-theme-area="frontend"] .writeups-rect-page .catalog-head .chip {
    width: auto;
    max-width: 100%;
    min-width: 0;
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
}
@media (max-width: 991.98px) {

    
    body.theme-light[data-theme-area="frontend"] .df-table-wrap {
        min-width: 0 !important;
        max-width: 100% !important;
    }

    
    body.theme-light[data-theme-area="frontend"] .df-table-wrap {
        width: 100% !important;
    }
}
.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;
}

.path-cover-image {
    display: block;
    width: 100%;
    max-height: 320px;
    object-fit: cover;
}

.path-aside-sticky {
    position: sticky;
    top: 72px;
    align-self: start;
    max-height: calc(100vh - 88px);
    overflow-y: auto;
}

.path-progress-lg {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(148, 163, 184, 0.22);
    border: 0;
    border-radius: 999px;
    display: block;
    height: 9px;
    overflow: hidden;
    width: 100%;
}

.path-progress-lg::-webkit-progress-bar {
    background: rgba(148, 163, 184, 0.22);
    border-radius: 999px;
}

.path-progress-lg::-webkit-progress-value {
    background: var(--accent);
    border-radius: 999px;
}

.path-progress-lg::-moz-progress-bar {
    background: var(--accent);
    border-radius: 999px;
}

@media (max-width: 768px) {
    .path-aside-sticky {
        position: static;
        max-height: none;
        overflow: visible;
    }
}

/* Frontend theme switcher: final two-theme segmented control. */
body.theme-light[data-theme-area="frontend"] .dfb-theme-switcher {
    flex: 0 0 auto;
}

body.theme-light[data-theme-area="frontend"] .dfb-theme-switcher-toggle {
    min-width: 88px;
    gap: 7px;
    padding-inline: 10px;
    border-radius: 8px;
}

body.theme-light[data-theme-area="frontend"] .dfb-theme-switcher-current-icon,
body.theme-light[data-theme-area="frontend"] .dfb-theme-switcher-icon {
    display: inline-flex;
    width: 22px;
    height: 22px;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
}

body.theme-light[data-theme-area="frontend"] .dfb-theme-switcher-current-label {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
}

body.theme-light[data-theme-area="frontend"] .dfb-theme-switcher-menu {
    min-width: 180px;
    padding: 6px;
    border-radius: 8px;
}

body.theme-light[data-theme-area="frontend"] .dfb-theme-switcher-item {
    align-items: center;
    gap: 10px;
    min-height: 44px;
    border-radius: 7px;
}

body.theme-light[data-theme-area="frontend"] .dfb-theme-switcher-copy {
    display: grid;
    gap: 1px;
    min-width: 0;
}

body.theme-light[data-theme-area="frontend"] .dfb-theme-switcher-copy span {
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
}

body.theme-light[data-theme-area="frontend"] .dfb-theme-switcher-copy small {
    color: var(--ink-muted);
    font-size: 11px;
    line-height: 1.2;
}

@media (max-width: 575.98px) {
    body.theme-light[data-theme-area="frontend"] .dfb-theme-switcher {
        width: 100%;
    }

    body.theme-light[data-theme-area="frontend"] .dfb-theme-switcher-toggle {
        width: 100%;
        justify-content: center;
    }

    body.theme-light[data-theme-area="frontend"] .dfb-theme-switcher-menu {
        left: 0;
        right: auto;
        width: min(100%, 220px);
    }
}

/* Shared frontend empty states: complete action card structure. */
body.theme-light[data-theme-area="frontend"] .empty-state {
    display: grid;
    justify-items: center;
    gap: 12px;
    padding: clamp(22px, 4vw, 38px) clamp(18px, 4vw, 34px);
    text-align: center;
}

body.theme-light[data-theme-area="frontend"] .empty-state-mark {
    width: 52px;
    height: 52px;
    margin-bottom: 0;
    border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
    border-radius: 8px;
    background: color-mix(in srgb, var(--accent-soft) 72%, var(--surface));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
    color: var(--accent);
    font-size: 0.92rem;
    letter-spacing: 0;
}

body.theme-light[data-theme-area="frontend"] .empty-state-body {
    display: grid;
    justify-items: center;
    gap: 6px;
    max-width: 44rem;
}

body.theme-light[data-theme-area="frontend"] .empty-state-title {
    color: var(--ink);
    font-size: clamp(1.08rem, 1.4vw, 1.28rem);
    line-height: 1.35;
}

body.theme-light[data-theme-area="frontend"] .empty-state-copy,
body.theme-light[data-theme-area="frontend"] .empty-state-description {
    max-width: 38rem;
    color: var(--ink-3);
    line-height: 1.72;
}

body.theme-light[data-theme-area="frontend"] .empty-state-eyebrow,
body.theme-light[data-theme-area="frontend"] .df-empty-state-eyebrow {
    color: var(--accent);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0;
}

body.theme-light[data-theme-area="frontend"] .empty-state-suggestions,
body.theme-light[data-theme-area="frontend"] .df-empty-state-suggestions {
    display: grid;
    gap: 7px;
    width: min(100%, 34rem);
    margin: 2px 0 0;
    padding: 0;
    list-style: none;
}

body.theme-light[data-theme-area="frontend"] .empty-state-suggestions li,
body.theme-light[data-theme-area="frontend"] .df-empty-state-suggestions li {
    padding: 9px 11px;
    border: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface) 74%, transparent);
    color: var(--ink-3);
    font-size: 0.84rem;
    line-height: 1.55;
}

body.theme-light[data-theme-area="frontend"] .empty-state-actions,
body.theme-light[data-theme-area="frontend"] .df-empty-state-actions {
    margin-top: 4px;
}

body.theme-light[data-theme-area="frontend"] .df-empty-state {
    border-radius: 8px;
    padding: 18px;
}

body.theme-light[data-theme-area="frontend"] .df-empty-state-body {
    display: grid;
    gap: 6px;
}

/* Final guard: keep the Light/Dark switcher compact after legacy wide rules. */
body.theme-light .dfb-theme-switcher-toggle {
    min-width: 88px !important;
    width: auto !important;
    height: 36px !important;
    justify-content: center;
    gap: 7px;
    padding-inline: 10px !important;
    white-space: nowrap;
}

body.theme-light .dfb-theme-switcher-current-label {
    clip: auto !important;
    border: 0 !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    overflow: visible !important;
    padding: 0 !important;
    position: static !important;
    white-space: nowrap !important;
}

body.theme-light .dfb-theme-switcher-caret {
    opacity: 0.72;
}

@media (max-width: 640px) {
    body.theme-light[data-theme-area="frontend"] :is(.section-link, .catalog-title-link, .card-title-link, .package-title-link) {
        min-height: 2.25rem;
    }
}

/* Final guard: archive filters stay compact on mobile while remaining open on desktop. */
body.theme-light[data-theme-area="frontend"] .archive-filter-disclosure {
    display: block;
}

body.theme-light[data-theme-area="frontend"] .archive-filter-summary-toggle {
    display: none;
}

body.theme-light[data-theme-area="frontend"] .archive-filter-disclosure:not([open]) > form {
    display: grid;
}

@media (max-width: 767.98px) {
    body.theme-light[data-theme-area="frontend"] .archive-filter-summary-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        min-height: 2.75rem;
        padding: 0.72rem 0.9rem;
        border: 1px solid rgba(37, 99, 235, 0.2);
        border-radius: 8px;
        background: rgba(37, 99, 235, 0.08);
        color: var(--ink, #172033);
        cursor: pointer;
        list-style: none;
        touch-action: manipulation;
    }

    body.theme-light[data-theme-area="frontend"] .archive-filter-summary-toggle::-webkit-details-marker {
        display: none;
    }

    body.theme-light[data-theme-area="frontend"] .archive-filter-summary-toggle span {
        min-width: 0;
        font-weight: 800;
        overflow-wrap: anywhere;
    }

    body.theme-light[data-theme-area="frontend"] .archive-filter-summary-toggle small {
        flex-shrink: 0;
        color: var(--ink-muted, #64748b);
        font-size: 0.78rem;
        font-weight: 700;
    }

    body.theme-light[data-theme-area="frontend"] .archive-filter-summary-toggle::after {
        content: "+";
        flex-shrink: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 1.35rem;
        height: 1.35rem;
        border-radius: 999px;
        background: rgba(37, 99, 235, 0.14);
        color: var(--accent, #2563eb);
        font-weight: 900;
    }

    body.theme-light[data-theme-area="frontend"] .archive-filter-disclosure[open] > .archive-filter-summary-toggle {
        margin-bottom: 0.75rem;
    }

    body.theme-light[data-theme-area="frontend"] .archive-filter-disclosure[open] > .archive-filter-summary-toggle::after {
        content: "-";
    }

    body.theme-light[data-theme-area="frontend"] .archive-filter-disclosure:not([open]) > form {
        display: none !important;
    }
}

body.theme-light[data-theme-area="frontend"] .search-mark {
    background: #fef08a;
    color: inherit;
    padding: 0 0.1em;
}

body.theme-light[data-theme-area="frontend"] .search-assist {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: center;
    color: var(--ink-muted, #64748b);
    font-size: 0.9rem;
}

body.theme-light[data-theme-area="frontend"] .search-assist span,
body.theme-light[data-theme-area="frontend"] .search-suggestion-block > span,
body.theme-light[data-theme-area="frontend"] .search-rescue-block > span,
body.theme-light[data-theme-area="frontend"] .search-term-row > span,
body.theme-light[data-theme-area="frontend"] .search-zero-context span,
body.theme-light[data-theme-area="frontend"] .search-result-guidance span {
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
    color: var(--ink-muted, #64748b);
}

body.theme-light[data-theme-area="frontend"] .search-assist div,
body.theme-light[data-theme-area="frontend"] .search-suggestion-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

body.theme-light[data-theme-area="frontend"] .search-suggestion-block,
body.theme-light[data-theme-area="frontend"] .search-rescue-block {
    display: grid;
    gap: 0.65rem;
}

body.theme-light[data-theme-area="frontend"] .search-rescue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: 0.65rem;
}

body.theme-light[data-theme-area="frontend"] .search-rescue-grid a,
body.theme-light[data-theme-area="frontend"] .search-zero-context {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border: 1px solid rgba(37, 99, 235, 0.24);
    background: rgba(37, 99, 235, 0.07);
    color: inherit;
    padding: 0.75rem 0.85rem;
    text-decoration: none;
}

body.theme-light[data-theme-area="frontend"] .search-zero-context {
    align-items: flex-start;
}

body.theme-light[data-theme-area="frontend"] .search-zero-context > div {
    min-width: 0;
}

body.theme-light[data-theme-area="frontend"] .search-zero-context strong {
    display: block;
    color: var(--ink, #0f172a);
    font-size: 1rem;
    overflow-wrap: anywhere;
}

body.theme-light[data-theme-area="frontend"] .search-zero-context p {
    margin: 0.35rem 0 0;
    color: var(--ink-muted, #64748b);
    line-height: 1.65;
}

body.theme-light[data-theme-area="frontend"] .search-rescue-grid strong {
    font-size: 0.95rem;
}

body.theme-light[data-theme-area="frontend"] .search-rescue-grid small {
    color: var(--ink-muted, #64748b);
    white-space: nowrap;
}

body.theme-light[data-theme-area="frontend"] .search-assist a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: var(--surface, #fff);
    color: inherit;
    padding: 0.25rem 0.55rem;
    text-decoration: none;
}

body.theme-light[data-theme-area="frontend"] .search-assist small {
    color: var(--ink-muted, #64748b);
    font-size: 0.7rem;
}

body.theme-light[data-theme-area="frontend"] .search-normalized-note {
    border: 1px solid rgba(37, 99, 235, 0.2);
    background: rgba(37, 99, 235, 0.08);
    color: var(--ink, #0f172a);
    padding: 0.65rem 0.8rem;
    font-weight: 700;
}

body.theme-light[data-theme-area="frontend"] .search-term-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    color: var(--ink-muted, #64748b);
}

body.theme-light[data-theme-area="frontend"] .search-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
    gap: 0.65rem;
}

body.theme-light[data-theme-area="frontend"] .search-breakdown-item {
    display: flex;
    min-height: 3.25rem;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: var(--surface, #fff);
    color: inherit;
    padding: 0.7rem 0.8rem;
    text-decoration: none;
}

body.theme-light[data-theme-area="frontend"] .search-breakdown-item span {
    font-size: 0.9rem;
    font-weight: 700;
}

body.theme-light[data-theme-area="frontend"] .search-breakdown-item strong {
    font-variant-numeric: tabular-nums;
}

body.theme-light[data-theme-area="frontend"] .search-breakdown-item.active {
    border-color: rgba(37, 99, 235, 0.55);
    box-shadow: 0 0 0 0.18rem rgba(37, 99, 235, 0.12);
}

body.theme-light[data-theme-area="frontend"] .search-breakdown-item.is-empty {
    background: var(--surface-muted, #f8fafc);
    color: var(--ink-muted, #64748b);
}

body.theme-light[data-theme-area="frontend"] .search-result-guidance {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid rgba(37, 99, 235, 0.22);
    background: rgba(37, 99, 235, 0.06);
    padding: 1rem;
}

body.theme-light[data-theme-area="frontend"] .search-result-guidance strong {
    display: block;
    color: var(--ink, #0f172a);
    font-size: 1rem;
}

body.theme-light[data-theme-area="frontend"] .search-result-guidance p {
    margin: 0.35rem 0 0;
    color: var(--ink-muted, #64748b);
    line-height: 1.65;
}

body.theme-light[data-theme-area="frontend"] .search-result-guidance-actions {
    display: flex;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

body.theme-light[data-theme-area="frontend"] .search-results .catalog-line,
body.theme-light[data-theme-area="frontend"] .search-results .catalog-line > div:first-child {
    min-width: 0;
}

body.theme-light[data-theme-area="frontend"] .search-results .catalog-line > div:first-child,
body.theme-light[data-theme-area="frontend"] .search-results .catalog-title,
body.theme-light[data-theme-area="frontend"] .search-results .catalog-summary,
body.theme-light[data-theme-area="frontend"] .search-results .search-context {
    overflow-wrap: anywhere;
    word-break: break-word;
}

body.theme-light[data-theme-area="frontend"] .search-results .catalog-side {
    max-width: 100%;
}

body.theme-light[data-theme-area="frontend"] .search-context {
    margin: 0.45rem 0 0;
    color: var(--ink-muted, #64748b);
    font-size: 0.88rem;
    line-height: 1.65;
}

body.theme-light[data-theme-area="frontend"] .search-context span {
    display: inline-flex;
    margin-right: 0.4rem;
    color: var(--ink, #0f172a);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

body.theme-light[data-theme-area="frontend"] .search-empty-panel .btn {
    min-width: 8rem;
}

body.theme-light[data-theme-area="frontend"] .search-load-more {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-top: 1px solid rgba(37, 99, 235, 0.22);
    padding: 1rem 0 0;
}

body.theme-light[data-theme-area="frontend"] .search-load-more p {
    margin: 0;
    color: var(--ink-muted, #64748b);
}

@media (max-width: 640px) {
    body.theme-light[data-theme-area="frontend"] .search-result-guidance,
    body.theme-light[data-theme-area="frontend"] .search-zero-context {
        align-items: flex-start;
        flex-direction: column;
    }

    body.theme-light[data-theme-area="frontend"] .search-result-guidance-actions {
        justify-content: flex-start;
    }

    body.theme-light[data-theme-area="frontend"] .search-load-more {
        align-items: stretch;
        flex-direction: column;
    }
}

/* Mobile information hierarchy shared with the dark theme. */
.comp-rail-nav-toggle {
    display: none;
}

.content-outline-toggle {
    display: none;
}

@media (max-width: 768px) {
    body.theme-light[data-theme-area="frontend"].route-home .df26-hero {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 10px !important;
        padding: 12px !important;
    }

    body.theme-light[data-theme-area="frontend"].route-home .df26-hero-copy {
        order: 1;
        gap: 10px !important;
    }

    body.theme-light[data-theme-area="frontend"].route-home .df26-hero-side.df26-hero-logo-side {
        order: 2 !important;
        min-height: 0 !important;
    }

    body.theme-light[data-theme-area="frontend"].route-home .df26-hero-title {
        font-size: 2rem !important;
    }

    body.theme-light[data-theme-area="frontend"].route-home .df26-hero-lead {
        font-size: .88rem !important;
        line-height: 1.52 !important;
    }

    body.theme-light[data-theme-area="frontend"].route-home .df26-hero-stats {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 4px !important;
    }

    body.theme-light[data-theme-area="frontend"].route-home .df26-metric {
        min-height: 50px;
        align-content: center;
        gap: 3px;
        padding: 7px 6px !important;
        box-shadow: none;
    }

    body.theme-light[data-theme-area="frontend"].route-home .df26-metric strong {
        font-size: 1rem !important;
    }

    body.theme-light[data-theme-area="frontend"].route-home .df26-metric span {
        font-size: .68rem !important;
        line-height: 1.2;
    }

    body.theme-light[data-theme-area="frontend"].route-home .df26-search-shell {
        padding: 5px !important;
    }

    body.theme-light[data-theme-area="frontend"].route-home .df26-search-shell .search-shell {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 86px;
        gap: 6px;
    }

    body.theme-light[data-theme-area="frontend"].route-home .df26-search-main {
        display: contents !important;
    }

    body.theme-light[data-theme-area="frontend"].route-home .df26-search-shell .search-target-wrap {
        display: none !important;
    }

    body.theme-light[data-theme-area="frontend"].route-home .df26-search-shell .search-input-wrap,
    body.theme-light[data-theme-area="frontend"].route-home .df26-search-button {
        width: 100% !important;
        height: 42px !important;
        min-width: 0 !important;
    }

    body.theme-light[data-theme-area="frontend"].route-home .df26-search-button {
        grid-column: 2;
        grid-row: 1;
        padding-inline: 8px;
        font-size: .82rem;
    }

    body.theme-light[data-theme-area="frontend"].route-home .df26-hero-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    body.theme-light[data-theme-area="frontend"].route-home .df26-hero-actions .btn:nth-child(n + 3) {
        display: none !important;
    }

    body.theme-light[data-theme-area="frontend"].route-home .df26-hero-logo-side .df-hero-logo-live,
    body.theme-light[data-theme-area="frontend"].route-home .df26-hero-logo-side .df-typewriter-panel {
        min-height: 0 !important;
    }

    body.theme-light[data-theme-area="frontend"].route-home .df26-hero-logo-side .df-typewriter-panel {
        padding: 10px 12px !important;
    }

    body.theme-light[data-theme-area="frontend"].route-home .df26-hero-logo-side .df-typewriter-code {
        min-height: 0 !important;
        gap: 4px !important;
    }

    body.theme-light[data-theme-area="frontend"].route-home .df26-hero-logo-side .df-typewriter-command-row,
    body.theme-light[data-theme-area="frontend"].route-home .df26-hero-logo-side .df-typewriter-subline-alt {
        display: none !important;
    }

    body.theme-light[data-theme-area="frontend"].route-home .df26-hero-logo-side :is(.df-typewriter-word, .df-typewriter-word-ghost) {
        font-size: 1.6rem !important;
        line-height: 1 !important;
    }

    body.theme-light[data-theme-area="frontend"].route-home .df26-hero-logo-side .df-typewriter-subline {
        font-size: .66rem;
        line-height: 1.35;
    }

    body.theme-light[data-theme-area="frontend"].route-challenges-index .rect-challenge-list .df-list-row.rect-index-row {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 12px !important;
        padding: 14px !important;
    }

    body.theme-light[data-theme-area="frontend"].route-challenges-index .rect-challenge-list .package-line-main {
        display: grid;
        gap: 8px;
    }

    body.theme-light[data-theme-area="frontend"].route-challenges-index .rect-challenge-list .catalog-head {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 5px;
    }

    body.theme-light[data-theme-area="frontend"].route-challenges-index .rect-challenge-list .catalog-head .chip {
        width: auto !important;
        max-width: 100%;
    }

    body.theme-light[data-theme-area="frontend"].route-challenges-index .rect-challenge-list .package-summary {
        display: -webkit-box;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    body.theme-light[data-theme-area="frontend"].route-challenges-index .rect-challenge-list .package-line-aside {
        display: grid !important;
        grid-template-columns: auto auto minmax(110px, 1fr) !important;
        width: 100%;
        min-width: 0;
        align-items: center;
        gap: 10px;
        padding: 12px 0 0 !important;
        border-top: 1px solid var(--border);
        border-left: 0 !important;
    }

    body.theme-light[data-theme-area="frontend"].route-challenges-index .rect-challenge-list .package-stat {
        display: flex;
        align-items: baseline;
        gap: 4px;
        text-align: left;
        white-space: nowrap;
    }

    body.theme-light[data-theme-area="frontend"].route-challenges-index .rect-challenge-list .package-stat strong {
        display: inline;
        font-size: 1rem;
    }

    body.theme-light[data-theme-area="frontend"].route-challenges-index .rect-challenge-list .package-start-link {
        grid-column: auto !important;
        width: 100%;
        min-width: 0;
        margin-top: 0;
    }

    body.theme-light[data-theme-area="frontend"].route-challenges-show .comp-rail-nav-toggle {
        display: flex;
        flex: 1 1 100%;
        width: 100%;
        min-height: 42px;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 9px 11px;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: var(--surface-alt);
        color: var(--ink);
        font-weight: 750;
    }

    body.theme-light[data-theme-area="frontend"].route-challenges-show .comp-rail-nav-toggle::after {
        content: "+";
        display: inline-flex;
        width: 22px;
        height: 22px;
        align-items: center;
        justify-content: center;
        margin-left: auto;
        border-radius: 999px;
        background: var(--accent-soft);
        color: var(--accent);
        font-size: 1rem;
    }

    body.theme-light[data-theme-area="frontend"].route-challenges-show .comp-rail.is-nav-open .comp-rail-nav-toggle::after {
        content: "−";
    }

    body.theme-light[data-theme-area="frontend"].route-challenges-show .comp-rail-nav-window {
        display: none !important;
    }

    body.theme-light[data-theme-area="frontend"].route-challenges-show .comp-rail.is-nav-open .comp-rail-nav-window {
        display: grid !important;
        max-height: 220px !important;
        overflow-y: auto !important;
        overscroll-behavior: contain;
    }

    body.theme-light[data-theme-area="frontend"]:is(.route-wiki-show, .route-writeups-show) .wiki-doc-layout {
        display: flex !important;
        flex-direction: column;
    }

    body.theme-light[data-theme-area="frontend"]:is(.route-wiki-show, .route-writeups-show) .wiki-doc-layout .wiki-doc-outline-rail {
        display: block !important;
        position: sticky !important;
        top: calc(var(--df-header-total, 65px) + 8px) !important;
        z-index: 18;
        order: 1 !important;
        max-height: calc(100dvh - var(--df-header-total, 65px) - 16px);
        align-self: start;
    }

    body.theme-light[data-theme-area="frontend"]:is(.route-wiki-show, .route-writeups-show) .wiki-doc-layout .wiki-doc-main {
        order: 2 !important;
    }

    body.theme-light[data-theme-area="frontend"]:is(.route-wiki-show, .route-writeups-show) .wiki-doc-layout .wiki-doc-meta-rail {
        order: 3 !important;
    }

    body.theme-light[data-theme-area="frontend"]:is(.route-wiki-show, .route-writeups-show) .wiki-doc-meta-rail .doc-current-card {
        display: none !important;
    }

    body.theme-light[data-theme-area="frontend"]:is(.route-wiki-show, .route-writeups-show) .content-outline-toggle {
        display: flex;
        width: 100%;
        min-height: 44px;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 12px;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: var(--surface);
        color: var(--ink);
        font-weight: 750;
    }

    body.theme-light[data-theme-area="frontend"]:is(.route-wiki-show, .route-writeups-show) .content-outline-toggle::after {
        content: "+";
        display: inline-flex;
        width: 22px;
        height: 22px;
        align-items: center;
        justify-content: center;
        margin-left: auto;
        border-radius: 999px;
        background: var(--accent-soft);
        color: var(--accent);
    }

    body.theme-light[data-theme-area="frontend"]:is(.route-wiki-show, .route-writeups-show) .wiki-doc-outline-rail.is-outline-open .content-outline-toggle::after {
        content: "−";
    }

    body.theme-light[data-theme-area="frontend"]:is(.route-wiki-show, .route-writeups-show) .wiki-doc-outline-rail .doc-outline-panel {
        display: none !important;
    }

    body.theme-light[data-theme-area="frontend"]:is(.route-wiki-show, .route-writeups-show) .wiki-doc-outline-rail.is-outline-open .doc-outline-panel {
        display: block !important;
        max-height: min(60vh, 420px) !important;
        margin-top: 8px;
        overflow-y: auto !important;
        overscroll-behavior: contain;
    }

    body.theme-light[data-theme-area="frontend"] .breadcrumbs {
        min-width: 0;
        align-items: center;
        flex-wrap: nowrap !important;
    }

    body.theme-light[data-theme-area="frontend"] .breadcrumbs > :is(a, span) {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    body.theme-light[data-theme-area="frontend"] .breadcrumbs > strong {
        min-width: 0;
        flex: 1 1 auto;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.theme-light[data-theme-area="frontend"].route-community-index .community-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px;
    }

    body.theme-light[data-theme-area="frontend"].route-community-index .community-stat {
        display: flex;
        min-height: 54px;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 10px 12px;
    }

    body.theme-light[data-theme-area="frontend"].route-community-index .community-stat strong {
        flex: 0 0 auto;
        margin-top: 0;
        font-size: 1.2rem;
    }

    body.theme-light[data-theme-area="frontend"].route-community-index .community-stat:last-child {
        grid-column: 1 / -1;
    }
}
@media (max-width: 768px) {
    body.route-home [data-home-mobile-secondary] {
        display: none !important;
    }

    body.theme-light[data-theme-area="frontend"] .dfb-header.is-open .dfb-theme-switcher {
        padding-bottom: 0 !important;
        margin-bottom: 0 !important;
    }

    body.theme-light[data-theme-area="frontend"] .dfb-header.is-open .dfb-theme-switcher-menu {
        position: static !important;
        inset: auto !important;
        display: none !important;
        width: 100% !important;
        max-width: none !important;
        margin-top: 8px;
        transform: none !important;
    }

    body.theme-light[data-theme-area="frontend"] .dfb-header.is-open .dfb-theme-switcher.is-open .dfb-theme-switcher-menu {
        display: grid !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
}

/* Footer records remain easy to tap even when the legal text is short. */
.dfb-footer-records .dfb-record-link,
.dfb-footer-records a.dfb-record-item {
    display: inline-flex !important;
    align-items: center !important;
    min-height: 44px !important;
}

@media (max-width: 640px) {
    body.theme-light[data-theme-area="frontend"] .writeup-index-head .section-link,
    body.theme-light[data-theme-area="frontend"] .community-link {
        display: inline-flex !important;
        align-items: center !important;
        min-height: 44px !important;
        padding-inline: .35rem !important;
    }
}
