:root {
  --ink: #1f1f1f;
  --muted: #8a8f99;
  --soft-text: #576b95;
  --paper: #f5f6f7;
  --card: #ffffff;
  --line: #e5e6e8;
  --green: #07c160;
  --green-dark: #06ad56;
  --green-soft: #e9f8ef;
  --danger: #fa5151;
  --shadow: 0 6px 24px rgba(0, 0, 0, .06);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--soft-text); }

.topbar { height: 64px; background: #fff; border-bottom: 1px solid #ececec; }
.topbar-inner { width: min(1140px, calc(100% - 40px)); height: 100%; margin: 0 auto; display: flex; align-items: center; }
.brand { display: flex; align-items: center; gap: 10px; color: #2b2b2b; text-decoration: none; flex: 0 0 auto; }
.brand strong { font-size: 20px; font-weight: 500; letter-spacing: -.5px; }
.brand-mark { width: 30px; height: 30px; display: block; object-fit: contain; }
.primary-nav { height: 100%; margin-left: 48px; display: flex; gap: 38px; align-items: stretch; }
.primary-nav a { position: relative; display: flex; align-items: center; color: #2b2b2b; text-decoration: none; font-size: 16px; }
.primary-nav a:hover, .primary-nav a.active { color: var(--green-dark); }
.primary-nav a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--green); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.top-actions a { color: #2b2b2b; text-decoration: none; }
.top-actions a:hover { color: var(--green-dark); }
.nav-button { padding: 8px 0; border: 0; color: #2b2b2b; background: transparent; cursor: pointer; }
.nav-button:hover { color: var(--green-dark); }
.user-chip { max-width: 180px; padding: 4px 8px 4px 4px; display: inline-flex; align-items: center; gap: 8px; overflow: hidden; border: 1px solid #e3e7e4; border-radius: 18px; color: #60646b; background: #fff; cursor: pointer; }
.user-chip:hover { color: var(--green-dark); border-color: #bfe8cf; background: #f8fcfa; }
.user-chip span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-avatar, .profile-avatar-preview { display: inline-grid; place-items: center; overflow: hidden; color: #fff; background: var(--green); border-radius: 50%; font-weight: 650; }
.user-avatar { width: 28px; height: 28px; flex: 0 0 auto; font-size: 12px; }
.user-avatar img, .profile-avatar-preview img { width: 100%; height: 100%; display: block; object-fit: cover; }

.hero { background: #fff; border-bottom: 1px solid var(--line); }
.hero-inner { width: min(1140px, calc(100% - 40px)); min-height: 176px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 56px; }
.eyebrow, .kicker { color: var(--green-dark); font-size: 11px; font-weight: 600; letter-spacing: .12em; }
.hero h1 { margin: 5px 0 3px; font-size: 30px; line-height: 1.35; font-weight: 500; letter-spacing: -.5px; }
.hero p { margin: 0; color: #767b84; font-size: 15px; }
.search-box { width: 430px; height: 44px; padding-left: 14px; display: flex; align-items: center; border: 1px solid #d9dadd; background: #fff; }
.search-icon { width: 15px; height: 15px; border: 1.5px solid #a5a8ad; border-radius: 50%; position: relative; flex: 0 0 auto; }
.search-icon::after { content: ""; position: absolute; width: 6px; height: 1.5px; right: -5px; bottom: -2px; background: #a5a8ad; transform: rotate(45deg); }
.search-box input { flex: 1; min-width: 0; height: 100%; padding: 0 13px; border: 0; outline: 0; color: var(--ink); background: transparent; }
.search-box button { align-self: stretch; width: 74px; border: 0; color: #fff; background: var(--green); cursor: pointer; }
.search-box button:hover { background: var(--green-dark); }

.workspace { width: min(1140px, calc(100% - 40px)); margin: 0 auto; padding: 24px 0 72px; display: grid; grid-template-columns: minmax(0, 820px) 300px; gap: 20px; align-items: start; }
.community-panel { min-width: 0; }
.section-heading { height: 58px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; background: #fff; border: 1px solid var(--line); border-bottom: 0; }
.feed-tabs { height: 100%; display: flex; gap: 30px; }
.feed-tabs button { position: relative; padding: 0; border: 0; color: #60646b; background: transparent; cursor: pointer; font-size: 15px; }
.feed-tabs button.active { color: var(--ink); font-weight: 600; }
.feed-tabs button.active::after { content: ""; position: absolute; left: 2px; right: 2px; bottom: 0; height: 3px; background: var(--green); }
.button { min-height: 36px; padding: 8px 16px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 2px; cursor: pointer; font-weight: 500; text-decoration: none; transition: background .15s, border-color .15s, color .15s; white-space: nowrap; }
.button-primary { color: #fff; background: var(--green); border-color: var(--green); }
.button-primary:hover { background: var(--green-dark); border-color: var(--green-dark); }
.button-ghost { color: #555; background: #fff; border-color: #d9dadd; }
.button-ghost:hover { color: var(--green-dark); border-color: var(--green); }
.button-danger { color: #c84040; background: #fff; border-color: #f0b8b8; }
.button-wide { width: 100%; min-height: 42px; }

.question-list, .review-list, .source-list { background: #fff; border: 1px solid var(--line); }
.question-card { position: relative; padding: 22px 20px 20px 68px; display: block; border-bottom: 1px solid #eeeeef; background: #fff; cursor: pointer; transition: background .15s; }
.question-card:last-child { border-bottom: 0; }
.question-card:hover { background: #fafcfb; }
.question-mark { position: absolute; left: 20px; top: 24px; width: 32px; height: 32px; display: grid; place-items: center; color: var(--green-dark); background: var(--green-soft); border-radius: 3px; font-size: 15px; font-weight: 600; }
.question-main { min-width: 0; }
.question-card h3 { margin: 5px 0 7px; color: #252525; font-size: 17px; line-height: 1.5; font-weight: 500; }
.question-card p { margin: 0 0 10px; color: #777c85; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta, .card-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; color: var(--muted); font-size: 12px; }
.card-footer { justify-content: space-between; margin-top: 13px; }
.tag { display: inline-block; margin: 0 5px 0 0; padding: 2px 7px; color: #637082; background: #f1f3f5; border-radius: 2px; font-size: 11px; }
.official-badge, .status-badge, .featured-badge, .pin-badge { display: inline-flex; align-items: center; min-height: 20px; padding: 1px 6px; border-radius: 2px; font-size: 11px; }
.official-badge { color: var(--green-dark); background: var(--green-soft); }
.featured-badge { color: #9a6512; background: #fff1d5; }
.pin-badge { color: #516998; background: #edf2ff; }
.status-pending { color: #b26a00; background: #fff4d8; }
.status-published { color: #2b7a50; background: #edf7f1; }
.status-rejected, .status-deleted { color: #bd4545; background: #fff0f0; }

.side-column { position: sticky; top: 20px; display: grid; gap: 16px; }
.ai-panel, .side-card { padding: 20px; background: #fff; border: 1px solid var(--line); }
.ai-panel { padding: 0 0 16px; overflow: hidden; border-top: 3px solid var(--green); box-shadow: 0 8px 24px rgba(20, 85, 52, .08); }
.side-title { display: flex; align-items: center; gap: 11px; padding: 17px 18px 15px; background: linear-gradient(135deg, #f0fbf5, #fff); border-bottom: 1px solid #e6f2eb; }
.side-title h2 { margin: 0; font-size: 17px; line-height: 1.4; font-weight: 500; }
.side-title small { color: var(--muted); }
.service-identity { min-width: 0; }
.service-identity small { display: flex; align-items: center; gap: 5px; margin-top: 2px; white-space: nowrap; font-size: 11px; }
.ai-resize-button { width: 32px; height: 32px; margin-left: auto; padding: 0; display: grid; place-items: center; flex: 0 0 auto; color: #63736a; background: rgba(255, 255, 255, .72); border: 1px solid #dbe9e1; border-radius: 4px; cursor: pointer; }
.ai-resize-button:hover { color: var(--green-dark); border-color: #9eddbb; background: #fff; }
.ai-resize-button:focus-visible { outline: 2px solid rgba(7, 193, 96, .3); outline-offset: 2px; }
.ai-resize-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ai-collapse-icon { display: none; }
.online-dot { width: 7px; height: 7px; display: inline-block; flex: 0 0 auto; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(7, 193, 96, .12); }
.ai-orbit { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; color: #fff; background: var(--green); border-radius: 4px; }
.ai-orbit span { font-weight: 650; }
.service-intro { margin: 14px 18px 10px; color: #667078; line-height: 1.7; font-size: 12px; }
.ai-suggestions { display: grid; gap: 6px; margin: 0 18px 14px; }
.ai-suggestions button { padding: 7px 10px; border: 1px solid #e2e9e5; border-radius: 2px; color: #53615a; background: #f8faf9; cursor: pointer; text-align: left; font-size: 12px; }
.ai-suggestions button::before { content: "›"; margin-right: 6px; color: var(--green-dark); font-weight: 700; }
.ai-suggestions button:hover { color: var(--green-dark); border-color: #9eddbb; background: #f3fbf6; }
.ai-chat { min-height: 132px; max-height: 340px; margin: 0 18px; padding: 12px; display: grid; align-content: start; gap: 8px; overflow-y: auto; background: #f6f8f7; border: 1px solid #e8ebe9; }
.ai-empty { padding: 10px 2px; color: #7c8380; font-size: 12px; }
.ai-empty::before { content: "客服"; width: 30px; height: 30px; margin-bottom: 9px; display: grid; place-items: center; color: #fff; background: var(--green); border-radius: 50%; font-size: 10px; }
.ai-empty strong, .ai-empty span { display: block; }
.ai-empty strong { margin-bottom: 4px; color: #3b413e; font-weight: 500; }
.chat-message { padding: 8px 10px; border-radius: 3px; line-height: 1.6; white-space: pre-wrap; font-size: 12px; }
.chat-message.user { margin-left: 24px; background: #dff7e9; }
.chat-message.assistant { margin-right: 10px; background: #f3f4f5; }
.ai-sources { display: grid; gap: 4px; font-size: 11px; }
.ai-sources a { color: var(--soft-text); text-decoration: none; }
.ai-input { min-height: 78px; margin: 10px 18px 0; display: flex; align-items: stretch; border: 1px solid #cfd6d2; background: #fff; }
.ai-input textarea { flex: 1; min-width: 0; padding: 8px 9px; resize: none; border: 0; outline: 0; }
.ai-input button { width: 54px; border: 0; color: #fff; background: var(--green); cursor: pointer; font-size: 12px; }
.ai-input button:hover { background: var(--green-dark); }
.ai-notice { display: block; margin: 8px 18px 0; color: #969c99; line-height: 1.5; font-size: 11px; }
.ai-panel-backdrop { position: fixed; z-index: 890; inset: 0; background: rgba(20, 30, 24, .48); backdrop-filter: blur(2px); }
body.ai-panel-open { overflow: hidden; }
.ai-panel.is-expanded { position: fixed; z-index: 900; inset: 24px; width: min(860px, calc(100vw - 48px)); height: min(780px, calc(100dvh - 48px)); margin: auto; padding-bottom: 16px; display: flex; flex-direction: column; border-radius: 6px; box-shadow: 0 24px 80px rgba(10, 35, 21, .3); }
.ai-panel.is-expanded .ai-expand-icon { display: none; }
.ai-panel.is-expanded .ai-collapse-icon { display: block; }
.ai-panel.is-expanded .side-title, .ai-panel.is-expanded .service-intro, .ai-panel.is-expanded .ai-suggestions, .ai-panel.is-expanded .ai-input, .ai-panel.is-expanded .ai-notice { flex: 0 0 auto; }
.ai-panel.is-expanded .ai-chat { min-height: 240px; max-height: none; flex: 1 1 auto; }
.ai-panel.is-expanded .chat-message { font-size: 14px; }
.side-card h3 { margin: 0 0 14px; font-size: 16px; font-weight: 500; }
.side-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.side-card-heading h3 { margin-bottom: 14px; }
.side-card-heading button { margin: 0 0 14px; padding: 0; border: 0; color: var(--green-dark); background: transparent; cursor: pointer; font-size: 12px; }
.featured-side-card { padding-bottom: 10px; }
.featured-side-list { margin: 0; padding: 0; list-style: none; }
.featured-side-list li { border-top: 1px solid #edf0ee; }
.featured-side-list button { width: 100%; min-width: 0; padding: 11px 0; display: grid; grid-template-columns: 22px minmax(0, 1fr); column-gap: 8px; border: 0; color: inherit; background: transparent; cursor: pointer; text-align: left; }
.featured-side-list button:hover strong { color: var(--green-dark); }
.featured-side-list button > span { grid-row: 1 / span 2; width: 20px; height: 20px; display: grid; place-items: center; color: #9a6512; background: #fff2da; border-radius: 2px; font-size: 11px; font-weight: 650; }
.featured-side-list strong { overflow: hidden; color: #414743; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 500; }
.featured-side-list small { margin-top: 2px; color: #9aa19d; font-size: 10px; }
.side-loading, .side-empty { padding: 15px 0; color: var(--muted); font-size: 12px; text-align: center; }
.hot-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.hot-tags span { padding: 4px 9px; color: #5f6976; background: #f4f5f6; border-radius: 2px; font-size: 12px; }

.compose-card, .detail-card, .answer-card, .comments-card { margin-bottom: 16px; padding: 24px; background: #fff; border: 1px solid var(--line); }
.compose-header { margin-bottom: 18px; display: flex; justify-content: space-between; }
.compose-header strong, .compose-header small { display: block; }
.compose-header small { margin-top: 3px; color: var(--muted); }
.question-compose { display: grid; gap: 20px; }
.question-compose-heading { padding: 6px 2px 2px; }
.question-compose-heading > div { margin-top: 24px; display: flex; align-items: center; gap: 13px; }
.question-compose-heading h1 { margin: 0; font-size: 28px; font-weight: 520; }
.question-compose-heading p { margin: 8px 0 0 49px; color: #8a918d; }
.question-compose-mark { width: 36px; height: 36px; display: grid; place-items: center; color: #fff; background: var(--green); border-radius: 50%; font-size: 20px; font-weight: 600; }
.compose-back { padding: 0; color: #7e8983; background: transparent; border: 0; cursor: pointer; }
.compose-back:hover { color: var(--green-dark); }
.question-fields-card, .question-editor-card { background: #fff; border: 1px solid #e7e9e8; box-shadow: 0 3px 14px rgba(20, 38, 28, .025); }
.question-field-row { min-height: 92px; margin: 0; padding: 0 30px; display: grid; grid-template-columns: 170px minmax(0, 1fr); align-items: center; gap: 24px; border-bottom: 1px solid #edf0ee; }
.question-field-row:last-child { border-bottom: 0; }
.question-field-row > span { color: #303a34; font-size: 15px; }
.question-field-row em { margin-left: 3px; color: #e34b4b; font-style: normal; }
.question-field-row small { margin-left: 6px; color: #9aa39e; font-size: 11px; font-weight: 400; }
.question-field-row input { height: 52px; padding: 0; border: 0; border-bottom: 1px solid #e3e7e4; border-radius: 0; font-size: 15px; }
.question-field-row input:focus { border-bottom-color: var(--green); box-shadow: none; }
.question-editor-card { overflow: hidden; }
.markdown-toolbar { height: 58px; padding: 0 25px; display: flex; align-items: center; gap: 7px; border-bottom: 1px solid #edf0ee; }
.markdown-toolbar button { min-width: 34px; height: 34px; padding: 0 8px; color: #3e4a43; background: transparent; border: 1px solid transparent; border-radius: 4px; cursor: pointer; }
.markdown-toolbar button:hover { color: var(--green-dark); background: #f2faf5; border-color: #d9eee2; }
.markdown-toolbar .markdown-preview-toggle { margin-left: auto; min-width: 56px; color: #69756e; font-size: 12px; }
.question-editor-card > textarea { width: 100%; min-height: 300px; padding: 28px 32px; display: block; resize: vertical; border: 0; border-radius: 0; box-shadow: none; font-size: 14px; }
.question-editor-card > textarea:focus { box-shadow: inset 0 0 0 1px rgba(7, 193, 96, .24); }
.markdown-preview { min-height: 300px; padding: 28px 32px; }
.editor-help { padding: 0 32px 20px; display: block; color: #9aa19d; }
.attachment-drafts { padding: 0 32px 20px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.attachment-draft { min-width: 0; padding: 10px; display: flex; align-items: center; gap: 9px; color: #606a64; background: #f7f9f8; border: 1px solid #e2e7e4; border-radius: 5px; font-size: 12px; }
.attachment-draft > span:first-child { width: 29px; height: 29px; display: grid; place-items: center; flex: 0 0 auto; color: #087a43; background: #e1f5e9; border-radius: 4px; }
.attachment-draft > span:nth-child(2) { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-draft button { padding: 2px 5px; color: #949c97; background: transparent; border: 0; cursor: pointer; }
.attachment-draft button:hover { color: var(--danger); }
.question-tags-card .question-field-row { min-height: 82px; }
.question-compose-actions { padding: 5px 0 22px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.question-compose-actions > span { color: #8f9792; font-size: 12px; }
.question-compose-actions .button { min-width: 132px; min-height: 44px; }
body.question-compose-open .hero, body.question-compose-open .community-panel > .section-heading, body.question-compose-open .question-list, body.question-compose-open .back-button { display: none !important; }
body.question-compose-open .workspace { grid-template-columns: minmax(0, 1fr); width: min(1240px, calc(100% - 40px)); }
body.question-compose-open .side-column { display: none; }
.question-facts { margin: 18px 0; padding: 13px 16px; display: flex; flex-wrap: wrap; gap: 12px 24px; color: #66716b; background: #f7faf8; border-left: 3px solid var(--green); }
.question-facts span { overflow-wrap: anywhere; }
.question-facts strong { color: #37423c; }
.markdown-body { color: #39423d; line-height: 1.85; overflow-wrap: anywhere; }
.markdown-body > :first-child { margin-top: 0; }
.markdown-body > :last-child { margin-bottom: 0; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { margin: 1.2em 0 .5em; line-height: 1.4; }
.markdown-body p { margin: .7em 0; }
.markdown-body pre { max-width: 100%; padding: 14px; overflow-x: auto; color: #dce9e1; background: #1d2922; border-radius: 5px; }
.markdown-body code { padding: 2px 5px; color: #12623a; background: #edf6f0; border-radius: 3px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.markdown-body pre code { padding: 0; color: inherit; background: transparent; }
.markdown-body a { color: #087c44; }
.question-attachments { margin-top: 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.question-attachment { margin: 0; overflow: hidden; background: #f5f7f6; border: 1px solid #e1e6e3; border-radius: 5px; }
.question-attachment img, .question-attachment video { width: 100%; max-height: 420px; display: block; object-fit: contain; background: #111; }
.question-attachment figcaption { padding: 8px 10px; overflow: hidden; color: #7a837e; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.icon-button, .modal-close { padding: 0; border: 0; color: #777; background: transparent; cursor: pointer; font-size: 24px; }
label { margin-bottom: 15px; display: grid; gap: 7px; color: #4d5158; font-weight: 500; font-size: 13px; }
input, textarea, select { padding: 10px 11px; color: var(--ink); background: #fff; border: 1px solid #d9dadd; border-radius: 2px; outline: 0; }
input:focus, textarea:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 2px rgba(7, 193, 96, .08); }
textarea { resize: vertical; line-height: 1.6; }
.form-actions { display: flex; justify-content: flex-end; }
.detail-card h1 { margin: 12px 0; font-size: 28px; line-height: 1.4; font-weight: 500; }
.featured-reason { margin: 15px 0; padding: 10px 13px; color: #816023; background: #fff9ec; border-left: 3px solid #efb44b; font-size: 13px; }
.detail-body, .answer-body, .comment-body { white-space: pre-wrap; line-height: 1.85; overflow-wrap: anywhere; }
.answer-card.official { border-left: 3px solid var(--green); }
.answer-head { margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.comment { margin-top: 13px; padding-top: 13px; border-top: 1px solid #eee; }
.inline-form { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.inline-form textarea { flex: 1; }
.inline-form .inline-attachment-bar { display: flex; gap: 6px; align-items: center; }
.inline-form .inline-attachment-bar .button { min-height: 34px; padding: 6px 10px; font-size: 12px; }
.inline-form .inline-attachment-drafts { flex: 1 1 100%; padding: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.compose-card .inline-attachment-bar { margin: -6px 0 12px; display: flex; gap: 8px; }
.compose-card .inline-attachment-drafts { padding: 0 0 14px; }
.back-button { margin-top: 16px; }
.empty, .loading { padding: 48px 20px; color: var(--muted); background: #fff; text-align: center; }

.modal { position: fixed; z-index: 1000; inset: 0; padding: 16px; display: grid; place-items: center; overflow-y: auto; background: rgba(0, 0, 0, .45); }
.modal-card { position: relative; width: min(480px, calc(100vw - 32px)); padding: 34px 42px 38px; background: #fff; border-radius: 3px; box-shadow: 0 16px 60px rgba(0, 0, 0, .24); }
.modal-card h2 { margin: 6px 0; font-size: 24px; font-weight: 500; }
.modal-card > p { margin-bottom: 22px; color: var(--muted); }
.modal-close { position: absolute; right: 19px; top: 12px; }
.modal-open { overflow: hidden; }
.profile-preview { margin: 18px 0 20px; display: flex; align-items: center; gap: 14px; }
.profile-avatar-preview { width: 58px; height: 58px; flex: 0 0 auto; font-size: 20px; }
.profile-preview strong, .profile-preview small { display: block; }
.profile-preview strong { color: #2b2b2b; font-size: 16px; font-weight: 500; }
.profile-preview small { color: var(--muted); font-size: 12px; }
#loginCaptchaWrap .yidun_popup { position: fixed !important; inset: 0 !important; width: 100vw !important; height: 100vh !important; z-index: 9999 !important; }
#loginCaptchaWrap .yidun_popup__mask { position: fixed !important; inset: 0 !important; width: 100vw !important; height: 100vh !important; }
#loginCaptchaWrap .yidun_cover-frame { position: fixed !important; inset: 0 !important; width: 100vw !important; height: 100vh !important; }
.dev-login { margin-top: 20px; padding-top: 16px; display: grid; gap: 8px; border-top: 1px solid var(--line); }
.dev-login span { color: #a05d1f; font-size: 11px; font-weight: 600; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 28px; padding: 10px 18px; transform: translateX(-50%); color: #fff; background: rgba(31, 31, 31, .92); border-radius: 3px; box-shadow: var(--shadow); }

.admin-main { width: min(1140px, calc(100% - 40px)); margin: 0 auto; padding: 34px 0 72px; }
.admin-hero h1 { margin: 5px 0; font-size: 30px; font-weight: 500; }
.admin-hero p { color: var(--muted); }
.metric-grid { margin: 24px 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.metric { padding: 18px; background: #fff; border: 1px solid var(--line); }
.metric strong { display: block; font-size: 28px; font-weight: 500; }
.metric span { color: var(--muted); font-size: 12px; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, .8fr); gap: 20px; align-items: start; }
.admin-section { padding: 22px; background: #fff; border: 1px solid var(--line); }
.admin-section > .section-heading { height: auto; margin-bottom: 16px; padding: 0 0 15px; border: 0; border-bottom: 1px solid var(--line); }
.admin-section > .section-heading h2 { margin: 2px 0 0; font-size: 20px; font-weight: 500; }
.review-card, .source-card { padding: 18px; background: #fff; border-bottom: 1px solid var(--line); }
.review-card:last-child, .source-card:last-child { border-bottom: 0; }
.review-card h3 { margin: 8px 0; }
.review-card p, .source-card p { color: var(--muted); line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-actions { margin-top: 14px; display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.review-actions textarea { flex: 1 1 100%; }
.source-form { margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.source-card { font-size: 13px; }
.source-card strong { overflow-wrap: anywhere; }
.source-status { margin: 12px 0; display: flex; justify-content: space-between; }
.published-section { margin-top: 24px; }

@media (max-width: 900px) {
  .primary-nav { margin-left: 30px; gap: 22px; }
  .hero-inner { min-height: 190px; align-items: flex-start; flex-direction: column; justify-content: center; gap: 22px; }
  .search-box { width: 100%; }
  .workspace, .admin-grid { grid-template-columns: 1fr; }
  .side-column { position: static; grid-template-columns: 1fr 1fr; }
  .ai-panel { grid-row: span 2; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .topbar { height: 58px; }
  .topbar-inner, .hero-inner, .workspace, .admin-main { width: min(100% - 28px, 1140px); }
  .brand strong { font-size: 17px; }
  .primary-nav { display: none; }
  .top-actions { gap: 13px; }
  .user-chip { display: none; }
  .hero-inner { min-height: 174px; gap: 18px; }
  .hero h1 { font-size: 25px; }
  .hero p { font-size: 13px; }
  .workspace { padding-top: 14px; }
  .section-heading { padding: 0 14px; }
  .feed-tabs { gap: 20px; }
  .button { padding: 7px 12px; }
  .question-card { padding: 18px 14px 17px 54px; }
  .question-mark { left: 14px; top: 20px; width: 28px; height: 28px; }
  .question-card h3 { font-size: 16px; }
  .card-footer { align-items: flex-start; flex-direction: column; gap: 5px; }
  .side-column { grid-template-columns: 1fr; }
  .ai-panel { grid-row: auto; }
  .ai-panel.is-expanded { inset: 0; width: 100%; height: 100dvh; border-right: 0; border-bottom: 0; border-left: 0; border-radius: 0; }
  .ai-panel.is-expanded .ai-chat { min-height: 160px; }
  .compose-card, .detail-card, .answer-card, .comments-card { padding: 18px 15px; }
  body.question-compose-open .workspace { width: min(100% - 28px, 1140px); }
  .question-compose-heading h1 { font-size: 24px; }
  .question-compose-heading p { margin-left: 0; }
  .question-field-row { min-height: 104px; padding: 16px 18px; grid-template-columns: 1fr; gap: 5px; }
  .question-field-row input { height: 44px; }
  .markdown-toolbar { padding: 0 12px; }
  .question-editor-card > textarea, .markdown-preview { min-height: 270px; padding: 20px 18px; }
  .editor-help { padding: 0 18px 16px; }
  .attachment-drafts { padding: 0 18px 16px; grid-template-columns: 1fr; }
  .question-compose-actions { align-items: stretch; flex-direction: column; }
  .question-compose-actions .button { width: 100%; }
  .question-attachments { grid-template-columns: 1fr; }
  .detail-card h1 { font-size: 23px; }
  .inline-form { flex-direction: column; }
  .modal-card { padding: 30px 24px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
}

/* Official workspace */
body.admin-body { min-width: 320px; background: #f3f5f4; color: #202722; }
.admin-shell { min-height: 100vh; }
.admin-sidebar { position: fixed; z-index: 40; inset: 0 auto 0 0; width: 248px; padding: 24px 16px 18px; display: flex; flex-direction: column; color: #e7eee9; background: #17221c; box-shadow: 8px 0 30px rgba(20, 41, 29, .08); }
.admin-brand { height: 54px; padding: 0 10px; display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.admin-brand img { width: 34px; height: 34px; padding: 5px; object-fit: contain; background: #fff; border-radius: 9px; }
.admin-brand span, .admin-brand strong, .admin-brand small { display: block; min-width: 0; }
.admin-brand strong { font-size: 16px; line-height: 1.4; font-weight: 600; letter-spacing: .01em; }
.admin-brand small { color: #8fa197; line-height: 1.3; font-size: 11px; }
.admin-nav { margin-top: 38px; display: grid; gap: 7px; }
.admin-nav::before { content: "管理菜单"; margin: 0 12px 8px; color: #718078; font-size: 10px; letter-spacing: .12em; }
.admin-nav-item { width: 100%; height: 46px; padding: 0 13px; display: flex; align-items: center; gap: 12px; border: 0; border-radius: 7px; color: #aebbb4; background: transparent; cursor: pointer; text-align: left; transition: color .16s, background .16s; }
.admin-nav-item:hover { color: #fff; background: rgba(255, 255, 255, .055); }
.admin-nav-item.active { color: #fff; background: #087d43; box-shadow: 0 6px 18px rgba(4, 100, 52, .22); }
.admin-nav-item svg { width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.admin-nav-item:first-child svg { fill: currentColor; stroke: none; }
.admin-nav-item span { flex: 1; font-size: 14px; }
.admin-nav-item em { min-width: 21px; height: 21px; padding: 0 6px; display: grid; place-items: center; color: #fff; background: #e75050; border-radius: 11px; font-size: 10px; font-style: normal; }
.admin-sidebar-foot { margin-top: auto; padding: 16px 9px 0; display: flex; align-items: center; gap: 10px; border-top: 1px solid rgba(255, 255, 255, .08); }
.admin-user-avatar { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; color: #0b6f3d; background: #dff5e8; border-radius: 50%; font-size: 13px; font-weight: 650; }
.admin-user-copy { min-width: 0; flex: 1; }
.admin-user-copy strong, .admin-user-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-user-copy strong { color: #eef4f0; font-size: 12px; font-weight: 500; }
.admin-user-copy small { color: #7f9087; font-size: 10px; }
.admin-sidebar-foot > a { width: 28px; height: 28px; display: grid; place-items: center; color: #809087; text-decoration: none; font-size: 17px; }
.admin-sidebar-foot > a:hover { color: #fff; }

.admin-stage { min-height: 100vh; margin-left: 248px; }
.admin-topbar { position: sticky; z-index: 30; top: 0; height: 76px; padding: 0 clamp(24px, 3.5vw, 52px); display: flex; align-items: center; gap: 18px; background: rgba(255, 255, 255, .94); border-bottom: 1px solid #e4e9e6; backdrop-filter: blur(12px); }
.admin-topbar h1 { margin: 0; color: #202722; font-size: 20px; line-height: 1.35; font-weight: 600; }
.admin-topbar p { margin: 2px 0 0; color: #8b9590; font-size: 11px; }
.admin-menu-button { display: none; border: 0; background: transparent; font-size: 21px; cursor: pointer; }
.admin-top-actions { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.system-state { display: flex; align-items: center; gap: 7px; color: #6f7b74; font-size: 11px; }
.system-state i, .healthy i, .knowledge-summary-copy span i { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(7, 193, 96, .1); }
.icon-refresh { width: 36px; height: 36px; border: 1px solid #dde3df; border-radius: 7px; color: #66716b; background: #fff; cursor: pointer; font-size: 20px; line-height: 1; transition: border-color .15s, color .15s; }
.icon-refresh:hover { color: var(--green-dark); border-color: #9bd8b7; }
.icon-refresh.spinning { animation: admin-spin .6s linear infinite; }
@keyframes admin-spin { to { transform: rotate(360deg); } }

.admin-content { width: min(1380px, 100%); margin: 0 auto; padding: 34px clamp(24px, 3.5vw, 52px) 72px; }
.admin-page { display: none; }
.admin-page.active { display: block; animation: admin-page-in .2s ease-out; }
@keyframes admin-page-in { from { opacity: 0; transform: translateY(4px); } }
.admin-welcome { min-height: 126px; padding: 25px 28px; display: flex; align-items: center; justify-content: space-between; gap: 30px; color: #fff; background: linear-gradient(115deg, #123724 0%, #0b5f35 56%, #07894a 100%); border-radius: 11px; box-shadow: 0 12px 30px rgba(17, 89, 51, .15); overflow: hidden; position: relative; }
.admin-welcome::after { content: ""; position: absolute; right: -45px; top: -90px; width: 250px; height: 250px; border: 46px solid rgba(255,255,255,.055); border-radius: 50%; }
.admin-welcome > * { position: relative; z-index: 1; }
.admin-welcome .kicker { color: #9ee2bb; }
.admin-welcome h2 { margin: 4px 0 3px; font-size: 24px; font-weight: 550; }
.admin-welcome p { margin: 0; color: #bbd2c4; font-size: 13px; }
.admin-welcome .button-primary { color: #087641; background: #fff; border-color: #fff; border-radius: 6px; }
.admin-welcome .button-primary:hover { color: #065f35; background: #effaf4; }

.metric-grid.admin-metrics { margin: 20px 0; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.admin-metrics .metric { min-height: 112px; padding: 20px; display: flex; align-items: center; gap: 15px; border-color: #e4e9e6; border-radius: 9px; box-shadow: 0 3px 13px rgba(25, 48, 34, .025); }
.admin-metrics .metric-icon { width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; font-size: 13px; font-weight: 650; }
.admin-metrics .metric > div { min-width: 0; }
.admin-metrics .metric strong { display: inline; margin-right: 8px; color: #1d2921; font-size: 25px; font-weight: 650; }
.admin-metrics .metric span:not(.metric-icon) { color: #3f4b44; font-size: 12px; font-weight: 550; }
.admin-metrics .metric small { margin-top: 3px; display: block; color: #9aa39e; font-size: 10px; }
.metric-attention .metric-icon { color: #b76819; background: #fff1df; }
.metric-green .metric-icon { color: #087a43; background: #e4f6eb; }
.metric-blue .metric-icon { color: #3b69b2; background: #e9f0fc; }
.metric-violet .metric-icon { color: #7551ad; background: #f0ebfa; }
.metric-cyan .metric-icon { color: #197f88; background: #e5f5f6; }
.metric-orange .metric-icon { color: #b65b2c; background: #fceedf; }

.overview-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(330px, .65fr); gap: 16px; }
.admin-panel { background: #fff; border: 1px solid #e3e8e5; border-radius: 9px; box-shadow: 0 3px 13px rgba(25, 48, 34, .025); }
.admin-panel-head { min-height: 70px; padding: 17px 20px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid #edf0ee; }
.admin-panel-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.admin-panel-head p { margin: 3px 0 0; color: #929c96; font-size: 10px; }
.text-button, .panel-close { border: 0; color: #4e6658; background: transparent; cursor: pointer; font-size: 11px; }
.text-button:hover { color: var(--green-dark); }
.compact-list { min-height: 225px; }
.compact-question { width: 100%; min-height: 69px; padding: 11px 18px; display: flex; align-items: center; gap: 12px; border: 0; border-bottom: 1px solid #f0f2f1; background: #fff; cursor: pointer; text-align: left; }
.compact-question:last-child { border-bottom: 0; }
.compact-question:hover { background: #f8fbf9; }
.compact-question-mark { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; color: #087a43; background: #e6f6ed; border-radius: 7px; font-size: 11px; font-weight: 700; }
.compact-question > span:nth-child(2) { min-width: 0; flex: 1; }
.compact-question strong, .compact-question small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-question strong { color: #2a332d; font-size: 12px; font-weight: 550; }
.compact-question small { margin-top: 3px; color: #9aa29e; font-size: 10px; }
.compact-question em { color: #7a8980; font-size: 10px; font-style: normal; }
.knowledge-overview { min-height: 225px; padding: 25px; display: flex; align-items: center; justify-content: center; gap: 24px; }
.knowledge-ring { --progress: 0deg; width: 110px; height: 110px; padding: 9px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: conic-gradient(#08a957 var(--progress), #eaf0ec 0); }
.knowledge-ring > div { width: 100%; height: 100%; display: grid; place-content: center; text-align: center; background: #fff; border-radius: 50%; }
.knowledge-ring strong, .knowledge-ring span { display: block; }
.knowledge-ring strong { font-size: 22px; line-height: 1.2; }
.knowledge-ring span { margin-top: 4px; color: #87928b; font-size: 9px; }
.knowledge-summary-copy strong { font-size: 12px; }
.knowledge-summary-copy p { max-width: 175px; margin: 6px 0 12px; color: #8c9690; font-size: 10px; }
.knowledge-summary-copy span { display: flex; align-items: center; gap: 7px; color: #5c6c62; font-size: 10px; }
.activity-panel { margin-top: 16px; }
.activity-list { padding: 4px 20px 12px; }
.activity-item { min-height: 56px; display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 11px; border-bottom: 1px solid #f0f2f1; color: #657169; font-size: 11px; }
.activity-item:last-child { border-bottom: 0; }
.activity-dot { width: 7px; height: 7px; border-radius: 50%; background: #b9c8c0; }
.activity-item strong { color: #344038; font-weight: 550; }
.activity-item small { margin-top: 2px; display: block; color: #a1aaa5; }
.activity-item time { color: #9ca59f; font-size: 10px; }

.page-intro { margin-bottom: 22px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.page-intro h2 { margin: 0; color: #202a23; font-size: 25px; font-weight: 600; }
.page-intro p { margin: 5px 0 0; color: #89938d; font-size: 12px; }
.count-pill { padding: 8px 12px; color: #6c766f; background: #fff; border: 1px solid #e0e6e2; border-radius: 18px; font-size: 11px; }
.count-pill strong { color: #087a43; }
.admin-toolbar, .source-toolbar { min-height: 62px; margin-bottom: 12px; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #fff; border: 1px solid #e3e8e5; border-radius: 9px; }
.admin-search { width: min(380px, 100%); height: 40px; margin: 0; padding: 0 12px; display: flex; align-items: center; gap: 8px; border: 1px solid #dfe5e1; border-radius: 6px; color: #929c96; background: #f9faf9; }
.admin-search:focus-within { border-color: #6fc799; box-shadow: 0 0 0 3px rgba(7, 193, 96, .07); }
.admin-search input { width: 100%; height: 100%; padding: 0; border: 0; box-shadow: none; background: transparent; font-size: 12px; }
.management-list, .source-management-list { overflow: hidden; background: #fff; border: 1px solid #e3e8e5; border-radius: 9px; box-shadow: 0 3px 13px rgba(25, 48, 34, .025); }
.list-pagination { min-height: 52px; margin-top: 12px; padding: 8px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #66746b; font-size: 12px; background: #fff; border: 1px solid #e3e8e5; border-radius: 9px; }
.list-pagination > div { display: flex; gap: 8px; }
.management-card { min-height: 176px; padding: 21px 22px; display: flex; align-items: center; gap: 25px; border-bottom: 1px solid #edf0ee; }
.management-card:last-child { border-bottom: 0; }
.management-card:hover { background: #fcfdfc; }
.management-card-main { min-width: 0; flex: 1; }
.management-card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; color: #959f99; font-size: 10px; }
.management-card-meta > span:not(.status-badge) + span::before { content: "·"; margin-right: 9px; color: #ccd1ce; }
.management-card h3 { margin: 9px 0 5px; color: #27312a; font-size: 16px; font-weight: 590; }
.management-excerpt { max-width: 850px; margin: 0; color: #68736c; line-height: 1.75; font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; }
.management-card-foot { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: #9aa39e; font-size: 10px; }
.management-card-actions { width: 108px; display: grid; gap: 8px; flex: 0 0 auto; }
.management-question-facts { margin: 6px 0; color: #587064; font-size: 11px; overflow-wrap: anywhere; }
.management-card-actions .button { width: 100%; min-height: 34px; padding: 6px 10px; border-radius: 5px; font-size: 11px; }
.button-danger-subtle { color: #b64747; background: #fff; border-color: #eed2d2; }
.button-danger-subtle:hover { color: #a53030; background: #fff6f6; border-color: #e6adad; }
.user-role-admin { color: #7551ad; background: #f0ebfa; }
.user-role-moderator { color: #0b6e78; background: #e3f4f5; }
.user-role-user { color: #52655a; background: #edf2ee; }
.current-user-note { align-self: center; color: #89948e; font-size: 11px; text-align: center; }
.user-role-control { display: grid; gap: 7px; }
.user-role-control select { width: 100%; min-height: 34px; padding: 6px 8px; border: 1px solid #dfe5e1; border-radius: 5px; color: #35423a; background: #fff; font: inherit; font-size: 11px; }
.status-badge { gap: 5px; min-height: 22px; padding: 2px 8px; border-radius: 11px; }
.status-badge i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.segmented { height: 38px; padding: 3px; display: flex; gap: 2px; background: #f0f3f1; border-radius: 6px; }
.segmented button { padding: 0 16px; border: 0; border-radius: 4px; color: #68736c; background: transparent; cursor: pointer; font-size: 11px; }
.segmented button.active { color: #087a43; background: #fff; box-shadow: 0 1px 5px rgba(31, 55, 41, .09); font-weight: 600; }
.content-toolbar .admin-search { margin-left: auto; }

.knowledge-title-row .button { border-radius: 6px; }
.knowledge-strip { min-height: 88px; margin-bottom: 16px; padding: 15px 20px; display: grid; grid-template-columns: repeat(3, minmax(120px, 180px)) 1fr; align-items: center; gap: 20px; background: #fff; border: 1px solid #e3e8e5; border-radius: 9px; }
.knowledge-strip > div { padding-right: 20px; border-right: 1px solid #edf0ee; }
.knowledge-strip span { display: block; color: #909a94; font-size: 10px; }
.knowledge-strip strong { margin-top: 4px; display: block; color: #27322b; font-size: 19px; }
.knowledge-strip strong.healthy { display: flex; align-items: center; gap: 8px; color: #087a43; font-size: 13px; }
.knowledge-strip strong.healthy span { color: inherit; font-size: inherit; }
.knowledge-strip strong.has-error { color: #c24747; }
.knowledge-strip strong.has-error i { background: #e34f4f; box-shadow: 0 0 0 4px rgba(227, 79, 79, .1); }
.knowledge-strip > p { justify-self: end; margin: 0; color: #8b9590; font-size: 10px; }
.knowledge-strip code { padding: 4px 7px; color: #53635a; background: #f3f6f4; border-radius: 4px; }
.source-form-panel { margin-bottom: 16px; }
.panel-close { width: 32px; height: 32px; font-size: 22px; }
.source-form-grid { padding: 20px; display: grid; grid-template-columns: 1fr 180px; gap: 15px; }
.source-form-grid label { margin: 0; font-size: 11px; }
.source-form-grid .wide { grid-column: 1 / -1; }
.source-form-grid input { height: 42px; border-radius: 5px; font-size: 12px; }
.source-form-actions { align-self: end; display: flex; justify-content: flex-end; gap: 8px; }
.source-toolbar { justify-content: space-between; }
.source-management-card { min-height: 142px; padding: 21px; display: flex; align-items: flex-start; gap: 16px; border-bottom: 1px solid #edf0ee; }
.source-management-card:last-child { border-bottom: 0; }
.source-product-icon { width: 43px; height: 43px; display: grid; place-items: center; flex: 0 0 auto; color: #087a43; background: #e5f6ec; border-radius: 9px; font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.source-management-main { min-width: 0; flex: 1; }
.source-title-line { display: flex; align-items: center; gap: 10px; }
.source-title-line h3 { margin: 0; overflow: hidden; color: #29342d; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; }
.source-state { padding: 3px 8px; display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; border-radius: 11px; font-size: 9px; }
.source-state i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.source-state-ready { color: #087943; background: #e8f7ee; }
.source-state-working { color: #a36816; background: #fff4df; }
.source-state-error { color: #bd4141; background: #fff0f0; }
.source-management-main > a { max-width: 700px; margin-top: 5px; display: block; overflow: hidden; color: #79867e; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.source-management-main > a:hover { color: #087a43; }
.source-facts { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 18px; color: #929c96; font-size: 10px; }
.source-facts span + span { padding-left: 18px; border-left: 1px solid #e4e9e6; }
.source-facts strong { color: #4e5c53; }
.source-error { margin-top: 10px; padding: 7px 9px; color: #b34545; background: #fff5f5; border-radius: 4px; font-size: 10px; }
.source-card-actions { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; }
.source-card-actions .button { min-height: 34px; border-radius: 5px; font-size: 10px; }
.more-button { width: 34px; height: 34px; padding: 0; border: 1px solid #e1e6e3; border-radius: 5px; color: #869089; background: #fff; cursor: pointer; font-size: 18px; line-height: 1; }
.more-button:hover { color: #bb4141; border-color: #edc2c2; }
.sync-progress { height: 3px; margin-top: 12px; overflow: hidden; background: #edf1ee; border-radius: 2px; }
.sync-progress i { width: 36%; height: 100%; display: block; background: #09ac59; border-radius: inherit; animation: sync-progress 1.3s ease-in-out infinite; }
@keyframes sync-progress { from { transform: translateX(-105%); } to { transform: translateX(290%); } }

.action-modal { position: fixed; z-index: 1000; inset: 0; padding: 20px; display: grid; place-items: center; background: rgba(15, 25, 19, .52); backdrop-filter: blur(3px); }
.action-modal-card { width: min(620px, 100%); padding: 25px; background: #fff; border-radius: 12px; box-shadow: 0 24px 80px rgba(10, 25, 16, .24); animation: action-modal-in .18s ease-out; }
@keyframes action-modal-in { from { opacity: 0; transform: translateY(8px) scale(.99); } }
.action-modal-head { display: flex; align-items: flex-start; justify-content: space-between; }
.action-modal-head > div { display: flex; align-items: center; gap: 11px; }
.action-modal-head h2 { margin: 0; font-size: 19px; font-weight: 600; }
.action-modal-head button { width: 32px; height: 32px; border: 0; color: #7f8a83; background: transparent; cursor: pointer; font-size: 23px; }
.action-modal-icon { width: 35px; height: 35px; display: grid; place-items: center; color: #087a43; background: #e4f6eb; border-radius: 8px; font-size: 11px; font-weight: 700; }
.action-modal-icon.danger { color: #bd4141; background: #fff0f0; }
.action-modal-card > p { margin: 13px 0 16px; color: #7b867f; line-height: 1.7; font-size: 12px; }
.action-question-preview { margin-bottom: 18px; padding: 12px 14px; background: #f6f8f7; border-left: 3px solid #a6cdb7; border-radius: 3px; }
.action-question-preview strong, .action-question-preview span { display: block; }
.action-question-preview strong { color: #344039; font-size: 12px; }
.action-question-preview span { margin-top: 3px; overflow: hidden; color: #929c96; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.action-modal-card label { margin: 0; font-size: 11px; }
.action-modal-card textarea { min-height: 180px; border-radius: 6px; font-size: 12px; }
.action-attachment-input { margin-top: 14px !important; padding: 11px 12px; display: grid; gap: 7px; color: #5a685f; background: #f6f8f7; border: 1px dashed #cbd7d0; border-radius: 6px; }
.action-attachment-input input { width: 100%; font-size: 11px; }
.action-attachment-list { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.action-attachment-list span { max-width: 100%; padding: 5px 8px; overflow: hidden; color: #4e6255; background: #edf5f0; border-radius: 4px; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.question-detail-card { width: min(880px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.question-detail-content { min-height: 0; overflow-y: auto; padding: 4px 2px 0; }
.question-detail-content h3 { margin: 14px 0 8px; color: #26322a; font-size: 18px; }
.question-detail-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: #89948d; font-size: 11px; }
.question-detail-meta > span + span::before { content: "·"; margin-right: 8px; color: #c7cfca; }
.question-detail-body, .conversation-detail-block p, .question-detail-answer p { color: #435149; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; font-size: 13px; }
.question-detail-body { margin: 16px 0 0; }
.question-detail-answers { margin-top: 24px; border-top: 1px solid #e8edea; }
.question-detail-answers > h4, .conversation-detail-block h4 { margin: 18px 0 10px; color: #4b5b51; font-size: 12px; }
.question-detail-answer { padding: 14px 0; border-top: 1px solid #eef1ef; }
.question-detail-answer > div { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.question-detail-answer strong { color: #324139; font-size: 12px; }
.question-detail-answer time { color: #99a39d; font-size: 10px; }
.question-detail-answer .status-badge { min-height: 19px; font-size: 9px; }
.conversation-detail-block { margin-top: 18px; padding: 14px; background: #f7f9f8; border-left: 3px solid #b9d8c5; border-radius: 4px; }
.conversation-detail-block h4 { margin-top: 0; }
.conversation-detail-block p { margin: 0; }
.conversation-detail-block ul { margin: 0; padding-left: 18px; }
.conversation-detail-block li { margin: 5px 0; font-size: 12px; overflow-wrap: anywhere; }
.conversation-detail-block a { color: #087a43; }
.action-modal-actions { margin-top: 20px; display: flex; justify-content: flex-end; gap: 9px; }
.action-modal-actions .button { min-width: 96px; border-radius: 6px; }
.button-danger-solid { color: #fff; background: #d74848; border-color: #d74848; }
.button-danger-solid:hover { background: #bd3737; border-color: #bd3737; }
.button:disabled { opacity: .55; cursor: not-allowed; }
.button.is-busy::before { content: ""; width: 11px; height: 11px; margin-right: 6px; border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: admin-spin .7s linear infinite; }

.admin-toast { left: auto; right: 25px; bottom: 25px; min-width: 220px; padding: 12px 16px; display: flex; align-items: center; gap: 10px; transform: none; background: #1e3327; border-radius: 7px; font-size: 12px; }
.admin-toast > span:first-child { width: 21px; height: 21px; display: grid; place-items: center; color: #155b35; background: #bdf0d0; border-radius: 50%; font-size: 10px; font-weight: 700; }
.admin-toast.is-error { background: #4b2424; }
.admin-toast.is-error > span:first-child { color: #8f2d2d; background: #ffd0d0; }
.admin-empty { min-height: 220px; padding: 42px 20px; display: grid; place-items: center; align-content: center; text-align: center; }
.admin-empty > span { width: 42px; height: 42px; margin-bottom: 10px; display: grid; place-items: center; color: #6b8b77; background: #eef5f1; border-radius: 50%; }
.admin-empty strong { color: #536159; font-size: 12px; }
.admin-empty p { margin: 4px 0 0; color: #a0a8a3; font-size: 10px; }
.admin-empty.compact { min-height: 160px; }
.admin-access-denied { width: min(420px, calc(100% - 32px)); margin: 18vh auto; padding: 40px; display: grid; gap: 18px; color: #4d5a52; background: #fff; border: 1px solid #e2e8e4; border-radius: 10px; text-align: center; }
.admin-drawer-mask { position: fixed; z-index: 35; inset: 0; background: rgba(11, 20, 14, .45); }

@media (max-width: 1120px) {
  .metric-grid.admin-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-grid { grid-template-columns: 1fr; }
  .knowledge-overview { min-height: 190px; }
  .knowledge-strip { grid-template-columns: repeat(3, 1fr); }
  .knowledge-strip > p { grid-column: 1 / -1; justify-self: start; }
}

@media (max-width: 820px) {
  .admin-sidebar { transform: translateX(-105%); transition: transform .2s ease; }
  .admin-nav-open .admin-sidebar { transform: translateX(0); }
  .admin-stage { margin-left: 0; }
  .admin-menu-button { display: block; }
  .admin-topbar { height: 68px; padding: 0 18px; }
  .admin-content { padding: 24px 18px 60px; }
  .system-state { display: none; }
  .management-card { align-items: stretch; flex-direction: column; gap: 16px; }
  .management-card-actions { width: auto; display: flex; }
  .management-card-actions .button { width: auto; }
  .source-management-card { flex-wrap: wrap; }
  .source-card-actions { width: 100%; justify-content: flex-end; }
}

@media (max-width: 560px) {
  .admin-topbar p { display: none; }
  .admin-content { padding: 18px 12px 48px; }
  .admin-welcome { min-height: 170px; padding: 22px; align-items: flex-start; flex-direction: column; justify-content: center; gap: 16px; }
  .admin-welcome h2 { font-size: 21px; }
  .metric-grid.admin-metrics { grid-template-columns: 1fr; }
  .admin-metrics .metric { min-height: 94px; }
  .page-intro { align-items: flex-start; }
  .page-intro h2 { font-size: 22px; }
  .admin-toolbar, .source-toolbar, .content-toolbar { align-items: stretch; flex-direction: column; }
  .admin-search { width: 100%; }
  .segmented { width: 100%; }
  .segmented button { min-width: 0; flex: 1; padding: 0 5px; }
  .management-card { padding: 18px 15px; }
  .management-card-foot { align-items: flex-start; flex-direction: column; gap: 7px; }
  .management-card-actions { flex-wrap: wrap; }
  .knowledge-title-row { align-items: stretch; flex-direction: column; }
  .knowledge-strip { grid-template-columns: 1fr 1fr; }
  .knowledge-strip > div { border-right: 0; }
  .knowledge-strip > div:nth-child(3), .knowledge-strip > p { grid-column: 1 / -1; }
  .source-form-grid { grid-template-columns: 1fr; }
  .source-form-grid .wide { grid-column: auto; }
  .source-form-actions { margin-top: 5px; }
  .source-management-card { padding: 17px 14px; }
  .source-title-line { align-items: flex-start; flex-direction: column; }
  .source-facts { gap: 8px; }
  .source-facts span + span { padding-left: 8px; }
  .action-modal { padding: 10px; align-items: end; }
  .action-modal-card { padding: 21px 17px; border-radius: 12px 12px 5px 5px; }
  .action-modal-card textarea { min-height: 150px; }
}
