:root {
  color-scheme: light;
  --bg: #f4f1ea;
  --panel: #ffffff;
  --ink: #171717;
  --muted: #68625a;
  --line: #ded7cc;
  --accent: #0f766e;
  --accent-soft: rgba(15, 118, 110, 0.1);
  --accent-ink: #ffffff;
  --warn: #b45309;
  --bad: #b91c1c;
  --good: #15803d;
  --shadow: 0 22px 60px rgba(35, 30, 22, 0.12);
}

* {
  box-sizing: border-box;
}

.share-seed {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0.01;
  pointer-events: none;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 0%, rgba(15, 118, 110, 0.12), transparent 28%),
    linear-gradient(180deg, #fbfaf6 0%, var(--bg) 38%, #eee8dc 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

button,
textarea {
  font: inherit;
}

.app {
  min-height: 100vh;
  padding: 34px 28px;
}

.workspace {
  width: min(1240px, 100%);
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(30px, 5vw, 58px);
  line-height: 1;
  letter-spacing: 0;
  color: #11100e;
}

h2 {
  font-size: 18px;
}

.topbar p {
  margin-top: 12px;
  color: var(--muted);
  font-size: 15px;
}

.status-pill {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  padding: 9px 13px;
  color: var(--muted);
  font-size: 14px;
  box-shadow: 0 8px 25px rgba(39, 32, 22, 0.08);
}

.status-pill.good {
  color: var(--good);
  border-color: rgba(21, 128, 61, 0.28);
}

.status-pill.bad {
  color: var(--bad);
  border-color: rgba(185, 28, 28, 0.28);
}

.ask-panel,
.summary,
.answers,
.model-wall,
.tip-box,
.value-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.ask-panel {
  padding: 18px;
  margin-bottom: 20px;
}

textarea {
  width: 100%;
  min-height: 108px;
  resize: vertical;
  border: 1px solid #d8d0c3;
  border-radius: 8px;
  padding: 15px;
  outline: none;
  line-height: 1.65;
  color: var(--ink);
  background: linear-gradient(180deg, #fffefb 0%, #fffaf2 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

textarea:focus {
  border-color: rgba(15, 118, 110, 0.55);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

button {
  border: 0;
  border-radius: 8px;
  min-height: 42px;
  padding: 0 18px;
  cursor: pointer;
  background: linear-gradient(135deg, #0f766e, #0d9488);
  color: var(--accent-ink);
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.22);
}

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

button.ghost {
  background: #eee7dc;
  color: #37322c;
  box-shadow: none;
}

.summary,
.answers,
.model-wall,
.tip-box,
.value-panel {
  padding: 16px;
  margin-bottom: 20px;
}

.value-panel {
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), transparent 50%),
    #fffdf9;
}

.value-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.value-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 11px;
}

.value-grid strong {
  display: block;
  color: #0f766e;
  margin-bottom: 7px;
  font-size: 15px;
}

.value-grid p {
  color: var(--muted);
  line-height: 1.48;
  font-size: 13px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}

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

#summaryContent {
  line-height: 1.72;
  color: #24211d;
}

.answers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 12px;
}

.answer-note {
  margin: -4px 0 14px;
  color: var(--muted);
  line-height: 1.65;
  font-size: 14px;
}

.extra-answers {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.extra-answers summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 800;
  user-select: none;
}

.extra-answers summary span {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
}

.extra-grid {
  margin-top: 12px;
}

.answer-card {
  border: 1px solid #dcd4c8;
  border-radius: 8px;
  background: linear-gradient(180deg, #fffefb 0%, #fffaf3 100%);
  min-height: 176px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.answer-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(246, 243, 237, 0.58);
}

.answer-name {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.answer-id {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.answer-state {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
}

.answer-state.done {
  color: var(--good);
}

.answer-state.error {
  color: var(--bad);
}

.answer-body {
  padding: 15px;
  line-height: 1.65;
  color: #24211d;
  overflow-wrap: anywhere;
}

.answer-body p,
#summaryContent p {
  margin: 0 0 12px;
}

.answer-body p:last-child,
#summaryContent p:last-child {
  margin-bottom: 0;
}

.answer-body h3,
#summaryContent h3 {
  margin: 16px 0 8px;
  font-size: 15px;
  line-height: 1.35;
}

.answer-body h3:first-child,
#summaryContent h3:first-child {
  margin-top: 0;
}

.answer-body strong,
#summaryContent strong {
  font-weight: 850;
  color: #0f766e;
}

.answer-body ul,
#summaryContent ul {
  margin: 8px 0 14px;
  padding-left: 20px;
}

.answer-body li,
#summaryContent li {
  margin: 6px 0;
}

.key-line {
  border-left: 4px solid rgba(15, 118, 110, 0.42);
  background: rgba(15, 118, 110, 0.06);
  border-radius: 6px;
  padding: 9px 10px;
}

