:root {
  --bg: #f3efe6;
  --bg-panel: rgba(255, 252, 247, 0.92);
  --bg-panel-strong: #fffaf1;
  --sidebar: linear-gradient(180deg, #1f3d34 0%, #152921 100%);
  --line: rgba(24, 43, 35, 0.12);
  --line-strong: rgba(24, 43, 35, 0.22);
  --text: #1f2d28;
  --muted: #5e6f67;
  --accent: #d87b38;
  --accent-strong: #b85d20;
  --accent-soft: rgba(216, 123, 56, 0.12);
  --success: #1d7a55;
  --shadow: 0 22px 60px rgba(22, 30, 26, 0.14);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  --sans: "Segoe UI", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(216, 123, 56, 0.18), transparent 28%),
    linear-gradient(180deg, #f7f3eb 0%, #eee6d8 100%);
  color: var(--text);
  font-family: var(--sans);
}

body {
  min-height: 100vh;
}

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

code,
pre {
  font-family: var(--mono);
}

.hidden {
  display: none !important;
}

.app-shell {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 28px 22px;
  background: var(--sidebar);
  color: #eef4ee;
}

.sidebar-head h1 {
  margin: 0;
  font-size: 1.9rem;
  line-height: 1.05;
}

.sidebar-copy {
  margin: 12px 0 0;
  color: rgba(238, 244, 238, 0.72);
  line-height: 1.55;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: inherit;
  opacity: 0.72;
}

.module-nav {
  display: grid;
  gap: 10px;
}

.module-button {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 14px 14px 13px;
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    transform 120ms ease,
    background 120ms ease,
    border-color 120ms ease;
}

.module-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.module-button.is-active {
  background: rgba(216, 123, 56, 0.18);
  border-color: rgba(216, 123, 56, 0.56);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.module-button strong {
  display: block;
  font-size: 0.98rem;
  margin-bottom: 4px;
}

.module-button span {
  display: block;
  font-size: 0.84rem;
  line-height: 1.4;
  color: rgba(238, 244, 238, 0.74);
}

.workspace {
  display: grid;
  gap: 22px;
  padding: 26px;
}

.hero-panel,
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero-panel {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  padding: 24px 26px;
}

.hero-panel h2 {
  margin: 0;
  font-size: 2rem;
}

.module-description {
  margin: 10px 0 0;
  max-width: 720px;
  color: var(--muted);
  line-height: 1.6;
}

.endpoint-card {
  min-width: 240px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--bg-panel-strong);
  border: 1px solid var(--line);
}

.endpoint-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.endpoint-card code {
  display: block;
  font-size: 0.92rem;
  word-break: break-all;
}

.grid {
  display: grid;
  grid-template-columns: minmax(320px, 450px) minmax(0, 1fr);
  gap: 22px;
}

.panel {
  padding: 22px;
}

.panel-head,
.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-head h3,
.preview-head h4 {
  margin: 0;
}

.preview-head h4 {
  font-size: 0.95rem;
}

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

.field,
.field-block {
  display: grid;
  gap: 8px;
}

.field span,
.field-block span {
  font-size: 0.9rem;
  font-weight: 600;
}

.field small {
  color: var(--muted);
  line-height: 1.45;
}

.field input,
.field select,
.field-block textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  padding: 12px 13px;
  background: #fffdf9;
  color: var(--text);
}

.field-block textarea {
  min-height: 280px;
  resize: vertical;
  line-height: 1.5;
}

.field-span-2 {
  grid-column: span 2;
}

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

.actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.primary-button,
.ghost-button {
  border-radius: 999px;
  padding: 11px 18px;
  cursor: pointer;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    background 120ms ease;
}

.primary-button {
  border: 1px solid var(--accent-strong);
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fffaf4;
  font-weight: 700;
}

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

.ghost-button {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
}

.request-status,
.response-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.preview-stack {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.preview-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid var(--line);
}

.preview-code {
  margin: 0;
  max-height: 480px;
  overflow: auto;
  padding: 16px;
  border-radius: 16px;
  background: #1d2421;
  color: #eef5f2;
  font-size: 0.88rem;
  line-height: 1.56;
}

.image-placeholder {
  display: grid;
  place-items: center;
  min-height: 240px;
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed rgba(29, 122, 85, 0.28);
  background: linear-gradient(180deg, rgba(29, 122, 85, 0.04), rgba(216, 123, 56, 0.08));
  color: var(--muted);
  text-align: center;
}

.image-preview {
  width: 100%;
  max-height: 720px;
  object-fit: contain;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
}

.reply-preview {
  display: grid;
  gap: 16px;
}

.reply-item {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.reply-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.reply-item-title {
  font-size: 0.95rem;
}

.reply-item-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 700;
}

.reply-image {
  width: 100%;
  max-height: 960px;
  object-fit: contain;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
}

.reply-audio {
  width: 100%;
}

.reply-text {
  margin: 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: #1d2421;
  color: #eef5f2;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
}

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

  .sidebar {
    gap: 18px;
  }

  .hero-panel,
  .grid {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    flex-direction: column;
  }

  .endpoint-card {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .workspace {
    padding: 16px;
  }

  .sidebar {
    padding: 18px 16px;
  }

  .panel,
  .hero-panel {
    padding: 18px;
    border-radius: 22px;
  }

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

  .field-span-2 {
    grid-column: auto;
  }
}
