:root {
  --bg: #fbfaf7;
  --paper: #fffefd;
  --paper-soft: #fcfbf8;
  --line: rgba(72, 59, 46, 0.14);
  --line-strong: rgba(72, 59, 46, 0.24);
  --text: #2f271f;
  --muted: #716455;
  --accent: #8a5a3b;
  --accent-soft: #a67857;
  --shadow: 0 4px 16px rgba(62, 49, 35, 0.03);
  --serif: "Baskerville", "Palatino Linotype", "Songti SC", "STSong", serif;
  --sans: "Avenir Next", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), transparent 180px),
    linear-gradient(180deg, #ffffff 0%, #fbfaf7 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 15% 10%, rgba(151, 113, 80, 0.025), transparent 24%),
    radial-gradient(circle at 85% 12%, rgba(151, 113, 80, 0.02), transparent 22%);
}

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

button,
input,
textarea {
  font: inherit;
}

.page-shell {
  position: relative;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 118px 0 56px;
}

.floating-tools {
  position: fixed;
  top: 128px;
  right: 22px;
  z-index: 40;
  display: grid;
  gap: 14px;
  width: 188px;
}

.floating-profile,
.music-toggle {
  border: 1px solid rgba(72, 59, 46, 0.1);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.floating-profile {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
}

.avatar-badge {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #8f6245, #c49b79);
  color: #fffefc;
  font-family: var(--serif);
  font-size: 1.15rem;
  letter-spacing: 0.08em;
}

.floating-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.floating-copy {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 0.84rem;
}

.music-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--accent);
  transition: transform 0.2s ease, background 0.2s ease;
}

.music-toggle:hover {
  transform: translateY(-1px);
}

.music-toggle.is-playing {
  background: rgba(245, 237, 228, 0.95);
}

.music-icon {
  font-size: 1rem;
}

.site-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 22px;
  align-items: end;
  padding: 18px 0 16px;
  border-bottom: 1px solid var(--line);
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(1120px, calc(100% - 32px));
  z-index: 30;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
}

.brand-kicker,
.eyebrow,
.section-lead {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.7rem;
  color: var(--muted);
  margin: 0;
}

.brand h1,
.home-intro h2,
.page-title,
.article-title,
.section-head h3 {
  font-family: var(--serif);
}

.brand h1 {
  margin: 8px 0 10px;
  font-size: clamp(2rem, 4.8vw, 3.6rem);
  font-weight: 400;
  line-height: 1;
}

.site-intro {
  margin: 0;
  max-width: 54ch;
  color: var(--muted);
  line-height: 1.9;
  font-size: 0.96rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 16px;
  padding-bottom: 8px;
}

.nav-link {
  position: relative;
  padding: 4px 0;
  color: var(--muted);
  transition: color 0.2s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--accent);
}

.nav-link:hover::after,
.nav-link.is-active::after {
  transform: scaleX(1);
}

.app {
  margin-top: 28px;
}

.view,
.home-view,
.home-primary,
.home-sidebar,
.article-list,
.moment-list {
  display: grid;
  gap: 20px;
}

.panel,
.article-card,
.moment-card,
.photo-card,
.link-card,
.article-detail,
.about-card,
.empty-state,
.quote-card {
  border: 1px solid rgba(72, 59, 46, 0.08);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
}

.panel,
.article-detail,
.about-card,
.empty-state,
.quote-card {
  padding: 24px;
  border-radius: 24px;
}

.home-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
  gap: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(251, 249, 245, 0.94)),
    var(--paper);
}

.home-intro h2 {
  margin: 12px 0 14px;
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1.18;
}

.panel-copy,
.quote-author,
.article-excerpt,
.moment-content,
.photo-description,
.link-description,
.about-card p,
.article-body p {
  color: var(--muted);
  line-height: 1.95;
}

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

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--accent);
  background: rgba(255, 255, 255, 0.68);
  transition: background 0.2s ease, transform 0.2s ease;
}

.button-link.primary {
  color: #fffdfa;
  background: linear-gradient(135deg, #8f6245, #b38361);
  border-color: transparent;
}

.button-link:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.92);
}

.button-link.primary:hover {
  background: linear-gradient(135deg, #86573a, #ab7958);
}

.quote-card {
  display: grid;
  align-content: space-between;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 248, 244, 0.98)),
    var(--paper);
}

.quote-card-inline {
  min-height: 100%;
}

