:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #637083;
  --line: #d9e1ec;
  --primary: #123b73;
  --primary-2: #176b87;
  --accent: #2f8f7f;
  --danger: #b42318;
}

* { box-sizing: border-box; }

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  line-height: 1.65;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  min-height: 64px;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.page-shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 28px auto 56px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 12px 30px rgba(22, 38, 65, 0.08);
}

.narrow { max-width: 760px; margin-inline: auto; }
.center { text-align: center; }

h1, h2 { line-height: 1.25; margin: 0 0 14px; letter-spacing: 0; }
h1 { font-size: 28px; }
h2 { font-size: 20px; }
p { margin: 0 0 16px; }
.lead { color: #24324a; font-size: 17px; }
.note, .scale-note { color: var(--muted); font-size: 14px; }
.error-text { color: var(--danger); font-weight: 700; }

button, .link-button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(23, 107, 135, 0.35);
  outline-offset: 2px;
}

button:disabled {
  cursor: progress;
  opacity: 0.68;
}

button.is-loading {
  pointer-events: none;
  cursor: progress;
  opacity: 0.68;
}

.primary, .link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  color: #fff;
  background: var(--primary);
  text-decoration: none;
}

.secondary {
  color: var(--primary);
  background: #e8f0fb;
  border: 1px solid #c8d8ef;
}

.ghost {
  min-height: 34px;
  color: var(--primary-2);
  background: transparent;
  border: 1px solid var(--line);
  padding: 5px 10px;
}

.checkline, .select-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 0;
}

.task-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 24px 0;
}

.task-grid div, .choice-card, .audio-box, .survey-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.task-grid div { padding: 16px; }
.task-grid strong, .task-grid span { display: block; }
.task-grid strong { color: var(--muted); font-size: 13px; }

.ai-mark {
  display: inline-flex;
  width: 54px;
  height: 54px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  background: var(--primary);
  font-weight: 800;
}

.progress {
  overflow: hidden;
  height: 12px;
  margin-top: 28px;
  border-radius: 999px;
  background: #dde6f2;
}

.progress span {
  display: block;
  height: 100%;
  width: 45%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  animation: loading 1.2s ease-in-out infinite alternate;
}

@keyframes loading { from { transform: translateX(-80%); } to { transform: translateX(190%); } }

.assistant-head {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-bottom: 22px;
}

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

.destination-card {
  display: flex;
  flex-direction: column;
  min-height: 430px;
  max-height: 560px;
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

dl { margin: 0; }
dt { color: var(--muted); font-size: 13px; font-weight: 700; }
dd { margin: 2px 0 12px; }
.select-line { margin-top: auto; font-weight: 700; }

.audio-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding: 14px 16px;
}

.audio-box p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

.survey-item {
  margin-bottom: 14px;
  padding: 16px;
}

.survey-item legend { font-weight: 700; }
.scale {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.scale label { text-align: center; }

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-top: 20px;
}

.choice-card {
  min-height: 132px;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 18px;
  font-weight: 700;
}

.chat-log {
  min-height: 230px;
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcff;
}

.msg { margin: 0 0 12px; padding: 10px 12px; border-radius: 8px; }
.msg.user { background: #e8f0fb; }
.msg.ai { background: #edf8f3; }
textarea, input[type="text"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  font: inherit;
}

input::placeholder,
textarea::placeholder {
  color: #98a2b3;
  font-size: 14px;
}

.start-screen,
.task-create-page,
.result-page {
  width: min(100%, 980px);
  margin: 0 auto;
}

.start-screen {
  display: grid;
  min-height: calc(100vh - 148px);
  place-items: center;
}

.start-card,
.task-card,
.result-card {
  width: min(100%, 720px);
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(22, 38, 65, 0.09);
}

.start-card {
  max-width: 680px;
  padding: 42px;
  text-align: center;
}

.product-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--primary);
  font-size: 18px;
  font-weight: 800;
}

.product-logo {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  font-weight: 900;
}

.research-note {
  margin-top: 18px;
  color: var(--muted);
}

.start-button {
  min-width: 180px;
}

.task-create-page {
  padding: 8px 0 28px;
}

.task-card {
  position: relative;
  width: min(100%, 760px);
  padding: 30px;
}

.task-form {
  margin-top: 22px;
}

.form-fields {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-fields label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #26364d;
  font-weight: 700;
}

.choice-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.choice-field legend {
  padding: 0;
  color: #26364d;
  font-weight: 700;
}

.choice-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.choice-option {
  display: grid !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px !important;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #d9e3ef;
  border-radius: 8px;
  background: #fff;
  color: #26364d;
  font-weight: 600 !important;
  cursor: pointer;
}

