@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&family=Josefin+Sans:wght@300;400;500;600;700&display=swap');

/* ===== 变量 ===== */
:root {
  --c-primary:   #5cc6b0;
  --c-secondary: #d4c4a8;
  --c-dark:      #172623;
  --c-bg:        #f5ede0;
  --c-bg2:       #ece0cf;
  --c-terra:     #c67b5c;
  --c-sand:      #d4b896;
  --c-olive:     #7a7a50;
  --c-text:      #2e1f14;
  --c-text-soft: #5a4a3a;
  --c-muted:     #9a8870;
  --c-card:      #ede2d3;
  --c-card2:     #e4d6c2;
  --c-border:    #c9b89a;
  --c-white:     #faf7f2;

  --nav-width:   220px;
  --radius-sm:   8px;
  --radius-md:   14px;
  --radius-lg:   18px;
  --shadow-soft: 0 4px 24px rgba(23,38,35,0.10), 0 1px 4px rgba(23,38,35,0.06);
  --shadow-card: 0 2px 12px rgba(23,38,35,0.09);
  --font-head:   'Cinzel', Georgia, serif;
  --font-body:   'Josefin Sans', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --transition:  0.28s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; background: var(--c-bg); }
body { font-family: var(--font-body); color: var(--c-text); line-height: 1.7; background: var(--c-bg); min-height: 100vh; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--c-terra); }
ol, ul { list-style: none; }
h1,h2,h3,h4,h5,h6 { font-family: var(--font-head); color: var(--c-dark); line-height: 1.3; letter-spacing: 0.03em; }

/* ===== Grain overlay ===== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.5;
  z-index: 9999;
}

/* ===== 侧边导航 ===== */
.sidenav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-width);
  height: 100vh;
  background: var(--c-dark);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  z-index: 100;
  overflow-y: auto;
  border-right: 2px solid var(--c-primary);
}

.sidenav-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px 20px;
  border-bottom: 1px solid rgba(92,198,176,0.2);
}

.brand-icon {
  font-family: var(--font-head);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--c-primary);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--c-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.sidenav > ol {
  flex: 1;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidenav > ol > li > a {
  display: block;
  padding: 12px 20px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--c-secondary);
  border-left: 3px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  min-height: 44px;
  line-height: 1.4;
}

.sidenav > ol > li > a:hover,
.sidenav > ol > li > a:focus {
  background: rgba(92,198,176,0.1);
  color: var(--c-primary);
  border-left-color: var(--c-primary);
}

/* ===== Page wrap (offset for sidenav) ===== */
.page-wrap {
  margin-left: var(--nav-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== Main content area ===== */
#main-content {
  flex: 1;
}

/* ===== Wrap: main > div.wrap > section > article 四层 ===== */
.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 32px;
}

/* ===== Hero (Home) ===== */
.hero-section {
  min-height: 45vh;
  background: linear-gradient(160deg, var(--c-dark) 0%, #1e3530 55%, #2a3f38 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0;
  position: relative;
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-media .hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.35;
}

.hero-placeholder {
  background: radial-gradient(ellipse at 70% 60%, rgba(92,198,176,0.18) 0%, transparent 70%);
}

.hero-text {
  position: relative;
  z-index: 2;
  padding: 48px 48px 52px;
  max-width: 640px;
  text-align: left;
}

.hero-badge {
  display: inline-block;
  background: var(--c-primary);
  color: var(--c-dark);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
  font-family: var(--font-body);
}

.hero-section h1 {
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  color: var(--c-white);
  margin-bottom: 14px;
  font-weight: 700;
}

.hero-sub {
  color: var(--c-secondary);
  font-size: 1rem;
  margin-bottom: 28px;
  line-height: 1.6;
  max-width: 480px;
}

.hero-cta {
  display: inline-block;
  background: var(--c-primary);
  color: var(--c-dark);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  padding: 13px 32px;
  border-radius: var(--radius-md);
  transition: background var(--transition), transform var(--transition);
  min-height: 44px;
}

.hero-cta:hover {
  background: var(--c-terra);
  color: var(--c-white);
  transform: translateY(-2px);
}

/* ===== 首页内容区 ===== */
.home-content-section {
  padding: 8px 0 24px;
}

.home-content-section article.prose {
  background: var(--c-card);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  box-shadow: var(--shadow-card);
}

/* ===== 首页资源导航卡片 ===== */
.home-nav-section {
  background: var(--c-bg2);
  padding: 48px 48px 56px;
}

.home-nav-section h2,
.home-articles-section h2 {
  font-family: var(--font-head);
  font-size: 1.5rem;
  color: var(--c-dark);
  margin-bottom: 8px;
}

.home-nav-section hr,
.home-articles-section hr {
  border: none;
  border-top: 2px solid var(--c-primary);
  width: 60px;
  margin-bottom: 32px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  list-style: none;
}

.card {
  background: var(--c-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-soft);
}

.card .card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.card-body {
  padding: 20px 22px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-body h3 {
  font-size: 1rem;
  font-family: var(--font-head);
  color: var(--c-dark);
  line-height: 1.4;
}

.card-body h3 a { color: inherit; }
.card-body h3 a:hover { color: var(--c-terra); }

.card-date { font-size: 0.78rem; color: var(--c-muted); }

.card-desc {
  font-size: 0.87rem;
  color: var(--c-text-soft);
  line-height: 1.6;
  flex: 1;
}

.card-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--c-primary);
  letter-spacing: 0.04em;
  margin-top: 6px;
  align-self: flex-start;
}

