:root {
  color-scheme: light;
  --bg: #f4f8f4;
  --surface: #fffefb;
  --surface-2: #f0f7f1;
  --surface-3: #e7f0e8;
  --ink: #132118;
  --muted: #617168;
  --soft: #93a198;
  --line: #d8e7db;
  --line-strong: #b8d7c2;
  --red: #0b8f5a;
  --red-dark: #067246;
  --red-soft: #eaf7ef;
  --green: #0b8f5a;
  --shadow: 0 20px 60px rgba(20, 86, 50, 0.09);
  --radius: 18px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
}

body {
  min-height: 100vh;
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
textarea,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 58px;
  padding: 0 clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.9);
  backdrop-filter: blur(16px);
}

.brand {
  color: #122018;
  font-size: 20px;
  font-weight: 850;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: #554b43;
  font-size: 14px;
  white-space: nowrap;
}

.site-nav a {
  transition: color 0.2s ease;
}

.site-nav a:hover,
.site-nav .active {
  color: var(--red);
}

.site-nav .active {
  font-weight: 800;
}

.solve-shell {
  display: grid;
  grid-template-columns: 292px minmax(0, 920px);
  justify-content: center;
  gap: 16px;
  height: calc(100dvh - 58px);
  padding: 16px;
  background:
    radial-gradient(circle at 20% 0%, rgba(206, 239, 218, 0.85), transparent 28rem),
    linear-gradient(180deg, #fbfff9 0%, #f4f8f4 72%);
}

.side-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
}

.tool-card,
.quota-card,
.history-card,
.chat-panel {
  border: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.96);
  box-shadow: var(--shadow);
}

.tool-card {
  border-radius: var(--radius);
  padding: 18px;
}