.rich-table {
  width: 100%;
  overflow-x: auto;
  margin: 10px 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.rich-table table {
  width: 100%;
  border-collapse: collapse;
  min-width: 420px;
  font-size: 14px;
}

.rich-table td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 9px 10px;
  vertical-align: top;
}

.rich-table tr:first-child td {
  background: #f3efe7;
  font-weight: 800;
}

.rich-table tr:last-child td {
  border-bottom: 0;
}

.rich-table td:last-child {
  border-right: 0;
}

.empty {
  border: 1px dashed #c9bfae;
  border-radius: 8px;
  color: var(--muted);
  padding: 32px;
  text-align: center;
}

.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.model-logo {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fffefb 0%, #fffaf4 100%);
  padding: 11px;
  overflow: hidden;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.model-logo:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 118, 110, 0.32);
  box-shadow: 0 12px 28px rgba(35, 30, 22, 0.09);
}

.model-mark {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
  background: #171717;
}

.model-brand {
  font-weight: 850;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.model-provider {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.model-logo.gpt .model-mark {
  background: #171717;
}

.model-logo.claude .model-mark {
  background: #8b5e3c;
}

.model-logo.gemini .model-mark {
  background: #2563eb;
}

.model-logo.deepseek .model-mark {
  background: #4f46e5;
}

.model-logo.qwen .model-mark {
  background: #0f766e;
}

.model-logo.kimi .model-mark {
  background: #7c3aed;
}

.model-logo.glm .model-mark {
  background: #be123c;
}

.model-logo.minimax .model-mark {
  background: #0e7490;
}

.model-logo.doubao .model-mark {
  background: #dc2626;
}

.model-logo.baidu .model-mark {
  background: #2563eb;
}

.model-logo.hunyuan .model-mark {
  background: #0f172a;
}

.model-logo.llama .model-mark {
  background: #0284c7;
}

.model-logo.mistral .model-mark {
  background: #d97706;
}

.model-logo.nemotron .model-mark {
  background: #16a34a;
}

.model-logo.hermes .model-mark {
  background: #9333ea;
}

.tip-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  align-items: center;
  gap: 18px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), transparent 48%),
    #fffdf9;
}

.tip-copy h2 {
  margin-bottom: 8px;
}

.tip-copy p {
  max-width: 720px;
  color: var(--muted);
  line-height: 1.7;
}

.tip-box img {
  width: 180px;
  aspect-ratio: 1 / 1.35;
  object-fit: cover;
  object-position: center top;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f2fbf5;
}

.support-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(23, 23, 23, 0.52);
  backdrop-filter: blur(8px);
}

.support-modal[hidden] {
  display: none;
}

.support-dialog {
  position: relative;
  width: min(430px, 100%);
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.28);
  padding: 20px;
  text-align: center;
}

.support-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 50%;
  background: #eee7dc;
  color: #37322c;
  box-shadow: none;
  font-size: 22px;
  line-height: 1;
}

.support-copy h2 {
  margin: 0 34px 8px;
}

.support-copy p {
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 14px;
}

.support-dialog img {
  width: min(260px, 82vw);
  border-radius: 8px;
  border: 1px solid var(--line);
  display: block;
  margin: 0 auto 14px;
}

.support-dialog #unlockButton {
  width: 100%;
}

@media (max-width: 720px) {
  .app {
    padding: 14px;
  }

  .topbar {
    display: block;
  }

  .status-pill {
    display: inline-flex;
    margin-top: 14px;
  }

  .actions {
    justify-content: stretch;
  }

  .ask-panel {
    padding: 12px;
    margin-bottom: 14px;
  }

  textarea {
    min-height: 96px;
    padding: 12px;
    line-height: 1.5;
  }

  .summary,
  .answers,
  .model-wall,
  .tip-box,
  .value-panel {
    padding: 13px;
    margin-bottom: 14px;
  }

  button {
    flex: 1;
  }

  .answers-grid {
    grid-template-columns: 1fr;
  }

  .value-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .value-grid article {
    padding: 10px;
  }

  .value-grid strong {
    margin-bottom: 5px;
    font-size: 13px;
  }

  .value-grid p {
    font-size: 12px;
    line-height: 1.42;
  }

  .model-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .model-logo {
    min-height: 98px;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 7px;
    padding: 8px 6px;
    text-align: center;
  }

  .model-mark {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    font-size: 13px;
  }

  .model-brand {
    font-size: 13px;
    line-height: 1.1;
  }

  .model-provider {
    margin-top: 3px;
    font-size: 11px;
    line-height: 1.2;
  }

  .tip-box {
    grid-template-columns: 1fr;
  }

  .tip-box img {
    width: min(240px, 100%);
  }
}

@media (min-width: 430px) and (max-width: 720px) {
  .model-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
