:root {
  color-scheme: light;
  --bg: #f4f6f2;
  --surface: #ffffff;
  --surface-strong: #eef3ec;
  --text: #17201b;
  --muted: #667168;
  --line: #d8e0d6;
  --accent: #2f6f56;
  --accent-dark: #255946;
  --danger: #a33b3b;
  --shadow: 0 18px 48px rgb(41 60 49 / 12%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  min-height: 100dvh;
  margin: 0 auto;
  padding: 36px 0;
  display: grid;
  align-items: center;
}

.panel,
.chat-layout {
  width: 100%;
}

.panel {
  max-width: 760px;
  margin: 0 auto;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.header-block {
  margin-bottom: 28px;
}

.kicker {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.15;
  letter-spacing: 0;
}

.description {
  max-width: 62ch;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

.notice-block {
  display: grid;
  gap: 8px;
  margin: 0 0 24px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.notice-block p {
  margin: 0;
}

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

label {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
}

label span {
  font-size: 14px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--text);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input,
select {
  height: 44px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  min-height: 124px;
  padding: 14px;
  line-height: 1.65;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgb(47 111 86 / 16%);
}

.primary-button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}

.primary-button:hover {
  background: var(--accent-dark);
}

.primary-button:active {
  transform: translateY(1px);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.form-grid .primary-button {
  grid-column: 1 / -1;
}

.error-text {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 14px;
  line-height: 1.45;
}

.form-grid .error-text {
  grid-column: 1 / -1;
}

.chat-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}

.side-panel,
.conversation-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.side-panel {
  padding: 24px;
  align-self: start;
  position: sticky;
  top: 24px;
}

.progress-line {
  display: grid;
  gap: 12px;
  margin: 0 0 24px;
  color: var(--muted);
  font-weight: 700;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-strong);
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.22s ease;
}

.turn-prompt {
  margin: 0;
  padding: 16px;
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--text);
  line-height: 1.7;
  font-weight: 700;
}

.conversation-panel {
  min-height: 680px;
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
}

.messages {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 24px;
  overflow-y: auto;
}

.message {
  max-width: min(78%, 620px);
  padding: 13px 15px;
  border-radius: 10px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.message.user {
  justify-self: end;
  background: var(--accent);
  color: #ffffff;
}

.message.ai {
  justify-self: start;
  border: 1px solid var(--line);
  background: #fbfcfa;
}

.survey-action {
  display: flex;
  justify-content: center;
}

.survey-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
}

.survey-button:hover {
  background: var(--accent-dark);
}

.message.system {
  justify-self: center;
  max-width: 100%;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 14px;
}

.composer {
  border-top: 1px solid var(--line);
  padding: 18px;
  background: #ffffff;
}

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

.done-panel {
  text-align: left;
}

.hidden {
  display: none !important;
}

@media (max-width: 820px) {
  .app-shell {
    width: min(100% - 20px, 1120px);
    padding: 16px 0;
    align-items: start;
  }

  .panel {
    padding: 22px;
  }

  .form-grid,
  .chat-layout {
    grid-template-columns: 1fr;
  }

  .side-panel {
    position: static;
  }

  .conversation-panel {
    min-height: 620px;
  }

  .message {
    max-width: 92%;
  }

  .composer-actions {
    display: grid;
  }
}


