/* =====================================================
   石屏文化网站 - 主样式
   ===================================================== */

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

:root {
  --primary:   #1a6b4a;   /* 山林绿 */
  --accent:    #c8420a;   /* 彝族红 */
  --gold:      #c9890d;   /* 金色 */
  --dark:      #1e1e1e;
  --gray:      #555;
  --light-bg:  #f8f5f0;   /* 米白 */
  --border:    #e0d8cc;
  --radius:    8px;
  --shadow:    0 2px 12px rgba(0,0,0,.09);
  --font-cn:   'PingFang SC', 'Microsoft YaHei', 'Noto Serif SC', serif;
}

body {
  font-family: var(--font-cn);
  background: var(--light-bg);
  color: var(--dark);
  line-height: 1.8;
  font-size: 16px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--accent); }

img { max-width: 100%; height: auto; display: block; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 20px; }

/* ---- Header ---- */
.site-header {
  background: var(--primary);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.site-logo {
  color: #fff;
  font-size: 22px;
  font-weight: bold;
  letter-spacing: 1px;
}
.site-logo span { color: var(--gold); }

.main-nav { display: flex; gap: 4px; }
.main-nav a {
  color: rgba(255,255,255,.85);
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  transition: background .2s;
}
.main-nav a:hover, .main-nav a.active {
  background: rgba(255,255,255,.18);
  color: #fff;
}

/* ---- Hero Banner ---- */
.hero {
  background: linear-gradient(135deg, #1a6b4a 0%, #0d4030 60%, #1a3a20 100%);
  color: #fff;
  text-align: center;
  padding: 70px 20px 60px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-content { position: relative; }
.hero h1 { font-size: 38px; font-weight: bold; margin-bottom: 16px; text-shadow: 0 2px 8px rgba(0,0,0,.3); }
.hero p { font-size: 17px; opacity: .88; max-width: 580px; margin: 0 auto 28px; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.hero-tag {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
  padding: 5px 16px;
  border-radius: 20px;
  font-size: 13px;
}

/* ---- Categories Bar ---- */
.cat-bar { background: #fff; border-bottom: 2px solid var(--border); padding: 0; }
.cat-bar-inner { display: flex; gap: 0; overflow-x: auto; }
.cat-bar-inner::-webkit-scrollbar { height: 3px; }
.cat-bar-inner::-webkit-scrollbar-thumb { background: var(--border); }
.cat-link {
  white-space: nowrap;
  padding: 13px 18px;
  color: var(--gray);
  font-size: 14px;
  font-weight: 500;
  border-bottom: 3px solid transparent;
  transition: all .2s;
}
.cat-link:hover, .cat-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ---- Cards ---- */
.section-title {
  font-size: 20px;
  font-weight: bold;
  color: var(--dark);
  margin: 32px 0 20px;
  padding-left: 12px;
  border-left: 4px solid var(--accent);
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.13); }

.card-thumb {
  height: 180px;
  background: var(--primary);
  position: relative;
  overflow: hidden;
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: rgba(255,255,255,.6);
}

.card-cat {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 12px;
}

.card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.card-title {
  font-size: 16px;
  font-weight: bold;
  color: var(--dark);
  line-height: 1.5;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-summary {
  font-size: 13px;
  color: var(--gray);
  line-height: 1.6;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #999;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.card-meta .ai-badge {
  background: #edf7f1;
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
}

/* ---- Article Detail ---- */
.article-detail { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.article-header { padding: 40px 40px 20px; border-bottom: 1px solid var(--border); }
.article-header h1 { font-size: 28px; line-height: 1.5; margin-bottom: 16px; }
.article-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: #888; }
.article-meta span::before { content: '· '; }
.article-meta span:first-child::before { content: ''; }

.article-body { padding: 30px 40px; font-size: 16px; line-height: 2; }
.article-body p { margin-bottom: 1.4em; }
.article-body h2 { font-size: 20px; margin: 1.8em 0 .8em; color: var(--primary); }
.article-body h3 { font-size: 17px; margin: 1.4em 0 .6em; }
.article-body blockquote {
  border-left: 4px solid var(--gold);
  padding: 12px 20px;
  margin: 20px 0;
  background: #fffbf3;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: #666;
  font-style: italic;
}

/* ---- Sidebar ---- */
.layout-with-sidebar { display: flex; gap: 28px; align-items: flex-start; }
.main-content { flex: 1; min-width: 0; }
.sidebar { width: 280px; flex-shrink: 0; }
.widget { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 24px; }
.widget-title { font-size: 14px; font-weight: bold; color: var(--dark); margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid var(--border); }
.widget-list { list-style: none; }
.widget-list li { padding: 8px 0; border-bottom: 1px solid #f0ece6; font-size: 13px; }
.widget-list li:last-child { border: none; }
.widget-list a { color: var(--gray); display: block; line-height: 1.5; }
.widget-list a:hover { color: var(--primary); }

/* ---- Pagination ---- */
.pagination { display: flex; justify-content: center; gap: 8px; margin: 32px 0; flex-wrap: wrap; }
.pagination a, .pagination span {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--gray);
  background: #fff;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---- Footer ---- */
.site-footer { background: #1a1a1a; color: #aaa; text-align: center; padding: 40px 20px; margin-top: 60px; }
.site-footer .footer-links { display: flex; justify-content: center; gap: 20px; margin-bottom: 16px; flex-wrap: wrap; }
.site-footer .footer-links a { color: #888; font-size: 13px; }
.site-footer .footer-links a:hover { color: #fff; }
.site-footer p { font-size: 12px; line-height: 1.8; }
.site-footer .footer-logo { font-size: 18px; color: #fff; margin-bottom: 12px; }
.site-footer .footer-logo span { color: var(--gold); }

/* ---- Search ---- */
.search-bar { margin: 24px 0; }
.search-form { display: flex; gap: 8px; }
.search-form input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
}
.search-form input:focus { border-color: var(--primary); }
.search-form button {
  padding: 10px 22px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
}

/* ---- Category emojis ---- */
.emoji-icon { font-size: 32px; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .hero h1 { font-size: 26px; }
  .layout-with-sidebar { flex-direction: column; }
  .sidebar { width: 100%; }
  .article-header { padding: 24px 20px 16px; }
  .article-header h1 { font-size: 22px; }
  .article-body { padding: 20px; }
  .article-grid { grid-template-columns: 1fr; }
  .header-inner { height: 50px; }
  .site-logo { font-size: 17px; }
}
