:root {
    --help-ink: #25312b;
    --help-muted: #66716b;
    --help-line: #dfe5e1;
    --help-surface: #ffffff;
    --help-soft: #f4f7f5;
    --help-primary: #8b9a84;
    --help-primary-dark: #667b61;
    --help-accent: #b25d48;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    color: var(--help-ink);
    background: #f7f8f7;
    font-family: var(--font-chinese, 'LXGW WenKai', '霞鹜文楷', '霞骛文楷', serif);
    letter-spacing: 0;
}

.help-header {
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 66px;
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 0 5vw;
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--help-line);
}

.help-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--help-ink);
    text-decoration: none;
    font-weight: 700;
}

.help-brand img { width: 34px; height: 34px; object-fit: contain; }
.help-nav { display: flex; gap: 8px; margin-left: auto; }
.help-nav a {
    color: var(--help-muted);
    text-decoration: none;
    padding: 9px 12px;
    border-radius: 6px;
}
.help-nav a:hover, .help-nav a.active { color: var(--help-primary-dark); background: var(--help-soft); }
.help-auth { min-width: 120px; display: flex; justify-content: flex-end; }

.help-shell { width: min(1080px, calc(100% - 32px)); margin: 0 auto 72px; padding-top: 156px; }
.help-local-nav {
    position: fixed;
    top: 84px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .2rem;
    width: max-content;
    max-width: calc(100% - 20px);
    margin: 0;
    padding: .28rem .35rem;
    overflow-x: auto;
    white-space: nowrap;
    background: rgba(255, 255, 255, .88);
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06), 0 8px 32px rgba(0, 0, 0, .08), inset 0 1px 0 rgba(255, 255, 255, .9);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    scrollbar-width: none;
    z-index: 997;
}
.help-local-nav::-webkit-scrollbar { display: none; }
.help-local-nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: .38rem 1rem;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: .85rem;
    font-weight: 400;
    letter-spacing: .01em;
    line-height: 1.6;
    transition: all .22s ease;
}
.help-local-nav a:hover { color: var(--primary-color); background: rgba(139, 154, 132, .1); }
.help-local-nav a.active { color: #fff; background: var(--primary-color); font-weight: 600; box-shadow: 0 2px 12px rgba(139, 154, 132, .28); }
.help-local-nav .material-icons { display: none; }
#manual, #ai-help { scroll-margin-top: 144px; }
.help-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--help-line);
}
.help-eyebrow { margin: 0 0 8px; color: var(--help-primary); font-size: 14px; font-weight: 700; }
.help-intro h1 { margin: 0; font-size: clamp(30px, 5vw, 48px); font-weight: 700; line-height: 1.14; }
.help-intro p { max-width: 720px; margin: 14px 0 0; color: var(--help-muted); line-height: 1.75; }

.help-button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    border: 1px solid var(--help-primary);
    border-radius: 6px;
    background: var(--help-primary);
    color: #fff;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.help-button:hover { background: var(--help-primary-dark); }
.help-button.secondary { color: var(--help-primary-dark); background: #fff; }
.help-button.secondary:hover { background: var(--help-soft); }
.help-button .material-icons { font-size: 19px; }

.manual-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 28px; }
.manual-item {
    min-height: 180px;
    padding: 24px;
    background: var(--help-surface);
    border: 1px solid var(--help-line);
    border-radius: 8px;
}
.manual-head { display: flex; align-items: center; gap: 12px; }
.manual-number {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    flex: 0 0 32px;
    color: #fff;
    background: var(--help-primary);
    border-radius: 50%;
    font-weight: 700;
}
.manual-item h2 { margin: 0; font-size: 19px; }
.manual-item p { margin: 14px 0 0; color: var(--help-muted); line-height: 1.7; }
.manual-item a { color: var(--help-primary-dark); font-weight: 600; }

.help-section { margin-top: 42px; }
.help-section h2 { margin: 0 0 16px; font-size: 24px; }
.help-section-lead { max-width: 780px; margin: -6px 0 18px; color: var(--help-muted); line-height: 1.75; }
.help-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--help-line); }
.help-table th, .help-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--help-line); }
.help-table th { width: 180px; color: var(--help-primary-dark); background: var(--help-soft); }

.doc-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}
.doc-toc {
    position: sticky;
    top: 118px;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--help-line);
    border-radius: 8px;
}
.doc-toc strong { display: block; margin-bottom: 10px; color: var(--help-primary-dark); }
.doc-toc a {
    display: block;
    padding: 7px 8px;
    border-radius: 6px;
    color: var(--help-muted);
    text-decoration: none;
    line-height: 1.4;
}
.doc-toc a:hover { color: var(--help-primary-dark); background: var(--help-soft); }
.doc-content {
    display: grid;
    gap: 14px;
}
.doc-block {
    padding: 20px 22px;
    background: #fff;
    border: 1px solid var(--help-line);
    border-radius: 8px;
}
.doc-block h3 { margin: 0 0 10px; font-size: 20px; color: var(--help-primary-dark); }
.doc-block p { margin: 0; color: var(--help-muted); line-height: 1.75; }
.doc-block ul { margin: 10px 0 0; padding-left: 1.2rem; color: var(--help-muted); line-height: 1.75; }
.doc-block li + li { margin-top: 5px; }

