:root {
    --bg-page: #f7f6f2;
    --bg-surface: #fcfbf8;
    --bg-panel: rgba(255, 255, 255, 0.82);
    --text-primary: #171717;
    --text-secondary: #5c5c5c;
    --text-muted: #8b8b8b;
    --line-soft: rgba(23, 23, 23, 0.06);
    --line-medium: rgba(23, 23, 23, 0.10);
    --line-strong: rgba(23, 23, 23, 0.16);
    --accent-warm: #d98a3d;
    --accent-warm-soft: #e8b27a;
    --accent-warm-pale: rgba(217, 138, 61, 0.10);
    --ink-deep: #111111;
    --ink-soft: rgba(17, 17, 17, 0.78);
    --font-title-weight: 600;
    --font-heading-weight: 600;
    --font-body-weight: 400;
    --font-meta-weight: 500;
    --tracking-display: 0.04em;
    --tracking-heading: 0.02em;
    --tracking-body: 0em;
    --lh-display: 1.15;
    --lh-heading: 1.3;
    --lh-body: 1.8;
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 28px;
    --radius-xl: 40px;
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.04);
    --shadow-panel: 0 18px 50px rgba(0, 0, 0, 0.06);
    --shadow-frame: 0 24px 60px rgba(0, 0, 0, 0.08);
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 64px;
    --space-9: 96px;
    --space-10: 128px;
    --ease-standard: cubic-bezier(0.22, 1, 0.36, 1);
    --duration-fast: 180ms;
    --duration-mid: 280ms;
    --duration-slow: 480ms;
    --site-max-width: 1180px;
    --page-top-offset: 72px;
    --page-top-offset-mobile: 64px;
    --page-section-gap: 64px;
    --header-clearance: 72px;
    --header-clearance-mobile: 64px;
    --font-display: "Cormorant Garamond", "Noto Serif TC", serif;
    --font-heading: "Manrope", "Noto Sans TC", sans-serif;
    --font-body: "Noto Sans TC", "Manrope", sans-serif;
}

html {
    scroll-behavior: smooth;
    background: var(--bg-page);
}

html:has(body.content-footer-page),
body.content-footer-page {
    height: auto;
    min-height: 0;
}

body:not(.map-hud-page) {
    background: var(--bg-page);
    color: var(--text-primary);
    font-family: var(--font-body);
    height: auto;
    min-height: 0;
}

body:not(.map-hud-page)::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.26) 0%, rgba(255, 255, 255, 0) 24%),
        radial-gradient(circle at 18% 12%, rgba(255, 248, 238, 0.42), rgba(255, 248, 238, 0) 34%);
    opacity: 0.72;
    z-index: 0;
}

body:not(.map-hud-page),
body:not(.map-hud-page) .landing-container,
body:not(.map-hud-page) main,
body:not(.map-hud-page) #page-content,
body:not(.map-hud-page) #article-viewer-container,
body:not(.map-hud-page) section,
body:not(.map-hud-page) article {
    position: relative;
    z-index: 1;
    background: transparent;
}

body:not(.map-hud-page) h1,
body:not(.map-hud-page) h2,
body:not(.map-hud-page) h3,
body:not(.map-hud-page) h4,
body:not(.map-hud-page) h5,
body:not(.map-hud-page) h6 {
    font-family: var(--font-heading);
    color: var(--ink-deep);
    font-weight: var(--font-heading-weight);
    letter-spacing: var(--tracking-heading);
}

body:not(.map-hud-page) p,
body:not(.map-hud-page) li,
body:not(.map-hud-page) blockquote,
body:not(.map-hud-page) figcaption {
    color: var(--text-secondary);
    line-height: var(--lh-body);
}

.brand-shell {
    width: min(var(--site-max-width), calc(100% - 32px));
    margin: 0 auto;
}

.brand-page {
    padding-top: calc(var(--page-top-offset) + 4px);
    padding-bottom: calc(var(--space-9) + 36px);
}

body.content-footer-page .brand-page,
body.content-footer-page #page-content.brand-page,
body.content-footer-page #article-viewer-container.brand-page,
body.content-footer-page .content-shell.brand-page,
body.content-footer-page .content-page-shell.brand-page {
    padding-bottom: 0 !important;
}

body.content-footer-page [data-site-footer="compact"] {
    width: min(var(--site-max-width), calc(100% - 32px));
    margin: 0 auto 28px;
}

.page-intro {
    display: grid;
    gap: var(--space-5);
    margin-bottom: calc(var(--page-section-gap) - 8px);
}

