:root {
  --bg: #f7f5ef;
  --surface: #ffffff;
  --ink: #1f2a2b;
  --muted: #65716d;
  --line: #d8d3c7;
  --soft: #edf3ee;
  --accent: #2e745a;
  --accent-dark: #255f49;
  --warn: #b94f42;
  --blue: #2f6f9f;
  --gold: #b17c2f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

.shell {
  width: min(1200px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 22px 0 36px;
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  min-height: 86px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  width: 62px;
  height: 62px;
}

.brand-copy {
  min-width: 0;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.2;
}

h2 {
  font-size: 17px;
  line-height: 1.3;
}

p {
  color: var(--muted);
}

.repo-link {
  color: var(--blue);
  border: 1px solid #b8ccd9;
  border-radius: 999px;
  padding: 8px 12px;
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
  background: #eef5f8;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.summary > div {
  min-height: 76px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.summary-label {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.summary strong {
  display: block;
  margin-top: 6px;
  color: var(--accent);
  font-size: 28px;
  line-height: 1;
}

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

.topics,
.actions {
  min-width: 0;
}

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

.posts-head {
  margin-top: 20px;
}

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

.count-badge {
  min-width: 34px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: var(--accent);
  background: var(--soft);
  border: 1px solid #c9ddd1;
  font-weight: 700;
}

.topic-list,
.post-list,
.result-list,
.actions {
  display: grid;
  gap: 10px;
}

.topic-card {
  width: 100%;
  min-height: 98px;
  display: grid;
  gap: 7px;
  text-align: left;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
  cursor: pointer;
}

.topic-card:hover,
.topic-card.active {
  border-left-color: var(--accent);
  background: #f9fcfa;
}

.topic-title {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.topic-meta,
.topic-desc {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.post {
  display: grid;
  gap: 7px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbf8;
}

.post-author {
  color: var(--blue);
  font-weight: 800;
  font-size: 13px;
}

.post-content {
  color: var(--ink);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
}

.action-form,
.result {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.action-form {
  display: grid;
  gap: 11px;
  padding: 15px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

input,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fbfcfa;
  font: inherit;
  font-size: 14px;
  line-height: 1.45;
}

input {
  height: 38px;
  padding: 0 10px;
}

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

button {
  height: 40px;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  background: var(--accent);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

.result {
  margin-top: 18px;
  padding: 16px;
}

.event {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--soft);
}

.event.held {
  border-left-color: var(--warn);
  background: #f8eeeb;
}

.event-title {
  font-weight: 800;
}

.event-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.event-message {
  color: var(--ink);
  overflow-wrap: anywhere;
}

@media (max-width: 980px) {
  .topbar,
  .layout {
    grid-template-columns: 1fr;
  }

  .brand-mark {
    grid-row: 1;
  }

  .repo-link {
    justify-self: start;
  }

  .actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 660px) {
  .shell {
    width: min(100vw - 20px, 1200px);
    padding-top: 12px;
  }

  .summary,
  .actions,
  .event-grid {
    grid-template-columns: 1fr;
  }
}
