:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #5d6878;
  --line: #d9e1ea;
  --paper: #ffffff;
  --surface: #f5f8fb;
  --blue: #245b85;
  --blue-dark: #173f61;
  --gold: #9a6a1f;
  --green: #2f6f5e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(36, 91, 133, 0.08), transparent 42%),
    var(--surface);
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 32px;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 40px 0;
}

.workspace,
.preview-panel {
  min-width: 0;
}

.intro {
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  font-size: clamp(2.2rem, 5vw, 4.8rem);
  line-height: 1.05;
}

h2 {
  font-size: 1.25rem;
}

.lede {
  max-width: 760px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.75;
}

.notice-strip {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  max-width: 760px;
  margin-top: 18px;
  padding: 13px 15px;
  color: var(--blue-dark);
  background: #edf5fb;
  border: 1px solid #c9ddeb;
  border-radius: 8px;
  line-height: 1.55;
}

.notice-strip strong {
  flex: 0 0 auto;
}

.research-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(23, 32, 51, 0.08);
}

.field,
.field-set {
  display: grid;
  gap: 8px;
}

.full {
  grid-column: 1 / -1;
}

label,
legend {
  font-size: 0.92rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  color: var(--ink);
  background: #fbfdff;
  border: 1px solid #c9d4df;
  border-radius: 6px;
  font: inherit;
}

input:focus,
select:focus {
  outline: 3px solid rgba(36, 91, 133, 0.18);
  border-color: var(--blue);
}

.field-set {
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.field-set legend {
  padding: 0 8px;
}

.field-set label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 600;
}

.field-set input {
  width: 18px;
  min-height: 18px;
}

.primary-action {
  grid-column: 1 / -1;
  min-height: 52px;
  border: 0;
  border-radius: 6px;
  background: var(--blue);
  color: white;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.secondary-action,
.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 6px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
}

.primary-link {
  color: white;
  background: var(--blue);
}

.secondary-action {
  color: var(--blue);
  background: white;
  border: 1px solid #b7c8d8;
  cursor: pointer;
}

.primary-action:hover {
  background: var(--blue-dark);
}

.primary-action:disabled {
  cursor: progress;
  opacity: 0.72;
}

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

.preview-panel {
  display: grid;
  align-content: start;
  gap: 18px;
  padding-top: 82px;
}

.status-card,
.result-card {
  padding: 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.pipeline {
  display: grid;
  gap: 14px;
  margin: 20px 0 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.55;
}

.check-list {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  color: var(--muted);
  line-height: 1.55;
  list-style: none;
}

.check-list li {
  position: relative;
  padding-left: 22px;
}

.check-list li::before {
  position: absolute;
  left: 0;
  color: var(--green);
  content: "✓";
  font-weight: 900;
}

.result-card {
  border-color: rgba(47, 111, 94, 0.28);
  background: #f4fbf8;
}

.result-card p:last-of-type {
  color: var(--muted);
  line-height: 1.65;
}

.mock-files {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.mock-files span {
  padding: 10px 12px;
  border: 1px solid rgba(47, 111, 94, 0.24);
  border-radius: 6px;
  color: var(--green);
  background: white;
  font-weight: 700;
}

.hidden-field {
  display: none;
}

.status-page {
  width: min(900px, calc(100% - 40px));
  margin: 0 auto;
  padding: 46px 0;
}

.status-view {
  display: grid;
  gap: 24px;
}

.status-detail {
  display: grid;
  gap: 18px;
}

.status-pill {
  width: fit-content;
  margin: 0;
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--green);
  background: #e9f6f1;
  font-size: 0.82rem;
  font-weight: 800;
}

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

.task-grid div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfdff;
}

.task-grid dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.task-grid dd {
  margin: 0;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.status-message {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.account-page h1 {
  font-size: clamp(2rem, 4vw, 3.8rem);
}

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

.account-box {
  display: grid;
  gap: 16px;
  padding: 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  background: #eef3f8;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.segment {
  min-height: 38px;
  color: var(--blue);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.segment.active {
  color: white;
  background: var(--blue);
}

.compact-action {
  grid-column: auto;
  width: fit-content;
  min-width: 140px;
  padding: 0 18px;
}

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

.model-form {
  gap: 18px;
}

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

.error-text {
  color: #9b1c1c;
}

.ai-preview {
  padding: 18px;
  border: 1px solid rgba(36, 91, 133, 0.22);
  border-radius: 8px;
  background: #f7fbff;
}

.ai-preview p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.75;
  white-space: pre-wrap;
}

.back-link a {
  color: var(--blue);
  font-weight: 800;
}

.setup-link {
  margin: 18px 0 0;
}

.setup-link a {
  color: var(--blue);
  font-weight: 800;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    width: min(100% - 28px, 720px);
    padding: 26px 0;
  }

  .preview-panel {
    padding-top: 0;
  }

  .research-form {
    grid-template-columns: 1fr;
  }

  .field-set {
    grid-template-columns: 1fr;
  }

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

  .account-layout,
  .model-grid {
    grid-template-columns: 1fr;
  }

  .notice-strip {
    display: grid;
  }
}
