:root {
  --page: #f4f6f5;
  --surface: #ffffff;
  --ink: #22211f;
  --muted: #626a67;
  --line: #d9dfdc;
  --accent: #7d2f2f;
  --accent-quiet: #f6e9e6;
  --teal: #23615d;
  --shadow: 0 12px 28px rgba(31, 40, 37, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 36px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 14px;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.18;
  font-weight: 750;
  letter-spacing: 0;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.stats span,
.metaPill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.62);
  white-space: nowrap;
}

.controls {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(190px, 280px) minmax(220px, 340px);
  gap: 14px;
  padding: 18px 0 22px;
}

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

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

.field input,
.field select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

.field input:focus,
.field select:focus,
.storyRow:focus-visible,
.listHeader button:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(142, 59, 51, 0.14);
}

.content {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.listPane {
  min-width: 0;
}

.listHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 14px;
}

.listHeader button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 12px;
  cursor: pointer;
}

.storyList {
  display: grid;
  gap: 9px;
  max-height: calc(100vh - 226px);
  overflow: auto;
  padding: 1px 4px 12px 1px;
}

.storyRow {
  width: 100%;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  padding: 12px;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
}

.storyRow:hover {
  border-color: #c9c0b5;
  box-shadow: var(--shadow);
}

.storyRow.isActive {
  border-color: var(--accent);
  background: var(--accent-quiet);
}

.storyTitle {
  margin: 0 0 7px;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.storyMeta,
.storyExcerpt {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.storyExcerpt {
  margin-top: 6px;
}

.detailPane {
  min-width: 0;
  border-top: 3px solid var(--ink);
  padding-top: 18px;
}

.detailTitle {
  margin: 0 0 12px;
  font-size: 27px;
  line-height: 1.28;
  font-weight: 760;
  overflow-wrap: anywhere;
}

.detailMeta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 13px;
}

.storyText {
  margin: 0;
  padding: 22px 0 0;
  border-top: 1px solid var(--line);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 17px;
  line-height: 1.86;
}

.emptyState {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  padding: 24px;
  color: var(--muted);
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 24px, 720px);
    padding-top: 20px;
  }

  .topbar {
    align-items: start;
    flex-direction: column;
  }

  h1 {
    font-size: 28px;
  }

  .stats {
    justify-content: flex-start;
  }

  .controls,
  .content {
    grid-template-columns: 1fr;
  }

  .storyList {
    max-height: none;
  }

  .detailTitle {
    font-size: 23px;
  }
}