.help-ai-layout {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(360px, 1.1fr);
    gap: 20px;
    align-items: start;
}
.help-ai-copy, .help-ai-panel {
    background: #fff;
    border: 1px solid var(--help-line);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(37, 49, 43, .055);
}
.help-ai-copy { padding: 26px; border-top: 3px solid rgba(139, 154, 132, .72); }
.help-ai-copy h2, .help-ai-panel h2 { margin: 0; font-size: 23px; color: var(--help-ink); }
.help-ai-copy p { margin: 12px 0 0; color: var(--help-muted); line-height: 1.75; }
.help-ai-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 9px;
    color: var(--help-primary-dark);
    font-size: 13px;
    font-weight: 700;
}
.help-ai-kicker .material-icons { font-size: 17px; }
.help-ai-prompts { display: grid; gap: 10px; margin-top: 22px; }
.help-ai-prompt {
    min-height: 68px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 20px;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border: 1px solid rgba(139, 154, 132, .24);
    border-radius: 6px;
    background: var(--help-soft);
    color: var(--help-ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, transform .2s ease, box-shadow .2s ease;
}
.help-ai-prompt:hover { border-color: rgba(139, 154, 132, .5); background: #fff; transform: translateY(-1px); box-shadow: 0 5px 15px rgba(37, 49, 43, .06); }
.help-ai-prompt:focus-visible { outline: 3px solid rgba(139, 154, 132, .18); outline-offset: 2px; }
.help-ai-prompt .prompt-icon {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--help-primary-dark);
    background: rgba(139, 154, 132, .14);
    font-size: 17px;
}
.help-ai-prompt .prompt-copy { display: grid; gap: 3px; min-width: 0; }
.help-ai-prompt strong { color: var(--help-ink); font-size: 15px; font-weight: 600; }
.help-ai-prompt small { color: var(--help-muted); font-size: 12px; line-height: 1.45; }
.help-ai-prompt .prompt-arrow { color: var(--help-primary); font-size: 18px; transition: transform .2s ease; }
.help-ai-prompt:hover .prompt-arrow { transform: translateX(2px); }
.help-ai-panel {
    height: clamp(520px, 68vh, 680px);
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.help-ai-panel-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid var(--help-line);
}
.help-ai-panel-title { display: flex; align-items: center; gap: 11px; min-width: 0; }
.help-ai-panel-title h2 { font-size: 20px; }
.help-ai-panel-title p { margin: 2px 0 0; color: var(--help-muted); font-size: 12px; }
.help-ai-mark {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    flex: 0 0 36px;
    border-radius: 6px;
    background: var(--help-primary);
    color: #fff;
    font-size: 17px;
}
.help-ai-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border: 1px solid rgba(139, 154, 132, .2);
    border-radius: 999px;
    color: var(--help-primary-dark);
    background: var(--help-soft);
    font-size: 12px;
    white-space: nowrap;
}
.help-ai-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--help-primary); }
.help-ai-messages {
    flex: 1;
    min-height: 0;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #fbfaf6;
}
.help-ai-empty {
    margin: auto;
    max-width: 420px;
    padding: 28px 20px;
    text-align: center;
    color: var(--help-muted);
    line-height: 1.7;
}
.help-ai-empty-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    margin: 0 auto 15px;
    border: 1px solid rgba(139, 154, 132, .28);
    border-radius: 8px;
    background: #fff;
    color: var(--help-primary-dark);
    box-shadow: 0 8px 22px rgba(37, 49, 43, .07);
    font-size: 24px;
}
.help-ai-empty h3 { margin: 0; color: var(--help-ink); font-size: 19px; font-weight: 600; }
.help-ai-empty p { margin: 9px auto 0; max-width: 360px; font-size: 14px; }
.help-ai-capabilities { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 18px; margin-top: 20px; }
.help-ai-capabilities > span { display: inline-flex; align-items: center; gap: 5px; color: var(--help-primary-dark); font-size: 12px; font-weight: 600; }
.help-ai-capabilities .material-icons { font-size: 15px; }
.help-ai-message {
    max-width: 88%;
    padding: 12px 14px;
    border-radius: 8px;
    line-height: 1.7;
    font-size: 15px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.help-ai-message.user {
    align-self: flex-end;
    background: var(--help-primary);
    color: #fff;
}
.help-ai-message.assistant {
    align-self: flex-start;
    background: #fff;
    color: var(--help-ink);
    border: 1px solid rgba(139, 154, 132, .2);
}
.help-ai-message.assistant h1,
.help-ai-message.assistant h2,
.help-ai-message.assistant h3 {
    margin: .15em 0 .55em;
    color: var(--help-primary-dark);
    font-size: 1em;
}
.help-ai-message.assistant p { margin: 0 0 .65em; }
.help-ai-message.assistant p:last-child { margin-bottom: 0; }
.help-ai-message.assistant ul,
.help-ai-message.assistant ol { margin: .35em 0 .65em; padding-left: 1.25rem; }
.help-ai-input-row {
    display: flex;
    gap: 10px;
    align-items: end;
    padding: 14px 16px 16px;
    border-top: 1px solid var(--help-line);
    background: #fff;
}
.help-ai-input-row textarea {
    flex: 1;
    min-height: 44px;
    max-height: 120px;
    padding: 10px 12px;
    border: 1px solid #cfd8d2;
    border-radius: 6px;
    background: #f8faf8;
    resize: vertical;
    font: inherit;
    line-height: 1.55;
}
.help-ai-input-row textarea:focus { outline: 3px solid rgba(139,154,132,.16); border-color: var(--help-primary); }
.help-ai-send {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: var(--help-primary);
    cursor: pointer;
}
.help-ai-send:disabled { opacity: .55; cursor: not-allowed; }
.help-ai-send .material-icons { font-size: 20px; }

.feedback-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 20px; margin-top: 28px; }
.feedback-panel { padding: 24px; background: #fff; border: 1px solid var(--help-line); border-radius: 8px; }
.feedback-panel h2 { margin: 0 0 8px; font-size: 21px; }
.feedback-panel > p { margin: 0 0 22px; color: var(--help-muted); line-height: 1.6; }
.form-row { margin-bottom: 18px; }
.form-row label { display: block; margin-bottom: 7px; font-size: 14px; font-weight: 650; }
.form-row textarea, .form-row select, .form-row input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #cfd8d2;
    border-radius: 6px;
    background: #fff;
    color: var(--help-ink);
    font: inherit;
}
.form-row textarea { min-height: 150px; resize: vertical; line-height: 1.6; }
.form-row textarea:focus, .form-row select:focus, .form-row input:focus { outline: 3px solid rgba(139,154,132,.16); border-color: var(--help-primary); }
.form-hint { margin-top: 6px; color: var(--help-muted); font-size: 13px; }
.form-message { display: none; margin-bottom: 16px; padding: 11px 12px; border-radius: 6px; font-size: 14px; }
.form-message.show { display: block; }
.form-message.success { color: #285a39; background: #edf7f0; border: 1px solid #bfddc7; }
.form-message.error { color: #8b3529; background: #fff1ef; border: 1px solid #efc5bf; }

.feedback-list { display: grid; gap: 10px; }
.feedback-entry { padding: 15px; border: 1px solid var(--help-line); border-radius: 7px; }
.feedback-entry-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.feedback-entry-title { font-weight: 650; }
.feedback-entry p { margin: 6px 0 0; color: var(--help-muted); line-height: 1.55; overflow-wrap: anywhere; }
.feedback-entry small { color: #7b847f; }
.status-badge { display: inline-flex; padding: 3px 8px; border-radius: 999px; font-size: 12px; white-space: nowrap; }
.status-pending { color: #79531b; background: #fff5dc; }
.status-in_review { color: #34546f; background: #eaf3fa; }
.status-resolved { color: #285a39; background: #eaf6ed; }
.status-rejected { color: #7a3a34; background: #f8ecea; }
.empty-state { padding: 34px 16px; text-align: center; color: var(--help-muted); border: 1px dashed #ccd5cf; border-radius: 7px; }

@media (max-width: 760px) {
    .header {
        min-height: 58px;
        padding: 10px 14px;
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
        gap: 6px;
    }
    .header .logo { min-width: 0; gap: 5px; font-size: 1.05rem; }
    .header .company-logo { width: 118px; height: 30px; object-fit: contain; }
    .header .help-product-name { display: none; }
    .header .logo-divider { margin: 0 2px; }
    .header .logo-seal { width: 28px; height: 28px; font-size: .95rem; }
    .header .auth-buttons { margin-left: auto; gap: 4px; }
    .header .auth-buttons .user-name, .header .auth-buttons .user-menu-trigger .arrow { display: none; }
    .header .auth-buttons .user-menu-trigger { padding: 3px; }
    .header .nav-links {
        display: none !important;
    }
    .header .nav-links li { min-width: 0; text-align: center; }
    .header .nav-links a { display: block; padding: 4px 1px; font-size: 12px; white-space: nowrap; }
    .help-shell { padding-top: 132px; }
    .help-local-nav { top: 68px; gap: 2px; }
    .help-local-nav a { flex: 0 0 auto; justify-content: center; min-width: 0; padding: .38rem .72rem; font-size: .8rem; white-space: nowrap; }
    #manual, #ai-help { scroll-margin-top: 124px; }
    .help-intro { grid-template-columns: 1fr; align-items: start; }
    .manual-grid, .feedback-layout, .doc-layout, .help-ai-layout { grid-template-columns: 1fr; }
    .doc-toc { position: static; }
    .help-ai-panel { height: min(620px, calc(100vh - 190px)); min-height: 440px; }
    .help-ai-panel-head { align-items: flex-start; flex-direction: column; }
    .help-table, .help-table tbody, .help-table tr, .help-table th, .help-table td { display: block; width: 100%; }
    .help-table th { border-bottom: 0; padding-bottom: 5px; }
    .help-table td { padding-top: 5px; }
}