.card-link:hover { color: var(--c-terra); }

/* ===== 首页文章列表 ===== */
.home-articles-section {
  padding: 48px 48px 56px;
}

.article-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  list-style: none;
}

.article-list > li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: var(--c-card);
  transition: background var(--transition);
}

.article-list > li:hover { background: var(--c-card2); }

.article-list > li > a {
  flex: 1;
  font-weight: 500;
  color: var(--c-text);
  font-size: 0.95rem;
}

.article-list > li > a:hover { color: var(--c-terra); }

.article-list > li > small {
  font-size: 0.76rem;
  color: var(--c-muted);
  white-space: nowrap;
}

/* ===== CTA block ===== */
.home-cta-block,
.about-cta-block {
  background: linear-gradient(135deg, var(--c-dark) 0%, #1a3530 100%);
  color: var(--c-secondary);
  text-align: center;
  padding: 56px 32px 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.home-cta-block p,
.about-cta-block p {
  font-size: 1.1rem;
  color: var(--c-secondary);
  max-width: 480px;
}

.cta-btn {
  display: inline-block;
  background: var(--c-primary);
  color: var(--c-dark);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  padding: 16px 40px;
  border-radius: var(--radius-md);
  min-height: 44px;
  transition: background var(--transition), transform var(--transition);
}

.cta-btn:hover {
  background: var(--c-terra);
  color: var(--c-white);
  transform: translateY(-2px);
}

/* ===== Footer ===== */
.site-footer {
  background: var(--c-dark);
  border-top: 2px solid rgba(92,198,176,0.2);
  padding: 20px 48px;
}

.footer-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-brand { flex-shrink: 0; }

.footer-brand-text {
  font-family: var(--font-head);
  font-size: 0.95rem;
  color: var(--c-primary);
  font-weight: 600;
}

.footer-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.site-footer nav { flex: 1; }

.footer-nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  list-style: none;
}

.footer-nav-list > li > a {
  font-size: 0.78rem;
  color: var(--c-muted);
  transition: color var(--transition);
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 4px 2px;
}

.footer-nav-list > li > a:hover { color: var(--c-primary); }

.footer-copy {
  font-size: 0.73rem;
  color: var(--c-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ===== Article layout ===== */
.article-section > article.article-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: auto 1fr;
  gap: 0 32px;
  align-items: start;
}

.article-header {
  grid-column: 1 / -1;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--c-border);
}

.breadcrumb {
  font-size: 0.8rem;
  color: var(--c-muted);
  margin-bottom: 12px;
}

.breadcrumb a { color: var(--c-muted); }
.breadcrumb a:hover { color: var(--c-primary); }
.breadcrumb span { margin: 0 6px; }

.article-header h1 {
  font-size: clamp(1.4rem, 3.5vw, 2.2rem);
  margin-bottom: 12px;
  color: var(--c-dark);
}

.article-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--c-muted);
}

.art-date { font-size: 0.82rem; color: var(--c-muted); }
.art-date.mod { color: var(--c-olive); }