.page-intro__header {
    display: grid;
    gap: 0;
    max-width: 760px;
}

.meta-label {
    display: none;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--accent-warm);
    font-weight: var(--font-meta-weight);
}

.meta-label::before {
    content: "";
    width: 34px;
    height: 1px;
    background: linear-gradient(90deg, rgba(217, 138, 61, 0), rgba(217, 138, 61, 0.85));
}

.page-title,
.display-title {
    font-family: var(--font-display);
    font-weight: var(--font-title-weight);
    line-height: var(--lh-display);
    letter-spacing: var(--tracking-display);
}

.page-title {
    font-size: clamp(2.2rem, 4vw, 4.5rem);
    margin: 0;
}

.page-lead {
    max-width: 720px;
    font-size: 1.02rem;
    color: var(--text-secondary);
    margin: 0;
}

.frame-panel {
    background: var(--bg-panel);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-panel);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.section-block {
    display: grid;
    gap: var(--space-6);
    margin-top: var(--page-section-gap);
}

.section-heading {
    display: grid;
    gap: var(--space-4);
    max-width: 760px;
}

.section-heading h2 {
    margin: 0;
    font-size: clamp(1.8rem, 2.6vw, 3rem);
}

.section-heading p {
    margin: 0;
}

.cta-link,
.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 22px;
    border-radius: 999px;
    border: 1px solid rgba(217, 138, 61, 0.22);
    color: var(--ink-deep);
    background: rgba(255, 255, 255, 0.66);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.04);
    text-decoration: none;
    font-weight: 600;
    transition:
        transform var(--duration-fast) var(--ease-standard),
        border-color var(--duration-fast) ease,
        background-color var(--duration-fast) ease,
        color var(--duration-fast) ease;
}

.cta-link--accent,
.cta-button--accent,
.cta-button {
    background: rgba(217, 138, 61, 0.12);
    color: var(--accent-warm);
}

.cta-link:hover,
.cta-button:hover {
    transform: translateY(-2px);
    border-color: rgba(217, 138, 61, 0.46);
    background: rgba(217, 138, 61, 0.16);
}

.content-frame {
    padding: clamp(28px, 4vw, 48px);
}

.page-body {
    border-top: 1px solid var(--line-soft);
    padding-top: 24px;
    background: transparent;
}

.page-body--panel {
    padding: clamp(24px, 3.2vw, 34px);
    background: rgba(255, 255, 255, 0.42);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.editorial-layout {
    display: grid;
    gap: var(--space-6);
}

.content-page-shell {
    width: min(var(--site-max-width), calc(100% - 32px));
    margin: 0 auto;
}

.content-page-header {
    display: grid;
    gap: 18px;
    margin-bottom: 28px;
}

.content-page-header--article {
    max-width: 820px;
}

.content-page-panel {
    padding: clamp(26px, 3.4vw, 40px) 0 0;
}

.markdown-body,
.article-content {
    margin: 0 auto;
    color: var(--text-secondary);
}

.markdown-body h1,
.article-content h1 {
    margin-top: 0;
    margin-bottom: var(--space-6);
    padding: 0;
    border: 0;
    font-family: var(--font-display);
    font-size: clamp(2.1rem, 3.6vw, 3.8rem);
    line-height: 1.12;
    letter-spacing: 0.03em;
}

.markdown-body h2,
.article-content h2 {
    margin-top: var(--space-8);
    margin-bottom: var(--space-4);
    font-size: clamp(1.35rem, 2vw, 2rem);
}

.markdown-body p,
.article-content p,
.markdown-body li,
.article-content li {
    font-size: 1rem;
    line-height: 1.95;
}

.markdown-body blockquote,
.article-content blockquote {
    margin: var(--space-6) 0;
    padding: var(--space-4) var(--space-5);
    border-left: 2px solid var(--accent-warm-soft);
    background: rgba(255, 255, 255, 0.46);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.markdown-body img,
.article-content img {
    max-width: 100%;
    height: auto;
    margin: var(--space-6) auto;
    display: block;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
}

.article-date,
.page-kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.84rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.article-date::before,
.page-kicker::before {
    content: "";
    width: 26px;
    height: 1px;
    background: var(--line-strong);
}

.simple-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: var(--space-6);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--duration-fast) ease, transform var(--duration-fast) var(--ease-standard);
}

.article-shell {
    display: grid;
    gap: var(--space-6);
}

