/*
Theme Name: Teavoices 茶文化主题
Theme URI: https://teavoices.com
Author: Teavoices
Description: 茶叶百科、茶具、茶文化垂直博客主题
Version: 1.3
*/

:root {
  --main-color: #015135;
  --main-hover: #026b47;
}

* {
  margin:0;
  padding:0;
  box-sizing:border-box;
}
body {
  font-family: "Microsoft YaHei", sans-serif;
  line-height:1.6;
  background:#f5f5f5;
  color:#333;
}
.container {
  max-width:1200px;
  margin:0 auto;
  padding:0 15px;
}
a {
  text-decoration:none;
  color:#333;
  transition: all 0.2s ease;
}
a:hover {
  color: var(--main-color);
}

/* 头部 */
.header {
  background:#fff;
  box-shadow:0 2px 5px rgba(0,0,0,0.1);
  padding:15px 0;
  position: sticky;
  top: 0;
  z-index: 999;
}
.header-inner {
  display:flex;
  justify-content:space-between;
  align-items:center;
}

/* ========== LOGO 宽度 240px (PC端) ========== */
.logo img {
  width: 240px;
  height: auto;
  display:block;
}

/* 导航 18px + 主色调 */
.nav {
  display:flex;
  gap:60px;
  align-items:center;
}
.nav a {
  font-size: 18px;
  font-weight:500;
  color: #333;
}
.nav a:hover {
  color: var(--main-color);
}

/* ========== 搜索图标缩小 ========== */
.search-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.search-icon img {
  width: 20px;
  height: 20px;
  display: block;
}

/* ========== 搜索弹窗 精美美化版 ========== */
#searchModal {
  position:fixed;
  top:0;
  left:0;
  width:100%;
  height:100%;
  background:rgba(0,0,0,0.6);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:9999;
  backdrop-filter: blur(4px);
}
#searchModal.show {
  display:flex;
}
.search-modal-inner {
  background:#fff;
  width:90%;
  max-width:520px;
  padding: 50px 40px;
  border-radius: 16px;
  position:relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.search-modal-inner input {
  width:100%;
  padding: 16px 20px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size:16px;
  outline: none;
  transition: all 0.2s;
}
.search-modal-inner input:focus {
  border-color: var(--main-color);
  box-shadow: 0 0 0 3px rgba(1,81,53,0.1);
}
.search-modal-inner button {
  margin: 20px auto 0;
  padding: 14px 36px;
  background: var(--main-color);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  display: block;
  transition: background 0.2s;
}
.search-modal-inner button:hover {
  background: var(--main-hover);
}
.close-search {
  position:absolute;
  right: 24px;
  top: 24px;
  cursor:pointer;
  font-size: 20px;
  color: #666;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}
.close-search:hover {
  background: #f5f5f5;
  color: #000;
}
.close-search {
  position:absolute;
  right:15px;
  top:15px;
  cursor:pointer;
  font-size:18px;
}

/* 主体布局 + 自适应 */
.main {
  display:flex;
  gap:30px;
  margin:30px 0;
}
.content {
  flex:1;
}
.sidebar {
  width:300px;
  flex-shrink: 0;
}

/* 文章列表：左图右文 */
.article-item {
  display: flex;
  background: #fff;
  border-radius: 12px;
  margin-bottom: 20px;
  box-shadow: 0 2px 2px rgba(0,0,0,0.05);
  align-items: center;
  padding: 12px;
}

/* 文章列表 */
.article-item {
  display: flex;
  background: #fff;
  border-radius: 12px;
  margin-bottom: 20px;
  box-shadow: 0 2px 2px rgba(0,0,0,0.05);
  align-items: center;
  padding: 12px;
}

/* 图片外层框（不动，负责裁切） */
.article-img-wrap {
  width: 240px;
  height: 160px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden; /* 这一行是关键！必须写在wrap上！ */
}

/* 图片：在wrap里放大 */
.article-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

/* 悬浮：图片在框内放大 */
.article-item:hover .article-img {
  transform: scale(1.1);
}

/* 让 A 标签撑满整个卡片，保持弹性布局 */
.article-link {
  display: flex;
  align-items: center;
  width: 100%;
  text-decoration: none !important;
  color: inherit !important;
}

.article-info {
  flex:1;
  padding:20px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  height:160px;
}
.article-title {
  font-size:17px;
  margin-bottom:8px;
  line-height:1.4;
  color: var(--main-color);
}
.article-meta {
  font-size:12px;
  color:#999;
  margin-bottom:8px;
}
.article-excerpt {
  font-size:14px;
  color:#666;
  line-height:1.5;
}

/* 侧边栏 */
.widget {
  background:#fff;
  padding:20px;
  border-radius:8px;
  margin-bottom:20px;
}
.widget-title {
  font-size:16px;
  margin-bottom:15px;
  padding-bottom:10px;
  border-bottom:1px solid #eee;
  color: var(--main-color);
}
.widget ul {
  list-style:none;
}
.widget ul li {
  padding:6px 0;
  font-size:14px;
}

/* 广告位 */
.ad-space {
  background:#fff;
  padding:10px;
  text-align:center;
  margin:20px 0;
  border:1px dashed #ccc;
  color:#666;
}

/* 横向文章列表（上图下文 + 简介） */
.grid-4 {
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:20px;
}
/* 下方上图下文卡片 */
.grid-item {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
/* 图片容器：固定不动 */
.grid-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  padding: 8px;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s ease;
}
/* 仅图片放大 */
.grid-item:hover .grid-img {
  transform: scale(1.1);
}
.grid-info {
  padding:15px;
  flex:1;
  display:flex;
  flex-direction:column;
}
.grid-title {
  font-size:14px;
  margin-bottom:6px;
  line-height:1.4;
  color: var(--main-color);
}
.grid-excerpt {
  font-size:12px;
  color:#888;
  line-height:1.4;
  margin-top:auto;
}

/* 分页 */
.pagination {
  text-align:center;
  margin:30px 0;
}
.pagination a {
  padding:8px 12px;
  background:#fff;
  margin:0 3px;
  border-radius:4px;
  color: #333;
}
.pagination a:hover {
  background: var(--main-color);
  color: #fff;
}

/* 底部 */
.footer {
  background:#222;
  color:#fff;
  padding:40px 0 20px;
  margin-top:50px;
}
.footer-nav {
  display:flex;
  gap:25px;
  margin-bottom:20px;
  justify-content:center;
}
.footer-nav a {
  color:#eee;
  font-size:14px;
}
.footer-nav a:hover {
  color: #fff;
}
.copyright {
  text-align:center;
  font-size:12px;
  color:#999;
  padding-top:20px;
  border-top:1px solid #444;
}

/* ====================== 自适应布局 ====================== */
@media (max-width: 992px) {
  .main {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
  }
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    gap: 15px;
  }
  .nav {
    gap: 18px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .article-item {
    flex-direction: column;
  }
  .article-img {
    width: 100%;
    height: 200px;
  }
  .article-info {
    height: auto;
  }
  /* 手机端LOGO自动适配，不强制240px */
  .logo img {
    width: 180px;
  }
}

@media (max-width: 576px) {
  .grid-4 {
    grid-template-columns: 1fr;
  }
  .footer-nav {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }
}