:root {
  color-scheme: light;
  --ink: #232323;
  --muted: #687076;
  --line: #dbe0e3;
  --paper: #fbfaf7;
  --panel: #ffffff;
  --accent: #1d766f;
  --accent-dark: #13534e;
  --warm: #c35635;
  --leaf: #76924a;
  --shadow: 0 18px 45px rgba(40, 45, 48, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
}

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

.sidebar {
  min-height: 100vh;
  padding: 24px;
  background: #20302e;
  color: #f8faf8;
  position: sticky;
  top: 0;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 28px;
}

.brand span,
.eyebrow,
.share-box span,
.entry-meta {
  color: var(--muted);
  font-size: 13px;
}

.brand span {
  display: block;
  color: #b9c8c4;
}

.mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  font-weight: 800;
}

.new-space {
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 8px;
  margin-bottom: 20px;
}

.new-space input,
.space-button,
.composer,
.feed-wrap,
.entry-card {
  border: 1px solid var(--line);
}

.new-space input {
  min-width: 0;
  border-radius: 8px;
  padding: 10px 12px;
  background: #f7fbf9;
  border: 0;
}

button {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

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

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

.ghost:hover {
  background: #eef7f5;
}

.space-list {
  display: grid;
  gap: 10px;
}

.space-button {
  width: 100%;
  padding: 12px;
  text-align: left;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.space-button.active,
.space-button:hover {
  background: #f8faf8;
  color: #20302e;
}

.space-button span {
  display: block;
  margin-top: 5px;
  color: #9fb1ad;
  font-size: 12px;
}

.space-button.active span,
.space-button:hover span {
  color: #60706c;
}

.app {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 34px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 18px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 34px;
}

.share-box {
  min-width: 168px;
  padding: 14px 16px;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.share-box strong {
  display: block;
  margin-top: 4px;
  color: var(--warm);
}

.composer,
.feed-wrap {
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.composer {
  padding: 18px;
  margin-bottom: 22px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 12px;
  margin-bottom: 12px;
}

.form-row.compact {
  grid-template-columns: 160px 140px 1fr;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
}

textarea {
  resize: vertical;
  line-height: 1.6;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.actions button {
  min-height: 42px;
  padding: 0 18px;
}

.feed-wrap {
  padding: 18px;
}

.feed-head {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 340px);
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.feed-head h2 {
  margin-bottom: 0;
}

.feed {
  display: grid;
  gap: 14px;
}

.entry-card {
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.entry-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.entry-card h3 {
  margin: 0 0 6px;
  font-size: 20px;
}

.entry-card p {
  white-space: pre-wrap;
  line-height: 1.7;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.tag {
  border-radius: 999px;
  padding: 4px 9px;
  background: #eff4ea;
  color: #50692d;
  font-size: 12px;
}

.entry-tools {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
}

.icon-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: #eef4f3;
  color: var(--accent-dark);
}

.delete {
  color: var(--warm);
  background: #fbefeb;
}

.empty {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 820px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    position: static;
  }

  .app {
    padding: 22px;
  }

  .topbar,
  .entry-top {
    flex-direction: column;
  }

  .form-row,
  .form-row.compact,
  .feed-head {
    grid-template-columns: 1fr;
  }
}
