:root {
  color-scheme: light;
  --page: #edf1f6;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --surface-tint: #eef7f4;
  --ink: #172033;
  --muted: #667085;
  --line: #d8e0eb;
  --brand: #2454d6;
  --brand-dark: #173a9a;
  --teal: #147f72;
  --gold: #b7791f;
  --red: #b42318;
  --shadow: 0 18px 52px rgba(23, 32, 51, 0.14);
  --small-shadow: 0 10px 28px rgba(23, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(36, 84, 214, 0.10), transparent 36%),
    linear-gradient(180deg, #f8fafc 0%, var(--page) 100%);
  color: var(--ink);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
}

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

.app-shell {
  min-height: 100vh;
  padding: 24px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(330px, 430px) minmax(0, 1fr);
  gap: 20px;
  max-width: 1480px;
  min-height: calc(100vh - 48px);
  margin: 0 auto;
}

.input-panel,
.output-panel {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(216, 224, 235, 0.95);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.input-panel {
  padding: 24px;
  overflow: auto;
}

.brand-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.brand-mark {
  display: grid;
  grid-template-columns: repeat(3, 10px);
  align-items: end;
  flex: 0 0 auto;
  gap: 4px;
  width: 48px;
  height: 48px;
  padding: 10px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.10), transparent),
    #172033;
  box-shadow: var(--small-shadow);
}

.brand-mark span {
  display: block;
  width: 10px;
  border-radius: 3px 3px 0 0;
}

.brand-mark span:nth-child(1) {
  height: 15px;
  background: #82a7ff;
}

.brand-mark span:nth-child(2) {
  height: 25px;
  background: #77dbc7;
}

.brand-mark span:nth-child(3) {
  height: 19px;
  background: #f6c26b;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.panel-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.input-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.input-meta span {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #dfe6f0;
  border-radius: 6px;
  background: #fbfcff;
  color: #344054;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

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

h1 {
  margin-bottom: 0;
  font-size: 25px;
  line-height: 1.16;
}

h2 {
  margin-bottom: 0;
  font-size: 23px;
  line-height: 1.2;
}

h3 {
  margin-bottom: 10px;
  font-size: 18px;
  line-height: 1.3;
}

.request-form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
}

label span {
  color: #344054;
  font-size: 13px;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(23, 32, 51, 0.02);
}

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

textarea {
  resize: vertical;
  min-height: 82px;
  padding: 10px 12px;
  line-height: 1.55;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(36, 84, 214, 0.14);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}

button {
  min-height: 43px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 850;
}

button:disabled {
  cursor: wait;
  opacity: 0.66;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
}

.primary-button {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent),
    var(--brand);
  color: white;
  box-shadow: 0 10px 20px rgba(36, 84, 214, 0.20);
}

.primary-button:hover:not(:disabled) {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.10), transparent),
    var(--brand-dark);
}

.secondary-button {
  border: 1px solid var(--line);
  background: #fbfcff;
  color: #344054;
}

.secondary-button:hover:not(:disabled) {
  background: #f0f4fa;
}

.button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 12px;
}

.output-panel {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  overflow: hidden;
}

.output-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 24px 26px 16px;
  border-bottom: 1px solid var(--line);
}

.status {
  max-width: 280px;
  padding: 8px 12px;
  border-radius: 6px;
  background: #eaf1ff;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 850;
  text-align: right;
}

.status.error {
  background: #fef3f2;
  color: var(--red);
}

.status.success {
  background: #ecfdf3;
  color: #067647;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 26px;
  background: #fbfcff;
  border-bottom: 1px solid var(--line);
}

.summary-strip div {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #dfe6f0;
  border-radius: 8px;
  background: var(--surface);
}

.summary-strip span,
.metric span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.summary-strip strong {
  color: var(--ink);
  font-size: 17px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(92px, 1fr));
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}

.tab {
  min-height: 48px;
  border-radius: 0;
  background: #f8fafc;
  color: #475467;
}

.tab:hover {
  background: #ffffff;
}

.tab.active {
  background: var(--surface);
  color: var(--brand);
  box-shadow: inset 0 -3px 0 var(--brand);
}

.result-surface {
  min-height: 0;
  overflow: auto;
  padding: 24px 26px;
  background: var(--surface);
}

.empty-state {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 430px;
  text-align: center;
  color: var(--muted);
}

.empty-state p {
  max-width: 480px;
  margin-bottom: 0;
  line-height: 1.65;
}

.empty-state.error-state h3 {
  color: var(--red);
}

.empty-visual {
  width: 172px;
  height: 112px;
  margin-bottom: 22px;
  border: 1px solid #cad5e5;
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 12px, rgba(36, 84, 214, 0.13) 12px 14px, transparent 14px),
    linear-gradient(180deg, #ffffff 0 24px, #edf4ff 24px 25px, transparent 25px),
    linear-gradient(135deg, rgba(36, 84, 214, 0.16), rgba(20, 127, 114, 0.14) 54%, rgba(183, 121, 31, 0.12));
  box-shadow: var(--small-shadow);
}

.section-grid {
  display: grid;
  gap: 16px;
}

.content-section {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.content-section h3 {
  margin-bottom: 12px;
}

.pill-list,
.timeline,
.quiz-list,
.slide-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pill-list li,
.timeline li,
.quiz-list li,
.slide-list li {
  border: 1px solid #e4e9f2;
  border-left: 4px solid rgba(20, 127, 114, 0.55);
  border-radius: 6px;
  background: var(--surface);
  padding: 12px;
  line-height: 1.58;
}

.timeline strong,
.quiz-list strong,
.slide-list strong {
  color: var(--ink);
}

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

.metric {
  padding: 14px;
  border-radius: 8px;
  background: #f5fbff;
  border: 1px solid #d9ebff;
}

.metric:nth-child(2) {
  background: var(--surface-tint);
  border-color: #cfe7df;
}

.metric:nth-child(3) {
  background: #fff8ec;
  border-color: #f4dfb8;
}

.metric strong {
  color: var(--ink);
  font-size: 18px;
}

.raw-text {
  white-space: pre-wrap;
  line-height: 1.68;
}

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

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

  .output-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .status {
    max-width: none;
    text-align: left;
  }

  .summary-strip,
  .tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-row,
  .form-grid,
  .button-row,
  .input-meta {
    grid-template-columns: 1fr;
  }
}
