.icon-definitions { position: absolute; overflow: hidden; pointer-events: none; }
.workspace-open { overflow: hidden; }
.workspace {
  --ws-green: #00d97d;
  --accent: var(--ws-green);
  --ws-line: #ffffff1c;
  --ws-border: #dce4df;
  --ws-muted: #a4ada7;
  --rail-width: 76px;
  position: fixed; inset: 0; z-index: 4; display: flex;
  height: 100vh; height: 100dvh; background: #080b0b99;
  color: #edf2ef; font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.workspace button, .workspace a, .workspace input, .workspace textarea { touch-action: manipulation; }
.workspace button, .workspace a { transition: color .18s, background .18s, border-color .18s; }
.workspace button:focus-visible, .workspace a:focus-visible { outline-offset: 4px; }
.workspace :is(input, textarea):focus-visible { outline: 1px solid var(--ws-green); outline-offset: 3px; }
.workspace .status-dot { width: 5px; height: 5px; background: var(--ws-green); box-shadow: none; }
.ws-icon { display: block; width: 22px; height: 22px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* 结构分隔线保持轻；操作与输入使用清晰的直角描边。 */
.workspace-rail { flex: 0 0 var(--rail-width); display: flex; flex-direction: column; align-items: center; padding: 108px 10px max(24px, env(safe-area-inset-bottom)); border-right: 1px solid var(--ws-line); background: #080b0bcc; }
.rail-pages, .rail-bottom { display: flex; flex-direction: column; align-items: center; width: 100%; gap: 13px; }
.rail-bottom { margin-top: auto; gap: 12px; }
.rail-button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 54px; min-height: 66px; padding: 10px 0; border: 1px solid transparent; border-radius: 0; background: transparent; color: #b0b8b3; }
.rail-button > span { font-size: 12px; font-weight: 500; }
.rail-button:hover { border-color: #ffffff40; color: #fff; }
.rail-button.is-active { color: #05140c; background: var(--ws-green); border-color: var(--ws-green); }
.rail-utility { min-height: 42px; height: 42px; }
.rail-utility[aria-pressed="true"] { color: #758078; }
.workspace-body { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.workspace-header { flex: 0 0 80px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 32px; border-bottom: 1px solid var(--ws-line); background: #080b0b9c; }
.workspace-breadcrumb, .workspace-actions { display: flex; align-items: center; gap: 12px; min-width: 0; }
#workspace-title { margin: 0; font-size: 20px; font-weight: 500; letter-spacing: 0; white-space: nowrap; outline: none; }
.ws-button, .ws-icon-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 9px 17px; border: 1px solid var(--ws-border); border-radius: 0; background: transparent; color: #edf2ef; text-decoration: none; font-size: 14px; font-weight: 500; white-space: nowrap; }
.ws-button .ws-icon { width: 19px; height: 19px; }
.ws-button:hover, .ws-icon-button:hover { border-color: var(--ws-green); color: var(--ws-green); }
.ws-button[aria-expanded="true"] { border-color: var(--ws-green); color: var(--ws-green); }
.ws-icon-button { width: 36px; height: 36px; min-height: 36px; padding: 7px; border-color: transparent; }

.resume-layout { display: flex; flex: 1; min-height: 0; }
.resume-sidebar { display: flex; flex: 0 0 248px; flex-direction: column; min-height: 0; overflow-y: auto; padding: 37px 20px; border-right: 1px solid var(--ws-line); background: #080b0bcc; }
.resume-sidebar-heading { margin: 0 12px 29px; }
.resume-sidebar-heading h2 { margin: 0; color: #edf2ef; font-size: 19px; font-weight: 500; }
.resume-categories { display: flex; flex-direction: column; gap: 10px; }
.category-button { display: flex; align-items: center; gap: 13px; width: 100%; min-height: 51px; padding: 11px 13px; border: 1px solid transparent; border-radius: 0; background: transparent; text-align: left; color: #c5ccc8; font-size: 15px; font-weight: 500; }
.category-index { color: #848e87; font-size: 11px; font-variant-numeric: tabular-nums; }
.category-arrow { margin-left: auto; opacity: 0; }
.category-button:hover { border-color: #ffffff40; color: #fff; }
.category-button.is-active { color: #05140c; background: var(--ws-green); border-color: var(--ws-green); }
.category-button.is-active .category-index { color: #05140c99; }
.category-button.is-active .category-arrow { opacity: 1; }
.resume-content { flex: 1; min-width: 0; overflow-y: auto; overscroll-behavior: contain; padding: clamp(38px, 5vw, 72px) clamp(32px, 5.5vw, 88px) 50px; outline: none; }
.resume-document { max-width: 920px; margin-inline: auto; }
.resume-section-head { margin-bottom: 35px; }
.resume-section-head h2 { margin: 0; color: #edf2ef; font-size: clamp(30px, 3.3vw, 44px); font-weight: 500; line-height: 1.35; letter-spacing: -.7px; }
.profile-hero { position: relative; padding: 40px; border: 1px solid #dce4df70; background: #080b0b40; }
.profile-hero::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 16px; height: 16px; border-right: 2px solid #edf2ef; border-bottom: 2px solid #edf2ef; }
.profile-name { margin: 0 0 14px; color: #edf2ef; font-size: clamp(36px, 3.8vw, 52px); font-weight: 500; letter-spacing: -1px; line-height: 1.3; overflow-wrap: anywhere; }
.profile-focus { margin: 0; color: #cbd2ce; font-size: 18px; }
.profile-summary { max-width: 640px; margin: 26px 0 0; color: #aeb9b2; font-size: 16px; line-height: 1.9; }
.profile-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 30px 0 0; border-top: 1px solid var(--ws-line); border-bottom: 1px solid var(--ws-line); }
.profile-facts > div { padding: 23px 24px; border-right: 1px solid var(--ws-line); }
.profile-facts > div:first-child { padding-left: 0; }
.profile-facts > div:last-child { border: 0; }
.profile-facts dt { margin: 0 0 10px; color: var(--ws-muted); font-size: 13px; }
.profile-facts dd { margin: 0; color: #edf2ef; font-size: 16px; overflow-wrap: anywhere; }
.skill-block, .project-block { padding: 28px 0; border-top: 1px solid #ffffff30; }
.section-row { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; }
.section-row h3, .section-row h4 { margin: 0; min-width: 0; color: #edf2ef; font-size: 22px; font-weight: 500; overflow-wrap: anywhere; }
.project-group + .project-group { margin-top: 34px; }
.project-group-title { margin: 0 0 15px; color: #b6c0b9; font-size: 16px; font-weight: 500; }
.project-block .section-row { flex-wrap: wrap; }
.project-block .section-row h4 { flex: 1 1 320px; }
.section-date { white-space: nowrap; }
.section-number, .section-date { color: var(--ws-muted); font-size: 13px; }
.skill-block p, .project-block p { margin: 13px 0 20px; color: #b6c0b9; line-height: 1.9; font-size: 16px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }
.resume-tag { display: inline-block; padding: 6px 12px; border: 1px solid #dce4df65; background: transparent; color: #cbd2ce; font-size: 13px; }
.project-role { margin: 9px 0 0 !important; color: var(--ws-muted) !important; font-size: 14px !important; }
.project-highlights { margin: 21px 0 0; padding-left: 20px; color: #d1d9d4; font-size: 16px; line-height: 1.9; }
.project-highlights li::marker { color: #b6c0b9; }
.education-list { padding-left: 21px; border-left: 1px solid #dce4df80; }
.education-item { position: relative; padding: 0 0 28px 17px; }
.education-item::before { content: ""; position: absolute; left: -26px; top: 8px; width: 9px; height: 9px; background: var(--ws-green); }
.education-item h3 { margin: 12px 0 12px; font-size: 26px; font-weight: 500; }
.education-item p { margin: 16px 0 0; color: #b6c0b9; font-size: 16px; line-height: 1.9; }
.education-degree { color: #d1d9d4; font-size: 17px; }

.chat-layout { position: relative; display: flex; flex: 1; min-width: 0; min-height: 0; }
.connection-panel { z-index: 12; flex: 0 0 320px; display: flex; flex-direction: column; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 36px 28px; border-right: 1px solid var(--ws-line); background: #080b0be0; }
.connection-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 30px; }
.connection-heading h2 { margin: 0; font-size: 22px; font-weight: 500; }
.connection-target { padding: 10px 0; color: var(--ws-green); font-size: 15px; }
.connection-status { display: flex; align-items: center; gap: 9px; margin: 18px 0 32px; color: #b6c0b9; font-size: 13px; }
.connection-status:not([data-state="connected"]) .status-dot { background: #cbb69c; }
.config-label { display: block; margin: 23px 0 11px; color: #edf2ef; font-size: 16px; font-weight: 500; }
.config-input { display: block; width: 100%; height: 54px; padding: 0 13px; border: 2px solid var(--ws-border); border-radius: 0; background: #080b0b55; color: #edf2ef; font: inherit; font-size: 15px; outline: none; transition: border-color .18s; }
.config-input::placeholder { color: #9da9a1; font-size: 14px; }
.config-input:hover { border-color: #fff; }
.config-input:focus { border-color: var(--ws-green); }
.config-hint { margin: 10px 0 26px; color: var(--ws-muted); font-size: 12px; line-height: 1.8; }
.config-secret { position: relative; }
.config-secret .config-input { padding-right: 59px; }
.config-secret button { position: absolute; top: 2px; right: 4px; height: 50px; padding: 0 10px; border: 0; background: transparent; color: #bbc6bf; font-size: 12px; }
.config-secret button:hover { color: var(--ws-green); }
.config-save { width: 100%; min-height: 52px; justify-content: space-between; padding: 12px 17px; border: 2px solid var(--ws-green); color: #05140c; background: var(--ws-green); font-size: 16px; }
.config-save:hover { color: #05140c; background: #28e892; border-color: #28e892; }
.config-save:disabled { opacity: .65; cursor: wait; }
.connection-message { margin: 16px 0 0; color: #cbb69c; font-size: 13px; line-height: 1.8; }
.connection-message:empty { display: none; }
.chat-main { display: flex; flex: 1; flex-direction: column; min-width: 0; min-height: 0; }
.conversation-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.chat-empty { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 28px; width: min(880px, 100%); min-height: 100%; margin: 0 auto; padding: 48px 40px; }
.chat-empty h2 { margin: 0; color: #edf2ef; font-size: clamp(34px, 4vw, 54px); font-weight: 500; line-height: 1.4; letter-spacing: -1px; }
.sample-question { max-width: 100%; white-space: normal; text-align: left; }
.conversation { width: min(880px, 100%); margin: 0 auto; padding: 36px 40px; }
.conversation:empty { display: none; }
.chat-message { margin-bottom: 36px; }
.message-heading { display: flex; align-items: center; gap: 11px; margin-bottom: 17px; font-size: 14px; }
.message-avatar { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid #dce4df; color: #edf2ef; font-size: 14px; font-weight: 500; }
.message-label { color: #edf2ef; font-weight: 500; }
.message-badge { color: var(--ws-muted); font-size: 12px; }
.message-badge:empty { display: none; }
.message-content { margin: 0; color: #e0e7e2; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; line-height: 1.9; }
.chat-message.is-user { width: fit-content; max-width: 88%; margin-left: auto; margin-bottom: 28px; padding: 12px 18px; border: 1px solid #ffffff06; border-radius: 20px; background: #1b1f1ee8; }
.is-user .message-heading { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.is-user .message-label { color: var(--ws-muted); font-size: 13px; }
.is-user .message-content { color: #cbd3ce; line-height: 1.65; }
.message-footer { margin-top: 17px; }
.message-copy { display: inline-flex; align-items: center; gap: 7px; padding: 5px 0; border: 0; background: transparent; color: var(--ws-muted); font-size: 12px; }
.message-copy .ws-icon { width: 15px; height: 15px; }
.message-copy:hover { color: #fff; }
.message-note { margin: 12px 0 0; color: #cbb69c; font-size: 13px; }
.chat-answer { white-space: normal; }
.chat-answer p { margin: 0 0 16px; white-space: pre-wrap; }
.chat-answer :is(h2, h3, h4, h5, h6) { margin: 24px 0 14px; color: #edf2ef; font-weight: 500; line-height: 1.5; }
.chat-answer h2 { font-size: 23px; }
.chat-answer h3 { font-size: 20px; }
.chat-answer :is(ul, ol) { margin: 0 0 18px; padding-left: 26px; }
.chat-answer li { margin-bottom: 8px; }
.chat-answer code { padding: 2px 5px; border-radius: 3px; background: #ffffff0b; font: .9em ui-monospace, SFMono-Regular, Consolas, monospace; }
.chat-answer pre { max-width: 100%; overflow-x: auto; padding: 16px; border: 1px solid var(--ws-line); background: #080b0b99; white-space: pre; }
.chat-answer pre code { padding: 0; background: none; line-height: 1.7; }
.chat-answer a { color: var(--ws-green); }
.chat-answer blockquote { margin: 16px 0; padding-left: 15px; border-left: 2px solid var(--ws-green); color: var(--ws-muted); }
.chat-answer hr { margin: 22px 0; border: 0; border-top: 1px solid var(--ws-line); }
.chat-table { max-width: 100%; overflow-x: auto; margin-bottom: 20px; }
.chat-table table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
.chat-table :is(td, th) { padding: 12px; border-bottom: 1px solid var(--ws-line); vertical-align: top; }
.chat-table th { color: var(--ws-muted); font-weight: 500; }
.is-pending .message-content { color: var(--ws-muted); font-size: 14px; }
.is-pending .message-avatar { animation: chat-pulse 1s ease-in-out infinite alternate; }
.rag-citation { padding: 0 3px; border: 0; background: transparent; color: var(--ws-green); font-size: 12px; line-height: 1.8; }
.rag-citation:hover { color: #fff; text-decoration: underline; }
.rag-sources { padding: 12px 0; border-top: 1px solid #ffffff26; border-bottom: 1px solid #ffffff26; color: var(--ws-muted); font-size: 12px; }
.rag-sources summary { cursor: pointer; overflow-wrap: anywhere; }
.rag-sources summary:hover { color: #edf2ef; }
.rag-source-list { margin: 17px 0 0; padding-left: 24px; }
.rag-source-item { padding: 4px 0 12px 5px; scroll-margin-block: 18px; }
.rag-source-item::marker { color: var(--ws-green); }
.rag-source-item h3 { margin: 0 0 5px; color: #d9e2dc; font-size: 13px; font-weight: 500; }
.rag-source-item p { margin: 0; }
.composer-area { flex-shrink: 0; width: min(880px, 100%); margin-inline: auto; padding: 0 40px max(22px, env(safe-area-inset-bottom)); }
.question-form { padding: 14px 18px 12px; border: 1px solid #ffffff12; border-radius: 24px; background: #1b1f1ef2; box-shadow: 0 4px 22px #00000012; transition: border-color .18s, box-shadow .18s; }
.question-form:hover { border-color: #ffffff20; }
.question-form:focus-within { border-color: #ffffff38; box-shadow: 0 0 0 1px #ffffff05; }
#question-input { display: block; width: 100%; min-height: 28px; max-height: 180px; resize: none; padding: 0; border: 0; outline: none; background: transparent; color: #d7ded9; font: inherit; font-size: 16px; line-height: 1.65; overflow-y: auto; }
#question-input:focus-visible { outline: none; }
#question-input::placeholder { color: #8d9991; }
#question-input:disabled { cursor: not-allowed; }
.composer-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.composer-mode { display: inline-flex; align-items: center; gap: 8px; color: #99a69e; font-size: 12px; white-space: nowrap; }
.composer-mode:not([data-state="connected"]) .status-dot { background: #cbb69c; }
.composer-controls { display: flex; align-items: center; gap: 14px; }
.composer-hint { color: #8d9991; font-size: 11px; }
.question-send { display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; padding: 0; border: 0; border-radius: 50%; background: #cbd3ce; color: #161c18; }
.question-send .ws-icon { width: 20px; height: 20px; }
.question-send:hover { background: #edf2ef; }
.question-send:disabled { opacity: 1; background: #343d37; color: #8d9991; cursor: not-allowed; }
.stop-glyph { display: none; width: 12px; height: 12px; background: currentColor; }
.question-send[data-busy="true"] .send-glyph { display: none; }
.question-send[data-busy="true"] .stop-glyph { display: block; }
.chat-notice { margin: 12px 0 0; color: #a4ada7; font-size: 12px; line-height: 1.7; text-align: center; }
.chat-notice:empty { display: none; }
.connection-backdrop { position: absolute; inset: 0; z-index: 11; border: 0; background: #000a; cursor: default; }
.workspace-toast { position: absolute; bottom: 30px; left: 50%; z-index: 25; max-width: calc(100% - 36px); transform: translateX(-50%); padding: 12px 20px; border: 1px solid var(--ws-border); background: #080b0b; color: #edf2ef; font-size: 14px; }
.workspace :is(.resume-content, .resume-sidebar, .connection-panel, .conversation-scroll, textarea) { scrollbar-width: thin; scrollbar-color: #6d7770 transparent; }
@keyframes chat-pulse { to { opacity: .4; } }

@media (max-width: 1100px) {
  .resume-sidebar { flex-basis: 216px; padding-inline: 14px; }
  .resume-content { padding-inline: 32px; }
  .profile-hero { padding: 30px; }
  .connection-panel { flex-basis: 292px; padding-inline: 22px; }
  .composer-hint { display: none; }
  .section-row { align-items: flex-start; flex-wrap: wrap; gap: 9px; }
}
@media (max-width: 760px) {
  .workspace { --rail-width: 60px; }
  .workspace-rail { padding: calc(84px + env(safe-area-inset-top)) 6px max(18px, env(safe-area-inset-bottom)); }
  .rail-button { width: 46px; min-height: 60px; }
  .rail-button > span { font-size: 11px; }
  .rail-utility { min-height: 40px; }
  .workspace-header { flex-basis: calc(64px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 18px 0; gap: 10px; }
  #workspace-title { font-size: 17px; }
  .workspace-actions { gap: 8px; }
  .workspace-actions .ws-button { width: 36px; min-height: 36px; padding: 7px; }
  .workspace-actions .ws-button > span { display: none; }
  .resume-layout { flex-direction: column; }
  .resume-sidebar { display: block; flex: 0 0 auto; overflow: visible; padding: 0; border-right: 0; border-bottom: 1px solid var(--ws-line); background: #080b0be6; }
  .resume-sidebar-heading { display: none; }
  .resume-categories { flex-direction: row; gap: 7px; overflow-x: auto; padding: 12px 15px; scrollbar-width: none; }
  .resume-categories::-webkit-scrollbar { display: none; }
  .category-button { width: auto; min-height: 36px; flex-shrink: 0; padding: 7px 10px; gap: 7px; font-size: 12px; white-space: nowrap; }
  .category-index { font-size: 10px; }
  .category-arrow { display: none; }
  .resume-content { padding: 30px 22px 36px; }
  .resume-section-head { margin-bottom: 25px; }
  .resume-section-head h2 { font-size: 30px; }
  .profile-hero { padding: 26px 22px; }
  .profile-name { font-size: 32px; }
  .profile-focus { font-size: 15px; }
  .profile-summary { margin-top: 22px; font-size: 14px; }
  .profile-facts { grid-template-columns: 1fr; margin-top: 24px; }
  .profile-facts > div, .profile-facts > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 16px 0; border-right: 0; border-bottom: 1px solid var(--ws-line); }
  .profile-facts dt { flex-shrink: 0; margin: 0; font-size: 12px; }
  .profile-facts dd { max-width: 68%; font-size: 14px; text-align: right; }
  .section-row h3, .section-row h4 { font-size: 20px; }
  .project-block .section-row { flex-direction: column; align-items: flex-start; gap: 7px; }
  .project-block .section-row h4 { flex: initial; }
  .skill-block p, .project-block p, .project-highlights, .education-item p { font-size: 14px; }
  .education-item { padding-left: 7px; }
  .education-item h3 { font-size: 22px; }
  .education-degree { font-size: 15px; }
  .connection-panel { position: absolute; top: 0; bottom: 0; left: 0; width: min(320px, calc(100% - 18px)); padding: 28px 24px max(28px, env(safe-area-inset-bottom)); background: #080b0b; }
  .connection-heading h2 { font-size: 22px; }
  .config-input { font-size: 16px; }
  .chat-empty { padding: 32px 23px; }
  .chat-empty h2 { font-size: 32px; }
  .sample-question { font-size: 12px; padding: 10px 12px; }
  .conversation { padding: 28px 22px; }
  .message-content { font-size: 15px; }
  .message-heading { gap: 8px; font-size: 12px; }
  .message-badge { font-size: 11px; }
  .chat-message.is-user { max-width: 95%; padding: 10px 14px; border-radius: 18px; }
  .rag-title { font-size: 22px; }
  .rag-answer { font-size: 14px; }
  .rag-provenance { gap: 4px 12px; font-size: 11px; }
  .rag-comparison, .rag-comparison tbody, .rag-comparison tr, .rag-comparison th, .rag-comparison td { display: block; width: auto; }
  .rag-comparison thead { display: none; }
  .rag-comparison tr { padding: 18px 0; border-top: 1px solid #ffffff26; }
  .rag-comparison th, .rag-comparison td { padding: 0; border: 0; }
  .rag-comparison th:first-child { width: auto; padding: 0 0 10px; }
  .rag-method-name { display: inline; margin-right: 8px; }
  .rag-comparison td + td { margin-top: 12px; }
  .rag-comparison td::before { content: attr(data-label); display: block; margin-bottom: 4px; color: var(--ws-muted); font-size: 11px; }
  .rag-glossary { line-height: 1.9; }
  .composer-area { padding: 0 17px max(16px, env(safe-area-inset-bottom)); }
  .question-form { padding: 12px 14px 10px; border-radius: 20px; }
  #question-input { font-size: 16px; min-height: 26px; max-height: 120px; }
  .composer-mode { font-size: 11px; }
  .question-send { width: 32px; height: 32px; }
  .chat-notice { font-size: 11px; }
}
@media (max-width: 350px) {
  .workspace-header { padding-inline: 12px; }
  #workspace-title { font-size: 15px; }
  .workspace-actions { gap: 6px; }
  .workspace-actions .ws-button { width: 32px; min-height: 32px; }
  .resume-content { padding-inline: 17px; }
  .profile-hero { padding-inline: 17px; }
  .profile-name { font-size: 27px; }
  .chat-empty h2 { font-size: 27px; }
}
@media (max-height: 560px) {
  .chat-empty { padding-block: 25px; }
  .connection-panel { padding-top: 22px; }
  .workspace-rail { padding-top: 78px; }
}
