/* ==========================================
   全局基础变量与重置
   ========================================== */
:root {
  --primary: #c07c43;
  --primary-soft: rgba(192, 124, 67, .08);
  --text-main: #1e2226;
  --text-light: #5c636a;
  --text-muted: #88929b;
  --line: #f0f2f5;
  --bg: #f5f6f8;
  --white: #ffffff;
  --maxw: 860px;
  --maxw-home: 1080px;
  --vote-color: #e9543a;
  --radius: 16px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text-main);
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
}

/* ==========================================
   顶部导航 (通用)
   ========================================== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, .04);
}

.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  height: 64px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* 首页导航宽度单独处理 */
@media (min-width: 900px) {
  .nav-inner.nav-inner-home {
    max-width: var(--maxw-home);
  }
}

.nav-left a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  text-decoration: none;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.nav-right {
  position: relative;
}

.nav-btn {
  background: var(--white);
  border: 1px solid var(--line);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 16px;
  cursor: pointer;
  border-radius: 50%;
  transition: .2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .02);
}

.nav-btn:hover {
  color: var(--primary);
  border-color: var(--primary-soft);
  background: var(--primary-soft);
}

.nav-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 240px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .08);
  padding: 10px;
  display: none;
  flex-direction: column;
  animation: fadeInDown .2s ease;
}

.nav-menu.show {
  display: flex;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

.nav-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  color: var(--text-main);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: .2s;
}

.nav-menu a:hover {
  background: var(--bg);
  color: var(--primary);
}

/* ==========================================
   页面主布局包裹 (详情/列表共用)
   ========================================== */
.wrap {
  max-width: var(--maxw);
  margin: 32px auto 80px;
  padding: 0 20px;
}

/* 首页双栏布局 */
.wrap.wrap-home {
  max-width: var(--maxw-home);
  margin: 24px auto 80px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.main-col { flex: 1; min-width: 0; }
.side-col { width: 300px; flex-shrink: 0; }

/* 主卡片 */
.main-card {
  background: var(--white);
  border-radius: 20px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, .03), 0 1px 3px rgba(0, 0, 0, .02);
  padding: 48px 56px;
  overflow: hidden;
}

/* 列表和首页的主卡片内边距微调 */
.main-card.card-list { padding: 40px 48px; }
.main-card.card-home { padding: 10px 32px 32px; }

/* ==========================================
   面包屑与详情页头部
   ========================================== */
.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
  font-weight: 500;
}

.crumbs a { color: var(--text-muted); text-decoration: none; transition: .2s; }
.crumbs a:hover { color: var(--primary); }

.article-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 32px;
  margin-bottom: 36px;
}

.article-head h1 {
  font-size: 32px;
  line-height: 1.4;
  font-weight: 800;
  margin: 0 0 24px;
  color: #111418;
  letter-spacing: -0.5px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 13px;
  color: var(--text-muted);
  align-items: center;
}

.article-meta a {
  color: var(--primary);
  text-decoration: none;
  background: var(--primary-soft);
  padding: 4px 12px;
  border-radius: 6px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.article-meta span { display: inline-flex; align-items: center; gap: 6px; }

/* ==========================================
   详情页正文
   ========================================== */
.article-body {
  font-size: 17px;
  line-height: 2.0;
  word-break: break-word;
  color: #333a40;
  overflow: hidden;
}

.article-body p {
  margin: 0 0 1.5em !important;
  font-size: 17px !important;
  line-height: 2.0 !important;
  color: #333a40 !important;
  text-align: justify;
}

.article-body img {
  max-width: 100% !important;
  height: auto !important;
  display: block;
  margin: 36px auto !important;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .06);
}

.article-body a {
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px solid var(--primary);
  padding-bottom: 2px;
  transition: .2s;
}

.article-body a:hover { background: var(--primary-soft); }

.article-body h1, .article-body h2, .article-body h3, .article-body h4, .article-body h5, .article-body h6 {
  font-size: 20px !important;
  font-weight: 800 !important;
  line-height: 1.5 !important;
  margin: 2.2em 0 1em !important;
  color: #111418 !important;
  position: relative;
  padding-left: 16px;
}

