:root {
  color-scheme: light;
  --ink: #182026;
  --muted: #62706f;
  --line: rgba(24, 32, 38, 0.13);
  --paper: #fffaf1;
  --paper-strong: #fff6e5;
  --coral: #e86f5c;
  --teal: #1d8b83;
  --gold: #c99a2e;
  --plum: #7f5572;
  --shadow: 0 24px 70px rgba(13, 20, 22, 0.18);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #0f1719;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  background:
    linear-gradient(180deg, rgba(9, 16, 17, 0.45), rgba(252, 242, 222, 0.28)),
    url("assets/message-wall-bg.png") center / cover fixed;
}

button,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 250, 241, 0.72), transparent 32%),
    linear-gradient(120deg, rgba(255, 250, 241, 0.78), rgba(255, 250, 241, 0.35) 52%, rgba(15, 23, 25, 0.08));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1180px;
  margin: 0 auto 26px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(24, 32, 38, 0.22);
  border-radius: 8px;
  color: #fff9eb;
  background: linear-gradient(145deg, #182026, #35413e);
  box-shadow: 0 12px 26px rgba(24, 32, 38, 0.2);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.05rem;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
}

.wall-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.wall-stats span {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 241, 0.68);
  backdrop-filter: blur(16px);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 22px;
  max-width: 1180px;
  margin: 0 auto;
  align-items: start;
}

.composer-panel,
.wall-panel {
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius);
  background: rgba(255, 250, 241, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.composer-panel {
  position: sticky;
  top: 24px;
  padding: 24px;
}

.panel-heading {
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 7vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.composer {
  display: grid;
  gap: 16px;
}

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

.field span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.68);
  outline: none;
}

textarea {
  min-height: 148px;
  resize: vertical;
  padding: 14px;
  line-height: 1.65;
}

select {
  min-height: 44px;
  padding: 0 12px;
}

textarea:focus,
select:focus {
  border-color: rgba(29, 139, 131, 0.7);
  box-shadow: 0 0 0 4px rgba(29, 139, 131, 0.12);
}

.meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.char-count {
  color: var(--muted);
  font-size: 0.88rem;
}

.primary-btn,
.tab,
.icon-btn {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  color: #fffaf1;
  background: #182026;
  box-shadow: 0 12px 24px rgba(24, 32, 38, 0.22);
  font-weight: 800;
}

.primary-btn:hover,
.tab:hover,
.icon-btn:hover {
  transform: translateY(-1px);
}

.wall-panel {
  min-height: 620px;
  padding: 18px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.tabs,
.wall-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tab,
.icon-btn {
  background: rgba(255, 255, 255, 0.58);
  border-color: var(--line);
  color: var(--ink);
  font-weight: 800;
}

.tab {
  padding: 0 13px;
}

.tab.active {
  color: #fffaf1;
  background: var(--teal);
}

.icon-btn {
  width: 42px;
  padding: 0;
  font-size: 1.15rem;
}

.icon-btn.danger {
  color: #8f2f2a;
}

.featured-note {
  margin-bottom: 16px;
  padding: 18px;
  border-left: 5px solid var(--coral);
  border-radius: var(--radius);
  background: rgba(255, 246, 229, 0.82);
  box-shadow: 0 12px 28px rgba(24, 32, 38, 0.1);
  line-height: 1.7;
}

.wall-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.note {
  display: flex;
  min-height: 172px;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  border: 1px solid rgba(24, 32, 38, 0.11);
  border-radius: var(--radius);
  background: var(--paper-strong);
  box-shadow: 0 14px 28px rgba(24, 32, 38, 0.12);
  transform: rotate(var(--tilt, 0deg));
}

.note:nth-child(3n + 1) {
  --tilt: -0.7deg;
}

.note:nth-child(3n + 2) {
  --tilt: 0.5deg;
}

.note.paper {
  background: #fff8e8;
}

.note.coral {
  background: #ffe3da;
}

.note.teal {
  background: #ddf3ee;
}

.note.gold {
  background: #fff1bc;
}

.note-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.note-mood {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}

.note-mood::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border-radius: 999px;
  background: var(--mood-color, var(--teal));
}

.note-text {
  margin: 18px 0 0;
  overflow-wrap: anywhere;
  font-size: 1.02rem;
  line-height: 1.65;
}

.empty-state {
  min-height: 360px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(24, 32, 38, 0.2);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.45);
  text-align: center;
}

@media (max-width: 860px) {
  .app-shell {
    padding: 16px;
  }

  .topbar,
  .workspace {
    max-width: 640px;
  }

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

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

  .composer-panel {
    position: static;
  }

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

@media (max-width: 520px) {
  .topbar {
    flex-direction: column;
  }

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

  .meta-row {
    grid-template-columns: 1fr;
  }

  .composer-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-btn {
    width: 100%;
  }

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