:root {
    --help-bg: #f2f4f7;
    --help-panel: #fff;
    --help-text: #252932;
    --help-muted: #646b77;
    --help-border: #dfe3e9;
    --help-accent: #a87b00;
    --help-gold: #f1c40f;
    --help-danger: #a3231d;
}

html { scroll-behavior: smooth; }

body.help-legal-page {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    color: var(--help-text);
    background: var(--help-bg);
    font-family: "Microsoft JhengHei", sans-serif;
}

.help-public-header { min-height: 60px; }
.help-public-header .user-dropdown { width: 230px; }
.help-public-header .dropdown-top { border-bottom: 0; }
.help-logout-button {
    padding: 0;
    border: 0;
    background: transparent;
    font: inherit;
    text-align: left;
}

.help-page-shell {
    width: min(1160px, calc(100% - 40px));
    margin: 0 auto;
    padding: 26px 0 54px;
}

.help-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 18px;
    color: var(--help-muted);
    font-size: 13px;
}

.help-breadcrumb a { color: #375f85; text-decoration: none; }
.help-breadcrumb a:hover { text-decoration: underline; }

.help-hero {
    padding: 34px clamp(22px, 5vw, 54px);
    border-bottom: 4px solid var(--help-gold);
    color: #fff;
    background: #252932;
}

.help-hero h1 {
    margin: 0;
    font-size: clamp(28px, 4vw, 42px);
    letter-spacing: 0;
}

.help-hero p {
    max-width: 760px;
    margin: 12px 0 0;
    color: #d5d8df;
    font-size: 16px;
    line-height: 1.75;
}

.help-search {
    max-width: 720px;
    margin-top: 22px;
}

.help-search label { display: block; margin-bottom: 7px; font-weight: 700; }
.help-search input {
    width: 100%;
    box-sizing: border-box;
    padding: 13px 15px;
    border: 1px solid #707681;
    border-radius: 6px;
    color: #20242b;
    background: #fff;
    font: inherit;
}

.help-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 28px;
    align-items: start;
}

.help-article {
    min-width: 0;
    padding: clamp(24px, 4vw, 42px);
    border: 1px solid var(--help-border);
    border-radius: 7px;
    background: var(--help-panel);
    box-shadow: 0 4px 16px rgba(20, 28, 40, 0.05);
}

.help-article { max-width: 880px; }
.help-section { min-width: 0; }
.help-article h1 { margin: 0 0 10px; font-size: 32px; }
.help-article h2 { margin: 34px 0 12px; padding-top: 4px; font-size: 22px; }
.help-article h3 { margin: 24px 0 9px; font-size: 17px; }
.help-article p,
.help-article li { line-height: 1.85; }
.help-article p { margin: 10px 0; }
.help-article ul,
.help-article ol { padding-left: 24px; }
.help-article a { color: #285e8e; }

.help-updated { color: var(--help-muted); font-size: 13px; }

.help-toc {
    position: sticky;
    top: 80px;
    padding: 18px;
    border: 1px solid var(--help-border);
    border-radius: 7px;
    background: #fff;
}

.help-toc h2 { margin: 0 0 10px; font-size: 16px; }
.help-toc ol { display: grid; gap: 7px; margin: 0; padding-left: 20px; }
.help-toc a { color: #3b5268; font-size: 13px; line-height: 1.45; text-decoration: none; }
.help-toc a:hover { color: #8a6500; text-decoration: underline; }

.help-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.help-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 18px;
    border: 1px solid var(--help-border);
    border-radius: 7px;
    color: var(--help-text);
    background: #fff;
    text-decoration: none;
    transition: border-color .16s ease, box-shadow .16s ease;
}

.help-card:hover,
.help-card:focus-visible {
    border-color: #b9901f;
    box-shadow: 0 5px 15px rgba(28, 35, 45, .09);
}

.help-card h2,
.help-card h3 { margin: 0; font-size: 17px; }
.help-card p { margin: 0; color: var(--help-muted); font-size: 14px; line-height: 1.65; }
.help-card-category { color: #806000; font-size: 12px; font-weight: 700; }

.help-notice,
.help-warning {
    margin: 20px 0;
    padding: 15px 17px;
    border-left: 4px solid #3b7ca6;
    border-radius: 4px;
    background: #eef7fc;
    line-height: 1.75;
}

.help-warning {
    border-left-color: #c13930;
    color: #5a1c18;
    background: #fff1f0;
}

.help-status {
    min-height: 24px;
    margin: 15px 0 0;
    color: var(--help-muted);
}

.help-related {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid var(--help-border);
}

.help-related h2 { margin-top: 0; }
.help-related-links { display: flex; flex-wrap: wrap; gap: 10px; }
.help-related-links a {
    padding: 8px 11px;
    border: 1px solid #ccd3db;
    border-radius: 5px;
    color: #2d5679;
    background: #f8fafc;
    text-decoration: none;
}

.faq-list { display: grid; gap: 10px; margin-top: 20px; }
.faq-list details {
    border: 1px solid var(--help-border);
    border-radius: 6px;
    background: #fff;
}
.faq-list summary {
    padding: 15px 17px;
    cursor: pointer;
    font-weight: 700;
}
.faq-answer { padding: 0 17px 16px; color: #424852; line-height: 1.8; }

.help-two-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.help-empty-search { padding: 30px; text-align: center; color: var(--help-muted); }

@media (max-width: 900px) {
    .help-layout { grid-template-columns: 1fr; }
    .help-toc { position: static; order: -1; }
    .help-article { max-width: none; }
    .help-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
    .help-page-shell { width: min(100% - 28px, 1160px); padding-top: 18px; }
    .help-hero { padding: 28px 20px; }
    .help-card-grid,
    .help-two-column { grid-template-columns: 1fr; }
    .help-article { padding: 22px 18px; }
    .help-article h1 { font-size: 27px; }
}
