/* ===================================================
   古诗词网 - 主样式
   =================================================== */
:root {
  --primary: #8b1a1a;
  --primary-light: #c9302c;
  --primary-bg: #fdf6ec;
  --gold: #c8a44b;
  --gold-light: #f0d890;
  --text: #333;
  --text-light: #666;
  --text-muted: #999;
  --border: #e8d5b0;
  --bg: #fff;
  --bg-warm: #fdf6ec;
  --bg-card: #fffdf8;
  --shadow: 0 2px 12px rgba(139,26,26,0.08);
  --radius: 8px;
  --font-serif: "STKaiti","KaiTi","楷体", "SimSun", "宋体", Georgia, serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg-warm);
  color: var(--text);
  line-height: 1.7;
}

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

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ===== HEADER ===== */
.site-header {
  background: linear-gradient(135deg, #6b0f0f 0%, #8b1a1a 60%, #a82828 100%);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 60px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: bold;
  white-space: nowrap;
  text-decoration: none;
}

.logo-icon { font-size: 28px; }

.site-nav {
  display: flex;
  gap: 4px;
  flex: 1;
}

.site-nav a {
  color: rgba(255,255,255,0.9);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 16px;
  transition: all .2s;
  white-space: nowrap;
}

.site-nav a:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

.header-search {
  display: flex;
}

.header-search form {
  display: flex;
  background: rgba(255,255,255,0.15);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.3);
}

.header-search input {
  background: transparent;
  border: none;
  padding: 6px 14px;
  color: #fff;
  width: 180px;
  font-size: 13px;
  outline: none;
}

.header-search input::placeholder { color: rgba(255,255,255,0.6); }

.header-search button {
  background: rgba(255,255,255,0.25);
  border: none;
  padding: 6px 12px;
  cursor: pointer;
  color: #fff;
  transition: background .2s;
}

.header-search button:hover { background: rgba(255,255,255,0.4); }

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 18px;
  margin-left: auto;
}

.mobile-nav {
  display: none;
  padding: 12px 0;
  border-top: 1px solid rgba(255,255,255,0.2);
}

.mobile-nav a, .mobile-nav form {
  display: block;
  padding: 8px 0;
  color: rgba(255,255,255,0.9);
  font-size: 15px;
}

.mobile-nav form {
  display: flex;
  gap: 8px;
  padding: 8px 0;
}

.mobile-nav form input {
  flex: 1;
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 14px;
}

.mobile-nav form button {
  padding: 6px 14px;
  background: var(--gold);
  border: none;
  border-radius: 4px;
  color: #6b0f0f;
  cursor: pointer;
  font-weight: bold;
}

/* ===== MAIN ===== */
.site-main { padding: 24px 0; min-height: calc(100vh - 60px - 60px); }

/* ===== FOOTER ===== */
.site-footer {
  background: #3a0a0a;
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 20px;
  font-size: 13px;
}

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.card-title {
  font-family: var(--font-body);
  font-size: 18px;
  color: var(--primary);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--gold-light);
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 18px;
  background: var(--primary);
  border-radius: 2px;
}

/* ===== POEM LIST ===== */
.poem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.poem-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.poem-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--gold));
}

.poem-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139,26,26,0.15);
}

.poem-card-title {
  font-size: 18px;
  color: var(--primary);
  margin-bottom: 6px;
}

.poem-card-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.poem-card-meta span { margin-right: 10px; }

.poem-card-preview {
  font-size: 15px;
  color: var(--text);
  line-height: 1.9;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.poem-card-tags { margin-top: 10px; }

.tag {
  display: inline-block;
  padding: 2px 8px;
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 12px;
  color: var(--text-muted);
  margin: 2px;
  transition: all .2s;
}

.tag:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 14px;
  transition: all .2s;
  color: var(--text);
  text-decoration: none;
}

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