.tool-title,
.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tool-title span {
  color: var(--red);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.tool-title button,
.history-head button {
  background: transparent;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
}

h1,
h2,
p {
  margin: 0;
}

.tool-card h1 {
  margin-top: 5px;
  color: var(--red);
  font-size: 28px;
  line-height: 1.12;
  text-wrap: balance;
}

.tool-card p {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.quota-card {
  border-radius: var(--radius);
  padding: 16px;
  background: var(--red-soft);
}

.quota-card span {
  display: none;
  color: var(--muted);
  font-size: 13px;
}

.quota-card strong {
  display: none;
  margin: 4px 0 12px;
  color: var(--red);
  font-size: 30px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.quota-card button {
  width: 100%;
  border-radius: 12px;
  background: #fff;
  color: var(--red);
  padding: 10px 12px;
  font-weight: 850;
}

.mobile-history-btn,
.close-history,
.history-overlay {
  display: none;
}

.history-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.history-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  border-radius: var(--radius);
  padding: 16px;
}

.history-head h2 {
  font-size: 16px;
}

.history-list {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  margin-top: 12px;
  overflow: auto;
  padding-right: 2px;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

.history-item {
  position: relative;
  display: grid;
  gap: 5px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
  padding: 12px;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}

.history-item:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.history-item strong {
  padding-right: 46px;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item span {
  color: var(--muted);
  font-size: 12px;
}

.history-item em {
  width: fit-content;
  border-radius: 999px;
  background: #eef9f4;
  color: var(--green);
  padding: 3px 8px;
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
}

.history-delete {
  position: absolute;
  top: 10px;
  right: 10px;
  border-radius: 999px;
  background: #edf5ef;
  color: #50645a;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  transform: translateY(-2px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    background 0.2s ease,
    color 0.2s ease;
}

.history-item:hover .history-delete,
.history-item:focus-within .history-delete {
  opacity: 1;
  transform: translateY(0);
}

.history-delete:hover {
  background: #dff1e6;
  color: var(--green);
}

.chat-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 22px;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  overflow: auto;
  padding: 28px 30px;
  scroll-behavior: smooth;
}

.message {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  max-width: 830px;
  min-width: 0;
}

.message.user {
  align-self: flex-end;
  grid-template-columns: minmax(0, 1fr) 40px;
}

.message.user .avatar {
  grid-column: 2;
  background: var(--green);
}

.message.user .bubble {
  grid-column: 1;
  grid-row: 1;
  background: #f1faf4;
}

.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #102018;
  color: #fff;
  font-weight: 850;
}

.bubble {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 16px 18px;
  line-height: 1.75;
}

.bubble.welcome {
  padding: 22px;
}

.bubble.welcome h2,
.bubble.welcome h1 {
  font-size: 22px;
  line-height: 1.2;
}

.bubble.welcome p {
  margin-top: 8px;
  color: var(--muted);
}

.bubble.welcome .example-intro {
  margin-top: 2px;
}

.example-questions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.example-question {
  display: flex;
  min-width: 0;
  min-height: 196px;
  flex-direction: column;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 16px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.example-question:hover {
  border-color: var(--green);
  background: #fbfefc;
  box-shadow: 0 8px 22px rgba(18, 99, 65, 0.08);
}

.example-question:focus-visible {
  outline: 3px solid rgba(0, 155, 100, 0.18);
  outline-offset: 2px;
  border-color: var(--green);
}

.example-question:disabled {
  cursor: wait;
  opacity: 0.62;
  box-shadow: none;
}

.example-type {
  align-self: flex-start;
  border-radius: 4px;
  background: #edf5ef;
  color: #28724e;
  padding: 4px 8px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.example-content {
  display: flex;
  flex: 1;
  align-items: center;
  margin: 14px 0;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.65;
}

.example-formula {
  font-size: 20px;
  white-space: nowrap;
}

.example-action {
  color: var(--green);
  font-size: 14px;
  font-weight: 750;
}

.bubble > p {
  white-space: pre-wrap;
}

.bubble img {
  display: block;
  max-width: min(520px, 100%);
  max-height: 360px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  object-fit: contain;
  background: #fff;
}

.answer-body {
  color: #201a16;
  font-size: 15.5px;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.answer-body h2,
.answer-body h3,
.answer-body h4 {
  margin: 4px 0 10px;
  color: #15100d;
  line-height: 1.35;
}

.answer-body h2 {
  font-size: 20px;
}

.answer-body h3 {
  font-size: 17px;
}

.answer-body h4 {
  font-size: 16px;
}

.answer-body p {
  margin: 0 0 9px;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.answer-body ol,
.answer-body ul {
  margin: 0 0 10px 1.25rem;
  padding: 0;
}

.answer-body li {
  margin: 5px 0;
}

.answer-body strong {
  font-weight: 850;
}

.answer-body code {
  border-radius: 6px;
  background: #f6eee6;
  padding: 1px 5px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.92em;
}

.answer-body hr {
  height: 1px;
  margin: 14px 0;
  border: 0;
  background: var(--line);
}

.answer-body mjx-container {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.answer-body mjx-container[jax="CHTML"][display="true"] {
  display: block;
  padding: 4px 0 6px;
}

.answer-body mjx-container::-webkit-scrollbar {
  height: 3px;
}

.answer-body mjx-container::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #bdd8c7;
}

.trace {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.trace span {
  border-radius: 999px;
  background: #f4f1ec;
  color: var(--muted);
  padding: 4px 9px;
  font-size: 12px;
}

.thinking {
  color: var(--muted);
}

.thinking-title {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-weight: 850;
}

.thinking-title small {
  margin-left: auto;
  color: var(--soft);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.thinking-dot {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(11, 143, 90, 0.28);
  animation: pulseDot 1.4s ease-out infinite;
}

.thinking-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.thinking-steps span {
  position: relative;
  border-radius: 999px;
  background: #f1f6f2;
  color: var(--muted);
  padding: 5px 10px;
  font-size: 13px;
  transition:
    background 0.25s ease,
    color 0.25s ease,
    transform 0.25s ease;
}

.thinking-steps span.active {
  background: #eef9f4;
  color: var(--green);
  transform: translateY(-1px);
}

.thinking-steps span.done {
  background: #edf5ef;
  color: #7a9184;
}

.thinking-bar {
  height: 5px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf5ef;
}

.thinking-bar i {
  display: block;
  width: 12%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0b8f5a, #5fc58a);
  transition: width 1s ease;
}

.live-thinking,
.live-answer {
  margin-top: 14px;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
}

.live-thinking h3,
.live-answer h3 {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 13px;
  font-weight: 850;
}

.live-thinking pre {
  max-height: 220px;
  overflow: auto;
  margin: 0;
  border-radius: 12px;
  background: #f4faf6;
  color: #3b5a48;
  padding: 12px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.live-answer .answer-body {
  color: var(--ink);
}

@keyframes pulseDot {
  0% {
    box-shadow: 0 0 0 0 rgba(11, 143, 90, 0.28);
  }
  75% {
    box-shadow: 0 0 0 9px rgba(11, 143, 90, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(11, 143, 90, 0);
  }
}

.composer-wrap {
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.96);
  padding: 12px 20px 14px;
}

.attachment-preview {
  position: relative;
  width: 170px;
  margin: 0 0 10px 58px;
}

.attachment-preview img {
  display: block;
  width: 170px;
  max-height: 116px;
  border: 1px solid var(--line);
  border-radius: 12px;
  object-fit: cover;
  background: #fff;
}

.remove-image {
  position: absolute;
  top: -9px;
  right: -9px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #102018;
  color: #fff;
  font-size: 18px;
}

.composer {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 78px;
  gap: 10px;
  align-items: end;
}

.upload-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--red);
  font-size: 24px;
  line-height: 1;
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}

.upload-btn:hover {
  border-color: var(--red);
  transform: translateY(-1px);
}

textarea {
  width: 100%;
  min-height: 44px;
  max-height: 160px;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 16px;
  outline: none;
  background: #fff;
  color: var(--ink);
  padding: 11px 14px;
  line-height: 1.5;
}

textarea:focus,
.redeem-input:focus {
  border-color: #80c79e;
  box-shadow: 0 0 0 4px rgba(11, 143, 90, 0.1);
}

.send-btn,
.primary {
  border-radius: 14px;
  background: var(--red);
  color: #fff;
  font-weight: 850;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.send-btn {
  height: 44px;
}

.send-btn.stop-mode {
  background: #4f6559;
}

.send-btn.stop-mode:hover {
  background: #344a3e;
}

.send-btn:hover,
.primary:hover {
  background: var(--red-dark);
}

.send-btn:active,
.primary:active {
  transform: translateY(1px);
}

.status {
  min-height: 18px;
  margin: 7px 0 0 56px;
  color: var(--muted);
  font-size: 12px;
}

.status.error {
  color: var(--red);
  font-weight: 750;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(12, 36, 24, 0.44);
}

.modal-card {
  position: relative;
  width: min(420px, 100%);
  border-radius: 20px;
  background: #fff;
  padding: 28px;
  box-shadow: 0 28px 80px rgba(38, 22, 10, 0.24);
}

.modal-card h2 {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 26px;
  text-align: center;
}

.modal-card p {
  color: var(--muted);
  line-height: 1.7;
  text-align: center;
}

.close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: transparent;
  color: #8b7d72;
  font-size: 28px;
}

.redeem-input {
  width: 100%;
  margin: 18px 0 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  padding: 13px 14px;
}

.primary {
  width: 100%;
  padding: 13px 18px;
}

.wechat {
  margin-top: 16px;
  text-align: center;
}

.wechat img {
  width: min(260px, 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.wechat p {
  margin-top: 8px;
  color: #456a56;
  font-weight: 800;
}

@media (max-width: 920px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  .site-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 30;
    align-items: center;
    height: 52px;
    padding: 0 16px;
    flex-direction: row;
  }

  .brand {
    font-size: 18px;
  }

  .site-nav {
    width: auto;
    margin-left: auto;
    gap: 0;
    overflow: visible;
    padding-bottom: 0;
  }

  .site-nav a {
    display: none;
  }

  .site-nav .active {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: #eef9f4;
    color: var(--green);
    padding: 7px 10px;
    font-size: 13px;
  }

  .solve-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    height: 100dvh;
    min-height: 0;
    padding: 52px 0 0;
  }

  .side-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    min-height: 0;
  }

  .tool-card,
  .quota-card {
    border-width: 0 0 1px;
    border-radius: 0;
    box-shadow: none;
  }

  .tool-card {
    display: none;
  }

  .quota-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(238, 249, 244, 0.96);
    min-height: 48px;
  }

  .quota-card span {
    grid-column: 1;
    grid-row: 1;
    font-size: 12px;
  }

  .quota-card strong {
    grid-column: 2;
    grid-row: 1;
    justify-self: start;
    margin: 0;
    font-size: 18px;
  }

  .quota-card button,
  .mobile-history-btn {
    width: auto;
    min-width: 0;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 13px;
  }

  #openRedeem {
    grid-column: 2;
    grid-row: 1;
  }

  .mobile-history-btn {
    display: inline-flex;
    grid-column: 3;
    grid-row: 1;
    justify-content: center;
    background: #fff;
    color: var(--green);
    font-weight: 850;
  }

  .history-card {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 45;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    max-height: min(72dvh, 560px);
    border: 1px solid var(--line);
    border-radius: 22px 22px 0 0;
    background: #fffefb;
    box-shadow: 0 -18px 50px rgba(16, 48, 28, 0.18);
    padding: 18px 18px max(18px, env(safe-area-inset-bottom));
    transform: translateY(105%);
    transition: transform 0.24s ease;
    visibility: hidden;
  }

  .history-card.open {
    transform: translateY(0);
    visibility: visible;
  }

  .history-head h2 {
    font-size: 18px;
  }

  .close-history {
    display: inline-flex;
    position: absolute;
    top: 14px;
    right: 18px;
    justify-self: end;
    width: fit-content;
    border-radius: 999px;
    background: #edf5ef;
    color: #50645a;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 800;
  }

  .history-list {
    display: grid;
    overflow: auto;
    padding: 8px 2px 0 0;
  }

  .history-item {
    min-width: 0;
  }

  .history-delete {
    opacity: 1;
    transform: none;
  }

  .history-overlay {
    position: fixed;
    inset: 0;
    z-index: 44;
    display: block;
    background: rgba(12, 36, 24, 0.28);
  }

  .history-overlay[hidden] {
    display: none !important;
  }

  .chat-panel {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    min-height: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    background: rgba(255, 253, 249, 0.9);
  }

  .messages {
    gap: 12px;
    padding: 12px 12px 96px;
  }

  .message,
  .message.user {
    grid-template-columns: 30px minmax(0, 1fr);
    max-width: 100%;
    gap: 8px;
  }

  .message.user {
    align-self: stretch;
  }

  .message.user .avatar {
    grid-column: 1;
  }

  .message.user .bubble {
    grid-column: 2;
  }

  .avatar {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }

  .bubble {
    border-radius: 14px;
    padding: 12px 13px;
  }

  .bubble.welcome {
    padding: 16px;
  }

  .bubble.welcome h2,
  .bubble.welcome h1 {
    font-size: 20px;
  }

  .bubble.welcome p {
    font-size: 14px;
    line-height: 1.7;
  }

  .example-questions {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    margin-top: 14px;
  }

  .example-question {
    min-height: 0;
    padding: 13px;
  }

  .example-content {
    margin: 10px 0;
  }

  .bubble img {
    max-height: 240px;
  }

  .answer-body {
    font-size: 15px;
  }

  .composer-wrap {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 35;
    border-top: 1px solid var(--line);
    background: rgba(255, 253, 249, 0.96);
    backdrop-filter: blur(14px);
    padding: 8px 10px max(8px, env(safe-area-inset-bottom));
  }

  .composer {
    grid-template-columns: 38px minmax(0, 1fr) 62px;
    gap: 8px;
    align-items: end;
  }

  .upload-btn,
  .send-btn,
  textarea {
    min-height: 40px;
  }

  .upload-btn {
    width: 38px;
    height: 40px;
    font-size: 22px;
  }

  .send-btn {
    height: 40px;
    border-radius: 12px;
    font-size: 14px;
  }

  textarea {
    max-height: 112px;
    border-radius: 14px;
    padding: 9px 12px;
    font-size: 15px;
  }

  .attachment-preview,
  .status {
    margin-left: 46px;
  }

  .attachment-preview {
    width: 96px;
    margin-bottom: 6px;
  }

  .attachment-preview img {
    width: 96px;
    max-height: 68px;
    border-radius: 9px;
  }

  .status {
    margin-top: 4px;
    font-size: 11px;
  }
}

/* 2026-07 simplified visual alignment with the main site */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5fbf7;
  --surface-3: #edf7f1;
  --ink: #10261d;
  --muted: #607169;
  --soft: #91a097;
  --line: #d8e8de;
  --line-strong: #afd1bd;
  --red: #079766;
  --red-dark: #027a52;
  --red-soft: #f1faf5;
  --green: #079766;
  --shadow: none;
  --radius: 8px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

html,
body {
  background: #fff;
}

button,
a,
textarea,
input {
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

button:focus-visible,
a:focus-visible,
textarea:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(7, 151, 102, 0.2);
  outline-offset: 2px;
}

.site-header {
  height: 64px;
  padding: 0 clamp(22px, 4vw, 64px);
  border-bottom-color: #e3ece6;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.brand {
  font-size: 22px;
  font-weight: 800;
}

.site-nav {
  align-self: stretch;
  gap: clamp(18px, 3vw, 38px);
  color: #34453d;
  font-size: 15px;
}

.site-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.site-nav .active::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--green);
  content: "";
}

.solve-shell {
  grid-template-columns: 260px minmax(0, 900px);
  gap: 18px;
  height: calc(100dvh - 64px);
  padding: 20px;
  background: #f8fcf9;
}

.side-panel {
  gap: 10px;
}

.tool-card,
.quota-card,
.history-card,
.chat-panel {
  border-color: var(--line);
  border-radius: 8px;
  box-shadow: none;
}

.tool-card {
  padding: 18px;
}

.tool-card h1 {
  color: var(--ink);
  font-size: 27px;
}

.tool-title span,
.tool-title button,
.history-head button {
  color: var(--green-dark);
}

.quota-card {
  padding: 12px;
  background: #f3faf6;
}

.quota-card button {
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--green-dark);
  font-weight: 700;
}

.history-card {
  padding: 14px;
}

.history-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.history-item {
  border-radius: 5px;
  padding: 11px;
}

.history-item:hover {
  transform: none;
  background: #f7fbf8;
}

.chat-panel {
  border-radius: 8px;
  background: #fff;
}

.messages {
  gap: 16px;
  padding: 26px 28px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 5px;
  background: #173629;
}

.message {
  grid-template-columns: 36px minmax(0, 1fr);
}

.message.user {
  grid-template-columns: minmax(0, 1fr) 36px;
}

.bubble {
  border-radius: 7px;
  padding: 15px 17px;
}

.bubble.welcome {
  padding: 20px;
}

.bubble.welcome h2,
.bubble.welcome h1 {
  font-size: 22px;
}

.thinking-steps span,
.trace span {
  border-radius: 4px;
}

.thinking-bar,
.thinking-bar i {
  border-radius: 2px;
}

.thinking-bar i {
  background: var(--green);
}

.live-thinking pre {
  border-radius: 5px;
}

.composer-wrap {
  padding: 11px 16px 13px;
  background: rgba(255, 255, 255, 0.97);
}

.upload-btn {
  border-radius: 5px;
}

textarea {
  border-radius: 5px;
}

.send-btn,
.primary {
  border-radius: 5px;
}

.attachment-preview img {
  border-radius: 5px;
}

.modal-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(16, 38, 29, 0.16);
}