.article-reading-surface {
    width: 100%;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.article-reading-surface .article-content,
.article-reading-surface .markdown-body {
    width: 100%;
    max-width: none;
    margin: 0;
}

.simple-back-link:hover {
    color: var(--accent-warm);
    transform: translateX(-2px);
}

body:not(.map-hud-page) #logo-bar {
    top: 22px;
}

body:not(.map-hud-page) #logo-bar.header-hud-ready {
    left: 24px;
}

body:not(.map-hud-page) #logo-container.header-hud-chip,
body:not(.map-hud-page) #horizontal-nav-bar.site-nav-shell #nav-items-container,
body:not(.map-hud-page) #header-actions.site-nav-actions .header-action-chip {
    background: rgba(252, 251, 248, 0.78);
    border: 1px solid rgba(23, 23, 23, 0.08);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

body:not(.map-hud-page) #logo-container.header-hud-chip .logo-title,
body:not(.map-hud-page) #horizontal-nav-bar.site-nav-shell .nav-item,
body:not(.map-hud-page) #header-actions.site-nav-actions .dropdown-header,
body:not(.map-hud-page) #header-actions.site-nav-actions #header-bmac-link {
    color: var(--ink-soft);
}

body:not(.map-hud-page) #horizontal-nav-bar.site-nav-shell .nav-item::after {
    background: linear-gradient(90deg, rgba(217, 138, 61, 0), rgba(217, 138, 61, 0.96), rgba(217, 138, 61, 0));
}

body:not(.map-hud-page) #header-actions.site-nav-actions .dropdown-icon,
body:not(.map-hud-page) #header-actions.site-nav-actions #header-bmac-link .material-symbols-outlined,
body:not(.map-hud-page) #logo-container.header-hud-chip #logo-icon-svg .logo-emblem-north {
    color: var(--accent-warm);
    fill: var(--accent-warm);
}

body:not(.map-hud-page) #header-actions.site-nav-actions .dropdown-content {
    background: rgba(252, 251, 248, 0.98);
    border: 1px solid var(--line-soft);
    box-shadow: var(--shadow-soft);
    border-radius: var(--radius-md);
}

body:not(.map-hud-page) #header-actions.site-nav-actions .lang-btn {
    color: var(--ink-soft);
}

body:not(.map-hud-page) #header-actions.site-nav-actions .lang-btn:hover,
body:not(.map-hud-page) #header-actions.site-nav-actions .lang-btn.active {
    background: var(--accent-warm-pale);
    color: var(--accent-warm);
}

#footer-bar {
    position: fixed;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    min-height: 44px;
    height: auto;
    padding: 0 18px;
    background: rgba(24, 24, 24, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

#footer-bar:hover {
    background: rgba(20, 20, 20, 0.92);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: var(--shadow-panel);
}

#footer-bar .footer-section,
#footer-bar .footer-link,
#footer-bar .footer-text,
#footer-bar .footer-icon {
    color: rgba(245, 241, 234, 0.9);
}

#footer-bar .footer-divider {
    background-color: rgba(255, 255, 255, 0.18);
}

.footer-section,
.footer-link,
.footer-text,
.footer-icon {
    color: var(--text-secondary);
}

.footer-divider {
    background: var(--line-soft);
}

.footer-social-icon {
    filter: none;
    opacity: 0.72;
}

.footer-social-link:hover .footer-social-icon {
    opacity: 1;
}

@media (max-width: 960px) {
    .brand-page {
        padding-top: var(--page-top-offset-mobile);
    }

    #footer-bar {
        left: 16px;
        right: 16px;
        transform: none;
        width: auto;
        border-radius: var(--radius-lg);
        justify-content: center;
        flex-wrap: wrap;
        padding-top: 10px;
        padding-bottom: 10px;
    }
}

@media (max-width: 768px) {
    .brand-page {
        padding-top: calc(var(--page-top-offset-mobile) + 2px);
        padding-bottom: calc(var(--space-8) + 32px);
    }

    .page-intro {
        margin-bottom: 40px;
    }

    .brand-shell {
        width: min(var(--site-max-width), calc(100% - 24px));
    }

    body:not(.map-hud-page) #horizontal-nav-bar.site-nav-shell {
        background: rgba(247, 246, 242, 0.92);
    }

    body:not(.map-hud-page) #horizontal-nav-bar.site-nav-shell .nav-item,
    body:not(.map-hud-page) #horizontal-nav-bar.site-nav-shell #header-bmac-link {
        color: var(--ink-soft);
    }

    body:not(.map-hud-page) #menu-button {
        background: rgba(252, 251, 248, 0.84);
        border: 1px solid var(--line-soft);
        box-shadow: var(--shadow-soft);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
}
