/* ========================================
   能碳管理学 - 主样式表
   ======================================== */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 14px;
  color: #333;
  background: #f5f5f5;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
a:hover { color: #1a7d3f; }
ul { list-style: none; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* ===== 顶部横幅 ===== */
.top-bar {
  background: #1a3c2a;
  color: #ccc;
  font-size: 12px;
  padding: 5px 0;
}
.top-bar-inner {
  display: flex;
  gap: 20px;
  align-items: center;
}
.top-bar span { display: flex; align-items: center; gap: 5px; }
.top-right { margin-left: auto; }

/* 管理端按钮 */
.top-admin { margin-left: 12px; }
.admin-btn {
  color: #ffd700;
  font-size: 12px;
  padding: 2px 10px;
  border: 1px solid rgba(255,215,0,0.5);
  border-radius: 3px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.admin-btn:hover { background: rgba(255,215,0,0.15); color: #fff; }

/* ===== 头部 ===== */
.site-header {
  background: #fff;
  border-bottom: 3px solid #1a7d3f;
  padding: 15px 0;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.logo a {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.logo-icon {
  font-size: 36px;
  background: linear-gradient(135deg, #1a7d3f, #0a3d62);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.logo-text { display: flex; flex-direction: column; }
.logo-main {
  font-size: 28px;
  font-weight: 900;
  color: #0a3d62;
  letter-spacing: 2px;
}
.logo-sub { font-size: 11px; color: #888; letter-spacing: 1px; }

.header-search {
  display: flex;
  border: 2px solid #1a7d3f;
  border-radius: 4px;
  overflow: hidden;
}
.header-search input {
  border: none;
  outline: none;
  padding: 8px 15px;
  width: 280px;
  font-size: 13px;
}
.header-search button {
  background: #1a7d3f;
  border: none;
  color: #fff;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 14px;
}
.header-search button:hover { background: #155f30; }

/* ===== 主导航 ===== */
.main-nav {
  background: linear-gradient(135deg, #0a3d62 0%, #1a6d3f 100%);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.main-nav .container { position: relative; }
.nav-list {
  display: flex;
  flex-wrap: wrap;
}
.nav-list li a {
  display: block;
  color: #e8f5e9;
  padding: 14px 16px;
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.2s;
  white-space: nowrap;
}
.nav-list li a:hover,
.nav-list li a.active {
  background: rgba(255,255,255,0.15);
  color: #fff;
}
.nav-list li a i { margin-right: 4px; }
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 14px;
  margin: 8px 0;
  border-radius: 4px;
}

/* ===== Hero Banner ===== */
.hero-banner {
  position: relative;
  overflow: hidden;
}
.banner-slide {
  padding: 60px 0;
  color: #fff;
}
.banner-content h1 {
  font-size: 32px;
  font-weight: 900;
  margin-bottom: 14px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.banner-content p {
  font-size: 15px;
  margin-bottom: 24px;
  opacity: 0.9;
  max-width: 600px;
}
.btn-primary {
  display: inline-block;
  background: #e74c3c;
  color: #fff;
  padding: 12px 28px;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 600;
  transition: background 0.2s, transform 0.2s;
}
.btn-primary:hover { background: #c0392b; transform: translateY(-2px); color: #fff; }

/* ===== 数据统计条 ===== */
.stats-bar {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: 18px 0;
}
.stats-inner {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 10px;
}
.stat-item {
  text-align: center;
  padding: 0 20px;
}
.stat-num {
  display: block;
  font-size: 28px;
  font-weight: 900;
  color: #1a7d3f;
  line-height: 1;
}
.stat-label {
  display: block;
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}

/* ===== 主内容区 ===== */
.main-content { padding: 20px 0 40px; }
.content-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  align-items: start;
}

/* ===== 快速导航 ===== */
.quick-nav-section { margin-bottom: 20px; }
.quick-nav-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  background: #fff;
  padding: 16px;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.quick-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 4px;
  border-radius: 6px;
  transition: background 0.2s;
  text-align: center;
}
.quick-nav-item:hover { background: #f0f9f4; }
.qn-icon {
  width: 46px; height: 46px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 18px;
}
.quick-nav-item span { font-size: 12px; color: #555; font-weight: 500; }

/* ===== 内容区块 ===== */
.content-section {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  margin-bottom: 16px;
  overflow: hidden;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  background: #fafafa;
}
.section-header h2 {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #222;
}
.section-bar {
  display: inline-block;
  width: 4px; height: 18px;
  background: #e74c3c;
  border-radius: 2px;
}
.more-link { font-size: 12px; color: #1a7d3f; }
.more-link:hover { text-decoration: underline; }

/* ===== 新闻列表 ===== */
.news-list { padding: 10px 16px; }
.news-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px dashed #eee;
  font-size: 13.5px;
}
.news-list li:last-child { border-bottom: none; }
.news-list li a {
  flex: 1;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.news-list li a:hover { color: #1a7d3f; }
.news-date { color: #aaa; font-size: 12px; white-space: nowrap; }

.news-tag {
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 11px;
  color: #fff;
  white-space: nowrap;
}
.tag-red { background: #e74c3c; }
.tag-blue { background: #2980b9; }
.tag-green { background: #27ae60; }
.tag-orange { background: #e67e22; }

/* 紧凑列表 */
.news-list.compact li { padding: 7px 0; font-size: 13px; }

/* 两栏 */
.two-col-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 0;
}

/* ===== 产品卡片 ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 16px;
}
.product-card {
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  padding: 16px;
  text-align: center;
  transition: box-shadow 0.2s, transform 0.2s;
}
.product-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12); transform: translateY(-3px); }
.product-icon {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, #1a7d3f, #0a3d62);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
  font-size: 24px;
  color: #fff;
}
.product-card h3 { font-size: 14px; font-weight: 700; color: #222; margin-bottom: 8px; }
.product-card p { font-size: 12px; color: #666; line-height: 1.5; margin-bottom: 12px; }
.btn-sm {
  display: inline-block;
  background: #1a7d3f;
  color: #fff;
  padding: 5px 14px;
  border-radius: 3px;
  font-size: 12px;
  transition: background 0.2s;
}
.btn-sm:hover { background: #155f30; color: #fff; }

/* ===== 侧边栏 ===== */
.content-sidebar { position: sticky; top: 55px; }
.sidebar-widget {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  margin-bottom: 16px;
  overflow: hidden;
}
.widget-title {
  background: #fafafa;
  border-left: 4px solid #e74c3c;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  color: #222;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sidebar-list { padding: 8px 14px; }
.sidebar-list li {
  padding: 7px 0;
  border-bottom: 1px dashed #eee;
  font-size: 13px;
}
.sidebar-list li:last-child { border-bottom: none; }
.sidebar-list li a { color: #444; }
.sidebar-list li a:hover { color: #1a7d3f; }
.sidebar-list li a::before { content: "▸ "; color: #1a7d3f; font-size: 10px; }

/* 订阅 */
.subscribe-widget .widget-title + p {
  padding: 10px 14px 4px;
  font-size: 12px;
  color: #888;
}
.subscribe-widget input {
  width: calc(100% - 28px);
  margin: 4px 14px;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  outline: none;
}
.btn-subscribe {
  width: calc(100% - 28px);
  margin: 6px 14px 14px;
  padding: 9px;
  background: #e74c3c;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  display: block;
}
.btn-subscribe:hover { background: #c0392b; }

/* ===== 内页通用 ===== */
.page-hero {
  background: linear-gradient(135deg, #0a3d62 0%, #1a6d3f 100%);
  color: #fff;
  padding: 32px 0 24px;
  margin-bottom: 24px;
}
.page-hero h1 { font-size: 26px; font-weight: 900; margin-bottom: 6px; }
.page-hero p { font-size: 13px; opacity: 0.8; }
.breadcrumb { font-size: 12px; opacity: 0.7; margin-top: 8px; }
.breadcrumb a { color: #b2dfdb; }

.article-list { padding: 0; }
.article-item {
  background: #fff;
  border-radius: 6px;
  padding: 18px;
  margin-bottom: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  display: flex;
  gap: 16px;
  transition: box-shadow 0.2s;
}
.article-item:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.article-meta { min-width: 70px; text-align: center; }
.article-meta .meta-date-day { font-size: 28px; font-weight: 900; color: #1a7d3f; line-height: 1; }
.article-meta .meta-date-ym { font-size: 11px; color: #aaa; }
.article-body { flex: 1; }
.article-body h3 { font-size: 16px; margin-bottom: 6px; color: #222; }
.article-body h3 a:hover { color: #1a7d3f; }
.article-body p { font-size: 13px; color: #666; line-height: 1.6; margin-bottom: 8px; }
.article-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.article-tag {
  padding: 2px 8px;
  background: #e8f5e9;
  color: #1a7d3f;
  border-radius: 3px;
  font-size: 11px;
}

/* 页面内容网格 */
.page-content-grid {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 20px;
  align-items: start;
}

/* ===== 页脚 ===== */
.site-footer {
  background: #1a2633;
  color: #ccc;
  padding-top: 40px;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid #2c3e50;
}
.footer-col h3 {
  color: #fff;
  font-size: 15px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid #1a7d3f;
  display: inline-block;
}
.footer-col p { font-size: 13px; line-height: 1.8; margin-bottom: 6px; }
.footer-col ul li { padding: 4px 0; font-size: 13px; }
.footer-col ul li a { color: #bbb; }
.footer-col ul li a:hover { color: #1a7d3f; }
.footer-col p i { color: #1a7d3f; margin-right: 6px; }
.footer-bottom {
  text-align: center;
  padding: 14px 0;
  font-size: 12px;
  color: #888;
  background: #111e2a;
}
.footer-bottom span { margin: 0 6px; }

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
  .quick-nav-grid { grid-template-columns: repeat(4, 1fr); }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .content-grid { grid-template-columns: 1fr; }
  .content-sidebar { position: static; }
  .header-inner { flex-direction: column; align-items: flex-start; }
  .header-search input { width: 200px; }
  .logo-main { font-size: 22px; }
  .banner-content h1 { font-size: 22px; }
  .nav-toggle { display: block; }
  .nav-list { display: none; flex-direction: column; background: rgba(0,0,0,0.2); }
  .nav-list.open { display: flex; }
  .stats-inner { justify-content: flex-start; }
  .two-col-section { grid-template-columns: 1fr; }
  .quick-nav-grid { grid-template-columns: repeat(4, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .page-content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: 1fr 1fr; }
}
