/* ==========================================
   王仁民 · 自然健康博客
   Design inspired by Wellness Mama
   ========================================== */

/* ----- CSS Variables ----- */
:root {
  --green:       #4A6B4F;
  --green-light: #6B8F70;
  --green-pale:  #E8F0E5;
  --green-deep:  #3A563E;
  --gold:        #B88940;
  --gold-light:  #F0E4D0;
  --gold-soft:   #F5EDDF;
  --cream:       #FAF7F2;
  --cream-warm:  #F5F0EB;
  --white:       #FFFFFF;
  --text:        #3D3D3D;
  --text-light:  #6B6B6B;
  --text-muted:  #999999;
  --border:      #E8E3DC;
  --radius:      12px;
  --radius-sm:   8px;
  --radius-lg:   16px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.04), 0 1px 8px rgba(0,0,0,.05);
  --shadow:      0 1px 3px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.07);
  --shadow-lg:   0 2px 6px rgba(0,0,0,.04), 0 12px 40px rgba(0,0,0,.1);
  --font-serif:  Georgia, 'Noto Serif SC', 'Source Han Serif SC', serif;
  --font-sans:   system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --max-width:   1120px;
  --transition:  .3s cubic-bezier(.25,.8,.25,1);
}

/* ----- Reset ----- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 17px; }
body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--white);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--green); text-decoration: none; transition: color .2s; }
a:hover { color: var(--green-light); }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* ----- Header / Nav ----- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.88); backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, box-shadow .3s;
}
.site-header.scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 2px 12px rgba(0,0,0,.06);
}
.nav-container {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.logo {
  font-family: var(--font-serif);
  font-size: 1.45rem; font-weight: 700;
  color: var(--green); letter-spacing: .02em;
  transition: color var(--transition);
}
.logo:hover { color: var(--green-deep); }
.main-nav { display: flex; gap: 28px; }
.main-nav a {
  font-size: .9rem; color: var(--text-light); font-weight: 500;
  padding: 6px 0; border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}
.main-nav a:hover { color: var(--green); border-bottom-color: var(--green); }

.menu-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 6px;
}
.menu-toggle span {
  display: block; width: 24px; height: 2px;
  background: var(--text); border-radius: 1px; transition: all .3s;
}

/* ----- Search ----- */
.search-toggle {
  display: none; background: none; border: none; cursor: pointer;
  font-size: 1.2rem; padding: 6px; margin-left: auto; margin-right: 12px;
}
.search-bar {
  display: none; padding: 14px 0;
  background: var(--cream); border-bottom: 1px solid var(--border);
}
.search-bar.open { display: block; }
.search-bar .container {
  display: flex; align-items: center; gap: 12px;
}
.search-bar input {
  flex: 1; padding: 12px 18px;
  border: 1px solid var(--border); border-radius: 24px;
  font-size: .95rem; font-family: var(--font-sans); outline: none;
  transition: border-color .2s;
}
.search-bar input:focus { border-color: var(--green); }
.search-close {
  background: none; border: none; cursor: pointer;
  font-size: 1.2rem; color: var(--text-muted); padding: 4px 8px;
}
.search-results {
  padding-top: 14px; display: none;
}
.search-results.open { display: block; }
.search-results .result-item {
  display: block; padding: 12px 16px; border-radius: var(--radius-sm);
  transition: background .2s; margin-bottom: 4px;
}
.search-results .result-item:hover { background: var(--white); }
.search-results .result-item h4 {
  font-size: .95rem; font-weight: 600; color: var(--text); margin-bottom: 2px;
}
.search-results .result-item p {
  font-size: .82rem; color: var(--text-muted);
}
.search-no-results {
  text-align: center; padding: 24px; color: var(--text-muted);
  font-size: .9rem;
}

@media (max-width: 640px) {
  .search-toggle { display: block; }
}

