:root {
  --ink: #252a30;
  --muted: #626873;
  --brand-gold: #c29a5c;
  --accent: #806036;
  --accent-hover: #674b28;
  --nav: #252a30;
  --nav-hover: #383d43;
  --nav-text: #f1ede6;
  --nav-muted: #bfc3c9;
  --line: #dce0e5;
  --input-line: #858b94;
  --paper: #fff;
  --surface: #f6f7f9;
  --tint: #f1e9dc;
  --error: #aa3531;
  --focus: #806036;
  --shadow: 0 8px 28px #252a3008;
  --font-body: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  --font-display: "Bahnschrift", "Microsoft YaHei", "PingFang SC", sans-serif;
  --font-data: "Cascadia Code", Consolas, "Microsoft YaHei", monospace;
  font-family: var(--font-body);
  color: var(--ink);
  font-size: 16px;
  background: var(--surface);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea { font: inherit; }
button, a, input, textarea { touch-action: manipulation; }
button { cursor: pointer; border: 0; transition: background-color 160ms, border-color 160ms, color 160ms; }
button:disabled { cursor: not-allowed; opacity: .55; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.sidebar :focus-visible { outline-color: var(--brand-gold); }
a { color: inherit; }
input, textarea { width: 100%; border: 1px solid var(--input-line); border-radius: 8px; padding: 13px; color: var(--ink); background: var(--paper); resize: vertical; }
textarea { line-height: 1.65; }
input::placeholder, textarea::placeholder { color: var(--muted); }
label { font-size: 14px; font-weight: 600; }
label > span { font-weight: 400; color: var(--muted); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; clip: rect(0,0,0,0); overflow: hidden; }
.workspace { display: grid; grid-template-columns: 280px 1fr; min-height: 100dvh; }
.sidebar { height: 100dvh; position: sticky; top: 0; display: flex; flex-direction: column; background: var(--nav); color: var(--nav-text); padding: 36px 26px 22px; border-top: 3px solid var(--brand-gold); }
.brand { display: block; text-decoration: none; padding: 3px 0; }
.brand img { display: block; width: 100%; height: auto; }
.sidebar-intro { font-size: 14px; line-height: 1.85; color: var(--nav-muted); margin: 34px 0 24px; }
.new-conversation { min-height: 48px; padding: 13px 15px; border: 1px solid #8f7754; border-radius: 8px; background: #3f3931; color: var(--nav-text); text-align: left; font-size: 14px; }
.new-conversation:hover { background: #504532; border-color: var(--brand-gold); }
.nav-label { font-size: 12px; color: var(--nav-muted); margin: 32px 0 12px; letter-spacing: .06em; }
#conversation-list { overflow: auto; flex: 1; min-height: 0; }
.conversation-link { display: block; text-align: left; width: 100%; min-height: 44px; padding: 12px; background: transparent; color: var(--nav-text); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 6px; margin-bottom: 4px; border-left: 2px solid transparent; }
.conversation-link:hover { background: var(--nav-hover); }
.conversation-link.active { background: var(--nav-hover); border-left-color: var(--brand-gold); }
.empty-navigation { font-size: 13px; line-height: 1.8; color: var(--nav-muted); }
.sidebar-bottom { border-top: 1px solid #4c5056; padding-top: 12px; }
.support-nav { display: flex; justify-content: space-between; align-items: center; background: transparent; color: var(--nav-text); width: 100%; min-height: 44px; padding: 0; font-size: 14px; }
.sidebar-bottom p { font-size: 12px; line-height: 1.8; color: var(--nav-muted); margin: 12px 0 6px; }
.quiet-button { background: transparent; font-size: 12px; color: var(--nav-muted); padding: 10px 0; min-height: 44px; }
.close-menu { display: none; }
main { min-width: 0; }
.topbar { min-height: 84px; padding: 16px 44px; display: flex; justify-content: space-between; align-items: center; gap: 24px; border-bottom: 1px solid var(--line); background: var(--paper); font-size: 14px; }
.topbar > div { min-width: 0; overflow-wrap: anywhere; }
.topbar-separator { margin: 0 14px; color: var(--muted); }
#conversation-title { color: var(--muted); font-size: 13px; }
.service-label { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.service-label i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.menu-button { display: none; }
.consultation { max-width: 1080px; margin: auto; display: flex; flex-direction: column; min-height: calc(100dvh - 84px); }
.welcome { padding: 48px 60px 24px; margin: auto 0; }
.welcome-mark { display: block; width: 48px; height: auto; margin-bottom: 22px; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--accent); letter-spacing: .08em; margin: 0 0 16px; }
h1 { font-family: var(--font-display); font-size: clamp(30px,3.15vw,47px); font-weight: 600; line-height: 1.42; letter-spacing: -.03em; margin: 0 0 20px; }
h1 em { font-style: normal; color: var(--accent); }
.welcome > p:not(.eyebrow) { font-size: 15px; line-height: 1.9; color: var(--muted); }
.question-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 28px 0 0; max-width: 700px; }
.question-card { position: relative; color: var(--ink); background: var(--paper); border: 1px solid var(--line); padding: 20px 22px 22px; text-align: left; border-radius: 10px; }
.question-card:hover { border-color: var(--accent); background: #fcfaf7; }
.question-card span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.question-card strong { font-size: 15px; font-weight: 500; }
.question-card b { position: absolute; top: 20px; right: 18px; color: var(--accent); font-weight: 400; }
.catalog-note { font-size: 12px !important; margin-top: 18px; }
.composer-dock { padding: 20px 60px 24px; margin-top: auto; position: sticky; bottom: 0; background: var(--surface); z-index: 1; }
.composer { background: var(--paper); border: 1px solid var(--input-line); border-radius: 12px; padding: 16px 18px 12px; box-shadow: var(--shadow); }
.composer:focus-within { border-color: var(--accent); }
.composer textarea { border: 0; background: transparent; resize: none; padding: 0; max-height: 160px; font-size: 16px; outline-offset: 6px; }
.composer-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; }
.composer-footer > span { font-size: 12px; color: var(--muted); }
.send-button { background: var(--accent); color: var(--paper); width: 44px; height: 44px; flex: none; border-radius: 8px; font-size: 24px; }
.send-button:hover, .primary-button:hover { background: var(--accent-hover); }
.composer-note { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 12px; line-height: 1.7; color: var(--muted); margin-top: 8px; }
.composer-note button { color: var(--accent); font-size: 12px; padding: 8px 0; min-height: 44px; background: none; white-space: nowrap; }
.messages { padding: 30px 60px 0; }
.message { margin: 0 0 28px; font-size: 16px; line-height: 1.9; }
.message.user { margin-left: auto; max-width: 86%; width: fit-content; background: var(--tint); padding: 12px 18px; border-radius: 10px 10px 2px 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.assistant { display: grid; grid-template-columns: 32px 1fr; gap: 16px; }
.assistant-symbol { display: block; width: 30px; height: auto; margin-top: 5px; }
.message-body { min-width: 0; overflow-wrap: anywhere; }
.message-content { white-space: pre-wrap; }
.message-content strong { font-weight: 650; }
.source-list { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 8px; font-size: 12px; color: var(--muted); }
.source-list summary { cursor: pointer; padding: 10px 0; min-height: 44px; }
.source-item { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; font-family: var(--font-data); }
.source-item a { font-family: var(--font-body); color: var(--accent); margin-left: auto; padding: 8px 0; }
.progress { font-size: 13px; color: var(--accent); padding: 0 2px 12px; }
.form-error { color: var(--error); font-size: 13px; line-height: 1.7; margin: 10px 0 0; min-height: 1em; }
.access-panel { max-width: 680px; margin: 48px auto; padding: 24px 40px; }
.access-symbol { display: block; width: 56px; height: auto; margin-bottom: 28px; }
.access-panel > p:not(.eyebrow) { color: var(--muted); line-height: 1.9; font-size: 16px; }
.access-panel form { max-width: 410px; margin: 30px 0 0; display: grid; gap: 12px; }
.primary-button { min-height: 48px; padding: 14px 18px; background: var(--accent); color: var(--paper); border-radius: 8px; font-size: 15px; text-align: left; display: flex; justify-content: space-between; margin-top: 6px; }
.privacy-note { font-size: 12px !important; max-width: 440px; margin-top: 24px; }
.support-panel { max-width: 1080px; padding: 36px 50px; margin: auto; }
.back-button { background: none; color: var(--muted); padding: 8px 0; min-height: 44px; margin-bottom: 24px; font-size: 14px; }
.support-panel h1 { font-size: 36px; margin-bottom: 14px; }
.support-description { max-width: 650px; line-height: 1.9; color: var(--muted); font-size: 16px; }
.support-layout { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; margin-top: 30px; }
.support-form { display: grid; gap: 12px; }
.support-form > label:not(:first-child) { margin-top: 10px; }
.consent { display: flex; align-items: flex-start; gap: 12px; font-size: 13px; line-height: 1.8; font-weight: 400; min-height: 44px; padding: 8px 0; cursor: pointer; }
.consent input { width: 20px; height: 20px; flex: none; margin: 2px 0 0; accent-color: var(--accent); }
.support-history { border-left: 1px solid var(--line); padding-left: 30px; }
.support-history h2 { font-size: 17px; font-weight: 600; margin: 0 0 20px; }
.support-record { width: 100%; display: block; padding: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; text-align: left; margin-bottom: 12px; }
.support-record strong { font-size: 14px; font-weight: 600; color: var(--accent); display: block; margin-bottom: 6px; }
.support-record span { font-size: 14px; line-height: 1.7; color: var(--muted); }
.support-detail { font-size: 14px; line-height: 1.8; overflow-wrap: anywhere; }
.support-detail p { white-space: pre-wrap; }
.support-detail h3 { font-size: 16px; }
.support-thread { border-top: 1px solid var(--line); padding: 12px 0; }
.support-thread small { color: var(--accent); }
.support-detail form { display: grid; gap: 8px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--nav); color: var(--paper); padding: 14px 20px; border-radius: 8px; font-size: 14px; z-index: 10; max-width: 90vw; box-shadow: var(--shadow); }
.message-content p { margin: 0 0 1em; white-space: pre-line; }
.message-content p:last-child { margin-bottom: 0; }
.message-content h3, .message-content h4 { font-size: 1em; margin: 1.1em 0 .5em; }
.message-content ul, .message-content ol { margin: .5em 0 1em; padding-left: 1.5em; white-space: normal; }
.message-content li { margin: .3em 0; }
.reply-table-scroll { max-width: 100%; overflow-x: auto; margin: .8em 0; white-space: normal; }
.message-content table { border-collapse: collapse; width: 100%; min-width: 420px; font-size: .92em; font-variant-numeric: tabular-nums; }
.message-content th, .message-content td { border: 1px solid var(--line); padding: .55em .7em; text-align: left; vertical-align: top; }
.message-content th { background: var(--tint); font-weight: 600; }
@media (max-width: 1050px) {
  .workspace { grid-template-columns: 240px 1fr; }
  .sidebar { padding: 30px 20px 20px; }
  .topbar { padding: 16px 28px; }
  .welcome { padding: 40px 36px 24px; }
  .composer-dock { padding: 16px 36px 20px; }
  .messages { padding: 28px 36px 0; }
  .support-panel { padding: 32px; }
  .support-layout { gap: 24px; }
  .support-history { padding-left: 20px; }
}
@media (max-width: 720px) {
  .workspace { display: block; }
  .sidebar { display: none; position: fixed; width: min(300px,100vw); z-index: 5; box-shadow: 8px 0 32px #252a3033; padding-top: 70px; }
  .sidebar.open { display: flex; }
  .close-menu { display: block; position: absolute; right: 16px; top: 12px; width: 44px; height: 44px; border-radius: 8px; background: var(--nav-hover); color: var(--nav-text); font-size: 28px; }
  .topbar { min-height: 68px; padding: 10px 16px; justify-content: flex-start; gap: 12px; font-size: 14px; }
  .topbar-separator, #conversation-title, .service-label { display: none; }
  .menu-button { display: block; background: transparent; color: var(--accent); font-size: 22px; padding: 8px; width: 44px; height: 44px; }
  .consultation { min-height: calc(100dvh - 68px); }
  .welcome { padding: 28px 24px 16px; }
  .welcome-mark { width: 40px; margin-bottom: 18px; }
  h1 { font-size: 34px; }
  .welcome > p:not(.eyebrow) { font-size: 16px; }
  .desktop-break { display: none; }
  .question-grid { gap: 12px; margin-top: 24px; grid-template-columns: 1fr; }
  .question-card { padding: 16px 18px; }
  .question-card strong { font-size: 16px; }
  .question-card span { font-size: 12px; margin-bottom: 8px; }
  .question-card b { top: 16px; right: 18px; }
  .composer-dock { position: static; padding: 16px 16px max(20px,env(safe-area-inset-bottom)); }
  .composer-note { flex-wrap: wrap; gap: 0; }
  .composer-note button { margin-left: auto; }
  .composer-footer > span { font-size: 11px; }
  .messages { padding: 24px 18px 0; }
  .message.assistant { grid-template-columns: 26px 1fr; gap: 10px; }
  .assistant-symbol { width: 25px; }
  .source-item { flex-wrap: wrap; }
  .access-panel { margin: 20px auto; padding: 24px; }
  .access-panel h1 { font-size: 32px; }
  .access-panel form { max-width: none; }
  .support-panel { padding: 24px; }
  .support-layout { display: block; }
  .support-history { margin-top: 32px; border-left: 0; border-top: 1px solid var(--line); padding: 24px 0 0; }
  .support-panel h1 { font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
