/*
Theme Name: 寻药录·药膳修仙主题
Theme URI: https://yourdomain.com
Author: Your Name
Description: 道家修仙风格药膳养生WordPress主题，内置演示数据自动安装
Version: 2.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: xiuxian-herb
*/

:root {
  --bg: #f8f5ee;
  --card: #ffffff;
  --text: #2c2c2c;
  --text-light: #666666;
  --primary: #b22222; /* 朱砂红 */
  --secondary: #4a7c59; /* 青玉色 */
  --border: #e6e0d4;
  --shadow: 0 4px 12px rgba(0,0,0,0.06);
  --font-serif: "Noto Serif SC", "Source Han Serif CN", "SimSun", serif;
  --font-sans: "PingFang SC", "Microsoft YaHei", sans-serif;
  --container: 1200px;
  --gap: 24px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-serif);
  line-height: 1.75;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--secondary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary); }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

/* 页头 */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}
.header-inner { display: flex; justify-content: space-between; align-items: center; }
.site-title { font-size: 1.5rem; font-weight: 700; color: var(--primary); margin: 0; }
.main-nav { display: flex; gap: 24px; }
.main-nav a { font-weight: 500; padding: 8px 0; position: relative; }
.main-nav a::after {
  content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px;
  background: var(--secondary); transition: width 0.3s;
}
.main-nav a:hover::after { width: 100%; }

/* 主内容区 */
.site-main { padding: 40px 0; min-height: 60vh; }

/* 网格布局 */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--gap);
}
.post-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.post-card:hover { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(0,0,0,0.08); }
.post-thumb { width: 100%; height: 200px; object-fit: cover; }
.post-content { padding: 20px; }
.post-title { font-size: 1.25rem; margin-bottom: 8px; line-height: 1.3; }
.post-meta { font-size: 0.85rem; color: var(--text-light); margin-bottom: 12px; display: flex; gap: 12px; }
.post-excerpt { color: var(--text-light); margin-bottom: 16px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.btn {
  display: inline-block; padding: 8px 18px; background: var(--secondary); color: #fff;
  border-radius: 4px; font-size: 0.9rem; font-weight: 500;
}
.btn:hover { background: var(--primary); color: #fff; }

/* 文章详情 */
.single-post { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 40px; box-shadow: var(--shadow); }
.entry-header { margin-bottom: 24px; padding-bottom: 16px; border-bottom: 2px solid var(--primary); }
.entry-title { font-size: 2rem; margin-bottom: 12px; }
.entry-meta { display: flex; flex-wrap: wrap; gap: 16px; font-size: 0.9rem; color: var(--text-light); }
.entry-content { font-size: 1.05rem; line-height: 1.9; }
.entry-content p { margin-bottom: 1.2em; }
.entry-content h2, .entry-content h3 { margin: 1.5em 0 0.8em; color: var(--secondary); }
.entry-content img { border-radius: 6px; margin: 1.5em 0; }

/* 提示框 */
.tip-box {
  background: #f9f7f0; border-left: 4px solid var(--primary);
  padding: 16px 20px; margin: 24px 0; border-radius: 0 6px 6px 0;
}
.tip-box::before { content: "📜 修行提示"; font-weight: 700; color: var(--primary); display: block; margin-bottom: 6px; }

/* 页脚 */
.site-footer {
  background: var(--text); color: #ccc; text-align: center; padding: 32px 0; margin-top: 60px;
}
.site-footer a { color: #fff; }

/* 响应式 */
@media (max-width: 768px) {
  .header-inner { flex-direction: column; gap: 16px; }
  .main-nav { flex-wrap: wrap; justify-content: center; }
  .post-grid { grid-template-columns: 1fr; }
  .single-post { padding: 24px; }
  .entry-title { font-size: 1.6rem; }
}