:root {
  color-scheme: light;
  --bg: #edf2ef;
  --ink: #192a2f;
  --muted: #6a7a80;
  --line: rgba(35, 56, 62, 0.12);
  --panel: rgba(251, 248, 242, 0.86);
  --panel-strong: #fffdf8;
  --accent: #d15f2d;
  --accent-strong: #a3471f;
  --green: #2f7b67;
  --green-soft: #d7ece4;
  --error: #9f4630;
  --error-soft: #f8dfd7;
  --shadow: 0 24px 60px rgba(28, 49, 56, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(209, 95, 45, 0.12), transparent 28%),
    radial-gradient(circle at right 20%, rgba(47, 123, 103, 0.14), transparent 24%),
    linear-gradient(180deg, #f7faf8 0%, var(--bg) 100%);
}

code {
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(25, 42, 47, 0.07);
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

.appShell {
  max-width: 1680px;
  margin: 0 auto;
  padding: 28px 26px 36px;
}

.topbar,
.composerCard,
.resultBoard,
.detailBoard,
.detailEmpty {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 6px 8px;
  border: none;
  background: transparent;
  box-shadow: none;
}

.kicker {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

h1 {
  margin-top: 6px;
  font-size: clamp(34px, 4vw, 58px);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

h2 {
  font-size: 22px;
  line-height: 1.15;
}

h3 {
  font-size: 16px;
  line-height: 1.2;
}

p {
  color: var(--muted);
  line-height: 1.7;
}

.topbarLink,
.detailLink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 14px;
  border-radius: 999px;
  border: 1px solid rgba(35, 56, 62, 0.1);
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}

.composerCard {
  margin-top: 10px;
  padding: 22px;
  border-radius: 34px;
}

.composerLabel {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.composerInput {
  width: 100%;
  min-height: 180px;
  padding: 20px 22px;
  border: 1px solid rgba(35, 56, 62, 0.1);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font: inherit;
  font-size: 18px;
  line-height: 1.55;
  resize: vertical;
}

.composerInput:focus {
  outline: 2px solid rgba(209, 95, 45, 0.2);
  border-color: rgba(209, 95, 45, 0.28);
}

.toolbar {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.toolbarActions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.actionBtn,
.miniBtn,
.resultItem {
  border: none;
  font: inherit;
}

.actionBtn,
.miniBtn {
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    opacity 0.18s ease,
    background-color 0.18s ease;
}

.actionBtn {
  padding: 13px 18px;
}

.miniBtn {
  padding: 10px 14px;
}

.primary {
  background: linear-gradient(135deg, var(--accent) 0%, #df7a4f 100%);
  color: #fff;
}

.secondary {
  background: rgba(47, 123, 103, 0.12);
  color: var(--green);
}

.ghost {
  background: rgba(35, 56, 62, 0.06);
  color: var(--ink);
}

.actionBtn:hover,
.miniBtn:hover {
  transform: translateY(-1px);
}

.actionBtn:disabled,
.miniBtn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

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

.resultBoard,
.detailBoard,
.detailEmpty {
  border-radius: 30px;
}

.resultBoard {
  padding: 18px;
}

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

.railEmpty {
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  line-height: 1.7;
}

.resultItem {
  width: 100%;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 72px;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  text-align: left;
  background: rgba(255, 255, 255, 0.68);
  cursor: pointer;
  transition:
    transform 0.18s ease,
    background-color 0.18s ease,
    box-shadow 0.18s ease;
}

.resultItem:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.92);
}

.resultItem.isActive {
  background: #fffdf9;
  box-shadow: inset 0 0 0 1px rgba(209, 95, 45, 0.22);
}

.resultIndex {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.resultTitle {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resultState {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.resultState--success {
  background: var(--green-soft);
  color: var(--green);
}

.resultState--error {
  background: var(--error-soft);
  color: var(--error);
}

.detailEmpty {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.detailBoard {
  padding: 22px;
}

.errorView {
  padding: 20px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.72);
}

.errorBadge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.errorBadge {
  background: var(--error-soft);
  color: var(--error);
}

.postHero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.postHero h2 {
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.postHeroActions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.contentDeck {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.contentPanel {
  padding: 18px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.74);
}

.prosePanel h3,
.commentsPanel h3 {
  margin-bottom: 12px;
}

.proseBody {
  display: grid;
  gap: 12px;
}

.proseBody p {
  color: var(--ink);
}

.postMuted {
  color: var(--muted);
}

.panelHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panelHead span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.commentGrid {
  display: grid;
  gap: 8px;
  max-height: 520px;
  overflow: auto;
  padding-right: 6px;
}

.commentCard {
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--panel-strong);
  border: 1px solid rgba(35, 56, 62, 0.06);
}

.commentScore {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
}

.commentLine {
  margin-top: 8px;
  color: var(--ink);
  line-height: 1.65;
}

.commentEmpty {
  padding: 14px;
  border-radius: 18px;
  background: rgba(35, 56, 62, 0.05);
  color: var(--muted);
}

.jsonFold {
  margin-top: 16px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
}

.jsonFold summary {
  cursor: pointer;
  padding: 16px 18px;
  font-weight: 700;
  list-style: none;
}

.jsonFold summary::-webkit-details-marker {
  display: none;
}

.jsonFold pre {
  margin: 0;
  padding: 0 18px 18px;
  overflow: auto;
  color: #20353d;
  font-size: 13px;
  line-height: 1.65;
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

@media (max-width: 980px) {
  .detailEmpty {
    min-height: 0;
  }
}

@media (max-width: 760px) {
  .appShell {
    padding: 18px 12px 26px;
  }

  .topbar,
  .composerIntro,
  .toolbar,
  .postHero {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbarActions,
  .postHeroActions {
    width: 100%;
    flex-wrap: wrap;
  }

  .actionBtn,
  .miniBtn,
  .topbarLink,
  .detailLink {
    width: 100%;
    justify-content: center;
  }

  .composerCard,
  .detailBoard,
  .detailEmpty {
    border-radius: 24px;
  }

  .composerInput {
    min-height: 220px;
    font-size: 16px;
  }
}
