:root {
  --bg-1: #f8ece4;
  --bg-2: #f8f3ea;
  --card: #fffdf9;
  --ink: #221913;
  --soft-ink: #594a3f;
  --accent: #d0652e;
  --accent-soft: #f4d8c7;
  --line: #e9d8cc;
  --ok: #27785a;
  --error: #b53d2f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Noto Serif SC", "Songti SC", "STKaiti", serif;
  background:
    radial-gradient(1200px 500px at -10% -5%, #f8d9c7 0%, transparent 65%),
    radial-gradient(1000px 480px at 115% 105%, #f7dfcf 0%, transparent 68%),
    linear-gradient(160deg, var(--bg-1), var(--bg-2));
}

.page {
  max-width: 920px;
  margin: 0 auto;
  padding: 46px 18px 64px;
}

.hero {
  margin-bottom: 24px;
  animation: rise-in 380ms ease-out;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 3.8rem);
  line-height: 1.1;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

.hero p {
  margin: 10px 0 0;
  color: var(--soft-ink);
  font-size: 1rem;
}

.card {
  margin-bottom: 16px;
  padding: 18px;
  background: color-mix(in srgb, var(--card) 92%, white 8%);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 10px 26px rgb(49 29 11 / 8%);
  animation: rise-in 480ms ease-out;
}

.card:nth-of-type(2) {
  animation-delay: 80ms;
}

.card:nth-of-type(3) {
  animation-delay: 160ms;
}

.label {
  display: block;
  margin-bottom: 10px;
  font-weight: 700;
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 150px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #d8c6ba;
  background: #fff;
  font: 500 1rem/1.6 "Noto Serif SC", "Songti SC", "STKaiti", serif;
  color: var(--ink);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

textarea:focus-visible {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 4px rgb(208 101 46 / 14%);
}

.form-footer {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#counter {
  color: var(--soft-ink);
  font-size: 0.95rem;
}

#counter.warn {
  color: var(--accent);
  font-weight: 700;
}

button {
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: 700 0.98rem/1 "Noto Serif SC", "Songti SC", "STKaiti", serif;
  padding: 10px 18px;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}

button:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
  transform: none;
}

button.ghost {
  background: var(--accent-soft);
  color: #6f3518;
}

#form-msg {
  min-height: 1.5em;
  margin: 12px 2px 0;
  font-size: 0.95rem;
  color: var(--soft-ink);
}

#form-msg[data-type="success"] {
  color: var(--ok);
}

#form-msg[data-type="error"] {
  color: var(--error);
}

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

.list-head h2 {
  margin: 0;
  font-size: 1.2rem;
}

.entries {
  display: grid;
  gap: 12px;
}

.entry {
  background: #fff;
  border: 1px solid #ecded2;
  border-radius: 12px;
  padding: 12px 12px 10px;
}

.entry-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.badge {
  font-size: 0.86rem;
  color: #693219;
  background: #f7e6db;
  border: 1px solid #f0d5c5;
  border-radius: 999px;
  padding: 3px 8px;
}

.entry time {
  font-size: 0.85rem;
  color: var(--soft-ink);
}

.entry-content {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.65;
}

.empty {
  margin: 0;
  color: var(--soft-ink);
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 700px) {
  .page {
    padding-top: 34px;
  }

  .card {
    padding: 14px;
    border-radius: 14px;
  }

  .list-head {
    align-items: flex-start;
  }
}
