@charset "UTF-8";

:root {
  color-scheme: light;
  --canvas: #fafafa;
  --surface: #ffffff;
  --subtle: #f1f2f4;
  --hover: #e9ebee;
  --ink: #202329;
  --muted: #616773;
  --faint: #6a717c;
  --line: #e0e3e8;
  --strong-line: #b4bbc6;
  --accent: #526b8a;
  --button: #252a32;
  --button-text: #ffffff;
  --error-bg: #fff5f3;
  --error-ink: #983e2f;
  --error-line: #ebc8c0;
  --backdrop: #151a2566;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  color: var(--ink);
  background: var(--canvas);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --canvas: #111214;
    --surface: #181a1d;
    --subtle: #1e2125;
    --hover: #282c32;
    --ink: #edeef1;
    --muted: #a3a9b3;
    --faint: #9098a4;
    --line: #2e333a;
    --strong-line: #596370;
    --accent: #9aaec8;
    --button: #e5e8ed;
    --button-text: #191c21;
    --error-bg: #2a1d1c;
    --error-ink: #f0b3a7;
    --error-line: #624039;
    --backdrop: #00000088;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #111214;
  --surface: #181a1d;
  --subtle: #1e2125;
  --hover: #282c32;
  --ink: #edeef1;
  --muted: #a3a9b3;
  --faint: #9098a4;
  --line: #2e333a;
  --strong-line: #596370;
  --accent: #9aaec8;
  --button: #e5e8ed;
  --button-text: #191c21;
  --error-bg: #2a1d1c;
  --error-ink: #f0b3a7;
  --error-line: #624039;
  --backdrop: #00000088;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100svh; }
button, textarea, select { font: inherit; -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: wait; }
a { color: inherit; text-decoration: none; }
button, a, select, summary { touch-action: manipulation; }
button:focus-visible, a:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
svg { display: block; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.skip-link { position: absolute; top: -70px; left: 20px; z-index: 10; background: var(--button); color: var(--button-text); padding: 12px 18px; }
.skip-link:focus { top: 16px; }

.site-header { max-width: 1376px; margin: 0 auto; padding: 27px 42px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 650; letter-spacing: -.7px; }
.brand-mark { width: 32px; height: 32px; }
.brand-caption { display: block; font: 9px/1.4 "Consolas", monospace; letter-spacing: 1.6px; color: var(--muted); margin-top: 4px; }
.header-actions { display: flex; align-items: center; gap: 14px; }
.header-button, .theme-control { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.header-button { padding: 10px 9px; border: 0; background: transparent; border-radius: 6px; }
.header-button:hover { color: var(--ink); background: var(--subtle); }
.header-button > span:first-child:not(:last-child) { font-size: 19px; line-height: 1; }
.header-button svg, .theme-control svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.theme-control { padding-left: 19px; margin-left: 3px; border-left: 1px solid var(--line); }
#theme-select { max-width: 112px; border: 0; background: var(--canvas); color: var(--muted); padding: 8px 2px; cursor: pointer; font-size: 12px; }
.main-shell { max-width: 1104px; margin: 0 auto; padding: 68px 32px 24px; }
.chat-column { min-width: 0; }
.welcome { display: grid; grid-template-columns: minmax(0,1fr) 256px; column-gap: 56px; align-items: center; }
.eyebrow { display: flex; align-items: center; gap: 10px; font: 10px/1.6 "Consolas", monospace; letter-spacing: 1.25px; color: var(--muted); }
.index-number { color: var(--faint); margin-left: 4px; }
.pixel-signal { display: inline-block; flex-shrink: 0; width: 5px; height: 5px; background: var(--accent); box-shadow: 7px 0 var(--accent), 0 7px var(--accent); margin: 0 7px 5px 0; }
h1 { font-size: clamp(40px,4.65vw,64px); font-weight: 600; line-height: 1.3; letter-spacing: -2.2px; margin: 25px 0 22px; }
.hero-emphasis { white-space: nowrap; }
.pixel-period { display: inline-block; width: 10px; height: 10px; background: var(--accent); margin-left: 10px; vertical-align: baseline; }
.hero-description { color: var(--muted); font-size: 14px; line-height: 1.95; margin: 0; }
.profile-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 0; margin-top: 23px; font-size: 11px; color: var(--muted); }
.profile-facts span + span::before { content: "/"; margin: 0 13px; color: var(--strong-line); }
.pixel-card { align-self: stretch; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--line); background: var(--subtle); padding: 17px 18px; color: var(--ink); border-radius: 3px; }
.pixel-card-top, .pixel-card-bottom { display: flex; justify-content: space-between; gap: 10px; align-items: center; font: 9px/1.65 "Consolas", monospace; letter-spacing: 1px; color: var(--muted); }
.pixel-card-top .pixel-signal { width: 3px; height: 3px; box-shadow: 5px 0 var(--accent), 0 5px var(--accent); }
.pixel-portrait { width: 100%; max-height: 220px; margin: 6px auto; }
.pixel-fragment { color: var(--accent); }
.pixel-card-bottom svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.2; }
.suggestions { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin: 40px 0 25px; }
.suggestions button { display: flex; flex-direction: column; gap: 17px; background: transparent; border: 1px solid var(--line); color: var(--ink); padding: 18px 20px; border-radius: 7px; text-align: left; transition: background .15s, border-color .15s; }
.suggestions button:hover { background: var(--subtle); border-color: var(--strong-line); }
.suggestion-meta { width: 100%; display: flex; justify-content: space-between; color: var(--muted); font: 9px/1.3 "Consolas", monospace; letter-spacing: 1px; }
.suggestion-meta > span { font-size: 15px; }
.suggestion-title { font-size: 13px; font-weight: 500; }
.composer { padding: 20px 23px 16px; border: 1px solid var(--strong-line); border-radius: 12px; background: var(--surface); }
.composer:focus-within { border-color: var(--accent); outline: 1px solid var(--accent); outline-offset: 0; }
textarea { display: block; width: 100%; border: 0; outline: none; resize: vertical; min-height: 52px; max-height: 220px; background: transparent; color: var(--ink); font-size: 14px; line-height: 1.8; }
textarea::placeholder { color: var(--faint); }
.composer-footer { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 12px; }
.composer-footer > span { display: flex; align-items: center; color: var(--muted); font-size: 10px; }
.composer-footer .pixel-signal { width: 3px; height: 3px; margin-right: 11px; margin-bottom: 3px; box-shadow: 5px 0 var(--accent), 0 5px var(--accent); }
#send, .primary-button { background: var(--button); color: var(--button-text); border: 0; border-radius: 6px; font-size: 12px; padding: 11px 16px; }
#send { display: flex; align-items: center; gap: 12px; min-height: 38px; }
#send:hover, .primary-button:hover { opacity: .85; }
#send svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.privacy { display: flex; justify-content: space-between; gap: 10px; margin-top: 15px; color: var(--muted); font-size: 10px; line-height: 1.8; }
.privacy button { background: none; border: 0; padding: 0 0 0 8px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.privacy button:hover { color: var(--ink); text-decoration: underline; }
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); margin-top: 50px; padding-top: 20px; color: var(--faint); font: 9px/1.8 "Consolas", monospace; letter-spacing: .8px; }
.site-footer > span:last-child { display: flex; align-items: center; gap: 14px; letter-spacing: 0; }
.footer-divider { margin: 0 9px; }
.site-footer .pixel-signal { width: 3px; height: 3px; box-shadow: 5px 0 var(--accent), 0 5px var(--accent); }

