/* ================================================
   Tianya Theme - Visual Redesign v1
   卡片化 / 缩略图 / Hero / 侧边栏卡片 / 详情页增强
   引入顺序在 global_v3.css、home_v3.css 之后
   ================================================ */

/* ================= 首页 Hero ================= */
.content-main .hero-section {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 45%, #0ea5e9 100%);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  margin: 24px 0 18px;
  text-align: left;
  color: #fff;
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.25);
  position: relative;
  overflow: hidden;
}
.content-main .hero-section::after {
  content: '';
  position: absolute;
  right: -50px;
  top: -50px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}
.content-main .hero-section::before {
  content: '';
  position: absolute;
  right: 60px;
  bottom: -70px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}
.content-main .hero-title {
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}
.content-main .hero-desc {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.88);
  position: relative;
  z-index: 1;
}
.hero-stats {
  margin-top: 14px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.92);
  display: flex;
  gap: 8px;
  align-items: center;
  position: relative;
  z-index: 1;
}
.hero-stats .hero-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.25);
}

/* ================= 分类标签栏 ================= */
.content-main .category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
  padding-bottom: 0;
  border-bottom: none;
}
.content-main .category-tabs a {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--color-border);
  transition: var(--transition);
}
.content-main .category-tabs a:hover {
  color: var(--color-primary);
  border-color: var(--color-primary-light);
  transform: translateY(-1px);
}
.content-main .category-tabs a.active {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.28);
}

/* ================= 文章卡片列表 ================= */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  border: none;
}

.post-card {
  display: flex;
  gap: 16px;
  align-items: stretch;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: 0 1px 3px var(--color-shadow);
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
}
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(99, 102, 241, 0.16);
  border-color: var(--color-primary-light);
}
.post-card .post-thumb {
  flex: 0 0 136px;
  width: 136px;
  height: 96px;
  border-radius: var(--radius-sm);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.post-thumb-icon {
  font-size: 36px;
  line-height: 1;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.18));
}
.post-card .post-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.post-card .post-cat {
  font-size: 11px;
  color: var(--color-primary);
  font-weight: 600;
  margin-bottom: 5px;
  letter-spacing: 0.3px;
}
.post-card .post-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.45;
  margin-bottom: 6px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.post-card:hover .post-card-title {
  color: var(--color-primary);
}
.post-card .post-excerpt {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: 8px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.post-card .post-card-meta {
  margin-top: auto;
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--color-text-muted);
  align-items: center;
}
.post-card .post-views {
  color: var(--color-sky);
  font-weight: 500;
}
.post-card .post-views::before {
  content: '👁 ';
  font-size: 11px;
}

/* 列表为空 */
.post-list .empty-state {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

/* ================= 侧边栏卡片化 ================= */
.sidebar .widget {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--color-border);
  box-shadow: 0 1px 3px var(--color-shadow);
  transition: var(--transition);
}
.sidebar .widget:hover {
  box-shadow: 0 10px 22px rgba(99, 102, 241, 0.10);
}
.sidebar .widget-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border-light);
  color: var(--color-text);
}
.sidebar .tag-cloud a {
  padding: 4px 11px;
  border-radius: 14px;
  font-size: 12px;
  background: var(--color-primary-bg);
  color: var(--color-primary);
  transition: var(--transition);
}
.sidebar .tag-cloud a:hover {
  background: var(--color-primary);
  color: #fff;
}

/* 关于我卡片 */
.about-card {
  display: flex;
  gap: 12px;
  align-items: center;
}
.about-avatar {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #0ea5e9);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.about-info .about-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 3px;
}
.about-info .about-desc {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.55;
}

/* ================= 文章详情页 ================= */
.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, #6366f1, #0ea5e9, #14b8a6);
  z-index: 9999;
  transition: width 0.1s linear;
}

.article-header {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 26px 28px 18px;
  box-shadow: 0 1px 3px var(--color-shadow);
}
.article-title {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 12px;
  color: var(--color-text);
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--color-text-muted);
}
.article-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.article-content {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 24px 28px 30px;
  box-shadow: 0 1px 3px var(--color-shadow);
}
.article-content img {
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

/* 目录 */
.toc-box {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-primary);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin: 0 0 22px;
}
.toc-box .toc-head {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 8px;
}
.toc-box ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: toc;
}
.toc-box li {
  margin: 5px 0;
  font-size: 13px;
  line-height: 1.6;
}
.toc-box li.lv3 {
  padding-left: 18px;
  font-size: 12.5px;
}
.toc-box a {
  color: var(--color-text-secondary);
}
.toc-box a:hover {
  color: var(--color-primary);
}

/* 相关推荐 */
.related-posts {
  margin-top: 24px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: 0 1px 3px var(--color-shadow);
}
.related-posts .related-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border-light);
}
.related-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.related-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.related-item:hover {
  background: var(--color-primary-bg);
}
.related-item .related-icon {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}
.related-item .related-name {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.related-item:hover .related-name {
  color: var(--color-primary);
}
.related-item .related-date {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--color-text-muted);
}

/* ================= 响应式 ================= */
@media (max-width: 768px) {
  .content-main .hero-section {
    padding: 24px 18px;
    margin: 16px 0 14px;
  }
  .content-main .hero-title {
    font-size: 20px;
  }
  .content-main .hero-desc {
    font-size: 13px;
  }
  .post-card {
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
  }
  .post-card .post-thumb {
    flex: 0 0 92px;
    width: 92px;
    height: 72px;
  }
  .post-thumb-icon {
    font-size: 26px;
  }
  .post-card .post-card-title {
    font-size: 15px;
  }
  .post-card .post-excerpt {
    display: none;
  }
  .article-header {
    padding: 20px 18px 14px;
  }
  .article-title {
    font-size: 21px;
  }
  .article-content {
    padding: 18px 18px 24px;
  }
  .related-posts {
    padding: 16px 18px;
  }
}

/* ===== 侧边栏热门评论：限制 2 行 + 强制断词，防止超出卡片 ===== */
.sidebar .widget-list .widget-comment-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
  line-height: 1.55;
}

/* ===== 两栏顶部对齐：侧栏首张卡片与左栏 hero 顶边齐平 ===== */
/* 原 global_v3.css 中 .sidebar{margin-top:103px} 使侧栏比左栏首块低 79px */
@media (min-width: 769px) {
  .sidebar {
    margin-top: 24px;
  }
}
