:root {
  --ink: #1f1a17;
  --muted: #71665d;
  --paper: #fff9ef;
  --card: #fffdf8;
  --line: #eadcc7;
  --red: #9d1f1f;
  --red-dark: #741515;
  --gold: #c8953f;
  --green: #255e46;
  --shadow: 0 18px 55px rgba(80, 47, 14, .12);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: ui-serif, "Songti SC", STSong, SimSun, serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 5%, rgba(200,149,63,.18), transparent 28rem),
    linear-gradient(135deg, #fffaf1 0%, #f6ead8 48%, #fff6e6 100%);
}
.warning {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--red-dark);
  color: #fff7e8;
  padding: .7rem 1rem;
  text-align: center;
  font-size: .92rem;
}
.hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 4rem 1.2rem 2.4rem;
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 1.4rem;
  align-items: center;
}
.seal {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  border: 8px solid var(--red);
  color: var(--red);
  font-size: 3.8rem;
  font-weight: 800;
  border-radius: 18px;
  transform: rotate(-4deg);
}
.eyebrow {
  margin: 0 0 .4rem;
  color: var(--red);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .78rem;
}
h1 {
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 5rem);
  line-height: .95;
}
.lede {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.75;
}
.layout {
  max-width: 1180px;
  margin: 0 auto 3rem;
  padding: 0 1.2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.panel {
  background: rgba(255,253,248,.88);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 24px;
  padding: 1.2rem;
}
.panel-head {
  display: flex;
  gap: .85rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}
.step {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-weight: 800;
}
h2 { margin: 0; font-size: 1.3rem; }
.panel-head p { margin: .25rem 0 0; color: var(--muted); font-size: .92rem; }
.scenario-list {
  display: grid;
  gap: .75rem;
}
.scenario-card {
  border: 1px solid var(--line);
  background: #fffaf1;
  border-radius: 16px;
  padding: .95rem;
  cursor: pointer;
  text-align: left;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.scenario-card:hover { transform: translateY(-1px); border-color: var(--gold); }
.scenario-card.active { border-color: var(--red); background: #fff3df; }
.scenario-card b { display: block; margin-bottom: .25rem; }
.scenario-card span { color: var(--red); font-size: .78rem; font-weight: 700; }
.scenario-card p { margin: .35rem 0 0; color: var(--muted); line-height: 1.55; }
label { display: grid; gap: .35rem; margin: .8rem 0; font-weight: 700; }
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .8rem .9rem;
  background: #fffaf1;
  color: var(--ink);
  font: 500 .95rem/1.5 ui-sans-serif, system-ui, sans-serif;
}
textarea { resize: vertical; }
.checkbox {
  grid-template-columns: auto 1fr;
  align-items: center;
  font-weight: 500;
  color: var(--muted);
}
.checkbox input { width: auto; }
.presets, .actions, .output-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
}
button {
  border: 0;
  border-radius: 999px;
  padding: .75rem 1rem;
  cursor: pointer;
  font-weight: 800;
}
button.primary { background: var(--red); color: #fff8ec; }
button.secondary { background: #efe0ca; color: var(--ink); }
button.danger { color: var(--red-dark); }
.presets button { background: #fff0d7; color: var(--red-dark); border: 1px solid var(--line); }
.input-panel, .output-panel { grid-column: span 1; }
.status { color: var(--muted); min-height: 1.4rem; }
.markdown-output {
  min-height: 280px;
  white-space: pre-wrap;
  background: #1f1a17;
  color: #fff8ec;
  border-radius: 16px;
  padding: 1rem;
  overflow: auto;
  font: 500 .94rem/1.7 ui-sans-serif, system-ui, sans-serif;
}
footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.2rem 3rem;
  color: var(--muted);
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 2.6rem; }
  .layout { grid-template-columns: 1fr; }
  .input-panel, .output-panel { grid-column: auto; }
}
.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  margin-bottom: 1rem;
  padding: .35rem;
  background: #f3e4cf;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.mode-switch button {
  background: transparent;
  color: var(--muted);
}
.mode-switch button.active {
  background: var(--red);
  color: #fff8ec;
  box-shadow: 0 8px 24px rgba(157, 31, 31, .18);
}
.expert-controls {
  display: grid;
  grid-template-columns: 1.3fr .7fr;
  gap: .7rem;
  align-items: end;
  margin-bottom: 1rem;
}
.hidden { display: none !important; }
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .8rem .9rem;
  background: #fffaf1;
  color: var(--ink);
  font: 700 .95rem/1.5 ui-sans-serif, system-ui, sans-serif;
}
.skill-card small {
  display: block;
  margin-top: .45rem;
  color: var(--green);
  font: 700 .74rem/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-word;
}
.empty-state {
  margin: 0;
  padding: 1rem;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
  background: #fffaf1;
}
@media (max-width: 860px) {
  .expert-controls { grid-template-columns: 1fr; }
}
