/* Shared reading typography and a compact paper discussion workspace. */
.search-app { font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif; color: var(--workspace-text, #22344f); -webkit-font-smoothing: antialiased; }
.search-app button, .search-app input, .search-app select, .search-app textarea { font-family: inherit; }
.header-search:empty { display: none; }
.search-app:not([data-page="home"]) .site-header { height: var(--workspace-header-height); padding-top: 8px; padding-bottom: 8px; gap: 18px; }
.search-app:not([data-page="home"]) .header-rule { display: none; }
.header-search { flex: 1; min-width: 0; }
.search-app .header-search > .query-form { margin: 0; min-height: 46px; padding: 4px 6px 4px 14px; gap: 14px; border-radius: 11px; }
.search-app .header-search textarea { min-height: 28px; max-height: 28px; font-size: 15px; resize: none; }
.search-app .header-search .query-actions { gap: 9px; }
.search-app .header-search .search-submit { min-height: 36px; min-width: 87px; padding: 7px 13px; font-size: 13px; }
.search-app .header-search .search-mode-trigger { min-height: 36px; font-size: 12px; }
.search-app .results-layout { height: calc(100svh - var(--workspace-header-height)); padding-bottom: 10px; }
.search-app:not([data-page="home"]) .site-header .account-dock { display: block; position: relative; inset: auto; flex: none; }
.site-header .account-avatar { width: 37px; height: 37px; box-shadow: none; background: #ffffffb3; }
.search-app[data-page="results"] .account-avatar { color: var(--workspace-accent); border-color: var(--workspace-border); }
.site-header .account-menu { top: 48px; right: 0; left: auto; bottom: auto; }
.compact-paper .paper-title { font-size: 14px; font-weight: 600; line-height: 1.55; color: #243753; letter-spacing: .01em; }
.compact-paper .paper-translation { font-size: 12px; line-height: 1.65; color: #5b6f89; }
.search-app .paper-byline, .search-app .paper-meta, .search-app .preview-meta { color: var(--workspace-muted, #687d98); }
.reader-scroll > h2 { font-size: 17px; line-height: 1.6; color: var(--workspace-ink, #1b304c); }
.search-app .reader-abstract .abstract-text, .search-app .reader-insight .summary-text, .reading-markdown { font-size: 14px; color: var(--workspace-text, #3f536e); line-height: 1.9; white-space: normal; overflow-wrap: anywhere; }
.reading-markdown > :first-child { margin-top: 0; }
.reading-markdown > :last-child { margin-bottom: 0; }
.reading-markdown p { margin: 0 0 1em; }
.reading-markdown :is(h1,h2,h3,h4,h5,h6) { font-size: 1.06em; font-weight: 600; line-height: 1.55; color: var(--workspace-ink, #1e3b5d); margin: 1.4em 0 .55em; }
.reading-markdown :is(h1,h2) { font-size: 1.15em; }
.reading-markdown :is(ul,ol) { padding-left: 1.6em; margin: .6em 0 1em; }
.reading-markdown li { padding-left: .2em; margin: .35em 0; }
.reading-markdown li p { margin: .25em 0; }
.reading-markdown strong { font-weight: 600; color: var(--workspace-ink, #253d5d); }
.reading-markdown blockquote { margin: 1em 0; padding: .65em 1em; border-left: 3px solid #b7d6fa; background: #f5f9ff; }
.reading-markdown pre { overflow-x: auto; padding: 12px 14px; border: 1px solid #e2ebf5; border-radius: 8px; background: #f6f9fd; white-space: pre; font-size: 12px; }
.reading-markdown code { font-family: "SFMono-Regular", Consolas, monospace; font-size: .9em; }
.reading-markdown :not(pre) > code { padding: .1em .35em; border-radius: 4px; background: #edf3fa; }
.reading-markdown table { display: block; overflow: auto; max-width: 100%; border-collapse: collapse; font-size: .92em; margin: 1em 0; }
.reading-markdown :is(th,td) { padding: .5em .8em; border: 1px solid #dce6f2; text-align: left; }
.reading-markdown th { background: #f2f7fd; font-weight: 600; }
.reading-markdown a { color: var(--workspace-accent, #1876d3); text-decoration: underline; text-underline-offset: 3px; }
.reading-markdown hr { border: 0; border-top: 1px solid #e1eaf5; margin: 1.5em 0; }
.reading-markdown .katex { font-size: 1.08em; }
.reading-markdown .katex-display { max-width: 100%; overflow-x: auto; overflow-y: hidden; padding: .4em 0; margin: .7em 0; }
.reading-markdown .formula-fallback { font-family: Consolas, monospace; font-size: .9em; }
.reader-footer { min-height: 29px; padding: 5px 21px; font-size: 10px; background: #fff; }
.reader-tabs { gap: 21px; }
.chat-composer { flex: none; padding: 8px 12px 10px; border-top: 1px solid #d3e3f6; background: linear-gradient(180deg, #f8fbff, #f0f7ff); }
.chat-form { position: relative; margin: 0; border: 1px solid var(--workspace-border); border-radius: 12px; background: #fff; box-shadow: 0 2px 5px #2353800c; }
.chat-form:focus-within { border-color: #5599ee; box-shadow: 0 0 0 2px #dcecff; }
.chat-form .query-field { display: block; padding: 8px 12px 0; min-height: 36px; }
.search-app .chat-form textarea { display: block; width: 100%; min-height: 105px; max-height: 112px; padding: 0; border: 0; outline: 0; resize: none; font-size: 13px; line-height: 1.7; color: var(--workspace-ink); background: transparent; border-radius: 0; box-shadow: none; }
.chat-form textarea::placeholder { color: #5e7591; opacity: 1; }
.chat-actions { display: flex; align-items: center; justify-content: space-between; gap: 7px; padding: 3px 6px 5px 12px; }
.chat-quota { font-size: 10px; color: var(--workspace-muted); line-height: 1.6; flex: 1; }
.chat-actions .query-submit-tools { gap: 6px; flex: none; }
.search-app .chat-send { border: 0; border-radius: 9px; background: var(--workspace-accent); color: #fff; min-width: 34px; width: auto; min-height: 31px; height: 31px; padding: 0 11px; font-size: 20px; box-shadow: 0 2px 6px #0868e820; }
.search-app .chat-send:hover:not(:disabled) { background: var(--workspace-accent-hover); }
.chat-send[aria-label="登录后讨论"] { font-size: 12px; }
.chat-send:disabled { opacity: .42; }
.chat-actions .voice-trigger { width: 31px; height: 31px; min-width: 31px; padding: 6px; border-radius: 8px; border-color: var(--workspace-border); color: #315f9b; box-shadow: 0 1px 3px #2353800c; background: #f7fbff; }
.chat-stop { border: 1px solid #d7e4f5; border-radius: 7px; background: #f7faff; color: #3e6395; font-size: 11px; padding: 6px 9px; }
.chat-form .voice-panel { padding: 0; min-height: 96px; }
.chat-form .voice-wave { height: 40px; }
.chat-form .voice-heading { font-size: 11px; }
.chat-form .voice-actions { gap: 12px; }
.chat-form .voice-stop, .chat-form .voice-cancel { font-size: 11px; padding: 4px 7px; }
.chat-form.voice-active .query-field { min-height: 109px; }
.chat-form .voice-feedback { padding: 0 12px 9px; font-size: 10px; }
.chat-error { font-size: 11px; line-height: 1.65; margin: 8px 3px 0; color: #916541; }
.paper-conversation { padding: 0 0 12px; }
.chat-empty { padding: 15px 0; }
.chat-empty-symbol { display: block; font-size: 27px; color: #378de8; margin-bottom: 15px; }
.chat-empty h3 { font-size: 17px; font-weight: 600; color: #25466d; margin: 0 0 10px; }
.chat-empty p { font-size: 13px; line-height: 1.9; color: var(--workspace-muted); margin-bottom: 22px; }
.chat-suggestion { display: block; width: max-content; max-width: 100%; margin-top: 9px; padding: 8px 12px; border-radius: 8px; border: 1px solid #deebf8; background: #f9fcff; font-size: 12px; color: #53749c; text-align: left; }
.chat-message { margin: 0 0 23px; }
.chat-message-label { color: var(--workspace-muted); font-size: 11px; font-weight: 600; margin-bottom: 8px; }
.chat-message.user .chat-message-content { white-space: pre-wrap; padding: 11px 14px; background: #f0f6ff; border: 1px solid #e4eefb; border-radius: 10px; font-size: 13px; line-height: 1.8; color: #2b4669; }
.chat-context-scope, .chat-partial { font-size: 10px; line-height: 1.6; color: var(--workspace-muted); margin-bottom: 8px; }
.chat-message-content { min-width: 0; }
.api-provider { padding: 10px 12px; border-radius: 8px; background: #edf5ff; color: #4875a4; font-size: 13px; margin: 18px 0; }
.api-dialog .account-close { font-size: 23px; line-height: 1; padding: 1px; }
.api-dialog .account-help { margin-top: 13px; }
.detail-grid .paper-reader { max-height: 880px; }
.detail-grid .reader-scroll { overflow: auto; }
@media (max-width: 1100px) {
  .search-app:not([data-page="home"]) .site-header { gap: 15px; }
  .search-app .header-search .search-mode-trigger { padding-inline: 9px; }
  .reader-header { padding-inline: 16px; }
  .reader-tabs { gap: 15px; }
  .reader-scroll { padding: 14px 16px; }
}
@media (max-width: 900px) {
  .search-app .results-layout { height: auto; }
  .result-preview { height: max(560px, calc(100svh - 24px)); }
  .chat-composer { padding: 8px 12px 10px; }
}
@media (max-width: 640px) {
  .search-app:not([data-page="home"]) .site-header { height: auto; min-height: 108px; flex-wrap: wrap; padding: 10px 12px; gap: 8px; }
  .header-search { order: 3; flex-basis: 100%; }
  .search-app:not([data-page="home"]) .site-header .account-dock { margin-left: auto; }
  .search-app .header-search > .query-form { flex-wrap: nowrap; gap: 5px; padding: 7px 8px 7px 11px; }
  .search-app .header-search .query-field { flex-basis: auto; gap: 7px; }
  .search-app .header-search .query-actions { width: auto; gap: 5px; }
  .header-search .query-icon, .header-search .mode-icon, .header-search .search-submit .ui-icon { display: none; }
  .search-app .header-search .search-mode-trigger { font-size: 11px; padding-inline: 6px; }
  .search-app .header-search .search-submit { min-width: 48px; padding-inline: 9px; }
  .search-app .header-search textarea { font-size: 14px; }
  .chat-actions .voice-trigger, .search-app .chat-send { min-width: 36px; min-height: 36px; }
  .chat-quota { font-size: 10px; }
  .reader-tabs { gap: 19px; }
}