body[data-view="conversation"] .main-shell { max-width: 924px; padding-top: 30px; }
.chat-toolbar { display: flex; justify-content: space-between; align-items: center; padding-bottom: 19px; border-bottom: 1px solid var(--line); margin-bottom: 32px; }
.chat-toolbar > span { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.quiet-button { background: transparent; border: 0; color: var(--muted); font-size: 11px; padding: 9px 10px; border-radius: 5px; }
.quiet-button:hover { background: var(--subtle); color: var(--ink); }
.messages { display: flex; flex-direction: column; gap: 26px; margin-bottom: 30px; }
.message { font-size: 14px; line-height: 1.95; overflow-wrap: anywhere; white-space: pre-wrap; }
.message.user { align-self: flex-end; max-width: 85%; padding: 12px 18px; border: 1px solid var(--line); border-radius: 12px 12px 3px 12px; background: var(--subtle); }
.message.assistant { width: 100%; padding: 3px 0 6px; }
.activity { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 16px 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 12px; }
.message-label { display: flex; align-items: center; gap: 10px; color: var(--muted); font: 10px/1.5 "Consolas", monospace; letter-spacing: 1.3px; margin-bottom: 12px; }
.message-label::before { content: ""; width: 5px; height: 5px; background: var(--accent); box-shadow: 7px 0 var(--accent), 0 7px var(--accent); margin: 0 5px 5px 0; }
.thinking { color: var(--muted); }
.thinking .message-label::before { animation: pulse 1.8s ease-in-out infinite; }
.evidence { margin: 0 0 25px; border: 1px solid var(--line); border-radius: 7px; }
.evidence > summary { padding: 14px 17px; display: flex; justify-content: space-between; gap: 12px; list-style: none; color: var(--muted); font-size: 11px; cursor: pointer; }
.evidence > summary::-webkit-details-marker { display: none; }
.source-count { font: 10px "Consolas", monospace; margin-left: 7px; color: var(--accent); }
.evidence-arrow { font-size: 15px; line-height: 1; }
.evidence[open] .evidence-arrow { transform: rotate(45deg); }
.evidence-body { padding: 0 17px 16px; }
#sources { display: grid; gap: 8px; }
.source-card { background: var(--subtle); padding: 12px 14px; border-radius: 5px; font-size: 12px; line-height: 1.8; }
.source-card summary { cursor: pointer; }
.source-card small { display: block; font-size: 10px; color: var(--muted); margin-top: 5px; }
.source-card p { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; margin-bottom: 0; }
.muted { color: var(--muted); font-size: 12px; }
.metrics { white-space: pre-line; color: var(--muted); font: 10px/1.8 "Consolas", monospace; margin-top: 14px; }
.error { background: var(--error-bg); border: 1px solid var(--error-line); color: var(--error-ink); border-radius: 7px; padding: 14px 17px; font-size: 12px; line-height: 1.8; margin-bottom: 20px; }
.error button { background: none; border: 0; color: inherit; text-decoration: underline; font-size: 12px; padding: 4px 10px; }

dialog { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; width: min(520px,calc(100% - 32px)); max-height: calc(100svh - 48px); padding: 25px; }
dialog::backdrop { background: var(--backdrop); }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.dialog-heading h2 { font-size: 20px; font-weight: 550; margin: 9px 0; letter-spacing: -.5px; }
.icon-button { background: transparent; border: 1px solid var(--line); color: var(--muted); font-size: 22px; line-height: 1; width: 34px; height: 34px; border-radius: 5px; }
.icon-button:hover { color: var(--ink); background: var(--subtle); }
dialog p { color: var(--muted); font-size: 13px; line-height: 1.9; }
#history-dialog { width: min(390px,calc(100% - 32px)); margin: 88px 32px 0 auto; }
.dialog-description { margin: 6px 0 22px; font-size: 11px; }
#thread-list { display: flex; flex-direction: column; gap: 8px; max-height: 50svh; overflow: auto; }
.thread { background: transparent; border: 1px solid var(--line); border-radius: 6px; text-align: left; color: var(--muted); padding: 13px; font-size: 12px; line-height: 1.5; }
.thread.selected { background: var(--subtle); border-color: var(--strong-line); color: var(--ink); }
.thread:hover { background: var(--hover); }

@keyframes pulse { 50% { opacity: .3; } }
@media (max-width: 900px) {
  .main-shell { padding-top: 50px; }
  .welcome { grid-template-columns: minmax(0,1fr) 190px; column-gap: 28px; }
  h1 { font-size: 46px; }
  .pixel-card { padding: 14px; }
  .pixel-portrait { max-height: 180px; }
  .profile-facts { max-width: 410px; line-height: 1.6; }
  .suggestions { gap: 10px; }
  .suggestions button { padding: 17px 14px; }
}
@media (max-width: 620px) {
  .site-header { padding: 18px 20px; gap: 8px; }
  .brand { font-size: 19px; gap: 8px; }
  .brand-mark { width: 25px; height: 25px; }
  .brand-caption { font-size: 7px; letter-spacing: 1px; }
  .header-actions { gap: 4px; }
  .header-button { padding: 9px 7px; min-width: 36px; min-height: 38px; }
  #new-chat > span:last-child { display: none; }
  #new-chat > span:first-child { font-size: 23px; }
  #history-button > span { display: none; }
  .theme-control { margin-left: 3px; padding-left: 9px; }
  .theme-control svg { display: none; }
  #theme-select { font-size: 11px; max-width: 87px; }
  .main-shell { padding: 42px 22px 20px; }
  .welcome { grid-template-columns: 1fr; }
  .eyebrow { font-size: 8px; letter-spacing: 1px; gap: 6px; }
  h1 { font-size: clamp(37px,10.4vw,51px); margin: 22px 0 20px; letter-spacing: -1.5px; }
  .hero-description { font-size: 13px; }
  .profile-facts { margin-top: 20px; gap: 7px 0; font-size: 10px; }
  .profile-facts span + span::before { margin: 0 9px; }
  .pixel-card { display: none; }
  .suggestions { grid-template-columns: 1fr; gap: 9px; margin: 30px 0 22px; }
  .suggestions button { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 15px; }
  .suggestion-meta { width: auto; font-size: 8px; letter-spacing: .8px; }
  .suggestion-meta > span { display: none; }
  .suggestion-title { font-size: 11px; }
  .composer { padding: 17px 17px 13px; }
  textarea { font-size: 14px; }
  .composer-footer { gap: 6px; }
  .keyboard-hint { display: none; }
  .composer-footer > span { font-size: 9px; }
  #send { gap: 9px; font-size: 11px; padding: 10px 12px; }
  .privacy { font-size: 9px; align-items: flex-start; }
  .privacy button { font-size: 9px; }
  .site-footer { margin-top: 35px; font-size: 8px; flex-wrap: wrap; gap: 7px; padding-top: 15px; }
  .site-footer > span:last-child { gap: 12px; }
  body[data-view="conversation"] .main-shell { padding-top: 22px; }
  .chat-toolbar { margin-bottom: 25px; padding-bottom: 14px; }
  .message { font-size: 13px; }
  .message.user { max-width: 90%; padding: 10px 14px; }
  #history-dialog { margin: 80px auto 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
