:root {
  --brand-red: #e60012;
  --gold: #ffc107;
  --green: #2f7d68;
  --ink: #20282b;
  --muted: #657174;
  --line: #dfe5e2;
  --paper: #fbfaf7;
  --panel: #ffffff;
  --soft-red: #fff1f1;
  --soft-gold: #fff7dc;
  --soft-green: #eaf6f1;
  --shadow: 0 16px 42px rgba(32, 40, 43, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(230, 0, 18, 0.05) 0 1px, transparent 1px 96px),
    linear-gradient(0deg, rgba(47, 125, 104, 0.05) 0 1px, transparent 1px 96px),
    var(--paper);
  font-family: "Noto Sans TC", "Microsoft JhengHei", Arial, sans-serif;
}

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

button {
  border: 0;
  cursor: pointer;
}

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

h1 {
  font-size: 1.45rem;
  line-height: 1.25;
}

h2 {
  font-size: clamp(1.45rem, 2vw, 2.05rem);
  line-height: 1.3;
}

h3 {
  font-size: 1.15rem;
  line-height: 1.35;
}

.app-shell {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 20px;
  width: min(1480px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px;
}

.side-panel,
.main-panel,
.content-section,
.intro-band {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.side-panel {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: calc(100vh - 40px);
  padding: 22px;
}

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

.bit-mark {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand-red) 0 56%, var(--gold) 56% 100%);
  box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.38);
}

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

.progress-card,
.assist-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--soft-red);
}

.progress-title,
.section-heading,
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.progress-title span,
.section-heading span {
  color: var(--green);
  font-weight: 900;
}

.progress-title strong {
  color: var(--brand-red);
  font-size: 1.45rem;
}

.progress-track {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: #ffe2e5;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-red), var(--gold));
  transition: width 0.2s ease;
}

.progress-card p,
.assist-card li,
.intro-band p,
.question-item p {
  color: var(--muted);
  line-height: 1.6;
}

.step-list {
  display: grid;
  gap: 8px;
}

.step-list a {
  min-height: 42px;
  border-radius: 6px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
  font-weight: 900;
  text-decoration: none;
}

.step-list a:hover {
  color: #fff;
  background: var(--brand-red);
}

.assist-card {
  margin-top: auto;
  background: var(--soft-green);
}

.assist-card h2 {
  font-size: 1rem;
}

.assist-card ul {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 20px;
}

.main-panel {
  min-width: 0;
  padding: 22px;
}

.top-bar {
  margin-bottom: 18px;
}

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

.primary-action,
.secondary-action,
.ghost-action {
  min-height: 38px;
  border-radius: 6px;
  padding: 0 14px;
  font-weight: 900;
}

.primary-action {
  color: #fff;
  background: var(--brand-red);
}

.secondary-action {
  color: #613f00;
  background: var(--gold);
}

.ghost-action {
  color: var(--brand-red);
  background: var(--soft-red);
}

.intro-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
  padding: 18px;
  border-left: 5px solid var(--gold);
}

.intro-band strong {
  display: block;
  margin-bottom: 6px;
  color: var(--brand-red);
}

.brief-form {
  display: grid;
  gap: 18px;
}

.content-section {
  min-width: 0;
  padding: 20px;
}

.section-heading {
  margin-bottom: 16px;
}

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

label {
  display: grid;
  gap: 7px;
  color: #354244;
  font-size: 0.93rem;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

input,
select {
  min-height: 42px;
  padding: 9px 11px;
}

textarea {
  min-height: 104px;
  resize: vertical;
  padding: 11px;
  line-height: 1.55;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px rgba(230, 0, 18, 0.11);
}

fieldset {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 0 0 16px;
  border: 0;
  padding: 0;
}

legend {
  margin-bottom: 10px;
  color: #354244;
  font-weight: 900;
}

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

.chip-grid label {
  display: flex;
  align-items: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 11px;
  background: #fff;
  font-size: 0.9rem;
}

.custom-field {
  margin-top: 2px;
}

.chip-grid input {
  width: 18px;
  min-height: 18px;
  margin: 0 8px 0 0;
  accent-color: var(--brand-red);
}

.quick-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 0;
}

.quick-options button {
  min-height: 34px;
  border-radius: 6px;
  padding: 0 11px;
  color: var(--green);
  background: var(--soft-green);
  font-size: 0.86rem;
  font-weight: 900;
}

.quick-options button:hover {
  color: #fff;
  background: var(--green);
}

.quick-options button:last-child {
  color: var(--brand-red);
  background: var(--soft-red);
}

.output-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.ai-panel {
  align-self: start;
}

.question-list {
  display: grid;
  gap: 12px;
}

.question-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.question-item strong {
  display: block;
  margin-bottom: 6px;
  color: var(--brand-red);
}

.brief-output {
  min-height: 560px;
  max-height: 760px;
  overflow: auto;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  color: #2d373a;
  background: #fff;
  font-family: "Microsoft JhengHei", "Noto Sans TC", Arial, sans-serif;
  font-size: 0.95rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

.submit-status {
  min-height: 28px;
  margin: -4px 0 12px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.5;
}

.submit-status.is-success {
  color: var(--green);
}

.submit-status.is-error {
  color: var(--brand-red);
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .side-panel {
    position: static;
    height: auto;
  }

  .assist-card {
    margin-top: 0;
  }
}

@media (max-width: 820px) {
  .app-shell {
    padding: 12px;
  }

  .main-panel,
  .side-panel,
  .content-section {
    padding: 16px;
  }

  .top-bar,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions,
  .primary-action,
  .secondary-action,
  .ghost-action {
    width: 100%;
  }

  .intro-band,
  .form-grid,
  .chip-grid,
  .output-layout {
    grid-template-columns: 1fr;
  }
}
