:root {
  --ink: #1a1714;
  --paper: #f7f1e8;
  --muted: #7a7268;
  --line: rgba(26, 23, 20, 0.1);
  --warm: #d4894a;
  --warm-deep: #b56a2e;
  --cool: #3d5c6e;
  --cool-soft: #6f8f9e;
  --night: #121820;
  --card: rgba(247, 241, 232, 0.9);
  --shadow: 0 18px 50px rgba(18, 24, 32, 0.16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans SC", sans-serif;
  color: var(--ink);
  background: #0f141a;
}

.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 55% at 12% 0%, rgba(212, 137, 74, 0.28), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 15%, rgba(61, 92, 110, 0.35), transparent 50%),
    linear-gradient(180deg, #1a2430 0%, #121820 45%, #0e151c 100%);
}

.wrap {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0;
  flex-wrap: wrap;
}
.brand {
  font-family: "Ma Shan Zheng", cursive;
  font-size: 1.85rem;
  color: var(--paper);
  text-decoration: none;
  letter-spacing: 0.04em;
}
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.nav a {
  color: rgba(247, 241, 232, 0.72);
  text-decoration: none;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font-size: 0.92rem;
}
.nav a:hover,
.nav a.active {
  color: var(--paper);
  background: rgba(255, 255, 255, 0.08);
}

.hero {
  padding: 3.2rem 0 2rem;
  animation: rise 0.75s ease both;
}
.kicker {
  margin: 0;
  color: var(--warm);
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  font-weight: 700;
}
.hero h1 {
  margin: 0.55rem 0 0;
  font-family: "Ma Shan Zheng", cursive;
  font-size: clamp(2.6rem, 8vw, 4.2rem);
  color: var(--paper);
  font-weight: 400;
  line-height: 1.15;
}
.lead {
  max-width: 36rem;
  margin: 1rem 0 0;
  color: rgba(247, 241, 232, 0.78);
  line-height: 1.75;
  font-size: 1.05rem;
}
.quote-box {
  margin-top: 1.6rem;
  padding: 1.2rem 1.3rem;
  border-left: 3px solid var(--warm);
  background: rgba(255, 255, 255, 0.05);
  color: var(--paper);
  max-width: 40rem;
}
.quote-box p { margin: 0; font-size: 1.15rem; line-height: 1.7; }
.quote-box small { display: block; margin-top: 0.55rem; color: rgba(247, 241, 232, 0.55); }

.panel {
  margin: 1.4rem 0 2rem;
  padding: 1.35rem;
  border-radius: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  animation: rise 0.8s ease 0.08s both;
}
.panel h2 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
}
.panel .desc {
  margin: 0 0 1.1rem;
  color: var(--muted);
  line-height: 1.6;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.9rem;
}
.tile {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 1.05rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  transition: transform 0.2s ease;
}
.tile:hover { transform: translateY(-3px); }
.tile strong { display: block; margin-bottom: 0.35rem; }
.tile span { color: var(--muted); font-size: 0.9rem; line-height: 1.5; }

.mood-cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.4rem;
}
.mood-cell {
  aspect-ratio: 1;
  border-radius: 10px;
  border: 0;
  background: rgba(61, 92, 110, 0.12);
  cursor: pointer;
  font-size: 0.72rem;
  color: var(--cool);
}
.mood-cell.on { background: rgba(212, 137, 74, 0.35); color: var(--warm-deep); font-weight: 700; }
.mood-vote {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}
.mood-vote button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  font: inherit;
}
.mood-vote button:hover { border-color: var(--warm); }

.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 1rem; }
.chip {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  font: inherit;
  color: var(--muted);
}
.chip.active, .chip:hover {
  background: var(--warm);
  border-color: var(--warm);
  color: #fff;
}

.search {
  width: 100%;
  max-width: 420px;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  font: inherit;
  margin-bottom: 1rem;
}

.item {
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--line);
}
.item:last-child { border-bottom: 0; }
.item h3 { margin: 0 0 0.3rem; font-size: 1.05rem; }
.item p { margin: 0; color: var(--muted); line-height: 1.55; }
.tags { margin-top: 0.45rem; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tag {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(61, 92, 110, 0.1);
  color: var(--cool);
}

.work {
  border: 0;
  text-align: left;
  cursor: pointer;
  padding: 0;
  background: transparent;
  font: inherit;
  color: inherit;
}
.work-cover {
  aspect-ratio: 4/3;
  border-radius: 14px;
  margin-bottom: 0.65rem;
}
.like-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.like-row button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  cursor: pointer;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.7rem;
}
.stamp {
  padding: 0.85rem;
  border-radius: 14px;
  background: rgba(212, 137, 74, 0.12);
  border: 1px dashed rgba(212, 137, 74, 0.45);
  font-size: 0.9rem;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.7rem;
  margin-bottom: 1rem;
}
.stat {
  padding: 0.9rem;
  border-radius: 14px;
  background: rgba(61, 92, 110, 0.08);
}
.stat b { display: block; font-size: 1.4rem; color: var(--cool); }
.stat span { color: var(--muted); font-size: 0.85rem; }

.friend {
  display: block;
  padding: 1rem;
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
}
.friend strong { display: block; margin-bottom: 0.25rem; }
.friend span { color: var(--muted); font-size: 0.9rem; }

.form {
  display: grid;
  gap: 0.7rem;
  max-width: 520px;
}
.form input, .form textarea, .form select {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  font: inherit;
}
.form textarea { min-height: 110px; resize: vertical; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1.2rem;
  background: var(--warm);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.msg {
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--line);
}
.msg .meta { color: var(--muted); font-size: 0.82rem; margin-bottom: 0.3rem; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  background: #1a1714;
  color: #fff;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 50;
}
.toast.show { opacity: 1; }

.foot {
  padding: 2rem 0 2.5rem;
  color: rgba(247, 241, 232, 0.55);
  font-size: 0.88rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.2rem;
  justify-content: space-between;
}
.foot a { color: rgba(247, 241, 232, 0.75); }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 640px) {
  .hero { padding-top: 1.8rem; }
  .mood-cal { gap: 0.28rem; }
}