.modal-card h2 {
  color: var(--ink);
  font-size: 23px;
}

.redeem-input,
.wechat img {
  border-radius: 5px;
}

.wechat img {
  width: min(230px, 100%);
}

@media (max-width: 920px) {
  .site-header {
    height: 52px;
    padding: 0 16px;
  }

  .brand {
    font-size: 20px;
    white-space: nowrap;
  }

  .site-nav a {
    display: none;
  }

  .site-nav .active {
    display: inline-flex;
    border-radius: 4px;
    padding: 6px 9px;
  }

  .solve-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    width: 100%;
    padding-top: 52px;
    background: #fff;
  }

  .side-panel,
  .chat-panel,
  .messages {
    width: 100%;
    min-width: 0;
  }

  .tool-card {
    display: none;
  }

  .quota-card {
    min-height: 54px;
    padding: 8px 12px;
    border-width: 0 0 1px;
    background: #f3faf6;
  }

  .quota-card button,
  .mobile-history-btn {
    border-radius: 5px;
  }

  .chat-panel {
    border-radius: 0;
  }

  .messages {
    padding: 12px 12px 94px;
  }

  .message,
  .message.user {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .avatar {
    border-radius: 4px;
  }

  .bubble {
    border-radius: 6px;
  }

  .composer-wrap {
    background: rgba(255, 255, 255, 0.98);
  }

  .upload-btn,
  .send-btn,
  textarea {
    border-radius: 5px;
  }

  .history-card {
    border-radius: 8px 8px 0 0;
  }

  .modal {
    align-items: end;
    padding: 0;
  }

  .modal-card {
    width: 100%;
    max-height: 90dvh;
    overflow: auto;
    padding: 24px 20px max(24px, env(safe-area-inset-bottom));
    border: 0;
    border-radius: 8px 8px 0 0;
  }
}

/* Keep the complete shared site navigation reachable on mobile. */
@media (max-width: 920px) {
  .site-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 0;
    height: 108px;
    padding: 10px 16px 0;
  }

  .brand {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
  }

  .site-nav {
    width: 100%;
    min-height: 54px;
    margin-left: 0;
    justify-content: flex-start;
    gap: 18px;
    overflow-x: auto;
    padding-bottom: 0;
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .site-nav a,
  .site-nav .active {
    display: inline-flex;
    min-height: 54px;
    flex: 0 0 auto;
    align-items: center;
    border-radius: 0;
    padding: 0;
    background: transparent;
    font-size: 14px;
  }

  .solve-shell {
    padding-top: 108px;
  }
}
