/* ===== Reset & Base ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #6b7f3a;
  --primary-dark: #4a5a23;
  --primary-light: #93a85a;
  --accent: #8b6f47;
  --accent-dark: #6b5232;
  --bg: #f7f4ed;
  --bg-alt: #ede5d3;
  --card: #ffffff;
  --text: #2a2418;
  --text-soft: #5a4f3a;
  --text-muted: #8a7c5e;
  --border: #e2d8c0;
  --sky: #b8d4e8;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "Times New Roman", serif;
  --sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--primary-dark);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

/* ===== Navigation ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(247, 244, 237, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  transition: all 0.3s ease;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: 0.5px;
}

.nav-logo .latin {
  display: block;
  font-family: var(--sans);
  font-size: 11px;
  font-style: italic;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 2px;
  letter-spacing: 0;
}

.nav-menu {
  display: flex;
  gap: 28px;
  list-style: none;
}

.nav-menu a {
  font-size: 14px;
  color: var(--text-soft);
  font-weight: 500;
  position: relative;
  padding: 4px 0;
}

.nav-menu a:hover {
  color: var(--primary-dark);
  text-decoration: none;
}

.nav-menu a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--primary-dark);
  transition: width 0.3s ease;
}

.nav-menu a:hover::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--primary-dark);
  cursor: pointer;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding-top: 60px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url("images/tree-courtyard.jpeg");
  background-size: cover;
  background-position: center;
  filter: brightness(0.5) saturate(1.05);
  z-index: 0;
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(45, 60, 30, 0.3) 0%,
    rgba(74, 90, 35, 0.55) 60%,
    rgba(45, 60, 30, 0.85) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: #fff;
  padding: 0 24px;
  max-width: 900px;
}

.hero-tag {
  display: inline-block;
  padding: 6px 18px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 3px;
  font-weight: 500;
  margin-bottom: 24px;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
}

.hero-title {
  font-family: var(--serif);
  font-size: clamp(40px, 7vw, 76px);
  font-weight: 700;
  letter-spacing: 4px;
  margin-bottom: 12px;
  line-height: 1.1;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

.hero-pinyin {
  font-size: clamp(14px, 2vw, 18px);
  letter-spacing: 2px;
  font-style: italic;
  opacity: 0.85;
  margin-bottom: 8px;
}

.hero-latin {
  font-family: var(--sans);
  font-size: clamp(16px, 2.2vw, 22px);
  font-style: italic;
  font-weight: 300;
  opacity: 0.92;
  margin-bottom: 32px;
}

.hero-divider {
  width: 60px;
  height: 2px;
  background: rgba(255, 255, 255, 0.6);
  margin: 24px auto 32px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

.hero-meta-item {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 13px;
}

.hero-meta-item strong {
  display: block;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  opacity: 0.75;
  margin-bottom: 4px;
  font-weight: 500;
}

.hero-meta-item span {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 1px;
}

.hero-scroll {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-align: center;
  animation: float 2.4s ease-in-out infinite;
}

.hero-scroll::after {
  content: "";
  display: block;
  width: 1px;
  height: 30px;
  background: rgba(255, 255, 255, 0.5);
  margin: 8px auto 0;
}

@keyframes float {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 8px); }
}

/* ===== Container & Sections ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 100px 0;
  position: relative;
}

section + section {
  border-top: 1px solid var(--border);
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-tag {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--primary-dark);
  font-weight: 600;
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--serif);
  font-size: clamp(28px, 4.5vw, 44px);
  font-weight: 700;
  color: var(--text);
  letter-spacing: 2px;
  margin-bottom: 16px;
  position: relative;
  display: inline-block;
}

.section-title::before,
.section-title::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 30px;
  height: 1px;
  background: var(--primary-light);
}

.section-title::before { right: calc(100% + 16px); }
.section-title::after { left: calc(100% + 16px); }

.section-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto;
}

/* ===== Profile Cards ===== */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.profile-card {
  background: var(--card);
  border-radius: 16px;
  padding: 28px 24px;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.profile-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 0;
  background: var(--primary);
  transition: height 0.3s ease;
}

.profile-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -20px rgba(74, 90, 35, 0.25);
  border-color: var(--primary-light);
}

.profile-card:hover::before {
  height: 100%;
}

.profile-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 22px;
  margin-bottom: 18px;
}

.profile-card h3 {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}

.profile-card .latin {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 14px;
}

.profile-card p {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.7;
}

/* ===== Info Table ===== */
.info-block {
  background: var(--bg-alt);
  border-radius: 16px;
  padding: 36px;
  margin-top: 40px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

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

.info-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.info-value {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

/* ===== Detail Sections ===== */
.detail-block {
  background: var(--card);
  border-radius: 16px;
  padding: 36px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
}

.detail-block h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 18px;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 12px;
}

.detail-block h3::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--primary-dark);
  border-radius: 50%;
}

.detail-block p {
  font-size: 15px;
  color: var(--text-soft);
  line-height: 1.85;
  margin-bottom: 12px;
}

