:root {
  color-scheme: dark;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  background: #100e1a;
  color: #f3efff;
  --background: #100e1a;
  --sidebar: #151221;
  --panel: #191626;
  --line: #2c263e;
  --muted: #aca3bf;
  --accent: #c5a6ff;
  --accent-ink: #211637;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; display: grid; grid-template-columns: 255px minmax(0, 1fr); height: 100vh; height: 100dvh; overflow: hidden; }
button, input, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
button, input, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[data-icon] svg { width: 20px; height: 20px; display: block; }
.icon-button { background: none; border: 0; border-radius: 9px; color: var(--muted); width: 36px; height: 36px; display: inline-grid; place-items: center; flex: none; }
.icon-button:hover { color: #fff; background: #2b233c; }
.sidebar { min-width: 0; background: var(--sidebar); border-right: 1px solid #262137; display: flex; flex-direction: column; padding: 24px 16px 14px; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 5px; margin-bottom: 34px; }
.brand-icon { width: 43px; height: 43px; flex: none; display: grid; place-items: center; background: #2c2044; color: #d6bfff; border: 1px solid #473463; border-radius: 13px; }
.brand-icon svg { width: 24px; height: 24px; }
.brand strong { display: block; font-size: 19px; font-weight: 750; line-height: 1.25; letter-spacing: .06em; }
.brand strong span { font-size: 11px; letter-spacing: .13em; color: #c2a2ee; padding-left: 4px; }
.brand small, .sidebar-footer small { display: block; color: var(--muted); margin-top: 4px; font-size: .75rem; }
.new-chat { width: 100%; min-height: 46px; display: flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid #b895ee; border-radius: 11px; font-weight: 700; font-size: .91rem; color: var(--accent-ink); background: #c6a7fb; transition: background .18s ease; }
.new-chat:hover { background: #d9c0ff; }
.new-chat svg { width: 17px; height: 17px; }
.history-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 0 0 6px; margin-top: 28px; }
.history-heading h2 { color: var(--muted); font-size: .81rem; font-weight: 600; margin: 0; }
.history-heading svg, .sidebar-footer button svg { width: 17px; height: 17px; }
.history { flex: 1; min-height: 0; overflow: auto; padding: 3px 0; }
.empty-history { color: #a399b8; font-size: .81rem; line-height: 1.65; margin: 8px 6px; }
.history-row { display: flex; border: 1px solid transparent; border-radius: 9px; margin: 0 2px 4px; align-items: center; }
.history-row:hover { background: #201a30; }
.history-row.active { background: #282038; border-color: #3a2a50; }
.history-link { min-width: 0; flex: 1; display: flex; align-items: center; gap: 9px; text-align: left; background: none; border: 0; padding: 10px 2px 10px 8px; font-size: .85rem; border-radius: 8px; }
.history-link span:first-child { color: var(--accent); }
.history-link svg { width: 15px; height: 15px; }
.history-link span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-row button:last-child { width: 30px; height: 32px; margin-right: 3px; opacity: 0; }
.history-row button:last-child svg { width: 15px; height: 15px; }
.history-row:hover button:last-child, .history-row:focus-within button:last-child, .history-row.active button:last-child { opacity: 1; }
.sidebar-footer { display: flex; align-items: center; gap: 9px; padding: 15px 3px 2px 5px; margin-top: 12px; border-top: 1px solid var(--line); }
.sidebar-footer img { flex: none; border-radius: 12px; border: 1px solid #604784; background: #3e2a5a; }
.sidebar-footer div { flex: 1; min-width: 0; }
.sidebar-footer strong { display: block; font-size: .91rem; }
.workspace { display: grid; grid-template-rows: 66px minmax(0, 1fr) auto; min-width: 0; min-height: 0; background: radial-gradient(ellipse at 61% 12%, #1a1328 0%, transparent 58%), var(--background); }
.topbar { border-bottom: 1px solid #292238; display: flex; justify-content: space-between; align-items: center; padding: 0 28px; background: #151121; }
.topbar-title { display: flex; align-items: center; gap: 9px; min-width: 0; }
.topbar-title h1 { font-size: .94rem; margin: 0; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-symbol, .suggest-heading > span { color: var(--accent); }
.topbar-symbol svg { width: 18px; height: 18px; }
.mode { display: flex; align-items: center; gap: 7px; border: 1px solid #453457; border-radius: 20px; background: #222034; color: #d6c6ee; padding: 6px 11px; font-size: .78rem; white-space: nowrap; margin-left: 10px; }
.mode:hover { background: #352747; }
.mode > span:first-child { width: 7px; height: 7px; background: #c2a2ff; border-radius: 50%; }
.mode.connected > span:first-child { background: #8fdbb2; }
.menu-button, .mobile-close { display: none; }
.content-width { width: min(100% - 64px, 920px); margin-inline: auto; }
.chat-scroll { overflow-y: auto; scrollbar-color: #584667 transparent; }
.welcome { padding: clamp(26px, 5.1vh, 54px) 0 24px; }
.hero { position: relative; display: flex; align-items: center; min-height: clamp(230px, 33vh, 310px); border: 1px solid #49385f; border-radius: 22px; overflow: hidden; background-color: #281b3c; background-image: linear-gradient(90deg, #1c122de8, #221532a0 38%, #21143418 69%, transparent), url("./assets/hero.webp"); background-size: cover; background-position: center, center 49%; isolation: isolate; }
.hero-copy { position: relative; z-index: 1; padding: 32px clamp(22px, 4vw, 49px); }
.hero-name { font-size: .77rem; font-weight: 720; letter-spacing: .19em; color: #e0c4ff; display: flex; align-items: center; gap: 8px; }
.hero-name svg { width: 15px; height: 15px; }
.hero h2 { font-size: clamp(2rem, 4.1vw, 3.6rem); font-weight: 800; letter-spacing: -.045em; line-height: 1.22; margin: 12px 0; }
.hero h2 span { color: #e0c0ff; }
.hero p { font-size: clamp(.94rem, 1.2vw, 1rem); line-height: 1.7; color: #e0d5ef; margin: 0; text-wrap: pretty; }
.suggest-heading { display: flex; align-items: center; gap: 8px; margin: clamp(21px, 3.4vh, 34px) 0 12px; }
.suggest-heading h3 { margin: 0; font-size: .93rem; font-weight: 650; }
.suggest-heading svg { width: 17px; height: 17px; }
.suggestions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.suggestion { text-align: left; background: #1a1627; border: 1px solid var(--line); border-radius: 13px; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 73px; padding: 11px 14px; transition: background .18s ease, border-color .18s ease; }
.suggestion:hover { background: #241b34; border-color: #634a83; }
.suggest-icon { display: grid; place-items: center; width: 39px; height: 39px; flex: none; border-radius: 10px; }
.suggest-icon svg { width: 20px; height: 20px; }
.purple { color: #d3adff; background: #35234e; }
.peach { color: #ffd1ad; background: #432b38; }
.pink { color: #ffb6da; background: #45243d; }
.blue { color: #a9c4ff; background: #292f50; }
.suggestion strong { display: block; font-size: .91rem; }
.suggestion small { display: block; font-size: .8rem; color: var(--muted); line-height: 1.4; margin-top: 4px; }
.compose-area { padding: 10px 0 max(12px, env(safe-area-inset-bottom)); background: var(--background); }
.composer { background: #1a1627; border: 1px solid #413450; border-radius: 16px; padding: 11px 12px 9px; }
.composer:focus-within { border-color: #9473be; }
.composer textarea { display: block; width: 100%; resize: none; min-height: 28px; max-height: 144px; padding: 3px 5px; color: inherit; background: transparent; outline: none; border: 0; line-height: 1.45; }
.composer textarea:focus-visible { outline: none; }
.composer textarea::placeholder { color: #b4a8c7; }
.compose-controls { display: flex; justify-content: space-between; align-items: center; margin-top: 3px; gap: 8px; }
.keyboard-hint { color: var(--muted); padding-left: 5px; font-size: .73rem; }
.keyboard-hint span { padding: 0 3px; }
.send-button { margin-left: auto; display: grid; place-items: center; width: 38px; height: 35px; border: 0; border-radius: 10px; background: #c8a6ff; color: #25183c; }
.send-button:hover:not(:disabled) { background: #dfcaff; }
.send-button:disabled { background: #3e2f53; color: #bda3dd; }
.send-button svg { width: 18px; height: 18px; }
.compose-note { margin: 8px 12px 0; text-align: center; color: var(--muted); font-size: .75rem; line-height: 1.45; }
.messages { padding-block: 30px 20px; display: grid; gap: 22px; }
.message { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.message.user { justify-content: flex-end; }
.message-avatar { width: 36px; height: 36px; flex: none; border-radius: 10px; border: 1px solid #684c90; background: #332549; }
.message-body { min-width: 0; max-width: min(740px, 88%); }
.message-name { display: block; font-size: .82rem; color: #d6baf9; margin: 0 0 5px 1px; }
.message-text { margin: 0; padding: 12px 15px; background: #1d182b; border: 1px solid var(--line); border-radius: 5px 13px 13px; line-height: 1.72; white-space: pre-wrap; overflow-wrap: anywhere; }
.user .message-text { background: #322248; border-color: #4c3667; border-radius: 13px 5px 13px 13px; }
.message-tools { display: flex; align-items: center; margin-top: 4px; }
.message-tools svg { width: 15px; height: 15px; }
.inline-status { padding: 10px 0; color: var(--muted); font-size: .9rem; display: flex; align-items: center; gap: 8px; }
.typing-indicator { display: flex; gap: 4px; margin-right: 3px; }
.typing-indicator i { width: 5px; height: 5px; border-radius: 50%; background: #c7a8ff; animation: pulse 1s infinite alternate; }
.typing-indicator i:nth-child(2) { animation-delay: .15s; }
.typing-indicator i:nth-child(3) { animation-delay: .3s; }
@keyframes pulse { from { opacity: .4; } to { opacity: 1; } }
.retry { color: var(--accent); background: #282039; border: 1px solid #493460; border-radius: 8px; padding: 6px 10px; margin-left: 4px; }
.dialog { width: min(100% - 32px, 460px); max-height: 76dvh; border: 1px solid #4c3b62; border-radius: 18px; background: #20192d; color: #f3efff; padding: 19px; box-shadow: 0 12px 50px #06040cbc; }
.dialog::backdrop { background: #0a0710b8; }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin: 0 0 9px; }
.dialog h2 { font-size: 1.12rem; margin: 0; }
.dialog p { color: #c8bed8; line-height: 1.6; font-size: .94rem; }
.dialog input { width: 100%; color: inherit; background: #171220; padding: 10px 11px; border: 1px solid #5c4874; border-radius: 9px; }
.search-results { display: grid; gap: 4px; margin-top: 14px; }
.search-results button { text-align: left; padding: 9px; background: #2a2238; border: 1px solid #3e314f; border-radius: 8px; overflow-wrap: anywhere; }
.search-results button:hover { background: #38294d; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 17px; }
.dialog-actions button { border: 1px solid #5c4874; border-radius: 8px; padding: 8px 12px; }
.secondary-button { background: #2c223a; }
.danger-button { background: #63334a; }
.sidebar-backdrop { display: none; }
@media (max-width: 900px) {
  body { grid-template-columns: 216px minmax(0, 1fr); }
  .content-width { width: calc(100% - 42px); }
}
@media (max-width: 690px) {
  body { display: block; }
  .workspace { height: 100%; grid-template-rows: 54px minmax(0, 1fr) auto; }
  .sidebar { display: none; position: fixed; z-index: 10; inset: 0 auto 0 0; width: min(290px, calc(100% - 44px)); box-shadow: 10px 0 35px #08060d80; }
  .sidebar.open { display: flex; }
  .sidebar-backdrop:not([hidden]) { display: block; position: fixed; z-index: 9; inset: 0; border: 0; background: #0a0710a8; }
  .menu-button, .mobile-close { display: inline-grid; }
  .mobile-close { margin-left: auto; }
  .topbar-symbol { display: none; }
  .topbar { padding: 0 14px 0 8px; }
  .topbar-title { gap: 3px; }
  .history-row button:last-child { opacity: 1; }
  .content-width { width: calc(100% - 28px); }
  .welcome { padding-top: 16px; }
  .hero { min-height: 220px; background-image: linear-gradient(90deg, #1c122dea, #221532b5 44%, #21143427 83%), url("./assets/hero.webp"); background-position: center, 64% 47%; border-radius: 16px; }
  .hero-copy { padding: 25px 16px; width: min(75%, 355px); }
  .hero h2 { font-size: clamp(1.65rem, 5.9vw, 2.5rem); }
  .hero p { font-size: .85rem; }
  .suggestions { gap: 7px; }
  .suggestion { min-height: 69px; padding: 8px; gap: 7px; }
  .suggest-icon { width: 29px; height: 33px; }
  .suggest-icon svg { width: 17px; height: 17px; }
  .suggestion strong { font-size: .84rem; }
  .suggestion small { font-size: .74rem; }
  .compose-area { padding-top: 6px; }
  .keyboard-hint { visibility: hidden; }
  .compose-note { font-size: .71rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.topbar-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.topbar-actions .mode { margin-left: 0; }
.model-button, .account-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-size: .83rem; min-height: 36px; padding: 6px 10px; border-radius: 10px;
  border: 1px solid #443456; background: #221a31; color: #eadbff; white-space: nowrap;
}
.model-button:hover:not(:disabled), .account-button:hover { background: #352648; border-color: #6e528c; }
.model-button:disabled { opacity: .7; }
.model-button svg, .account-button svg { width: 15px; height: 15px; }
.model-button [data-icon="chevron"] { color: var(--muted); }
.account-button { background: #c6a7fb; color: #25183b; border-color: #b895ee; font-weight: 700; }
.account-button:hover { color: #25183b; background: #d9c0ff; border-color: #d9c0ff; }
.model-dialog { width: min(100% - 28px, 504px); }
.model-dialog p { margin: 8px 0 14px; }
.model-list { display: grid; gap: 5px; }
.model-option {
  width: 100%; border-radius: 10px; border: 1px solid transparent; background: none;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 8px 10px; text-align: left;
}
.model-option:hover, .model-option[aria-pressed="true"] { border-color: #543e70; background: #302341; }
.model-option strong { display: block; font-size: .94rem; }
.model-option small { display: block; color: var(--muted); font-size: .76rem; line-height: 1.45; }
.model-option .model-check { display: grid; place-items: center; width: 19px; height: 19px; flex: none; color: var(--accent); }
.model-option .model-check svg { width: 17px; height: 17px; }
.model-option[aria-pressed="false"] .model-check { visibility: hidden; }
.model-option .model-name { flex: 1; }
.account-toggle, .verification-choice { display: flex; gap: 6px; }
.account-toggle { margin: 6px 0 15px; padding: 4px; background: #171221; border-radius: 10px; }
.account-toggle button, .verification-choice button {
  flex: 1; min-height: 36px; background: transparent; border: 1px solid transparent; border-radius: 8px;
  color: var(--muted); font-size: .93rem;
}
.account-toggle button[aria-pressed="true"] { background: #3b2a52; color: #f3efff; }
.verification-choice button { display: flex; align-items: center; justify-content: center; gap: 7px; border-color: #4c3b62; }
.verification-choice button[aria-pressed="true"] { color: #eadbff; border-color: #a37cd5; background: #302343; }
.verification-choice svg { width: 17px; height: 17px; }
.auth-form { display: grid; gap: 7px; }
.auth-form label { display: block; color: #ddd2ed; font-size: .87rem; }
.auth-form input:disabled { opacity: .7; }
#auth-code-field label { margin: 4px 0 7px; }
.auth-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 7px; }
.account-action { border: 1px solid #5c4874; border-radius: 8px; padding: 8px 12px; }
.primary-button { background: #c6a7fb; border-color: #ba97f2; color: #25183b; font-weight: 650; }
.account-action:disabled { opacity: .58; }
.auth-status { margin: 14px 0 0; overflow-wrap: anywhere; }
.auth-status:empty { display: none; }
.account-dialog #signed-in-id { overflow-wrap: anywhere; }
@media (max-width: 690px) {
  .topbar { padding-right: 7px; }
  .topbar-actions { gap: 5px; }
  .model-button, .account-button { padding: 5px 7px; min-height: 33px; font-size: .74rem; }
  .model-button > [data-icon="sparkles"] { display: none; }
  .topbar-actions .mode { padding: 5px 7px; font-size: .70rem; }
  .account-button svg { width: 14px; height: 14px; }
}
@media (max-width: 360px) {
  .account-button > span:first-child { display: none; }
  .model-button > [data-icon="chevron"] { display: none; }
}