.choice-option:has(input:checked) {
  border-color: var(--primary-2);
  background: #f0f8fb;
  box-shadow: 0 0 0 3px rgba(23, 107, 135, 0.09);
}

.choice-option input {
  width: 16px;
  height: 16px;
  min-height: 16px;
  accent-color: var(--primary-2);
}

.field-hint {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.task-instruction {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #dbe6f3;
  border-radius: 8px;
  color: #334155;
  background: #f8fbff;
}

.select-task-instruction {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #dbe6f3;
  border-radius: 8px;
  color: #334155;
  background: #f8fbff;
}

.select-task-instruction h2 {
  margin: 0 0 6px;
  color: #26364d;
  font-size: 16px;
  line-height: 1.45;
}

.select-task-instruction p {
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
}

.select-task-instruction strong {
  color: inherit;
  font-weight: 800;
}

.form-fields input,
.form-fields textarea {
  min-height: 48px;
  font-size: 16px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-fields textarea {
  min-height: 112px;
  resize: vertical;
}

.form-fields input:focus,
.form-fields textarea:focus {
  border-color: var(--primary-2);
  box-shadow: 0 0 0 3px rgba(23, 107, 135, 0.12);
}

.full-button {
  width: 100%;
  margin-top: 24px;
}

.generation-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  border-radius: 8px;
  background: rgba(245, 247, 251, 0.86);
  backdrop-filter: blur(2px);
}

.generation-card {
  width: min(100%, 460px);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: center;
  box-shadow: 0 18px 38px rgba(22, 38, 65, 0.12);
}

.result-page {
  padding: 8px 0 36px;
}

.result-card {
  width: min(100%, 920px);
  padding: 28px;
}

.result-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.ai-state {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 10px;
  border: 1px solid #cfe0ef;
  border-radius: 999px;
  color: var(--primary-2);
  background: #eef7fb;
  font-weight: 700;
}

.copy-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.completion-code {
  display: inline-block;
  margin: 14px auto;
  padding: 16px 22px;
  border: 1px dashed var(--primary);
  border-radius: 8px;
  color: var(--primary);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 2px;
}

.preview-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.preview-tabs a {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--primary);
  text-decoration: none;
}
.preview-tabs a.active { color: #fff; background: var(--primary); }

.link-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.link-card {
  display: flex;
  min-height: 112px;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--primary);
  background: #fbfcff;
  text-decoration: none;
}

.form-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

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

.custom-form-panel label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  font-weight: 700;
}

.task-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 22px;
}

.task-summary div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.task-summary strong, .task-summary span {
  display: block;
}

.task-summary strong {
  color: var(--muted);
  font-size: 13px;
}

.secondary-link {
  color: var(--primary);
  background: #e8f0fb;
}

.travel-app .travel-form {
  margin-top: 18px;
}

.travel-generating {
  margin-top: 24px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
  text-align: center;
}

