:root {
  color-scheme: light;
  --bg: #fff;
  --rail: #f7f8fb;
  --ink: #252831;
  --sub: #667084;
  --line: #e4e7ed;
  --blue: #4169e7;
  --tint: #eaf0ff;
  --hover: #eff1f6;
  --bubble: #f0f3fb;
  --card: #fff;
  --shadow: 0 5px 20px #1c2b4b09;
  --error: #aa3645;
  font-family: Inter, 'Segoe UI', 'Microsoft YaHei', system-ui, sans-serif;
}
:root.dark {
  color-scheme: dark;
  --bg: #17191e;
  --rail: #1c1f26;
  --ink: #edf0f6;
  --sub: #a9b1c2;
  --line: #343943;
  --blue: #99acff;
  --tint: #26314e;
  --hover: #282d37;
  --bubble: #292f40;
  --card: #20232a;
  --shadow: none;
  --error: #ff9d9f;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
}
button,
input,
textarea {
  font: inherit;
}
button {
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}
button:disabled {
  cursor: default;
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(100%);
  overflow: hidden;
}
.desk {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  overflow: hidden;
}
.desk.folded {
  grid-template-columns: 0 minmax(0, 1fr);
}
.desk.folded aside {
  visibility: hidden;
}
aside {
  display: flex;
  flex-direction: column;
  background: var(--rail);
  border-right: 1px solid var(--line);
  padding: 22px 15px 12px;
  min-width: 0;
  overflow: hidden;
}
.wordmark,
.rail-foot,
.top,
.new,
.compose-tools,
.pill,
.suggestions,
.suggestions button,
.welcome,
nav button,
.dialog-row {
  display: flex;
  align-items: center;
}
.wordmark {
  gap: 9px;
  padding: 2px 6px 22px;
  color: var(--blue);
}
.wordmark strong {
  font-size: 24px;
  letter-spacing: 0.09em;
  line-height: 1;
}
.wordmark .fold {
  margin-left: auto;
}
.icon {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 9px;
  color: var(--sub);
  flex-shrink: 0;
}
.icon:hover,
nav button:hover,
.history button:hover,
.choices button:hover,
.suggestions button:hover,
.pill:hover {
  background: var(--hover);
}
i[data-icon] {
  display: inline-flex;
  flex-shrink: 0;
}
svg.icon-svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.new {
  gap: 10px;
  justify-content: center;
  height: 43px;
  border-radius: 12px;
  background: var(--tint);
  color: var(--blue);
  font-weight: 600;
}
.new:hover {
  filter: brightness(0.97);
}
.rail-label {
  font-size: 13px;
  color: var(--sub);
  margin: 26px 10px 9px;
}
.recent-label {
  margin-top: 24px;
}
nav {
  display: grid;
  gap: 3px;
}
nav button,
.history button {
  width: 100%;
  border-radius: 9px;
  padding: 10px 12px;
  text-align: left;
  font-size: 15px;
}
nav button {
  gap: 12px;
}
nav button[aria-current='true'] {
  background: var(--tint);
  color: var(--blue);
  font-weight: 600;
}
.history {
  flex: 1;
  overflow: auto;
  min-height: 0;
  color: var(--sub);
}
.history p {
  font-size: 14px;
  margin: 6px 11px;
}
.history button {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
}
.history button.current {
  background: var(--hover);
}
.rail-foot {
  border-top: 1px solid var(--line);
  padding: 13px 2px 1px;
  gap: 7px;
  font-size: 14px;
  white-space: nowrap;
}
.rail-foot .avatar {
  background: var(--tint);
  color: var(--blue);
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 650;
}
.rail-foot #theme {
  margin-left: auto;
}
.rail-foot .icon {
  width: 29px;
}
.unfold {
  display: none;
}
.desk.folded .unfold {
  display: inline-grid;
}
main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.top {
  min-height: 60px;
  padding: 0 28px;
  gap: 12px;
}
.top #modeTitle {
  font-size: 16px;
  font-weight: 630;
}
.top-divider {
  height: 14px;
  border-left: 1px solid var(--line);
}
#modeDetail {
  color: var(--sub);
  font-size: 14px;
}
.top #full {
  margin-left: auto;
}
.work {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}
.work.idle {
  justify-content: center;
  padding-bottom: min(12vh, 110px);
}
.scroll {
  overflow: auto;
  flex: 1;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.idle .scroll {
  display: none;
}
.compose-area,
.messages {
  width: min(100% - 64px, 780px);
  margin-inline: auto;
}
.compose-area {
  padding: 10px 0 14px;
}
.welcome {
  justify-content: center;
  gap: 13px;
  margin: 0 0 25px;
}
.welcome h1 {
  font-size: clamp(26px, 3vw, 35px);
  font-weight: 620;
  letter-spacing: -0.045em;
  margin: 0;
}
.compose {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 15px 16px 12px;
  box-shadow: var(--shadow);
}
.compose:focus-within {
  border-color: color-mix(in srgb, var(--blue) 40%, var(--line));
}
.compose textarea {
  display: block;
  resize: none;
  border: 0;
  outline: none;
  width: 100%;
  min-height: 60px;
  max-height: 27vh;
  line-height: 1.6;
  background: transparent;
  color: var(--ink);
  padding: 1px 4px 6px;
}
.compose textarea:focus-visible {
  outline: none;
}
.compose textarea::placeholder {
  color: var(--sub);
}
.compose-tools {
  gap: 8px;
  min-width: 0;
}
.pill {
  border: 1px solid var(--line);
  border-radius: 18px;
  gap: 6px;
  padding: 6px 9px;
  font-size: 14px;
  min-width: 0;
  max-width: 55%;
  height: 34px;
}
.pill span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pill .icon-svg {
  width: 16px;
  height: 16px;
}
.pill i:last-child .icon-svg {
  width: 12px;
}
.thinking {
  color: var(--blue);
  border-color: color-mix(in srgb, var(--blue) 35%, var(--line));
  background: var(--tint);
}
.send,
.primary {
  background: #456ce7;
  color: #fff;
}
.send {
  display: grid;
  place-items: center;
  padding: 0;
  margin-left: auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
}
.send:disabled {
  background: #b8c7f2;
}
.send svg {
  width: 19px;
  height: 19px;
}
.suggestions {
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 17px;
}
.suggestions button {
  gap: 7px;
  font-size: 14px;
  color: var(--sub);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 6px 11px;
}
.suggestions svg {
  width: 15px;
  height: 15px;
}
.error {
  color: var(--error);
  font-size: 14px;
  line-height: 1.5;
  margin: 7px 3px;
}
.error:empty {
  display: none;
}
.messages {
  padding: 24px 0 12px;
}
.turn {
  margin: 0 0 24px;
  overflow-wrap: anywhere;
}
.turn.user {
  display: flex;
  justify-content: flex-end;
}
.user .body {
  background: var(--bubble);
  padding: 12px 17px;
  border-radius: 17px 17px 5px 17px;
  white-space: pre-wrap;
  max-width: 86%;
  line-height: 1.65;
}
.byline {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--sub);
  font-size: 13px;
  margin-bottom: 7px;
}
.byline img {
  width: 24px;
  height: 24px;
}
.reply {
  line-height: 1.75;
}
.reply > :first-child {
  margin-top: 0;
}
.reply > :last-child {
  margin-bottom: 0;
}
.reply pre {
  position: relative;
  background: var(--rail);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 16px;
  white-space: pre;
  overflow: auto;
}
.reply code {
  font:
    0.89em/1.55 Consolas,
    monospace;
  background: var(--rail);
  border-radius: 4px;
  padding: 1px 3px;
}
.reply pre code {
  padding: 0;
}
.reply table {
  display: block;
  max-width: 100%;
  overflow: auto;
  border-collapse: collapse;
}
.reply th,
.reply td {
  padding: 5px 10px;
  border: 1px solid var(--line);
}
.reply blockquote,
.reason-text {
  padding-left: 12px;
  border-left: 2px solid var(--line);
  color: var(--sub);
}
.reply a {
  color: var(--blue);
}
.reason {
  color: var(--sub);
  font-size: 14px;
  margin: 8px 0;
}
.reason summary {
  cursor: pointer;
}
.reason-text {
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.6;
}
.waiting {
  font-size: 14px;
  color: var(--sub);
}
.copy {
  font-size: 13px;
  color: var(--sub);
  margin-top: 7px;
  padding: 4px 0;
}
.copy:hover {
  color: var(--blue);
}
dialog {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  width: min(420px, calc(100% - 28px));
  box-shadow: 0 18px 80px #161c3533;
}
dialog::backdrop {
  background: #18234044;
}
dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
dialog h2 {
  font-size: 19px;
  margin: 2px 0 12px;
}
.choices {
  overflow: auto;
  max-height: 50vh;
  min-height: 36px;
}
.choices button {
  display: block;
  text-align: left;
  width: 100%;
  border-radius: 9px;
  padding: 9px 10px;
}
.choices button.selected {
  background: var(--tint);
  color: var(--blue);
}
.choices small {
  display: block;
  color: var(--sub);
  margin-top: 3px;
  font-size: 12px;
}
.choices h3 {
  font-size: 13px;
  color: var(--sub);
  margin: 14px 9px 5px;
}
input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
}
#search {
  margin: 6px 0;
}
.remote {
  flex: 1;
  display: flex;
  min-height: 0;
  flex-direction: column;
}
.remote-status {
  margin: auto;
  text-align: center;
  color: var(--sub);
  padding: 16px;
}
.remote-status:empty {
  display: none;
}
.remote-status button {
  color: var(--blue);
  margin: 0 8px;
}
#viewer {
  flex: 1;
  min-height: 0;
}
#viewer:empty {
  display: none;
}
iframe {
  border: none;
  width: 100%;
  height: 100%;
  display: block;
}
.remote:fullscreen {
  background: var(--bg);
}
.access {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: 22px;
}
.access-card {
  width: min(100%, 360px);
  display: grid;
  gap: 12px;
}
.access-card img {
  margin: auto;
}
.access-card h1 {
  margin: 0 0 16px;
  text-align: center;
  font-size: 28px;
}
.access-card label {
  font-size: 14px;
  color: var(--sub);
}
.primary {
  border-radius: 12px;
  padding: 11px;
}
.shade {
  display: none;
}
@media (max-width: 760px) {
  .desk,
  .desk.folded {
    grid-template-columns: minmax(0, 1fr);
  }
  .desk aside,
  .desk.folded aside {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(275px, 86vw);
    z-index: 4;
    visibility: hidden;
    transform: translateX(-100%);
  }
  .desk.open aside {
    visibility: visible;
    transform: translateX(0);
  }
  .shade {
    display: block;
    position: fixed;
    inset: 0;
    background: #17213c55;
    z-index: 3;
  }
  .unfold {
    display: inline-grid;
  }
  .top {
    min-height: 52px;
    padding: 0 12px;
    gap: 9px;
  }
  .compose-area,
  .messages {
    width: calc(100% - 28px);
  }
  .welcome {
    gap: 8px;
    margin-bottom: 20px;
  }
  .welcome img {
    width: 44px;
    height: 44px;
  }
  .work.idle {
    padding-bottom: 10vh;
  }
  .compose {
    padding: 12px;
    border-radius: 20px;
  }
  .compose-tools {
    gap: 5px;
  }
  .pill {
    padding: 5px 7px;
    max-width: 52%;
  }
  .suggestions {
    gap: 6px;
  }
  .suggestions button {
    font-size: 13px;
    padding: 6px 9px;
  }
  .messages {
    padding-top: 14px;
  }
  .compose-area {
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
  .user .body {
    max-width: 92%;
  }
}
@media (max-width: 385px) {
  .pill {
    font-size: 13px;
  }
  .pill > i:first-child {
    display: none;
  }
  .welcome h1 {
    font-size: 25px;
  }
}