.article-hero-wrap {
  margin-top: 20px;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.article-hero-wrap .article-hero-img {
  width: 100%;
  height: 280px;
  object-fit: cover;
}

/* ===== Aside ===== */
.article-aside {
  grid-column: 1;
  grid-row: 2;
  background: var(--c-card);
  border-radius: var(--radius-md);
  padding: 22px 18px 24px;
  box-shadow: var(--shadow-card);
  position: sticky;
  top: 24px;
}

.article-aside h3 {
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--c-dark);
  margin-bottom: 8px;
  font-weight: 600;
}

.article-aside hr {
  border: none;
  border-top: 2px solid var(--c-primary);
  width: 36px;
  margin-bottom: 14px;
}

.article-aside ol {
  display: flex;
  flex-direction: column;
  gap: 2px;
  list-style: none;
}

.article-aside ol > li > a {
  display: block;
  font-size: 0.83rem;
  color: var(--c-text-soft);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
  min-height: 40px;
  line-height: 1.4;
  display: flex;
  align-items: center;
}

.article-aside ol > li > a:hover {
  background: rgba(92,198,176,0.12);
  color: var(--c-dark);
}

.article-content {
  grid-column: 2;
  grid-row: 2;
}

/* ===== Prose styles ===== */
.prose {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--c-text);
}

.prose h2 {
  font-size: 1.35rem;
  margin: 36px 0 8px;
  color: var(--c-dark);
  padding-bottom: 6px;
}

.prose h2 + hr {
  border: none;
  border-top: 2px solid var(--c-primary);
  width: 48px;
  margin-bottom: 18px;
}

.prose h3 {
  font-size: 1.1rem;
  margin: 28px 0 8px;
  color: var(--c-dark);
}

.prose h3 + hr {
  border: none;
  border-top: 1px solid var(--c-border);
  width: 36px;
  margin-bottom: 14px;
}

.prose p { margin-bottom: 18px; }

.prose a {
  color: var(--c-primary);
  border-bottom: 1px solid rgba(92,198,176,0.4);
  transition: border-color var(--transition), color var(--transition);
}

.prose a:hover {
  color: var(--c-terra);
  border-bottom-color: var(--c-terra);
}

.prose ul, .prose ol {
  margin: 0 0 18px 24px;
  list-style: disc;
}

.prose ol { list-style: decimal; }

.prose li { margin-bottom: 8px; line-height: 1.7; }

.prose blockquote {
  border-left: 4px solid var(--c-primary);
  padding: 12px 20px;
  margin: 24px 0;
  background: var(--c-card);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--c-text-soft);
  font-style: italic;
}

.prose img {
  border-radius: var(--radius-md);
  margin: 20px 0;
  box-shadow: var(--shadow-card);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.92rem;
}

.prose th {
  background: var(--c-dark);
  color: var(--c-secondary);
  padding: 10px 14px;
  text-align: left;
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.prose td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--c-border);
  color: var(--c-text);
}

.prose tr:nth-child(even) td { background: var(--c-card); }

