:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-soft: #f1f4f8;
  --text: #1b2a34;
  --muted: #5b6b7a;
  --accent: #e38b2c;
  --accent-2: #2a8f78;
  --accent-3: #e06a4a;
  --shadow: rgba(15, 26, 36, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  color: var(--text);
  background: radial-gradient(circle at 15% 10%, #fff2e3, #f7f9fb 45%, #eef2f6 100%);
  overflow-x: hidden;
}

.orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(0px);
  opacity: 0.14;
  z-index: 0;
}

.orb-a {
  width: 440px;
  height: 440px;
  background: linear-gradient(130deg, #f6c27b, #f7a48a);
  top: -160px;
  right: -140px;
}

.orb-b {
  width: 560px;
  height: 560px;
  background: linear-gradient(140deg, #a2e1d0, #6dbbb0);
  bottom: -260px;
  left: -210px;
}

.orb-c {
  width: 260px;
  height: 260px;
  background: linear-gradient(160deg, #c7d6e4, #9ab0c2);
  top: 38%;
  left: 62%;
}

.layout {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  font-family: "Futura", "Trebuchet MS", "Avenir Next", sans-serif;
  letter-spacing: 0.18em;
  font-weight: 700;
  font-size: 16px;
  padding: 10px 18px;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--accent), var(--accent-3));
  color: #1b1411;
}

.brand-title {
  font-family: "Futura", "Trebuchet MS", "Avenir Next", sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

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

.status {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.thinking {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 24px;
}

.panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(27, 42, 52, 0.08);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 20px 40px var(--shadow);
  backdrop-filter: blur(6px);
}

.intro h1 {
  font-size: 28px;
  margin: 0 0 12px;
  line-height: 1.3;
}

.intro p {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

.tips {
  display: grid;
  gap: 10px;
}

.tip {
  background: var(--panel-soft);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 13px;
  color: #2e3f4b;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.tags span {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(42, 143, 120, 0.12);
  color: #1b6e60;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.actions {
  margin-top: 18px;
}

button {
  border: none;
  cursor: pointer;
  font-family: "Futura", "Trebuchet MS", "Avenir Next", sans-serif;
}

button.primary {
  padding: 10px 18px;
  border-radius: 12px;
  background: linear-gradient(120deg, var(--accent), var(--accent-3));
  color: #1b1411;
  font-weight: 700;
}

button.ghost {
  padding: 8px 16px;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.chat {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 560px;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding-right: 8px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.message {
  display: grid;
  gap: 6px;
  animation: rise 0.35s ease-out;
}

.message.user .bubble {
  background: linear-gradient(120deg, rgba(42, 143, 120, 0.18), rgba(42, 143, 120, 0.04));
  border: 1px solid rgba(42, 143, 120, 0.35);
}

.message.assistant .bubble {
  background: linear-gradient(120deg, rgba(227, 139, 44, 0.2), rgba(227, 139, 44, 0.04));
  border: 1px solid rgba(227, 139, 44, 0.35);
}

.bubble {
  padding: 14px 16px;
  border-radius: 16px;
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: 14px;
}

.bubble p {
  margin: 0 0 10px;
}

.bubble h1,
.bubble h2,
.bubble h3,
.bubble h4,
.bubble h5,
.bubble h6 {
  margin: 10px 0 8px;
  font-size: 16px;
  letter-spacing: 0.02em;
}

.bubble ul,
.bubble ol {
  margin: 6px 0 10px 18px;
  padding: 0;
}

.bubble li {
  margin-bottom: 4px;
}

.bubble code {
  background: rgba(42, 143, 120, 0.12);
  color: #1e3f36;
  padding: 2px 4px;
  border-radius: 4px;
  font-family: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

.code-block {
  margin-top: 10px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(27, 42, 52, 0.12);
  background: #f6f8fb;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #eef2f6;
  font-size: 12px;
  color: #526273;
}

.code-header .code-lang {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.copy-btn {
  border: 1px solid rgba(27, 42, 52, 0.18);
  background: #ffffff;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

.code-block pre {
  margin: 0;
  padding: 12px;
  overflow-x: auto;
  font-family: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.6;
  color: #27313a;
}

.code-block pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.bubble a {
  color: #1d7c6a;
  text-decoration: none;
}

.bubble a:hover {
  text-decoration: underline;
}

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

.details {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.details summary {
  cursor: pointer;
  color: #b5c9d9;
}

.details pre {
  white-space: pre-wrap;
  background: rgba(243, 245, 248, 0.9);
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(27, 42, 52, 0.08);
  color: #2e3f4b;
}

.composer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

#input {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(27, 42, 52, 0.12);
  background: rgba(255, 255, 255, 0.95);
  padding: 14px;
  color: var(--text);
  font-size: 14px;
  resize: vertical;
}

.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0px);
  }
}

@media (max-width: 960px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .intro {
    order: 2;
  }
  .chat {
    min-height: auto;
  }
}