.article-body h1::before, .article-body h2::before, .article-body h3::before, .article-body h4::before, .article-body h5::before, .article-body h6::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 18px;
  background: var(--primary);
  border-radius: 4px;
}

.article-body blockquote {
  margin: 2em 0;
  padding: 20px 24px;
  border-left: 4px solid var(--primary);
  background: #fafbfc;
  color: var(--text-light);
  border-radius: 0 12px 12px 0;
  font-style: italic;
  font-size: 16px;
}

/* ==========================================
   标签组 (详情页)
   ========================================== */
.tag-box {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 40px 0 0;
  border-top: 1px dashed var(--line);
  margin-top: 40px;
}

.tag-box a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--bg);
  border: 1px solid transparent;
  color: var(--text-light);
  text-decoration: none;
  border-radius: 8px;
  font-size: 13px;
  transition: .25s;
  font-weight: 500;
}

.tag-box a:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--white);
  box-shadow: 0 4px 12px var(--primary-soft);
  transform: translateY(-2px);
}

/* ==========================================
   点赞柱状图 (详情页)
   ========================================== */
.vote-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 50px 0 20px;
  user-select: none;
}

.vote-number {
  font-size: 24px;
  font-weight: 900;
  color: var(--vote-color);
  margin: 0 0 10px 0;
  line-height: 1;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.vote-pill {
  position: relative;
  width: 46px;
  height: 68px;
  border-radius: 30px;
  background: #f0ece7;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.04);
}

.vote-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--vote-color);
  transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

.vote-icon {
  position: relative;
  z-index: 2;
  color: #b5afa8;
  font-size: 20px;
  transition: color 0.3s;
}

.vote-pill.active { transform: translateY(-4px); box-shadow: 0 12px 24px rgba(233, 84, 58, 0.2); }
.vote-pill.active .vote-icon { color: #fff; }
.vote-pill.pop { animation: pillPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }

@keyframes pillPop {
  0% { transform: translateY(-4px) scale(1); }
  40% { transform: translateY(-10px) scale(1.15); }
  100% { transform: translateY(-4px) scale(1); }
}

.float-num {
  position: absolute;
  top: -28px;
  color: var(--vote-color);
  font-weight: 900;
  font-size: 20px;
  pointer-events: none;
  animation: floatUp 0.8s ease-out forwards;
}

@keyframes floatUp {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-25px) scale(1.4); }
}

/* ==========================================
   点赞推荐卡片 (详情页)
   ========================================== */
.related-card {
  background: var(--white);
  border-radius: 20px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, .03), 0 1px 3px rgba(0, 0, 0, .02);
  padding: 32px 40px;
  margin-top: 24px;
}

.related-card h3 {
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #111;
}

.related-card h3::before {
  content: '';
  width: 6px;
  height: 20px;
  background: var(--primary);
  border-radius: 4px;
}

.rel-item {
  display: flex;
  gap: 20px;
  padding: 16px;
  margin: 0 -16px;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: .25s;
  align-items: center;
}

.rel-item:hover { background: #fafbfc; transform: translateX(4px); }
.rel-item + .rel-item { border-top: 1px solid #f7f8f9; }

.rel-img {
  width: 140px;
  height: 95px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: #f0f2f5;
}

.rel-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }

.rel-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.6;
  color: #222;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: .2s;
  margin-bottom: 12px;
}

.rel-item:hover .rel-title { color: var(--primary); }

.rel-meta { display: flex; gap: 20px; font-size: 13px; color: var(--text-muted); font-weight: 500; }
.rel-meta span { display: flex; align-items: center; gap: 6px; }

/* ==========================================
   文章列表项 (首页/列表页)
   ========================================== */
.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 24px;
  margin-bottom: 8px;
}