.detail-block p:last-child {
  margin-bottom: 0;
}

.detail-block .meta-list {
  list-style: none;
  margin-top: 8px;
}

.detail-block .meta-list li {
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 14px;
  display: flex;
  gap: 16px;
}

.detail-block .meta-list li:last-child {
  border-bottom: none;
}

.detail-block .meta-list .key {
  flex-shrink: 0;
  width: 110px;
  font-weight: 600;
  color: var(--primary-dark);
}

/* ===== Image Gallery ===== */
.gallery {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 24px;
  margin: 60px 0;
}

.gallery-item {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 4/3;
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.2);
}

.gallery-item:first-child {
  aspect-ratio: 4/5;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
  color: white;
  font-size: 13px;
  letter-spacing: 1px;
}

.gallery-caption strong {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
  font-family: var(--serif);
}

/* ===== Article Section ===== */
.article-divider {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 0 auto 60px;
  max-width: 500px;
  text-align: center;
}

.article-divider::before,
.article-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--primary-light);
}

.article-divider span {
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 4px;
  color: var(--primary-dark);
  font-weight: 600;
  text-transform: uppercase;
}

.article {
  background: var(--card);
  border-radius: 16px;
  padding: 48px 56px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 24px -8px rgba(0, 0, 0, 0.06);
  margin-bottom: 40px;
}

.article h2 {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
  line-height: 1.4;
}

.article .source {
  display: inline-block;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-alt);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 32px;
  border: 1px solid var(--border);
}

.article h3 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  margin: 32px 0 14px;
  color: var(--primary-dark);
  padding-left: 14px;
  border-left: 3px solid var(--primary);
}

.article p {
  font-size: 15.5px;
  color: var(--text-soft);
  line-height: 1.95;
  margin-bottom: 16px;
  text-align: justify;
  text-indent: 2em;
}

.article p:first-of-type::first-letter {
  font-family: var(--serif);
  font-size: 3.2em;
  font-weight: 700;
  float: left;
  line-height: 1;
  margin: 4px 8px 0 0;
  color: var(--primary-dark);
}

/* ===== Tree Timeline ===== */
.timeline {
  position: relative;
  padding: 20px 0 20px 50px;
  margin: 30px 0;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary), var(--accent));
}

.timeline-item {
  position: relative;
  margin-bottom: 30px;
  padding-left: 20px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -32px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--primary);
}

.timeline-year {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 6px;
  letter-spacing: 1px;
}

.timeline-content {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.8;
}

.timeline-content strong {
  display: block;
  color: var(--text);
  margin-bottom: 4px;
}

/* ===== References ===== */
.refs {
  background: var(--bg-alt);
  border-radius: 16px;
  padding: 36px;
}

.refs h3 {
  font-family: var(--serif);
  font-size: 22px;
  margin-bottom: 20px;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 12px;
}

.refs h3::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--primary-dark);
  border-radius: 50%;
}

.refs ol {
  padding-left: 24px;
}

.refs li {
  font-size: 13.5px;
  color: var(--text-soft);
  line-height: 1.7;
  margin-bottom: 10px;
  word-break: break-word;
}

/* ===== Footer ===== */
.footer {
  background: linear-gradient(135deg, var(--primary-dark), var(--accent-dark));
  color: rgba(255, 255, 255, 0.85);
  padding: 60px 0 30px;
  text-align: center;
}

.footer-logo {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
  color: white;
  margin-bottom: 12px;
  letter-spacing: 3px;
}

.footer-tagline {
  font-size: 14px;
  opacity: 0.75;
  margin-bottom: 30px;
  letter-spacing: 1px;
}

.footer-links {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: white;
  text-decoration: none;
}

.footer-divider {
  width: 60px;
  height: 1px;
  background: rgba(255, 255, 255, 0.3);
  margin: 0 auto 24px;
}

.footer-copy {
  font-size: 12px;
  opacity: 0.6;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .gallery {
    grid-template-columns: 1fr;
  }
  .article {
    padding: 32px 28px;
  }
  .info-block,
  .refs {
    padding: 24px;
  }
  .detail-block {
    padding: 24px;
  }
}

@media (max-width: 720px) {
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg);
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    gap: 14px;
  }
  .nav-menu.open {
    display: flex;
  }
  .nav-toggle {
    display: block;
  }
  section {
    padding: 70px 0;
  }
  .section-header {
    margin-bottom: 40px;
  }
  .info-block {
    padding: 20px;
  }
  .article {
    padding: 24px 20px;
  }
  .article p {
    text-indent: 1.5em;
  }
  .section-title::before,
  .section-title::after {
    display: none;
  }
  .hero {
    min-height: 80vh;
  }
  .timeline {
    padding-left: 40px;
  }
}

@media (max-width: 480px) {
  .hero-meta-item {
    padding: 8px 12px;
    font-size: 12px;
  }
  .hero-meta-item span {
    font-size: 14px;
  }
  .detail-block .meta-list .key {
    width: 90px;
    font-size: 13px;
  }
}