:root {
  --bg: #f2efe7;
  --panel: rgba(255, 250, 240, 0.84);
  --panel-strong: rgba(255, 247, 232, 0.96);
  --line: rgba(94, 58, 31, 0.14);
  --text: #24160f;
  --muted: #6c5648;
  --accent: #c44f2b;
  --accent-dark: #873117;
  --shadow: 0 20px 60px rgba(72, 35, 13, 0.12);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Noto Sans TC", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(216, 115, 68, 0.22), transparent 22%),
    radial-gradient(circle at top right, rgba(198, 188, 95, 0.16), transparent 26%),
    linear-gradient(140deg, #efe4cf 0%, #f8f4ea 40%, #e8e1d1 100%);
}

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

.app-shell {
  width: min(1360px, calc(100vw - 32px));
  margin: 24px auto 48px;
}

.hero,
.panel,
.warning-panel,
.page-nav {
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 32px;
  border-radius: 32px;
  background: linear-gradient(135deg, rgba(255, 248, 237, 0.95), rgba(247, 235, 214, 0.84));
}

.hero h1,
.panel h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.04em;
}

.hero h1 {
  font-size: clamp(2rem, 3vw, 3.4rem);
}

.hero-copy,
.warning-panel p,
.gallery-stats {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
}

.page-nav {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  padding: 12px;
  border-radius: 22px;
  background: rgba(255, 250, 240, 0.72);
}

.page-link {
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--accent-dark);
  text-decoration: none;
  background: rgba(196, 79, 43, 0.08);
  border: 1px solid rgba(196, 79, 43, 0.12);
}

.page-link.is-active {
  color: #fff7f1;
  background: linear-gradient(135deg, var(--accent), #d8842d);
}

.warning-panel {
  margin-top: 20px;
  padding: 16px 20px;
  border-radius: 22px;
  background: rgba(255, 243, 223, 0.92);
}

.single-column,
.stack-layout {
  display: grid;
  gap: 20px;
  margin-top: 20px;
}

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

.panel {
  padding: 20px;
  border-radius: var(--radius);
  background: var(--panel);
}

.panel-wide {
  background: var(--panel-strong);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.74rem;
  color: var(--accent-dark);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

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

textarea,
input,
.response-box {
  width: 100%;
  border: 1px solid rgba(94, 58, 31, 0.18);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 253, 248, 0.9);
  color: var(--text);
}

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

textarea,
.response-box,
.gallery-card pre {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.9rem;
  line-height: 1.55;
}

input:focus,
textarea:focus {
  outline: 2px solid rgba(196, 79, 43, 0.28);
  border-color: rgba(196, 79, 43, 0.4);
}

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

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.compact-row {
  margin-top: 0;
}

.editor-fold,
.response-fold {
  margin-top: 16px;
  border: 1px solid rgba(94, 58, 31, 0.14);
  border-radius: 18px;
  background: rgba(255, 251, 244, 0.72);
}

.editor-fold summary,
.response-fold summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 16px;
  font-weight: 700;
  color: var(--accent-dark);
}

.editor-fold summary::-webkit-details-marker,
.response-fold summary::-webkit-details-marker {
  display: none;
}

.editor-fold summary::after,
.response-fold summary::after {
  content: "+";
  float: right;
  font-family: "Space Grotesk", sans-serif;
}

.editor-fold[open] summary::after,
.response-fold[open] summary::after {
  content: "-";
}

.fold-body {
  padding: 0 16px 16px;
}

.request-source-fold {
  margin-top: 0;
}

.response-box {
  margin: 0;
  padding-top: 0;
  border: none;
  background: transparent;
  white-space: pre-wrap;
  word-break: break-word;
}

.meta-strip {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(135, 49, 23, 0.08);
  color: var(--accent-dark);
}

button {
  cursor: pointer;
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  transition: transform 180ms ease, background 180ms ease;
}

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

.primary-button {
  color: #fff7f1;
  background: linear-gradient(135deg, var(--accent), #d8842d);
}

.ghost-button {
  color: var(--accent-dark);
  background: rgba(196, 79, 43, 0.08);
  border: 1px solid rgba(196, 79, 43, 0.18);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.gallery-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 252, 246, 0.96);
  box-shadow: 0 12px 32px rgba(67, 37, 14, 0.1);
}

.gallery-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: linear-gradient(135deg, rgba(196, 79, 43, 0.15), rgba(214, 161, 94, 0.15));
}

.gallery-body {
  padding: 14px;
}

.gallery-head,
.gallery-meta,
.gallery-selection {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.gallery-title {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
}

.pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  background: rgba(135, 49, 23, 0.1);
  color: var(--accent-dark);
}

.gallery-card pre {
  margin: 12px 0 0;
  max-height: 160px;
  overflow: auto;
  padding: 12px;
  border-radius: 16px;
  background: rgba(243, 235, 220, 0.7);
}

.gallery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.gallery-actions button {
  flex: 1 1 120px;
}

@media (max-width: 900px) {
  .panel-header,
  .hero {
    flex-direction: column;
  }

  .api-grid,
  .inline-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100vw - 20px, 100%);
    margin-top: 10px;
  }

  .page-nav {
    flex-direction: column;
  }
}
