/* ==========================================================================
   news_freshgreen — 清新绿意生态风主题样式
   Pure CSS. No external fonts / CDN / JS dependencies.
   ========================================================================== */

:root {
  --green-900: #1b5e20;
  --green-800: #2e7d32;
  --green-600: #43a047;
  --green-400: #66bb6a;
  --green-200: #a5d6a7;
  --green-100: #dcefdd;
  --green-050: #f0f8f1;
  --bg: #f7faf7;
  --card-bg: #ffffff;
  --text-main: #23342a;
  --text-muted: #5c6f63;
  --text-faint: #86988c;
  --border: #e2ede3;
  --shadow: 0 4px 18px rgba(46, 125, 50, 0.08);
  --shadow-hover: 0 10px 28px rgba(46, 125, 50, 0.16);
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 10px;
  --font-sans: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB",
    -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --max-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
  border-radius: var(--radius-sm);
}

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

a:hover {
  color: var(--green-600);
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1, h2, h3, h4 {
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
  margin: 0 0 0.6em;
}

p {
  margin: 0 0 1em;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------------------------------------------------------------------- *
 * 装饰性叶脉 / 有机 blob（纯CSS，无图片）
 * ---------------------------------------------------------------------- */

.leaf-blob {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  border-radius: 60% 40% 55% 45% / 45% 55% 40% 60%;
  background: linear-gradient(135deg, var(--green-200), var(--green-050));
  opacity: 0.55;
  filter: blur(0px);
}

/* ---------------------------------------------------------------------- *
 * Header / 顶部导航（head.html 片段样式）
 * ---------------------------------------------------------------------- */

.site-header {
  position: relative;
  background: linear-gradient(180deg, var(--green-050) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.site-header::before {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 220px;
  height: 220px;
  border-radius: 58% 42% 63% 37% / 41% 44% 56% 59%;
  background: radial-gradient(circle at 30% 30%, var(--green-200), transparent 70%);
  opacity: 0.6;
  pointer-events: none;
}

.site-header .wrap {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding-top: 18px;
  padding-bottom: 18px;
}

.site-header .brand img {
  display: block;
  border-radius: var(--radius-sm);
}

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px;
  box-shadow: var(--shadow);
}

.site-nav a {
  display: inline-block;
  padding: 9px 18px;
  border-radius: 999px;
  color: var(--text-main);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a.is-home {
  background: var(--green-800);
  color: #fff;
}

/* ---------------------------------------------------------------------- *
 * 通用页面骨架
 * ---------------------------------------------------------------------- */

.page-layout {
  max-width: var(--max-width);
  margin: 32px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: start;
}

.page-layout > main {
  min-width: 0;
}

.breadcrumb {
  font-size: 13px;
  color: var(--text-faint);
  margin-bottom: 16px;
}

.breadcrumb a {
  color: var(--text-muted);
}

/* ---------------------------------------------------------------------- *
 * 卡片通用组件
 * ---------------------------------------------------------------------- */

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

/* ---------------------------------------------------------------------- *
 * 首页 — 分类区块 (index.html)
 * ---------------------------------------------------------------------- */

.home-intro {
  position: relative;
  overflow: hidden;
  padding: 46px 20px;
  text-align: center;
  background: linear-gradient(135deg, var(--green-100), var(--bg) 65%);
}

.home-intro .leaf-blob:nth-child(1) {
  width: 260px;
  height: 260px;
  top: -100px;
  left: -80px;
}

.home-intro .leaf-blob:nth-child(2) {
  width: 180px;
  height: 180px;
  bottom: -80px;
  right: 6%;
  background: linear-gradient(135deg, var(--green-400), var(--green-200));
  opacity: 0.35;
}

.home-intro h1 {
  position: relative;
  z-index: 1;
  font-size: 30px;
  color: var(--green-900);
}

.home-intro p {
  position: relative;
  z-index: 1;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto;
}

.home-sections {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 36px 20px 60px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.cat-block {
  position: relative;
  overflow: hidden;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cat-block::after {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  right: -40px;
  bottom: -40px;
  border-radius: 55% 45% 60% 40% / 40% 55% 45% 60%;
  background: var(--green-050);
  z-index: 0;
}

.cat-block-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 2px solid var(--green-100);
  padding-bottom: 10px;
}

.cat-block-head h2 {
  font-size: 19px;
  margin: 0;
  color: var(--green-900);
}

.cat-block-head h2::before {
  content: "\1F343";
  margin-right: 6px;
  font-size: 16px;
}

.cat-block-head a {
  font-size: 13px;
  color: var(--text-faint);
  font-weight: 600;
}

.cat-block-list {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cat-block-list li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 14.5px;
}

.cat-block-list li::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--green-400);
  margin-bottom: 1px;
}

.cat-block-list a {
  color: var(--text-main);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cat-block-list .date {
  color: var(--text-faint);
  font-size: 12.5px;
  flex: none;
}

/* ---------------------------------------------------------------------- *
 * 列表页 (list.html)
 * ---------------------------------------------------------------------- */

.list-main h1 {
  font-size: 24px;
  margin-bottom: 20px;
  padding-left: 14px;
  border-left: 5px solid var(--green-600);
}

.article-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.article-item {
  padding: 20px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.article-item:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.article-item h3 {
  font-size: 17px;
  margin-bottom: 8px;
}

.article-item h3 a {
  color: var(--text-main);
}

.article-item .meta {
  font-size: 12.5px;
  color: var(--text-faint);
  margin-bottom: 8px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.article-item .meta span::before {
  content: "· ";
  color: var(--green-400);
}

.article-item .meta span:first-child::before {
  content: "";
}

.article-item .summary {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* 分页 */

.pagination {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.pagination a,
.pagination span {
  display: inline-block;
  min-width: 38px;
  text-align: center;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  border: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-main);
}

.pagination a:hover {
  background: var(--green-800);
  border-color: var(--green-800);
  color: #fff;
}

/* ---------------------------------------------------------------------- *
 * 侧边栏 (list.html / show.html 共用)
 * ---------------------------------------------------------------------- */

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.widget {
  padding: 20px;
}

.widget h2 {
  font-size: 16px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--green-200);
  color: var(--green-900);
}

.widget h2::before {
  content: "\1F340";
  margin-right: 6px;
}

.widget ol,
.widget ul {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.widget li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 14px;
}

.widget li a {
  color: var(--text-main);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.widget li .date {
  font-size: 12px;
  color: var(--text-faint);
  flex: none;
}

.widget.hot ol {
  counter-reset: hotrank;
}

.widget.hot li {
  counter-increment: hotrank;
}

.widget.hot li::before {
  content: counter(hotrank);
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--green-100);
  color: var(--green-800);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  line-height: 20px;
}

.widget.hot li:nth-child(-n+3)::before {
  background: var(--green-800);
  color: #fff;
}

/* ---------------------------------------------------------------------- *
 * 文章详情页 (show.html)
 * ---------------------------------------------------------------------- */

.article-detail {
  padding: 30px;
}

.article-detail h1 {
  font-size: 25px;
  color: var(--green-900);
  margin-bottom: 12px;
}

.article-detail .meta {
  font-size: 13px;
  color: var(--text-faint);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.article-detail .meta span::before {
  content: "· ";
  color: var(--green-400);
}

.article-detail .meta span:first-child::before {
  content: "";
}

.summary {
  background: var(--green-050);
  border-left: 4px solid var(--green-600);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 14.5px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.article-content {
  font-size: 16px;
  color: var(--text-main);
  line-height: 1.95;
}

.article-content p {
  margin: 0 0 1.2em;
}

.article-content img {
  margin: 16px auto;
}

.article-content h2,
.article-content h3 {
  color: var(--green-800);
  margin-top: 1.6em;
}

.article-nav {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}

.article-nav .nav-item {
  display: flex;
  gap: 8px;
}

.article-nav .nav-label {
  flex: none;
  color: var(--text-faint);
}

.article-nav a {
  color: var(--text-main);
}

/* ---------------------------------------------------------------------- *
 * Footer / 底部（footer.html 片段样式）
 * ---------------------------------------------------------------------- */

.site-footer {
  margin-top: 50px;
  background: linear-gradient(180deg, var(--green-050) 0%, var(--green-100) 100%);
  border-top: 1px solid var(--border);
}

.friend-links {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 26px 20px 10px;
}

.friend-links h2 {
  font-size: 14px;
  color: var(--green-900);
  margin-bottom: 12px;
}

.friend-links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.friend-links li {
  font-size: 13px;
}

.friend-links a {
  color: var(--text-muted);
}

.copyright {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 18px 20px 30px;
  border-top: 1px solid rgba(46, 125, 50, 0.12);
  font-size: 12.5px;
  color: var(--text-faint);
  text-align: center;
  line-height: 1.9;
}

.copyright a {
  color: var(--text-muted);
}

/* ---------------------------------------------------------------------- *
 * 响应式：移动端 <768px
 * ---------------------------------------------------------------------- */

@media (max-width: 992px) {
  .home-sections {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  body {
    font-size: 15px;
  }

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

  .site-nav {
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
    border-radius: var(--radius-sm);
  }

  .site-nav a {
    padding: 8px 14px;
    font-size: 14px;
  }

  .home-intro {
    padding: 32px 16px;
  }

  .home-intro h1 {
    font-size: 23px;
  }

  .home-sections {
    grid-template-columns: 1fr;
    padding: 24px 16px 40px;
  }

  .page-layout {
    grid-template-columns: 1fr;
    margin: 20px auto;
  }

  .article-detail {
    padding: 20px;
  }

  .article-detail h1 {
    font-size: 21px;
  }

  .list-main h1 {
    font-size: 20px;
  }
}

/* ---------------------------------------------------------------------- *
 * 打印样式：去除装饰，保证内容可读
 * ---------------------------------------------------------------------- */

@media print {
  .site-header,
  .site-footer,
  .sidebar,
  .pagination,
  .leaf-blob {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .page-layout {
    grid-template-columns: 1fr;
  }

  .card,
  .article-detail {
    box-shadow: none;
    border: none;
  }
}
