:root {
  color-scheme: light;
  --bg: #f4efe7;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: rgba(255, 252, 246, 0.94);
  --ink: #1d1b18;
  --muted: #5b554d;
  --line: rgba(29, 27, 24, 0.12);
  --accent: #b84c2a;
  --accent-soft: rgba(184, 76, 42, 0.12);
  --shadow: 0 24px 60px rgba(29, 27, 24, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Georgia", "Songti SC", "Noto Serif CJK SC", serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top, rgba(184, 76, 42, 0.12), transparent 30%),
    linear-gradient(180deg, #f8f3eb 0%, var(--bg) 100%);
}

.shell {
  width: min(1100px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 48px 0 80px;
}

.hero {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  align-items: stretch;
  padding: 12px 0 28px;
}

.hero-copy,
.hero-spotlight {
  min-height: 100%;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero-copy {
  display: grid;
  align-content: start;
  gap: 18px;
}

.eyebrow {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2.8rem, 6vw, 4.9rem);
  line-height: 0.92;
}

h2 {
  font-size: 1.45rem;
}

.lede {
  max-width: 680px;
  color: var(--muted);
  line-height: 1.75;
}

.hero-status {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.hero-hint,
.meta,
.empty,
.detail-empty {
  color: var(--muted);
}

.hero-actions,
.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.align-end {
  align-self: end;
}

.hero-spotlight {
  display: grid;
  gap: 20px;
  grid-template-columns: 150px 1fr;
  align-items: center;
}

.spotlight-media {
  position: relative;
  min-height: 220px;
}

.spotlight-cover,
.detail-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(29, 27, 24, 0.06);
}

.spotlight-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 22px;
  color: white;
  font-size: 2.5rem;
  letter-spacing: 0.08em;
  background:
    linear-gradient(135deg, rgba(184, 76, 42, 0.92), rgba(79, 39, 29, 0.92));
}

.spotlight-copy {
  display: grid;
  gap: 12px;
}

.spotlight-label {
  color: var(--accent);
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.utility-grid,
.split {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr 1fr;
}

.operator-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr 1fr;
  margin-top: 18px;
}

.operator-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
}

.operator-toolbar {
  margin-top: 18px;
}

.operator-filter-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
}

.operator-stats {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 14px;
}

.operator-stat {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.operator-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.operator-list-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.operator-item-head {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
}

.operator-editor {
  display: grid;
  gap: 12px;
}

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

.operator-field-wide {
  grid-column: 1 / -1;
}

.operator-inline-form {
  align-items: center;
}

.panel {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  backdrop-filter: blur(12px);
}

.panel h2 {
  margin-bottom: 14px;
  font-size: 1.25rem;
}

.section-head,
.detail-topbar,
.card-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: var(--muted);
  font-size: 0.9rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
}

textarea {
  resize: vertical;
  min-height: 96px;
}

button,
.chip-button {
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  font: inherit;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

button:hover,
.chip-button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

button {
  color: white;
  background: var(--accent);
}

button.secondary {
  color: var(--ink);
  background: var(--accent-soft);
}

.chip-row {
  margin-top: 16px;
}

.chip-button {
  color: var(--muted);
  background: rgba(29, 27, 24, 0.06);
}

.chip-button.active {
  color: white;
  background: var(--accent);
}

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

.badge,
.pill,
.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.85rem;
}

.badge {
  color: var(--ink);
  background: rgba(29, 27, 24, 0.08);
}

.badge.active {
  color: white;
  background: var(--accent);
}

.pill {
  color: var(--accent);
  background: var(--accent-soft);
  white-space: nowrap;
}

.tag-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  color: var(--muted);
  background: rgba(29, 27, 24, 0.06);
}

.catalog {
  display: grid;
  gap: 14px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
  transition: transform 180ms ease, border-color 180ms ease,
    box-shadow 180ms ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(184, 76, 42, 0.28);
}

.card.selected {
  border-color: rgba(184, 76, 42, 0.42);
  box-shadow: 0 18px 40px rgba(184, 76, 42, 0.08);
}

.card-body {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.detail-panel {
  min-height: 520px;
}

.detail {
  display: grid;
  gap: 16px;
}

.detail-header {
  display: grid;
  gap: 16px;
  grid-template-columns: 140px 1fr;
}

.detail-cover {
  width: 140px;
  height: 188px;
}

.detail-copy {
  display: grid;
  gap: 10px;
}

.detail-description {
  line-height: 1.75;
  color: var(--ink);
}

.variant-list {
  display: grid;
  gap: 10px;
}

.variant {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
}

.download-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.download-panel-header {
  display: grid;
  gap: 6px;
}

.download-stage {
  display: grid;
  gap: 18px;
}

.download-stage-view {
  display: grid;
  gap: 18px;
}

.download-stage-followup {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px dashed rgba(184, 76, 42, 0.2);
  border-radius: 18px;
  background: rgba(255, 252, 246, 0.82);
}

.download-stage-top {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto;
  align-items: start;
}

.download-stage-steps {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.step-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.75);
}

.step-card.active {
  border-color: rgba(184, 76, 42, 0.35);
  background: rgba(184, 76, 42, 0.08);
}

.step-card.success {
  border-color: rgba(47, 128, 91, 0.28);
  background: rgba(47, 128, 91, 0.08);
}

.step-card.error {
  border-color: rgba(177, 57, 57, 0.28);
  background: rgba(177, 57, 57, 0.08);
}

.step-label {
  color: var(--accent);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.download-link {
  display: inline-flex;
  margin-top: 14px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.download-link:hover {
  text-decoration: underline;
}

.output {
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  background: #171411;
  color: #f6f3ef;
  font-family: "SFMono-Regular", "Menlo", monospace;
  font-size: 0.85rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.compact {
  margin-top: 2px;
}

.hidden {
  display: none;
}

@media (max-width: 860px) {
  .hero,
  .utility-grid,
  .split,
  .operator-grid,
  .operator-filter-grid,
  .operator-editor-grid,
  .search-grid,
  .hero-spotlight,
  .detail-header,
  .download-stage-top,
  .download-stage-steps {
    grid-template-columns: 1fr;
  }

  .operator-stats {
    grid-template-columns: 1fr;
  }

  .spotlight-media {
    min-height: 260px;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100vw - 20px, 1100px);
    padding-top: 28px;
  }

  h1 {
    font-size: 2.9rem;
  }

  .detail-topbar,
  .card-topline,
  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .detail-cover {
    width: min(100%, 220px);
    height: auto;
    aspect-ratio: 3 / 4;
  }
}
