:root {
  color-scheme: light;
  --ink: #272320;
  --muted: #746b65;
  --line: #eadbd4;
  --paper: #fff8f7;
  --surface: #fffdf9;
  --rose: #c65372;
  --rose-soft: #ffe2ea;
  --green: #677a5c;
  --shadow: 0 20px 48px rgba(68, 43, 39, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(154, 105, 96, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(154, 105, 96, 0.07) 1px, transparent 1px),
    var(--paper);
  background-size: 22px 22px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
textarea,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 64px) clamp(18px, 4vw, 32px) 22px;
}

.eyebrow,
.moment-date,
.hint {
  color: var(--rose);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 8px;
  font-size: clamp(34px, 7vw, 72px);
  line-height: 1;
}

.counter {
  border: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.86);
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.page-shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 32px) 64px;
  display: grid;
  grid-template-columns: minmax(280px, 0.78fr) minmax(0, 1.22fr);
  gap: 20px;
  align-items: start;
}

.composer,
.moment-card {
  border: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.94);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.composer {
  position: sticky;
  top: 18px;
  padding: 18px;
}

.composer h2 {
  font-size: 22px;
  margin-bottom: 14px;
}

#moment-form {
  display: grid;
  gap: 12px;
}

textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  color: var(--ink);
  background: #fffaf8;
  line-height: 1.65;
}

.upload-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.upload-control,
button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
}

.upload-control input {
  display: none;
}

button {
  grid-column: 1 / -1;
  color: #ffffff;
  border-color: var(--rose);
  background: var(--rose);
}

.hint {
  color: var(--muted);
  line-height: 1.5;
  text-transform: none;
  letter-spacing: 0;
}

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

.moment-card {
  padding: clamp(16px, 3vw, 22px);
  display: grid;
  gap: 14px;
}

.moment-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--rose-soft);
  color: var(--rose);
  font-size: 20px;
}

.moment-title {
  font-size: 18px;
  line-height: 1.2;
}

.moment-text {
  color: #3c3530;
  font-size: 17px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.moment-image {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf8;
}

.moment-image[src=""] {
  display: none;
}

.attachment {
  display: none;
}

.attachment.has-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff6f8;
}

.file-name {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.download-link {
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  padding: 10px 14px;
  font-weight: 800;
  white-space: nowrap;
}

@media (max-width: 820px) {
  .topbar {
    align-items: start;
    flex-direction: column;
  }

  .page-shell {
    grid-template-columns: 1fr;
  }

  .composer {
    position: static;
  }
}

@media (max-width: 520px) {
  .upload-row {
    grid-template-columns: 1fr;
  }

  .attachment.has-file {
    align-items: stretch;
    flex-direction: column;
  }

  .download-link {
    text-align: center;
  }
}
