:root {
  --bg: #f4f0e8;
  --bg-soft: rgba(255, 255, 255, 0.6);
  --paper: #fffdf8;
  --ink: #1f2430;
  --muted: #6c6f76;
  --line: rgba(31, 36, 48, 0.12);
  --accent: #9d5b3f;
  --accent-deep: #703f29;
  --accent-soft: #edd7ca;
  --shadow: 0 20px 60px rgba(52, 39, 27, 0.10);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(215, 172, 146, 0.32), transparent 32%),
    radial-gradient(circle at 85% 20%, rgba(162, 186, 174, 0.28), transparent 24%),
    linear-gradient(180deg, #f7f3ec 0%, #f2ece2 100%);
}

button,
input,
textarea {
  font: inherit;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 56px;
}

.hero,
.section {
  background: var(--bg-soft);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero {
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.brand-mark,
.eyebrow,
.section-kicker,
.panel-label,
.memory-tag {
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 12px;
}

.brand-mark,
.section-kicker,
.memory-tag {
  color: var(--accent);
}

.brand-name {
  font-size: 14px;
  color: var(--muted);
}

.hero-grid {
  margin-top: 34px;
  display: grid;
  grid-template-columns: 1.3fr 0.8fr;
  gap: 24px;
}

.hero-copy h1,
.section-heading h2,
.timeline-content h3,
.memory-card h3,
.board-header h3 {
  font-family: "STSong", "Songti SC", "Noto Serif SC", serif;
  font-weight: 600;
}

.hero-copy h1 {
  margin: 12px 0 18px;
  font-size: clamp(2.2rem, 4vw, 4.4rem);
  line-height: 1.14;
  max-width: 10ch;
}

.hero-text {
  max-width: 60ch;
  line-height: 1.8;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.solid-button,
.ghost-button,
.text-button {
  border: 0;
  cursor: pointer;
  transition: transform 180ms ease, background-color 180ms ease, color 180ms ease;
}

.solid-button,
.ghost-button {
  padding: 12px 18px;
  border-radius: 999px;
}

.solid-button {
  background: var(--accent);
  color: white;
}

.solid-button:hover,
.ghost-button:hover,
.text-button:hover {
  transform: translateY(-1px);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  border: 1px solid var(--line);
}

.hero-panel,
.stat-card,
.timeline-item,
.memory-card,
.capsule-form,
.capsule-board,
.message-card,
.album-sidebar,
.album-main,
.theme-chip,
.photo-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
}

.hero-panel {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100%;
}

.impression-list {
  margin: 20px 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.9;
}

.panel-footnote,
.form-tip {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

.section {
  margin-top: 18px;
  padding: 30px 24px;
}

.section-heading {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 22px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2.5vw, 2.4rem);
}

.stat-grid,
.memory-grid,
.capsule-layout {
  display: grid;
  gap: 16px;
}

.stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card {
  padding: 22px;
}

.stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.stat-label {
  color: var(--muted);
  line-height: 1.7;
}

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

.timeline-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 20px;
  padding: 18px;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.timeline-item.is-active {
  border-color: rgba(157, 91, 63, 0.5);
  box-shadow: 0 14px 30px rgba(125, 84, 59, 0.08);
  transform: translateX(4px);
}

.timeline-year {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--accent);
}

.timeline-content h3,
.memory-card h3,
.board-header h3 {
  margin: 0 0 10px;
}

.timeline-content p,
.memory-card p,
.message-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.memory-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.memory-card {
  padding: 20px;
}

.album-shell {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 16px;
}

.album-sidebar,
.album-main {
  padding: 20px;
}

.album-sidebar-head h3,
.album-toolbar h3 {
  margin: 0 0 6px;
  font-family: "STSong", "Songti SC", "Noto Serif SC", serif;
}

.album-sidebar-head p,
.album-current-label,
.album-tip,
.theme-count {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.theme-form {
  margin: 18px 0 20px;
}

.theme-form label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

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

.theme-form-row input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  background: #fff;
}

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

.theme-chip {
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.theme-chip:hover {
  transform: translateY(-1px);
}

.theme-chip.is-active {
  border-color: rgba(157, 91, 63, 0.5);
  box-shadow: 0 12px 24px rgba(125, 84, 59, 0.08);
}

.theme-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.theme-name {
  font-weight: 600;
}

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

.album-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: transform 180ms ease;
}

.upload-button:hover {
  transform: translateY(-1px);
}

.album-tip {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(237, 215, 202, 0.48);
  margin-bottom: 16px;
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.photo-card {
  overflow: hidden;
}

.photo-preview {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: linear-gradient(140deg, #ece4da, #dad2c6);
}

.photo-body {
  padding: 14px;
}

.photo-name {
  font-weight: 600;
  margin: 0 0 10px;
  word-break: break-all;
}

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

.photo-download {
  color: var(--accent-deep);
  text-decoration: none;
  font-size: 14px;
}

.photo-action-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.photo-size {
  font-size: 13px;
  color: var(--muted);
}

.album-empty {
  padding: 28px 20px;
  border: 1px dashed var(--line);
  border-radius: 20px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
}

.album-empty.is-error {
  color: #8a3b2f;
  border-color: rgba(138, 59, 47, 0.24);
  background: rgba(255, 238, 235, 0.9);
}

.danger-button {
  color: #8a3b2f;
}

.compress-dialog {
  border: 0;
  padding: 0;
  width: min(480px, calc(100% - 24px));
  border-radius: 24px;
  background: transparent;
}

.compress-dialog::backdrop {
  background: rgba(21, 22, 26, 0.35);
  backdrop-filter: blur(4px);
}

.compress-form {
  padding: 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
}

.compress-heading h3 {
  margin: 6px 0 0;
  font-family: "STSong", "Songti SC", "Noto Serif SC", serif;
}

.compress-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  cursor: pointer;
}

.compress-option input {
  margin-top: 4px;
}

.compress-option span {
  display: grid;
  gap: 4px;
}

.compress-option small {
  color: var(--muted);
  line-height: 1.6;
}

.compress-fields {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(237, 215, 202, 0.28);
}

.compress-fields input[type="number"],
.compress-fields input[type="range"] {
  width: 100%;
}

.compress-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.capsule-layout {
  grid-template-columns: 0.88fr 1.12fr;
  align-items: start;
}

.capsule-form,
.capsule-board {
  padding: 22px;
}

.capsule-form {
  display: grid;
  gap: 10px;
}

.capsule-form label {
  font-size: 14px;
}

.capsule-form input,
.capsule-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background: #fff;
}

.capsule-form textarea {
  min-height: 140px;
  resize: vertical;
}

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

.text-button {
  background: transparent;
  color: var(--accent-deep);
  padding: 0;
}

.message-list {
  display: grid;
  gap: 12px;
}

.message-card {
  padding: 16px;
}

.message-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
  font-size: 14px;
}

.message-name {
  font-weight: 600;
}

.message-time {
  color: var(--muted);
}

.empty-state {
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: 20px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
}

@media (max-width: 960px) {
  .hero-grid,
  .capsule-layout,
  .stat-grid,
  .memory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .album-shell,
  .album-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 100%);
    margin: 10px auto 28px;
  }

  .hero,
  .section {
    border-radius: 22px;
    padding: 20px 16px;
  }

  .topbar,
  .board-header,
  .timeline-item,
  .hero-grid,
  .stat-grid,
  .memory-grid,
  .capsule-layout {
    grid-template-columns: 1fr;
  }

  .topbar,
  .board-header {
    display: grid;
    justify-content: stretch;
  }

  .hero-copy h1 {
    max-width: none;
    font-size: 2.4rem;
  }

  .timeline-item {
    gap: 12px;
  }

  .album-shell,
  .album-grid,
  .theme-form-row {
    grid-template-columns: 1fr;
  }

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

  .album-toolbar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

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