.pagination .current {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.pagination .page-info {
  width: auto;
  padding: 0 10px;
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ===== INDEX PAGE ===== */
.index-hero {
  background: linear-gradient(135deg, #6b0f0f 0%, #8b1a1a 50%, #a82828 100%);
  color: #fff;
  border-radius: 12px;
  padding: 48px 40px;
  margin-bottom: 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.index-hero::before {
  content: '诗';
  position: absolute;
  font-size: 300px;
  font-family: var(--font-serif);
  color: rgba(255,255,255,0.03);
  top: -60px;
  left: -20px;
  pointer-events: none;
}

.index-hero h1 {
  font-family: var(--font-serif);
  font-size: 45px;
  margin-bottom: 12px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.index-hero p {
  font-size: 16px;
  opacity: 0.85;
  margin-bottom: 24px;
}

.index-hero .hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  border-radius: 24px;
  font-size: 15px;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  border: none;
}

.btn-primary {
  background: var(--gold);
  color: #6b0f0f;
  font-weight: bold;
}

.btn-primary:hover {
  background: #e8c460;
  transform: scale(1.03);
  color: #6b0f0f;
}

.btn-outline {
  border: 2px solid rgba(255,255,255,0.6);
  color: #fff;
}

.btn-outline:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

/* ===== LAYOUT 2COL ===== */
.layout-2col {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  align-items: start;
}

.layout-2col .sidebar {
  position: sticky;
  top: 80px;
}

/* ===== DYNASTY LIST ===== */
.dynasty-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dynasty-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 18px;
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  color: var(--text);
  min-width: 80px;
}

.dynasty-item:hover, .dynasty-item.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.dynasty-item .name {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: bold;
}

.dynasty-item .count {
  font-size: 12px;
  opacity: 0.7;
}

/* ===== SECTION TITLE ===== */
.section-title {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--primary);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--gold-light);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 22px;
  background: linear-gradient(var(--primary), var(--gold));
  border-radius: 2px;
}

/* ===== SIDEBAR POET LIST ===== */
.poet-list-mini {
  list-style: none;
}

.poet-list-mini li {
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.poet-list-mini li:last-child { border-bottom: none; }

.poet-list-mini a { color: var(--text); }
.poet-list-mini a:hover { color: var(--primary); }

.poet-list-mini .count {
  color: var(--text-muted);
  font-size: 12px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .site-nav { display: none; }
  .header-search { display: none; }
  .mobile-menu-btn { display: block; }

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

  .layout-2col .sidebar {
    position: static;
    order: -1;
  }

  .poem-grid {
    grid-template-columns: 1fr;
  }

  .poet-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
  }

  .poet-card { padding: 14px; }

  .pagination { gap: 4px; }
  .pagination a, .pagination span { width: 32px; height: 32px; font-size: 13px; }
  .pagination .page-info { font-size: 12px; padding: 0 6px; }

  .index-hero {
    padding: 32px 20px;
  }

  .index-hero h1 { font-size: 26px; }

  .dynasty-list { gap: 6px; }

  .dynasty-item {
    padding: 8px 12px;
    min-width: 60px;
  }

  .dynasty-item .name { font-size: 16px; }
}

@media (max-width: 480px) {
  .container { padding: 0 12px; }
  .index-hero { border-radius: 8px; }

  .poet-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px;
  }

  .poet-card .poet-avatar { width: 48px; height: 48px; font-size: 20px; }
}

/* ===== PAGE POEM LIST (list page) ===== */
.page-header-banner {
  background: linear-gradient(135deg, #6b0f0f, #8b1a1a);
  color: #fff;
  border-radius: 8px;
  padding: 24px 28px;
  margin-bottom: 24px;
}

.page-header-banner h1 {
  font-family: var(--font-serif);
  font-size: 26px;
  margin-bottom: 4px;
}

.page-header-banner p {
  font-size: 14px;
  opacity: 0.75;
}

/* Filter bar */
.filter-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
}

.filter-bar .filter-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-tags a {
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 13px;
  color: var(--text);
  background: var(--bg-warm);
  border: 1px solid var(--border);
  transition: all .2s;
}

.filter-tags a:hover, .filter-tags a.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ===== POET LIST ===== */
.poet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.poet-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: all .2s;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.poet-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139,26,26,0.12);
  border-color: var(--primary);
}

.poet-card .poet-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--gold));
  color: #fff;
  font-family: var(--font-serif);
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

.poet-card .poet-name {
  font-family: var(--font-body);
  font-size: 20px;
  color: var(--primary);
  margin-bottom: 4px;
}

.poet-card .poet-dynasty {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.poet-card .poet-count {
  font-size: 13px;
  color: var(--text-light);
}

/* ===== SEARCH ===== */
.search-result-count {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.search-result-count strong {
  color: var(--primary);
}

/* ===== INITIAL BAR ===== */
.initial-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.initial-bar a {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
  color: var(--text);
  transition: all .2s;
}

.initial-bar a:hover, .initial-bar a.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ===== FOOTER (网站设置增强) ===== */
.site-footer {
  padding: 24px 0;
  border-top: 1px solid var(--border);
  background: #faf8f5;
  font-size: 13px;
  color: #888;
}
.site-footer a {
  color: inherit;
}
.site-footer a:hover {
  color: var(--primary);
}