.travel-result {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.travel-sections {
  display: grid;
  gap: 14px;
}

.travel-section {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.travel-section h3 {
  margin: 0 0 8px;
  color: var(--primary);
}

.travel-section ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.speech-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.copy-app {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.copy-sidebar {
  min-height: 720px;
  padding: 24px 18px;
  color: #f7fbff;
  background: #123b73;
}

.copy-logo {
  margin-bottom: 26px;
  font-size: 21px;
  font-weight: 800;
}

.copy-side-item {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  color: #dbe8f7;
}

.copy-side-item.active {
  color: #123b73;
  background: #fff;
}

.copy-main {
  min-width: 0;
  background: #f8fafc;
}

.copy-status {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 56px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  color: #334155;
  background: #fff;
  font-weight: 700;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2f8f7f;
}

.copy-chat {
  max-width: 920px;
  margin: 0 auto;
  padding: 26px 22px 40px;
}

.copy-ai-row,
.copy-user-row {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}

.copy-user-row {
  justify-content: flex-end;
}

.copy-avatar {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: #176b87;
  font-weight: 800;
}

.copy-bubble {
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fff;
}

.copy-bubble.user {
  display: grid;
  gap: 4px;
  max-width: 680px;
  color: #17324d;
  background: #eaf4f2;
}

.copy-bubble.ai {
  flex: 1;
}

.copy-form {
  margin-left: 54px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.copy-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 700;
}

.copy-form-grid label:nth-child(4),
.copy-form-grid label:nth-child(5) {
  grid-column: span 1;
}

.copy-generating {
  margin-top: 18px;
}

.skeleton-line {
  width: 88%;
  height: 12px;
  margin: 4px 0 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e1e8f2, #f8fafc, #e1e8f2);
  animation: copy-shimmer 1.1s linear infinite;
}

.skeleton-line.short {
  width: 58%;
}

@keyframes copy-shimmer {
  from { opacity: 0.45; }
  to { opacity: 1; }
}

.copy-answer h1 {
  margin-bottom: 18px;
}

.copy-clear,
.copy-unclear {
  font-size: 16px;
  line-height: 1.65;
}

.copy-clear {
  display: grid;
  gap: 16px;
}

.copy-option-card {
  padding: 18px;
  border: 1px solid #cdd8e6;
  border-radius: 8px;
  background: #fff;
}

.copy-option-card.selected,
.copy-stream-item.selected {
  border-color: #2f8f7f;
  box-shadow: 0 0 0 2px rgba(47, 143, 127, 0.12);
}

.copy-option-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.copy-option-head h2,
.copy-stream-title {
  margin: 0 0 8px;
  color: #172033;
  font-size: 20px;
  line-height: 1.35;
}

.copy-number {
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 44px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: #fff;
  background: #123b73;
  font-weight: 800;
}

.copy-number.inline {
  margin-right: 10px;
  vertical-align: middle;
}

.copy-field-label {
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
}

.copy-sub-number {
  display: inline-flex;
  min-width: 20px;
  color: var(--primary);
  font-weight: 900;
}

.copy-sub-number.inline {
  margin-right: 6px;
}

.copy-field {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid #e7edf5;
}

.copy-field strong,
.copy-stream-item strong {
  color: #334155;
}

.copy-field p,
.copy-stream-item p {
  margin: 0 0 8px;
}

.copy-unclear {
  padding: 0;
  border: 0;
}

.copy-stream-item {
  padding: 0;
  border: 0;
}

.copy-stream-item + .copy-stream-item {
  margin-top: 0;
}

.copy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.copy-finish {
  display: flex;
  justify-content: center;
  margin-top: 22px;
}

.learn-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.learn-sections {
  display: grid;
  gap: 16px;
}

.learn-section {
  padding: 18px;
  border: 1px solid #cdd8e6;
  border-radius: 8px;
  background: #fff;
}

.learn-section h2 {
  margin-bottom: 10px;
}

.learn-section h3 {
  margin: 12px 0 6px;
  font-size: 17px;
  line-height: 1.35;
}

.learn-section ol,
.learn-section ul {
  margin: 8px 0 0;
  padding-left: 22px;
}

.learn-phase {
  padding: 10px 0;
  border-top: 1px solid #e7edf5;
}

.learn-phase:first-of-type {
  border-top: 0;
}

.learn-extension {
  background: #fbfcff;
}

.learn-extension-divider {
  display: grid;
  gap: 8px;
  margin: 4px 0;
  color: #475569;
}

.learn-extension-divider hr {
  width: 100%;
  height: 1px;
  margin: 0;
  border: 0;
  background: #cbd8e6;
}

.learn-extension-divider p {
  margin: 0;
  font-weight: 700;
}

.learn-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.learn-actions .primary,
.learn-actions .link-button {
  margin-top: 0;
}

.subtle-link {
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.subtle-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.select-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.select-sections {
  display: grid;
  gap: 16px;
}

.select-section {
  padding: 18px;
  border: 1px solid #cdd8e6;
  border-radius: 8px;
  background: #fff;
}

.select-emphasis {
  background: #fbfcff;
}

.select-section h2 {
  margin-bottom: 10px;
}

.select-section h3 {
  margin: 12px 0 6px;
  font-size: 17px;
  line-height: 1.35;
}

.select-section ol,
.select-section ul {
  margin: 8px 0 0;
  padding-left: 22px;
}

.select-option {
  padding: 10px 0;
  border-top: 1px solid #e7edf5;
}

.select-option:first-of-type {
  border-top: 0;
}

.select-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.select-actions .primary,
.select-actions .link-button {
  margin-top: 0;
}

@media (max-width: 820px) {
  .page-shell { width: min(100vw - 20px, 720px); margin-top: 14px; }
  .panel { padding: 20px; }
  .task-grid, .destination-grid, .choice-grid, .link-grid, .form-grid, .task-summary { grid-template-columns: 1fr; }
  .destination-card { min-height: 360px; }
  .assistant-head, .audio-box { align-items: flex-start; flex-direction: column; }
  .scale { grid-template-columns: repeat(4, 1fr); }
  .copy-app { grid-template-columns: 1fr; padding: 0; }
  .copy-sidebar { min-height: auto; padding: 16px; }
  .copy-side-item { display: inline-flex; margin-right: 8px; }
  .copy-chat { padding: 18px 14px 32px; }
  .copy-form { margin-left: 0; }
  .copy-form-grid { grid-template-columns: 1fr; }
  .copy-field { grid-template-columns: 1fr; gap: 2px; }
  .copy-ai-row { align-items: flex-start; }
  .start-screen { min-height: calc(100vh - 112px); }
  .start-card, .task-card, .result-card { padding: 22px; }
  .result-top { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
