:root {
  color-scheme: light;
  font-family: "Inter", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 14px;
  color: #20222b;
  --ink: #20222b;
  --muted: #5b6475;
  --line: #e4e8f0;
  --blue: #2f6bff;
  --blue-dark: #1f4fd8;
  --glass: rgba(255, 255, 255, .94);
  --bg: linear-gradient(180deg, #050f3d 0%, #0a2482 20%, #1a55f0 42%, #3f7bff 56%, #8a8dff 72%, #c9a3ff 86%, #f5b4e4 100%);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: #0a2482; background-image: var(--bg); background-attachment: fixed; overflow: hidden; }
[hidden] { display: none !important; }
button, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, textarea:focus-visible { outline: 2px solid #9db8ff; outline-offset: 3px; }
svg { width: 18px; height: 18px; flex: none; display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.glyphs { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.app { position: relative; z-index: 1; height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }

.nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px clamp(16px, 3vw, 36px); color: #fff; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, #3f7bff, #8b6cff); box-shadow: 0 6px 18px -6px rgba(63, 123, 255, .9), inset 0 0 0 1px rgba(255, 255, 255, .25); }
.brand-icon svg { width: 19px; height: 19px; }
.brand strong { font-size: 17px; font-weight: 700; letter-spacing: .02em; }
.new-chat { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 15px; border: 0; border-radius: 10px; background: #fff; color: #1b2240; font-weight: 600; box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .5); transition: transform .15s, box-shadow .15s; }
.new-chat svg { width: 16px; height: 16px; }
.new-chat:hover { transform: translateY(-1px); box-shadow: 0 10px 20px -10px rgba(0, 0, 0, .6); }

.scroll-area { overflow: auto; overscroll-behavior-y: contain; }
.content { max-width: 860px; margin: 0 auto; padding: 0 24px; }

.welcome { padding: clamp(36px, 10vh, 96px) 0 48px; text-align: center; color: #fff; }
h1 { margin: 0; font-weight: 800; line-height: 1.12; text-shadow: 0 6px 30px rgba(5, 15, 61, .35); }
.hero-small { display: block; font-size: clamp(34px, 5.6vw, 64px); letter-spacing: .08em; }
.hero-big { display: block; margin-top: 6px; font-size: clamp(28px, 4.6vw, 54px); letter-spacing: .02em; }
.lead { margin: 18px auto 34px; max-width: 34em; font-size: clamp(14px, 1.5vw, 17px); font-weight: 600; color: rgba(255, 255, 255, .86); text-wrap: balance; }

.hero-slot { max-width: 640px; margin: 0 auto; text-align: left; }
.composer { width: 100%; padding: 4px; border-radius: 22px; background: rgba(219, 232, 255, .82); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 25px 40px -20px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(255, 255, 255, .7); }
.composer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 14px 9px; font-size: 13px; color: #4a5470; }
.composer-tab { display: inline-flex; align-items: center; gap: 6px; padding-bottom: 6px; margin-bottom: -9px; border-bottom: 2px solid #20222b; color: #20222b; font-weight: 650; }
.composer-tab svg { width: 15px; height: 15px; color: var(--blue); }
.composer-hint { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: #6b7590; }
.composer-hint svg { width: 13px; height: 13px; }
.composer-body { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 36px; gap: 10px; align-items: end; padding: 14px 12px 12px 18px; border-radius: 18px; background: #fff; box-shadow: 0 1px 2px rgba(18, 30, 80, .08); }
.composer:focus-within .composer-body { box-shadow: 0 0 0 2px rgba(47, 107, 255, .35); }
.composer textarea { display: block; width: 100%; min-height: 66px; max-height: 180px; resize: none; padding: 0; border: 0; background: none; color: var(--ink); font-size: 15px; line-height: 1.6; }
.composer textarea:focus { outline: none; }
.composer textarea::placeholder { color: #8991a0; }
.send { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 10px; background: linear-gradient(180deg, #4d8bff, #2f6bff); color: #fff; box-shadow: 0 6px 14px -6px rgba(47, 107, 255, .9); transition: transform .15s; }
.send:hover:not(:disabled) { transform: translateY(-1px); }
.send:disabled { background: #e6ebf5; color: #9aa3b5; box-shadow: none; cursor: default; }

.sample-heading { margin: 40px 0 12px; font-size: 13px; font-weight: 650; color: rgba(255, 255, 255, .8); letter-spacing: .06em; }
.suggestions { max-width: 760px; margin: 0 auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; text-align: left; }
.suggestion { min-width: 0; min-height: 76px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 14px; color: #fff; text-align: left; border: 1px solid rgba(255, 255, 255, .22); border-radius: 16px; background: rgba(255, 255, 255, .12); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transition: background .15s, transform .15s, border-color .15s; }
.suggestion:hover { background: rgba(255, 255, 255, .22); border-color: rgba(255, 255, 255, .45); transform: translateY(-2px); }
.topic-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: #fff; }
.topic-icon svg { width: 18px; height: 18px; }
.travel { background: linear-gradient(135deg, #3f7bff, #5aa6ff); }
.safety { background: linear-gradient(135deg, #ff8a4c, #ffb35c); }
.people { background: linear-gradient(135deg, #8b6cff, #b48cff); }
.finance { background: linear-gradient(135deg, #e260c8, #ff8fb8); }
.suggestion-label { min-width: 0; }
.suggestion-label strong, .suggestion-label span { display: block; }
.suggestion-label strong { font-size: 14px; }
.suggestion-label span { margin-top: 3px; font-size: 12.5px; line-height: 1.45; color: rgba(255, 255, 255, .78); overflow-wrap: anywhere; }
.suggestion-arrow { width: 16px; height: 16px; opacity: .7; }

.composer-area { padding: 10px 24px max(16px, env(safe-area-inset-bottom)); }
.composer-area:empty { display: none; }
.composer-area .composer { max-width: 812px; margin: 0 auto; }
.composer-area .composer-head { display: none; }
.composer-area .composer-body { padding: 10px 10px 10px 16px; }
.composer-area textarea { min-height: 26px; }

.messages { padding: 28px 0 16px; }
.exchange + .exchange { margin-top: 26px; }
.question-text { width: fit-content; max-width: 86%; margin: 0 0 14px auto; padding: 11px 16px; color: #fff; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .3); border-radius: 18px 18px 4px 18px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.answer-card { padding: 18px 22px 20px; border-radius: 20px; background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 24px 40px -24px rgba(5, 15, 61, .55), inset 0 0 0 1px rgba(255, 255, 255, .7); }
.answer-label { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-weight: 700; color: #1b2240; }
.answer-label svg { width: 26px; height: 26px; padding: 5px; border-radius: 8px; color: #fff; background: linear-gradient(135deg, #3f7bff, #8b6cff); }
.answer-body { line-height: 1.8; font-size: 14.5px; overflow-wrap: anywhere; }
.plain-answer { white-space: pre-wrap; }
.answer-body > :first-child { margin-top: 0; }
.answer-body > :last-child { margin-bottom: 0; }
.answer-body h1, .answer-body h2, .answer-body h3 { font-size: 16px; line-height: 1.5; margin: 1em 0 .45em; text-shadow: none; }
.answer-body ul, .answer-body ol { padding-left: 24px; }
.answer-body strong { color: #10162e; }
.answer-body pre { white-space: pre-wrap; }
.answer-body table { display: block; max-width: 100%; overflow: auto; border-collapse: collapse; }
.answer-body th, .answer-body td { border: 1px solid var(--line); padding: 6px 10px; }
.answer-body th { background: #eef3ff; }
.answer-body blockquote { margin-left: 0; padding-left: 12px; border-left: 3px solid #b9c9ff; color: var(--muted); }
.pending { color: var(--muted); }
.pending::before { content: ""; display: inline-block; vertical-align: -1px; margin-right: 9px; width: 10px; height: 10px; border: 2px solid #c8d6ff; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error { color: #b3261e; }

.sources { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.sources h2 { margin: 0 0 8px; font-size: 13px; color: var(--muted); letter-spacing: .04em; }
.source-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.source-row { padding: 10px 12px; border-radius: 12px; background: #f5f7fc; border: 1px solid #e8ecf5; }
.source-main { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.source-title { display: flex; align-items: flex-start; gap: 8px; min-width: 0; flex: 1 1 220px; overflow-wrap: anywhere; line-height: 1.55; }
.source-title svg { margin-top: 2px; color: var(--blue); }
.source-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.source-actions button, .retry { min-height: 32px; display: inline-flex; gap: 5px; align-items: center; padding: 4px 11px; border: 1px solid #d5ddf0; border-radius: 9px; color: var(--blue-dark); background: #fff; font-size: 12px; font-weight: 600; transition: background .15s; }
.source-actions button svg, .retry svg { width: 15px; height: 15px; }
.source-actions button:hover, .retry:hover { background: #eef3ff; }
.source-actions .highlight { color: #7a5200; background: #fff6d6; border-color: #f0d68a; }
.source-actions .highlight:hover { background: #ffeeb0; }
.source-actions button:disabled { opacity: .65; cursor: wait; }
.source-notice { margin: 4px 0 0 26px; font-size: 12px; color: var(--muted); }
.source-notice:empty { display: none; }
.retry { margin-top: 10px; }

@media (max-width: 700px) {
  .nav { padding: 10px 14px; }
  .brand-icon { width: 30px; height: 30px; }
  .brand strong { font-size: 15px; }
  .new-chat { min-height: 32px; padding: 0 12px; }
  .content { padding: 0 14px; }
  .welcome { padding-top: 32px; }
  .lead { margin-bottom: 24px; }
  .composer-hint { display: none; }
  .composer-area { padding: 8px 12px max(12px, env(safe-area-inset-bottom)); }
  .answer-card { padding: 14px 15px 16px; }
}

@media (max-width: 520px) {
  .suggestions { grid-template-columns: 1fr; gap: 8px; }
  .suggestion { min-height: 62px; padding: 10px 12px; }
  .sample-heading { margin-top: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .pending::before { animation: none; }
  .suggestion, .new-chat, .send { transition: none; }
}
.source-row { position: relative; }
.has-pop .source-title { cursor: pointer; border-radius: 6px; }
.has-pop .source-title:focus-visible { outline: 2px solid #9db8ff; outline-offset: 2px; }
.pop-count { flex: none; align-self: center; padding: 1px 8px; border-radius: 999px; background: #e6edff; color: var(--blue-dark); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.source-pop { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 8px); display: none; flex-direction: column; max-height: 420px; border-radius: 16px; background: #fff; border: 1px solid #e3e8f3; box-shadow: 0 24px 48px -16px rgba(10, 20, 70, .45), 0 2px 6px rgba(10, 20, 70, .08); overflow: hidden; text-align: left; }
.source-pop::before { content: ""; position: absolute; left: 0; right: 0; height: 12px; top: -12px; }
.pop-up .source-pop { top: auto; bottom: calc(100% + 8px); }
.pop-up .source-pop::before { top: auto; bottom: -12px; }
.has-pop:hover .source-pop, .has-pop:has(.source-title:focus-visible) .source-pop, .has-pop.open .source-pop { display: flex; animation: pop-in .14s ease-out; }
@keyframes pop-in { from { opacity: 0; transform: translateY(4px); } }
.pop-head { display: flex; align-items: center; gap: 8px; padding: 11px 16px; background: #f5f7fc; border-bottom: 1px solid #e8ecf5; font-weight: 650; color: #1b2240; }
.pop-head svg { width: 16px; height: 16px; color: var(--blue); }
.pop-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-list { overflow: auto; padding: 4px 16px; overscroll-behavior: contain; }
.pop-item { padding: 12px 0; }
.pop-item + .pop-item { border-top: 1px solid #eef1f7; }
.pop-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; flex-wrap: wrap; }
.pop-chip { padding: 1px 8px; border-radius: 6px; border: 1px solid #dfe4ee; color: #5b6475; font-size: 12px; font-variant-numeric: tabular-nums; }
.pop-path { color: var(--blue-dark); font-size: 12px; font-weight: 600; }
.pop-text { margin: 0; color: #3a4152; font-size: 13px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) { .source-pop { animation: none !important; } }