.prose code {
  background: var(--c-card2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: 'Courier New', monospace;
  color: var(--c-terra);
}

.prose pre {
  background: var(--c-dark);
  color: var(--c-secondary);
  padding: 20px 24px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 24px 0;
  font-size: 0.88rem;
}

.prose pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

hr {
  border: none;
  border-top: 1px solid var(--c-border);
  margin: 24px 0;
}

/* ===== About layout ===== */
.about-hero {
  background: linear-gradient(150deg, var(--c-dark) 0%, #253d38 100%);
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 56px 48px;
  min-height: 40vh;
  position: relative;
  overflow: hidden;
}

.about-hero-text {
  flex: 1;
  max-width: 560px;
}

.eyebrow-tag {
  display: inline-block;
  background: rgba(92,198,176,0.2);
  color: var(--c-primary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 4px 14px;
  border-radius: 20px;
  border: 1px solid rgba(92,198,176,0.3);
  margin-bottom: 16px;
  font-family: var(--font-body);
}

.about-hero-text h1 {
  font-size: clamp(1.4rem, 3.5vw, 2.4rem);
  color: var(--c-white);
  margin-bottom: 10px;
}

.about-date {
  color: var(--c-muted);
  font-size: 0.84rem;
}

.about-hero-img {
  width: 200px;
  flex-shrink: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.about-hero-img .about-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.about-section > article.about-article {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0 32px;
  align-items: start;
}

.about-content {
  flex: 1;
}

/* ===== Privacy layout ===== */
.privacy-header {
  background: var(--c-dark);
  padding: 48px 48px 40px;
}

.privacy-header h1 {
  font-size: clamp(1.3rem, 3vw, 2rem);
  color: var(--c-white);
  margin: 12px 0 8px;
}

.privacy-date { font-size: 0.82rem; color: var(--c-muted); margin-top: 8px; }

.privacy-section > article.privacy-article {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0 32px;
  align-items: start;
}

.privacy-content { flex: 1; }

/* ===== Home specific prose ===== */
.home-content-section article.prose h2 { font-size: 1.25rem; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--c-bg); }
::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--c-primary); }

/* ===== Focus ===== */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ===== Animations ===== */
@media (prefers-reduced-motion: no-preference) {
  .card { will-change: transform; }

  .hero-media .hero-img {
    transform: scale(1.06);
    transition: transform 8s ease-out;
  }

  .hero-section:hover .hero-media .hero-img {
    transform: scale(1.0);
  }

  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .hero-text {
    animation: fadeUp 0.7s ease-out both;
  }

  .card {
    animation: fadeUp 0.5s ease-out both;
  }

  .card:nth-child(2) { animation-delay: 0.08s; }
  .card:nth-child(3) { animation-delay: 0.16s; }
  .card:nth-child(4) { animation-delay: 0.24s; }
  .card:nth-child(5) { animation-delay: 0.32s; }
  .card:nth-child(6) { animation-delay: 0.40s; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ===== 移动端断点 ===== */
@media (max-width: 900px) {
  :root { --nav-width: 0px; }

  .sidenav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 0;
    border-right: none;
    border-bottom: 2px solid var(--c-primary);
    overflow-x: auto;
    overflow-y: hidden;
    z-index: 200;
  }

  .sidenav-brand {
    padding: 12px 14px;
    border-bottom: none;
    border-right: 1px solid rgba(92,198,176,0.2);
    flex-shrink: 0;
  }

  .brand-icon {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .sidenav > ol {
    flex-direction: row;
    padding: 0;
    gap: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .sidenav > ol > li > a {
    white-space: nowrap;
    padding: 14px 16px;
    border-left: none;
    border-bottom: 3px solid transparent;
    min-height: 52px;
    font-size: 0.78rem;
  }

  .sidenav > ol > li > a:hover {
    border-left-color: transparent;
    border-bottom-color: var(--c-primary);
  }

  .page-wrap {
    margin-left: 0;
    padding-top: 58px;
  }

  .hero-text {
    padding: 32px 24px 36px;
  }

  .hero-section h1 { font-size: 1.5rem; }

  .home-nav-section,
  .home-articles-section {
    padding: 36px 20px 40px;
  }

  .home-cta-block,
  .about-cta-block {
    padding: 40px 20px 48px;
  }

  .site-footer {
    padding: 16px 20px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .footer-nav-list { gap: 4px 10px; }

  .wrap { padding: 28px 20px; }

  .article-section > article.article-body,
  .about-section > article.about-article,
  .privacy-section > article.privacy-article {
    grid-template-columns: 1fr;
  }

  .article-aside {
    grid-column: 1;
    grid-row: auto;
    position: static;
    margin-bottom: 24px;
  }

  .article-content {
    grid-column: 1;
    grid-row: auto;
  }

  .article-header { grid-column: 1; }

  .about-hero {
    flex-direction: column;
    padding: 36px 24px 40px;
    min-height: auto;
    gap: 24px;
  }

  .about-hero-img { width: 100%; }
  .about-hero-img .about-img { height: 180px; }

  .privacy-header { padding: 36px 24px 32px; }

  .home-content-section .prose { padding: 24px 22px; }
}

@media (max-width: 600px) {
  .card-grid { grid-template-columns: 1fr; }

  .sidenav > ol > li > a { padding: 14px 12px; font-size: 0.74rem; }

  .hero-text { padding: 24px 18px 28px; }

  .home-nav-section, .home-articles-section { padding: 28px 16px 32px; }

  .wrap { padding: 20px 16px; }

  .article-list > li { flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 14px; }
}