/* ----- Hero ----- */
.hero {
  background: linear-gradient(170deg, var(--cream) 0%, var(--white) 55%);
  padding: 88px 0 80px;
  text-align: center;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background-image: radial-gradient(circle, var(--green-pale) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: .5;
  pointer-events: none;
}
.hero-tag {
  display: inline-block; position: relative;
  background: var(--green-pale); color: var(--green);
  font-size: .82rem; font-weight: 600; letter-spacing: .08em;
  padding: 7px 20px; border-radius: 20px; margin-bottom: 28px;
}
.hero h1 {
  font-family: var(--font-serif); position: relative;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700; color: var(--text);
  line-height: 1.4; margin-bottom: 20px;
  letter-spacing: .01em;
}
.hero-desc {
  font-size: 1.08rem; color: var(--text-light); position: relative;
  line-height: 1.8; margin-bottom: 38px;
}
.hero-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; position: relative; }
.btn {
  display: inline-block; padding: 14px 34px;
  font-size: .95rem; font-weight: 600; border-radius: 30px;
  transition: all .35s cubic-bezier(.25,.8,.25,1); cursor: pointer; border: none;
  letter-spacing: .02em;
}
.btn-primary {
  background: var(--green); color: #fff;
  box-shadow: 0 2px 8px rgba(74,107,79,.25);
}
.btn-primary:hover { background: var(--green-light); transform: translateY(-2px); color: #fff; box-shadow: 0 6px 20px rgba(74,107,79,.35); }
.btn-outline {
  background: transparent; color: var(--green);
  border: 2px solid var(--green);
}
.btn-outline:hover { background: var(--green); color: #fff; transform: translateY(-2px); }

/* ----- Section Titles ----- */
.section-title {
  font-family: var(--font-serif);
  font-size: 1.75rem; font-weight: 700;
  text-align: center; margin-bottom: 14px;
  color: var(--text); letter-spacing: .01em;
}
.section-subtitle {
  text-align: center; color: var(--text-muted);
  font-size: .95rem; margin-bottom: 48px;
}

/* ----- Categories ----- */
.categories { padding: 80px 0 72px; background: var(--cream); }
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.category-card {
  background: var(--white); border-radius: var(--radius);
  padding: 36px 24px 32px; text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
  display: block;
  border: 1px solid transparent;
}
.category-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--green-pale);
}
.cat-icon { font-size: 2.4rem; display: block; margin-bottom: 14px; }
.category-card h3 {
  font-family: var(--font-serif);
  font-size: 1.12rem; font-weight: 700; color: var(--text);
  margin-bottom: 8px;
}
.category-card p {
  font-size: .88rem; color: var(--text-muted); line-height: 1.55;
}

