:root {
  color-scheme: light;
  --ink: #20231f;
  --muted: #85887f;
  --line: #e4e3dc;
  --paper: #fbfaf7;
  --canvas: #f1f0eb;
  --green: #316247;
  --green-deep: #264e39;
  --sage: #e4ece5;
  --gold: #c38b50;
  --soft-panel: #f4f4ee;
  --field-bg: #fffefa;
  --accent-soft: #e7eee6;
  --assistant-font-size: 15px;
  font-family: 'Microsoft YaHei UI', 'Noto Sans SC', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--canvas); color: var(--ink); min-width: 780px; transition: background-color .18s, color .18s; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
.app-shell { height: 100vh; min-height: 650px; display: flex; flex-direction: column; overflow: hidden; }
.topbar { height: 68px; flex: 0 0 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 26px; background: var(--paper); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 25px; height: 24px; display: flex; align-items: flex-end; gap: 3px; padding: 3px; border: 1px solid #a4b2a3; border-radius: 7px 7px 7px 3px; transform: rotate(-3deg); }
.brand-mark span { display: block; width: 4px; border-radius: 3px; background: var(--green); }
.brand-mark span:nth-child(1) { height: 9px; opacity: .55; }.brand-mark span:nth-child(2) { height: 14px; }.brand-mark span:nth-child(3) { height: 11px; opacity: .75; }
.brand-name { font-family: 'Noto Sans SC', sans-serif; font-size: 19px; line-height: 1; font-weight: 700; letter-spacing: .05em; }
.brand-divider { height: 18px; width: 1px; margin: 0 2px 0 5px; background: #d9d8d0; }
.brand-caption, .eyebrow, .cover-topline, .cover-bottomline, .welcome-kicker { font-family: 'DM Mono', monospace; letter-spacing: .12em; font-size: 9px; color: #999b92; }
.topbar-right { display: flex; align-items: center; gap: 22px; }
.model-status { display: flex; align-items: center; gap: 8px; color: #74776e; font-size: 11px; }
.status-dot { width: 7px; height: 7px; border-radius: 10px; background: #cf9f58; box-shadow: 0 0 0 3px #f4eadb; }
.model-status.connected .status-dot { background: #4e8b63; box-shadow: 0 0 0 3px #e3eee5; }
.model-status.disconnected .status-dot { background: #c56e5f; box-shadow: 0 0 0 3px #f4e5e1; }
.button { border: 0; border-radius: 8px; padding: 10px 15px; font-size: 12px; font-weight: 600; cursor: pointer; transition: transform .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--green); color: #fff; box-shadow: 0 2px 5px #264e3920; }
.button-primary:hover { background: var(--green-deep); }
.button svg { width: 15px; height: 15px; vertical-align: -3px; margin-right: 5px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.workspace { --assistant-width: 430px; min-height: 0; flex: 1; display: grid; grid-template-columns: 214px minmax(350px, 1fr) 8px var(--assistant-width); }
.resize-divider { position: relative; z-index: 2; display: grid; place-items: center; background: #f2f1ec; border-left: 1px solid #e5e4dd; border-right: 1px solid #e5e4dd; cursor: col-resize; touch-action: none; outline: none; }
.resize-divider span { width: 3px; height: 42px; border-radius: 4px; background: #c5c8be; transition: background .15s, height .15s; }
.resize-divider:hover span, .resize-divider:focus-visible span, body.resizing-panels .resize-divider span { height: 64px; background: #66846b; }
body.resizing-panels { cursor: col-resize; user-select: none; }
.paper-rail { background: #f7f6f1; border-right: 1px solid var(--line); padding: 27px 20px 19px; display: flex; flex-direction: column; min-width: 0; }
.rail-label { color: #969990; font-size: 10px; letter-spacing: .08em; margin-bottom: 15px; }
.paper-cover { position: relative; height: 190px; width: 142px; background: #dfe7df; border: 1px solid #cfd9cf; border-radius: 3px 9px 9px 3px; box-shadow: 4px 5px 0 #d4d6ce, 7px 9px 14px #44442a11; overflow: hidden; padding: 13px 12px; color: var(--green); }
.paper-cover::after { content: ''; position: absolute; inset: 0 auto 0 5px; width: 1px; background: #bdc9bd; }
.cover-topline { color: #748a77; font-size: 7px; }
.cover-glyph { position: absolute; inset: 57px 19px 44px; display: flex; justify-content: center; align-items: center; gap: 8px; }
.cover-glyph span { width: 17px; border: 1px solid #6d8b71; border-radius: 12px 12px 5px 5px; transform: rotate(-19deg); height: 65px; opacity: .82; }
.cover-glyph span:nth-child(2) { transform: rotate(0); height: 81px; border-radius: 14px 14px 10px 10px; }
.cover-glyph span:nth-child(3) { transform: rotate(19deg); height: 65px; }
.cover-glyph i { position: absolute; width: 88px; height: 1px; background: #9e875e; transform: rotate(-22deg); top: 48%; left: 8%; }
.cover-bottomline { position: absolute; left: 13px; bottom: 11px; color: #58765e; font-size: 7px; line-height: 1.7; }
.paper-info { margin-top: 19px; max-width: 165px; }
.paper-info h1 { font-family: 'Noto Sans SC', sans-serif; font-size: 14px; line-height: 1.6; font-weight: 600; margin: 0 0 6px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.paper-info p { color: #888b82; font-size: 10px; line-height: 1.8; white-space: pre-line; margin: 0; overflow-wrap: anywhere; }
.rail-rule { height: 1px; background: var(--line); margin: 19px 0 15px; }
.reading-progress-head { display: flex; justify-content: space-between; color: #85887f; font-size: 10px; }
.reading-progress-head span:last-child { color: #4d544c; font-family: 'DM Mono', monospace; font-size: 9px; }
.progress-track { height: 3px; background: #e1e1d9; border-radius: 3px; margin-top: 10px; overflow: hidden; }
.progress-track span { display: block; height: 100%; width: 0; background: var(--green); border-radius: inherit; transition: width .2s ease; }
.library-section { margin-top: 19px; min-height: 92px; flex: 1 1 auto; display: flex; flex-direction: column; overflow: hidden; }
.library-head { display: flex; align-items: center; justify-content: space-between; color: #85887f; font-size: 10px; margin-bottom: 8px; }
.library-head span:last-child { font: 9px 'DM Mono', monospace; color: #a0a39a; }
.library-list { display: flex; flex-direction: column; gap: 4px; min-height: 0; overflow-y: auto; padding-right: 2px; }
.library-empty { margin: 3px 0; color: #a0a39a; font-size: 9px; line-height: 1.6; }
.library-paper { display: block; width: 100%; padding: 8px 9px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.library-paper:hover { background: var(--soft-panel); }
.library-paper.active { background: var(--sage); border-color: #d5dfd5; }
.library-paper-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; line-height: 1.5; }
.library-paper-meta { display: block; margin-top: 2px; color: #92968d; font-size: 8px; }
.rail-tip { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 11px 10px; border-radius: 9px; background: #eeeee8; }
.tip-icon { width: 19px; height: 19px; border: 1px solid #b9beb4; border-radius: 5px; color: #777d73; display: grid; place-items: center; font-size: 9px; flex: 0 0 auto; }
.rail-tip p { color: #85887f; font-size: 9px; line-height: 1.65; margin: 0; }
.local-note { display: flex; align-items: center; gap: 7px; margin-top: 12px; color: #9b9d95; font-size: 9px; }
.local-lock { font-size: 10px; color: #6e8872; }
.reader-column { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: #eeede7; position: relative; }
.document-toolbar { height: 49px; flex: 0 0 49px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 19px; border-bottom: 1px solid #e3e1d9; background: #f4f3ee; }
.document-name-wrap { min-width: 0; display: flex; align-items: center; gap: 8px; }
.pdf-badge { color: #9e665d; background: #f1e6e1; font-family: 'DM Mono', monospace; font-size: 8px; padding: 3px 5px; border-radius: 3px; }
.toolbar-filename { color: #777a72; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; max-width: 280px; }
.reader-controls { display: flex; align-items: center; gap: 4px; color: #696d64; }
.icon-button { width: 26px; height: 26px; border: 1px solid transparent; background: transparent; border-radius: 6px; cursor: pointer; color: #767a70; font-size: 18px; line-height: 1; display: grid; place-items: center; }
.icon-button:hover { background: #e8e7e0; border-color: #deddd4; }
.page-counter { display: flex; align-items: center; gap: 6px; font-family: 'DM Mono', monospace; font-size: 10px; color: #8e9088; padding: 0 2px; }
.page-counter input { width: 30px; border: 0; outline: 0; background: transparent; color: #4b5048; text-align: right; font: inherit; }
.control-divider { width: 1px; height: 17px; background: #deddd6; margin: 0 7px; }
.zoom-button { font-size: 16px; }
.zoom-value { width: 34px; font-family: 'DM Mono', monospace; text-align: center; font-size: 8px; color: #888b82; }
.reader-scroll { overflow: auto; min-height: 0; flex: 1; padding: 30px 30px 44px; }
.empty-reader { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px; }
.empty-art { height: 142px; width: 174px; position: relative; margin: 0 auto 12px; display: grid; place-items: center; }
.art-page { position: relative; width: 83px; height: 112px; border: 1px solid #c9ccc2; background: #faf9f4; border-radius: 3px 10px 10px 3px; transform: rotate(-7deg); box-shadow: 9px 8px 0 #d8d9d1; padding: 25px 14px; }
.art-page span { display: block; height: 2px; background: #d6d9cf; border-radius: 2px; margin-bottom: 7px; }
.art-page span:nth-child(2) { width: 75%; }.art-page span:nth-child(3) { width: 89%; }.art-page span:nth-child(4) { width: 53%; }
.art-page i { position: absolute; top: 56px; left: 13px; height: 15px; width: 46px; background: #dce8db; border-radius: 2px; }
.art-spark { position: absolute; right: 20px; top: 15px; color: #b68b53; font-size: 27px; }
.empty-reader .eyebrow { margin: 8px 0 9px; color: #829183; font-size: 8px; }
.empty-reader h2 { margin: 0; font-family: 'Noto Sans SC', sans-serif; font-size: 22px; letter-spacing: .04em; font-weight: 600; }
.empty-copy { color: #85887f; font-family: 'Noto Sans SC', sans-serif; font-size: 11px; line-height: 1.9; margin: 11px 0 19px; }
.empty-reader .button { font-size: 11px; padding: 10px 17px; }.empty-reader .button span { font-size: 14px; margin-left: 6px; }
.page-stage { width: max-content; min-width: 100%; display: flex; justify-content: safe center; align-items: flex-start; }
.pdf-page { position: relative; margin: 0 auto; background: white; box-shadow: 0 3px 18px #292a201b; line-height: 1; overflow: hidden; }
.pdf-page canvas { display: block; }
.text-layer { position: absolute; inset: 0; overflow: hidden; opacity: 1; line-height: 1; transform-origin: 0 0; }
.text-layer span, .text-layer br { color: transparent; position: absolute; white-space: pre; transform-origin: 0 0; cursor: text; }
.text-layer ::selection { background: #b7d8ba9c; }
.text-layer span::selection { background: #b7d8ba9c; }
.selection-bar { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 36px); min-width: 250px; height: 35px; display: flex; align-items: center; gap: 8px; padding: 0 9px; background: #fffefa; border: 1px solid #dcded3; border-radius: 8px; box-shadow: 0 5px 16px #25261e1c; }
.selection-indicator { width: 6px; height: 6px; border-radius: 8px; background: #66846b; flex: 0 0 auto; }
.selection-label { color: #788075; font-size: 9px; flex: 0 0 auto; }
.selection-preview { color: #4d514b; font-size: 9px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; flex: 1; }
.selection-clear { border: 0; background: none; font-size: 16px; color: #9a9c94; cursor: pointer; line-height: 1; }
.assistant-panel { min-width: 0; min-height: 0; background: var(--paper); border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.assistant-head { height: 65px; display: flex; align-items: center; justify-content: space-between; padding: 0 17px; border-bottom: 1px solid #efeee9; }
.assistant-title-block { display: flex; align-items: center; gap: 10px; }
.assistant-icon { width: 28px; height: 28px; border-radius: 8px 8px 8px 3px; display: grid; place-items: center; color: #5f7d64; background: #e8eee5; font-size: 15px; }
.assistant-title-block h2 { font-family: 'Noto Sans SC', sans-serif; margin: 0; font-size: 15px; font-weight: 600; }
.assistant-title-block p { margin: 3px 0 0; font-size: 11px; color: #85887f; }
.reset-button { font-size: 17px; }
.assistant-settings { height: 48px; flex: 0 0 48px; margin: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 6px; border-bottom: 1px solid #edede7; }
.model-select-wrap { display: flex; align-items: center; gap: 8px; position: relative; min-width: 0; }
.model-select-wrap select { appearance: none; border: 0; background: transparent; color: #4f554c; min-width: 0; max-width: 150px; padding: 4px 14px 4px 2px; outline: 0; font-size: 12px; cursor: pointer; }
.model-select-wrap #provider-select { max-width: 115px; }
.model-select-wrap #model-select { max-width: 138px; }
.model-select-wrap select:disabled { color: #a7a9a0; }
.assistant-setting-actions { display: flex; align-items: center; flex: 0 0 auto; }
.assistant-setting-actions .text-button { padding: 5px 4px; }
.select-chevron { position: absolute; pointer-events: none; right: -1px; top: 5px; font-size: 10px; color: #92958c; }
.text-button { border: 0; background: transparent; color: #718374; font-size: 11px; cursor: pointer; padding: 5px; }
.text-button:hover { color: var(--green); }
.assistant-content { flex: 1; min-height: 0; overflow: auto; padding: 18px 19px; }
.welcome-card { background: var(--soft-panel); border: 1px solid var(--line); border-radius: 10px; padding: 17px 15px 7px; }
.welcome-kicker { font-size: 7px; letter-spacing: .13em; color: #959990; display: flex; gap: 6px; align-items: center; }
.welcome-star { color: #b78c55; font-size: 11px; }
.welcome-card h3 { font-family: 'Noto Sans SC', sans-serif; font-size: 19px; line-height: 1.55; letter-spacing: .02em; margin: 13px 0 7px; font-weight: 600; }
.welcome-card > p { font-family: 'Noto Sans SC', sans-serif; color: #74786f; font-size: 13px; line-height: 1.8; margin: 0 0 17px; }
.suggestion-list { border-top: 1px solid #e2e3db; }
.suggestion { border: 0; border-bottom: 1px solid #e5e6df; width: 100%; padding: 13px 0; background: transparent; display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer; font-family: 'Noto Sans SC', sans-serif; color: #555d53; font-size: 12px; }
.suggestion:last-child { border-bottom: 0; }
.suggestion > span { color: #a7a99f; font: 8px 'DM Mono', monospace; }
.suggestion b { margin-left: auto; color: #a6a89e; font-weight: 400; font-size: 11px; transition: transform .15s; }
.suggestion:hover { color: var(--green); }.suggestion:hover b { transform: translate(2px,-2px); color: var(--green); }
.messages { display: flex; flex-direction: column; gap: 12px; margin-top: 13px; }
.message { max-width: 100%; font-family: 'Noto Sans SC', sans-serif; font-size: var(--assistant-font-size); line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.user { align-self: flex-end; padding: 9px 11px; background: var(--accent-soft); color: #385540; border-radius: 9px 9px 2px 9px; max-width: 91%; }
.message.assistant { color: #4a4e47; padding: 1px 2px 4px; }
.message-label { display: block; color: #718071; font: 10px 'DM Mono', monospace; letter-spacing: .08em; margin-bottom: 6px; }
.message-reference { display: inline-block; margin: 5px 4px 0 0; padding: 2px 6px; border-radius: 4px; background: #f0f1eb; color: #778174; font: 8px 'DM Mono', monospace; }
.message.error { color: #9d584b; background: #f8eeeb; border-radius: 7px; padding: 9px 10px; }
.typing { color: #96998f; font-size: 10px; display: flex; align-items: center; gap: 7px; }
.typing-dots { display: inline-flex; gap: 3px; }.typing-dots i { width: 4px; height: 4px; border-radius: 5px; background: #81917e; animation: pulse .8s infinite alternate; }.typing-dots i:nth-child(2) { animation-delay: .2s; }.typing-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes pulse { to { opacity: .25; transform: translateY(-2px); } }
.composer-area { padding: 0 14px 12px; flex: 0 0 auto; }
.library-context-toggle { display: flex; align-items: center; gap: 7px; min-height: 29px; color: #687267; font-size: 10px; cursor: pointer; }
.library-context-toggle input { accent-color: var(--green); margin: 0; }
.library-context-toggle small { color: #a0a39a; font-size: 9px; }
.library-context-picker { border: 0; padding: 0 0 5px 20px; color: var(--green); background: transparent; font: inherit; font-size: 10px; cursor: pointer; }
.library-context-options { display: flex; flex-direction: column; gap: 2px; max-height: 112px; overflow-y: auto; margin: 0 0 7px 20px; padding: 4px 7px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft-panel); }
.library-context-option { display: flex; align-items: center; gap: 7px; min-height: 27px; color: var(--ink); font-size: 10px; cursor: pointer; }
.library-context-option input { flex: 0 0 auto; accent-color: var(--green); }
.library-context-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-actions { display: flex; gap: 6px; margin: 0 0 8px; }
.quick-action { background: #f3f4ee; border: 1px solid #e5e7de; border-radius: 6px; padding: 8px 11px; font-family: 'Noto Sans SC', sans-serif; color: #526653; font-size: 11px; cursor: pointer; }
.quick-action:hover { background: #e9efe8; border-color: #d7e1d6; }
.quick-action span { color: var(--green); font-size: 10px; margin-right: 3px; }
.composer { border: 1px solid var(--line); border-radius: 9px; background: var(--field-bg); padding: 9px 9px 7px 11px; transition: border-color .15s, box-shadow .15s; }
.composer:focus-within { border-color: #9eb39f; box-shadow: 0 0 0 3px #e7eee7; }
.composer textarea { display: block; resize: none; border: 0; outline: 0; background: transparent; color: #333932; width: 100%; min-height: 58px; max-height: 140px; font-family: 'Noto Sans SC', sans-serif; font-size: 13px; line-height: 1.7; }
.composer textarea::placeholder { color: #a3a59c; }
.composer-footer { display: flex; align-items: center; justify-content: space-between; }
.composer-hint { color: #85887f; font-size: 10px; }
.send-button { width: 25px; height: 25px; display: grid; place-items: center; border: 0; border-radius: 7px; color: white; background: var(--green); cursor: pointer; transition: background .15s, transform .15s; }
.send-button:disabled { background: #d8dbd3; cursor: not-allowed; }.send-button:not(:disabled):hover { background: var(--green-deep); transform: translateX(1px); }
.send-button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.privacy-caption { text-align: center; color: #a2a49b; font-size: 8px; margin-top: 9px; }.privacy-caption span { color: #819680; margin-right: 3px; }
.toast { position: fixed; z-index: 10; left: 50%; bottom: 25px; transform: translate(-50%, 10px); background: #303831; color: #fff; border-radius: 7px; padding: 9px 13px; font-size: 10px; opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; box-shadow: 0 4px 16px #1e241f25; }.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.provider-dialog { width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 36px); overflow: auto; padding: 0; border: 1px solid #dedfd6; border-radius: 14px; background: #fbfaf7; color: var(--ink); box-shadow: 0 18px 60px #20231f35; }
.provider-dialog::backdrop { background: #20231f61; backdrop-filter: blur(2px); }
.provider-form { padding: 24px; }
.provider-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.provider-dialog-head .welcome-kicker { margin: 0 0 8px; }
.provider-dialog-head h2 { margin: 0; font-family: 'Noto Sans SC', sans-serif; font-size: 21px; }
.provider-dialog-copy { color: #74786f; font-size: 13px; line-height: 1.7; margin: 12px 0 18px; }
.provider-field { display: grid; gap: 7px; margin: 14px 0; color: #555d53; font-size: 12px; }
.provider-field input { width: 100%; border: 1px solid #dedfd6; border-radius: 8px; outline: none; padding: 11px 12px; background: #fffefa; color: var(--ink); font: 13px 'Segoe UI', 'Microsoft YaHei UI', sans-serif; }
.provider-field input:focus { border-color: #9eb39f; box-shadow: 0 0 0 3px #e7eee7; }
.provider-field[hidden] { display: none; }
.remember-key { display: flex; align-items: center; gap: 8px; margin: 14px 0; color: #61675d; font-size: 12px; cursor: pointer; }
.remember-key input { width: 15px; height: 15px; accent-color: var(--green); }
.provider-warning { margin: 16px 0; padding: 11px 12px; border-radius: 8px; background: #f2f1e9; color: #74786f; font-size: 11px; line-height: 1.65; }
.provider-dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 19px; }
.button-secondary { background: #eceee8; color: #4f6652; }
.button-secondary:hover { background: #e3e9e1; }
@media (max-width: 420px) { .assistant-settings { margin-left: 10px; margin-right: 10px; gap: 2px; }.model-select-wrap { gap: 4px; }.model-select-wrap #provider-select { max-width: 102px; }.model-select-wrap #model-select { max-width: 100px; }.assistant-setting-actions .text-button { padding-left: 3px; padding-right: 3px; }.provider-form { padding: 19px; } }
@media (max-width: 1100px) { .workspace { --assistant-width: 380px; grid-template-columns: 180px minmax(240px, 1fr) 8px var(--assistant-width); }.paper-rail { padding-left: 16px; padding-right: 14px; }.assistant-content { padding-left: 16px; padding-right: 16px; } }
@media (max-width: 900px) { body { min-width: 600px; }.workspace { --assistant-width: 350px; grid-template-columns: minmax(0, 1fr) 8px var(--assistant-width); }.paper-rail { display: none; }.reader-scroll { padding: 22px 16px 40px; }.document-toolbar { padding: 0 12px; } }

.appearance-button { padding: 8px 11px; }
.appearance-dialog { width: min(420px, calc(100vw - 32px)); }
.appearance-select { appearance: none; width: 100%; border: 1px solid var(--line); border-radius: 8px; outline: none; padding: 11px 12px; background: var(--field-bg); color: var(--ink); }
.appearance-range { width: 100%; accent-color: var(--green); }
.appearance-field output { font-variant-numeric: tabular-nums; }
.inline-citation { border: 0; border-radius: 5px; padding: 1px 5px; margin: 0 1px; color: var(--green-deep); background: var(--accent-soft); cursor: pointer; font: 11px 'DM Mono', monospace; vertical-align: baseline; }
.inline-citation:hover, .evidence-jump:hover { text-decoration: underline; }
.evidence-list { margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft-panel); overflow: hidden; }
.evidence-list summary { padding: 8px 10px; cursor: pointer; color: var(--muted); font-size: 11px; }
.evidence-item { padding: 0 10px 10px; }
.evidence-jump { border: 0; padding: 0; background: transparent; color: var(--green); font-size: 11px; cursor: pointer; }
.evidence-quote { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; white-space: pre-wrap; }
.text-layer ::selection, .text-layer span::selection { background: #70b47c9c; }

body[data-theme="light"] { --paper: #ffffff; --canvas: #f4f6f8; --line: #dfe4e8; --ink: #202932; --muted: #697783; --soft-panel: #f7f9fb; --field-bg: #ffffff; --accent-soft: #e5eff9; --green: #3b6c94; --green-deep: #2d5475; --sage: #e5eff9; --gold: #bd8a43; }
body[data-theme="sage"] { --paper: #f3f7f0; --canvas: #e9f0e5; --line: #d5dfd2; --ink: #25352a; --muted: #718173; --soft-panel: #eaf1e7; --field-bg: #f9fcf6; --accent-soft: #dcebd9; --green: #3f7450; --green-deep: #315d40; --sage: #dcebd9; --gold: #b88b4e; }
body[data-theme="dark"] { color-scheme: dark; --paper: #202722; --canvas: #151a17; --line: #37423a; --ink: #e6e9e3; --muted: #a0aaa0; --soft-panel: #29332c; --field-bg: #1b221d; --accent-soft: #33483a; --green: #83b58e; --green-deep: #6c9e77; --sage: #33483a; --gold: #d6aa6e; }
body[data-theme="dark"] .topbar, body[data-theme="dark"] .paper-rail, body[data-theme="dark"] .assistant-panel, body[data-theme="dark"] .document-toolbar { background: var(--paper); color: var(--ink); }
body[data-theme="dark"] .reader-column, body[data-theme="dark"] .reader-scroll, body[data-theme="dark"] .resize-divider { background: var(--canvas); color: var(--ink); }
body[data-theme="dark"] .assistant-title-block p, body[data-theme="dark"] .provider-dialog-copy, body[data-theme="dark"] .welcome-card > p, body[data-theme="dark"] .message.assistant, body[data-theme="dark"] .evidence-quote { color: #c1cac0; }
body[data-theme="dark"] .welcome-card, body[data-theme="dark"] .evidence-list { background: var(--soft-panel); border-color: var(--line); }
body[data-theme="dark"] .composer, body[data-theme="dark"] .appearance-select, body[data-theme="dark"] .provider-field input { background: var(--field-bg); border-color: var(--line); color: var(--ink); }
body[data-theme="dark"] .composer textarea { color: var(--ink); }
body[data-theme="dark"] .provider-dialog { background: var(--paper); border-color: var(--line); color: var(--ink); }
body[data-theme="dark"] .provider-warning { background: var(--soft-panel); color: var(--muted); }
body[data-theme="dark"] .button-secondary { background: #344137; color: #dce8dc; }
body[data-theme="dark"] .message.user { color: #e5f2e7; }
body[data-theme="dark"] .selection-bar { background: var(--paper); border-color: var(--line); }
body[data-theme="dark"] .library-paper { color: var(--ink); }
body[data-theme="dark"] .library-paper.active { border-color: var(--line); }
body[data-theme="dark"] .library-context-toggle { color: #c1cac0; }
body[data-theme="dark"] .library-context-picker { color: #b5d1bd; }
body[data-theme="dark"] .selection-preview, body[data-theme="dark"] .selection-label, body[data-theme="dark"] .model-select-wrap select, body[data-theme="dark"] .page-counter input { color: var(--ink); }
@media (max-width: 600px) { .topbar { padding: 0 12px; }.topbar-right { gap: 8px; }.appearance-button { padding: 7px 8px; font-size: 11px; }.brand-caption { display: none; } }