.list-header h1 { font-size: 26px; font-weight: 800; margin: 0; color: #111; }
.list-header span { font-size: 14px; color: var(--text-muted); }

.list-item {
  display: flex;
  gap: 20px;
  padding: 24px 0;
  text-decoration: none;
  color: inherit;
  transition: .2s;
  align-items: flex-start;
}

.list-item + .list-item { border-top: 1px dashed var(--line); }
.list-item:hover { transform: translateX(4px); }
.list-item:hover .list-title { color: var(--primary); }

.list-img {
  width: 140px;
  height: 95px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: #f0f2f5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.list-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 95px;
}

.list-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  color: #111;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: .2s;
}

.list-snippet {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 4px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.list-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  align-items: center;
}

.list-meta span { display: flex; align-items: center; gap: 6px; }

.list-meta .cat-tag {
  color: var(--primary);
  background: var(--primary-soft);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

/* ==========================================
   右侧侧边栏 (首页专用)
   ========================================== */
.side-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 4px 30px rgba(0, 0, 0, .03);
  padding: 24px;
  margin-bottom: 24px;
}

.side-card h3 {
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 16px;
  color: #111;
  border-left: 4px solid var(--primary);
  padding-left: 8px;
}

.cat-list { display: flex; flex-wrap: wrap; gap: 10px; }
.cat-list a {
  display: inline-block;
  padding: 6px 14px;
  background: var(--bg);
  border-radius: 6px;
  color: var(--text-light);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: .2s;
}
.cat-list a:hover { background: var(--primary); color: #fff; }

.hot-list { display: flex; flex-direction: column; gap: 14px; }
.hot-item { display: flex; gap: 12px; text-decoration: none; color: inherit; align-items: baseline; }
.hot-num { font-size: 14px; font-weight: 800; font-style: italic; color: #ccc; width: 16px; flex-shrink: 0; }
.hot-item:nth-child(1) .hot-num { color: #e74c3c; }
.hot-item:nth-child(2) .hot-num { color: #e67e22; }
.hot-item:nth-child(3) .hot-num { color: #f1c40f; }
.hot-title { font-size: 14px; color: #333; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; transition: .2s; }
.hot-item:hover .hot-title { color: var(--primary); }

.side-news { display: flex; flex-direction: column; gap: 16px; }
.side-news-item { display: flex; gap: 12px; text-decoration: none; color: inherit; align-items: center; }
.side-news-img { width: 80px; height: 60px; object-fit: cover; border-radius: 6px; flex-shrink: 0; background: #f0f2f5; }
.side-news-title { font-size: 14px; color: #333; font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; transition: .2s; }
.side-news-item:hover .side-news-title { color: var(--primary); }

/* ==========================================
   分页组件
   ========================================== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  background: #f8f9fa;
  color: var(--text-main);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: .2s;
  border: 1px solid transparent;
}

.page-btn:hover { background: var(--primary-soft); color: var(--primary); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn.disabled { opacity: 0.5; pointer-events: none; }

/* ==========================================
   响应式适配 (移动端)
   ========================================== */
@media (max-width: 900px) {
  .wrap.wrap-home { flex-direction: column; gap: 16px; }
  .side-col { width: 100%; }
}

@media (max-width: 768px) {
  .wrap { padding: 0 12px; margin: 12px auto 40px; }
  .main-card { padding: 24px 20px; border-radius: 16px; }
  .related-card { padding: 24px 20px; border-radius: 16px; margin-top: 16px; }
  
  .article-head h1 { font-size: 24px; margin-bottom: 16px; }
  .article-body { font-size: 16px; }
  .article-body p { font-size: 16px !important; line-height: 1.9 !important; }
  
  .rel-img { width: 110px; height: 80px; }
  .rel-title { font-size: 15px; margin-bottom: 6px; }
  .rel-meta { gap: 12px; font-size: 12px; }

  .list-header h1 { font-size: 22px; }
  .list-item { gap: 12px; padding: 16px 0; }
  .list-img { width: 100px; height: 70px; }
  .list-body { min-height: 70px; }
  .list-title { font-size: 16px; }
  .list-snippet { display: none; }
  .list-meta { gap: 8px; font-size: 12px; }
}