/* ----- Articles ----- */
.articles { padding: 80px 0 72px; }
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.article-card {
  background: var(--white); border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 2px 12px rgba(0,0,0,.06);
  transition: transform .35s cubic-bezier(.25,.8,.25,1), box-shadow .35s cubic-bezier(.25,.8,.25,1);
}
.article-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 4px 12px rgba(0,0,0,.06), 0 12px 36px rgba(0,0,0,.1);
}
.article-img {
  height: 200px; position: relative; overflow: hidden;
  background: var(--cream);
}
.article-img img {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s cubic-bezier(.25,.8,.25,1);
}
.article-card:hover .article-img img {
  transform: scale(1.04);
}
.article-img::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 60%;
  background: linear-gradient(to top, rgba(0,0,0,.25), transparent);
  pointer-events: none; z-index: 1;
}
.article-category {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  background: rgba(255,255,255,.92); color: var(--green);
  font-size: .75rem; font-weight: 600; letter-spacing: .04em;
  padding: 5px 13px; border-radius: 14px;
  backdrop-filter: blur(4px);
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.article-body { padding: 22px 24px 26px; }
.article-body time {
  font-size: .8rem; color: var(--text-muted); display: block; margin-bottom: 8px;
  letter-spacing: .02em;
}
.article-body h3 {
  font-family: var(--font-serif);
  font-size: 1.05rem; font-weight: 700; line-height: 1.5; margin-bottom: 10px;
}
.article-body h3 a { color: var(--text); transition: color var(--transition); }
.article-body h3 a:hover { color: var(--green); }
.article-body p {
  font-size: .9rem; color: var(--text-light); line-height: 1.7; margin-bottom: 16px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.read-more {
  font-size: .88rem; font-weight: 600; color: var(--green);
  border-bottom: 1px solid transparent; transition: border-color var(--transition);
  padding-bottom: 1px;
}
.read-more:hover { border-bottom-color: var(--green); }

/* ----- About ----- */
.about {
  padding: 88px 0;
  background: linear-gradient(180deg, var(--cream-warm) 0%, var(--white) 100%);
}
.about-content {
  max-width: 720px; text-align: center;
}
.about-avatar {
  margin-bottom: 32px; display: inline-block;
}
.about-avatar img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  object-fit: cover;
  max-width: 200px;
  width: 100%;
  height: auto;
}
.about-text h2 {
  font-family: var(--font-serif);
  font-size: 1.75rem; font-weight: 700; margin-bottom: 28px;
  letter-spacing: .01em;
}
.about-text p {
  font-size: 1.02rem; color: var(--text-light); line-height: 1.85; margin-bottom: 16px;
}
.about-credentials {
  display: inline-block; margin-top: 24px;
  background: var(--green-pale); color: var(--green);
  padding: 16px 28px; border-radius: var(--radius);
  font-size: .9rem; line-height: 1.65;
}
.signature { margin-top: 32px; opacity: .8; }

/* ----- Subscribe ----- */
.subscribe {
  padding: 88px 0; background: var(--green-deep);
  color: var(--white); text-align: center;
  position: relative; overflow: hidden;
}
.subscribe::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}
.subscribe-content { max-width: 600px; position: relative; }
.subscribe h2 {
  font-family: var(--font-serif);
  font-size: 1.75rem; font-weight: 700; margin-bottom: 14px;
  letter-spacing: .01em;
}
.subscribe p { font-size: 1.02rem; opacity: .88; line-height: 1.75; margin-bottom: 30px; }
.subscribe-form {
  display: flex; gap: 12px; max-width: 480px; margin: 0 auto 16px;
}
.subscribe-form input {
  flex: 1; padding: 15px 22px;
  border: 2px solid transparent; border-radius: 30px;
  font-size: .95rem; font-family: var(--font-sans);
  outline: none; transition: border-color var(--transition), box-shadow var(--transition);
  background: rgba(255,255,255,.95);
}
.subscribe-form input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(184,137,64,.15);
}
.subscribe-form .btn-primary {
  background: var(--gold); box-shadow: 0 2px 8px rgba(0,0,0,.15);
  transition: all .35s cubic-bezier(.25,.8,.25,1);
}
.subscribe-form .btn-primary:hover { background: #c9984a; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.subscribe-note { font-size: .85rem; opacity: .65; }
.subscribe-note strong { opacity: 1; }

/* ----- Footer ----- */
.site-footer {
  background: #2D2D2D; color: rgba(255,255,255,.65);
  padding: 64px 0 32px;
}
.footer-content {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px; margin-bottom: 44px;
}
.footer-col h4 {
  color: var(--white); font-size: .95rem; font-weight: 600; margin-bottom: 16px;
  letter-spacing: .02em;
}
.footer-col p { font-size: .88rem; line-height: 1.75; }
.footer-col a {
  display: block; font-size: .88rem; color: rgba(255,255,255,.5);
  padding: 5px 0; transition: color var(--transition);
}
.footer-col a:hover { color: var(--gold); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 24px; font-size: .8rem; text-align: center;
  color: rgba(255,255,255,.3);
}

/* ----- Responsive ----- */
@media (max-width: 900px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .article-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-content { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .main-nav { display: none; }
  .main-nav.open {
    display: flex; flex-direction: column; gap: 0;
    position: absolute; top: 64px; left: 0; right: 0;
    background: var(--white); border-bottom: 1px solid var(--border);
    padding: 8px 0; box-shadow: var(--shadow-lg);
  }
  .main-nav.open a { padding: 14px 24px; border-bottom: 1px solid var(--border); }
  .menu-toggle { display: flex; }
  .hero { padding: 48px 0 48px; }
  .category-grid { grid-template-columns: 1fr; gap: 14px; }
  .article-grid { grid-template-columns: 1fr; gap: 24px; }
  .subscribe-form { flex-direction: column; }
  .footer-content { grid-template-columns: 1fr; gap: 28px; }
  .hero h1 { font-size: 1.55rem; }
  .section-title { font-size: 1.45rem; margin-bottom: 32px; }
}

/* ----- Print ----- */
@media print {
  .site-header, .subscribe, .site-footer, .menu-toggle { display: none; }
  body { font-size: 14px; }
}
