:root {
    color-scheme: light;
    --bg-canvas: #ffefe3;
    --bg-panel: #ffffff;
    --bg-panel-strong: #ffffff;
    --bg-soft: #f6f8fb;
    --bg-hover: #f7f9fc;
    --line-soft: rgba(18, 31, 53, 0.1);
    --line-strong: rgba(18, 31, 53, 0.18);
    --text-primary: #172033;
    --text-secondary: rgba(23, 32, 51, 0.74);
    --text-muted: rgba(23, 32, 51, 0.54);
    --accent: #0a6fe8;
    --shadow-card: 0 8px 22px rgba(30, 42, 64, 0.07);
    --shadow-focus: 0 0 0 4px rgba(88, 156, 255, 0.2);
    --page-gutter: clamp(1rem, 3vw, 2rem);
    --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
        Roboto, "Helvetica Neue", Arial, "PingFang TC", "Hiragino Sans CNS",
        "Noto Sans TC", "Noto Sans CJK TC", "Microsoft JhengHei UI",
        "Microsoft JhengHei", sans-serif;
}

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

html {
    font-size: 16px;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text-primary);
    background: var(--bg-canvas);
    font-family: var(--font-sans);
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

a {
    color: inherit;
}

svg {
    display: block;
}

.site-navbar-inner {
    width: min(760px, calc(100% - (2 * var(--page-gutter))));
    min-width: 0;
    display: flex;
    align-items: center;
    margin: 0 auto;
}

.site-breadcrumb {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-breadcrumb-item,
.site-breadcrumb-current {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 9px;
}

.site-brand {
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 750;
    text-decoration: none;
}

.site-brand:hover {
    color: var(--text-primary);
}

.site-brand:focus-visible,
.document-link:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus);
}

.site-separator {
    color: var(--text-muted);
}

.site-page-title {
    min-width: 0;
    overflow: hidden;
    margin: 0;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.document-shell {
    width: min(760px, calc(100% - (2 * var(--page-gutter))));
    flex: 1 0 auto;
    margin: 0 auto;
    padding: 0 0 16px;
}

.document-panel {
    overflow: hidden;
    border: 1px solid var(--line-soft);
    border-radius: 18px;
    background: var(--bg-panel-strong);
    box-shadow: var(--shadow-card);
}

.document-panel-heading {
    padding: 16px 18px 14px;
    border-bottom: 1px solid var(--line-soft);
}

.document-panel-heading h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.18rem;
    font-weight: 820;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.document-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.document-list li + li {
    border-top: 1px solid var(--line-soft);
}

.document-link {
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    padding: 13px 16px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 160ms ease, color 160ms ease;
}

.document-link:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

.document-link:active {
    background: var(--bg-soft);
}

.document-icon,
.download-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.document-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.download-icon svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.document-name {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 0.94rem;
    font-weight: 720;
}

.site-footer {
    flex: 0 0 auto;
    width: 100%;
    margin-top: auto;
    padding: 8px var(--page-gutter) calc(8px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(18, 31, 53, 0.08);
    background: #f0d8c8;
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.3;
    text-align: center;
}

.footer-row {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.42rem;
    white-space: nowrap;
}

.footer-separator {
    opacity: 0.72;
}

.footer-home-link {
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 0.06em;
    text-underline-offset: 0.18em;
}

@media (max-width: 640px) {
    .site-navbar-inner,
    .document-shell {
        width: min(100% - 20px, 760px);
    }

    .site-navbar-inner {
        justify-content: center;
    }

    .site-brand,
    .site-separator,
    .site-navbar-actions {
        display: none;
    }

    .site-page-title {
        font-size: 1.08rem;
        text-align: center;
    }

    .document-panel-heading {
        padding: 14px 15px 12px;
    }

    .document-link {
        padding: 13px 14px;
    }
}

@media print {
    :root,
    html[data-theme="dark"] {
        color-scheme: light;
        --bg-canvas: #ffffff;
        --bg-panel: #ffffff;
        --bg-panel-strong: #ffffff;
        --bg-soft: #ffffff;
        --bg-hover: #ffffff;
        --line-soft: #d8dde6;
        --text-primary: #111827;
        --text-secondary: #374151;
        --text-muted: #4b5563;
        --accent: #111827;
        --shadow-card: none;
        --shadow-focus: none;
    }

    .site-navbar-actions,
    .site-brand,
    .site-separator,
    .site-footer {
        display: none !important;
    }

    body {
        background: #ffffff;
    }

    .site-navbar-inner,
    .document-shell {
        width: 100%;
    }

    .document-panel {
        border-radius: 0;
        box-shadow: none;
    }
}