.quote-text {
  margin: 14px 0 8px;
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  line-height: 1.6;
  color: var(--text);
}

.quote-author {
  margin: 4px 0 0;
}

.home-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
  gap: 24px;
  align-items: start;
}

.home-sidebar {
  position: sticky;
  top: 108px;
}

.section-panel,
.sidebar-panel,
.about-panel {
  background: rgba(255, 255, 255, 0.66);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(72, 59, 46, 0.1);
}

.section-head h3,
.page-title,
.article-title {
  margin: 6px 0 0;
  font-size: clamp(1.55rem, 2vw, 2.15rem);
  font-weight: 400;
}

.section-link,
.back-link,
.admin-entry {
  color: var(--accent);
}

.article-card,
.moment-card,
.photo-card,
.link-card {
  border-radius: 16px;
}

.article-card {
  display: grid;
  grid-template-columns: 144px 1fr;
  gap: 18px;
  padding: 14px 0;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  border-radius: 0;
  background: transparent;
}

.article-card img,
.photo-card img,
.moment-image {
  width: 100%;
  display: block;
  object-fit: cover;
}

.article-cover {
  aspect-ratio: 4 / 3.2;
  overflow: hidden;
  border-radius: 12px;
}

.meta-row,
.moment-meta,
.photo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-pill,
.tag {
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(138, 90, 59, 0.08);
  color: var(--accent);
  font-size: 0.78rem;
}

.article-card h4,
.moment-card h4,
.photo-card h4,
.link-card h4 {
  margin: 10px 0 10px;
  font-size: 1.08rem;
  font-weight: 600;
}

.moments-panel .moment-list {
  gap: 14px;
}

.moment-card {
  position: relative;
  padding: 16px 0 16px 18px;
  border-top: 0;
  border-right: 0;
  border-bottom: 1px solid rgba(72, 59, 46, 0.08);
  border-left: 0;
  border-radius: 0;
  background: transparent;
}

.moment-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 22px;
  bottom: 22px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, #bb906f, #ecd7c4);
}

.moment-content {
  margin: 10px 0 0;
  font-size: 0.97rem;
}

.moment-images {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.moment-image {
  border-radius: 12px;
}

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

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

.photo-card {
  overflow: hidden;
  padding: 0;
  border: 0;
  background: transparent;
}

.photo-card img {
  aspect-ratio: 4 / 5;
  margin-bottom: 12px;
  border-radius: 12px;
}

.photo-card h4 {
  margin-bottom: 8px;
}

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

.compact-links {
  grid-template-columns: 1fr;
}

.link-card {
  padding: 12px 0;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  border-radius: 0;
  background: transparent;
  transition: color 0.2s ease, transform 0.2s ease;
}

.link-card:hover,
.photo-card:hover,
.article-card:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.article-detail .article-title {
  font-size: clamp(2rem, 4vw, 3rem);
}

.article-detail img {
  width: 100%;
  margin-top: 16px;
  border-radius: 18px;
}

.article-body {
  margin-top: 20px;
}

.article-body p {
  margin: 0 0 1.1em;
}

.empty-state {
  text-align: center;
  color: var(--muted);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line-strong);
  color: var(--muted);
}

.scroll-area {
  overflow: auto;
  padding-right: 6px;
}

.scroll-area-tall {
  max-height: 72vh;
}

.scroll-area-medium {
  max-height: 42vh;
}

.scroll-area-gallery {
  max-height: 40vh;
}

.scroll-area-links {
  max-height: 28vh;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(138, 90, 59, 0.28) transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: rgba(138, 90, 59, 0.2);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(138, 90, 59, 0.34);
}

@media (max-width: 980px) {
  .site-header,
  .home-intro,
  .home-columns,
  .article-card,
  .gallery-grid,
  .link-grid {
    grid-template-columns: 1fr;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .home-sidebar {
    position: static;
  }

  .floating-tools {
    top: auto;
    right: 16px;
    bottom: 18px;
    width: 156px;
  }

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

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 1120px);
    padding-top: 20px;
  }

  .site-header {
    width: min(100% - 20px, 1120px);
  }

  .panel,
  .article-card,
  .moment-card,
  .photo-card,
  .link-card,
  .article-detail,
  .about-card,
  .empty-state,
  .quote-card {
    border-radius: 18px;
  }

  .compact-gallery,
  .link-grid {
    grid-template-columns: 1fr;
  }

  .floating-tools {
    display: none;
  }

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