/* Zhi (知识分享) 专用样式 */

/* =========================================
   全局样式重置
   ========================================= */
* {
  box-sizing: border-box;
}

/* =========================================
   主内容布局
   ========================================= */
.main-content {
  padding: 4rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.content-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.page-title {
  font-size: 2.5rem;
  font-weight: 600;
  color: #000;
  margin: 0;
}

.page-description {
  font-size: 1.1rem;
  color: #666;
  line-height: 1.6;
  margin: 0;
  max-width: 800px;
  margin: 0 auto;
}

.buttons-container {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.nav-button {
  padding: 1rem 2rem;
  background: #fff;
  color: #000;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
  cursor: pointer;
  min-width: 120px;
  text-align: center;
  position: relative;
}

.nav-button:hover {
  background: #f8f9fa;
  transform: translateY(-2px);
}

/* 像素风格悬停提示样式 */
.nav-button::after {
  content: attr(data-tooltip);
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  background: #000;
  color: #fff;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
  pointer-events: none;
  border: 2px solid #000;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.nav-button::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid #000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
  pointer-events: none;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.nav-button:hover::after,
.nav-button:hover::before {
  opacity: 1;
  visibility: visible;
}

/* =========================================
   分割线样式
   ========================================= */
.divider-line {
  width: 100%;
  height: 2px;
  background: #000;
  margin: 2rem 0;
}

/* =========================================
   新知部分样式
   ========================================= */
/* 旧时部分的高度设置 */
.knowledge-section:nth-of-type(3) {
  min-height: 360px;
  max-height: none;
  overflow: visible;
}

.knowledge-container {
  text-align: center;
}

.section-title {
  font-size: 2rem;
  font-weight: 600;
  color: #000;
  margin: 0 0 3rem 0;
  position: relative;
  text-align: left;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -0.5rem;
  left: 0;
  width: 100%;
  height: 2px;
  background: #000;
}

/* 旧时标题右对齐样式 */
.section-title.right-align {
  text-align: right;
}

.section-title.right-align::after {
  left: auto;
  right: 0;
}

.knowledge-layout {
  display: flex;
  gap: 2rem;
  text-align: left;
  height: 100%;
  max-height: 280px;
}

/* 小屏幕下移除高度限制 */
@media (max-width: 768px) {
  .knowledge-layout {
    max-height: none;
    min-height: auto;
  }
}

.knowledge-left {
  width: 30%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-end;
  height: 100%;
  overflow: hidden;
}

.article-titles {
  text-align: right;
  width: 100%;
  display: flex;
  justify-content: flex-end;
}


.article-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.article-list li {
  margin: 0 0 0.2rem 0;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  justify-content: flex-end;
}

.article-date {
  color: #e5e5e5;
  font-size: 0.8rem;
  font-weight: 400;
  white-space: nowrap;
}

.article-list a {
  color: #666;
  text-decoration: none;
  font-size: 0.9rem;
  line-height: 1.4;
}

/* 移除文章链接的hover效果 */

.knowledge-right {
  width: 70%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 100%;
  overflow: hidden;
}

/* 封面画廊样式 */
.cover-gallery {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  height: 100%;
  max-height: 240px;
}

.cover-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

/* 移除封面图片的hover效果 */

.cover-item img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border: 2px solid #000;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.cover-title {
  display: none;
}

.knowledge-item {
  border: 2px solid #000;
  padding: 1.5rem;
  background: #fff;
  transition: all 0.3s ease;
}

.knowledge-item:hover {
  background: #f8f9fa;
  transform: translateY(-2px);
}

.knowledge-item h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: #000;
  margin: 0 0 0.5rem 0;
}

.knowledge-date {
  font-size: 0.9rem;
  color: #888;
  margin: 0 0 1rem 0;
}

.knowledge-content {
  font-size: 0.95rem;
  color: #666;
  line-height: 1.6;
  margin: 0;
}

/* =========================================
   卡片样式 - 简单黑色边框
   ========================================= */
.zhi-card {
  border: 2px solid #000;
  padding: 1.5rem;
  text-align: left;
  transition: all 0.3s ease;
  background: #fff;
  text-decoration: none;
  color: inherit;
  display: block;
  cursor: pointer;
}

.zhi-card:hover {
  background: #f8f9fa;
  transform: translateY(-2px);
}

.zhi-card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: #000;
  margin: 0 0 1rem 0;
}

.card-line1 {
  font-size: 0.9rem;
  color: #666;
  margin: 0 0 0.5rem 0;
  line-height: 1.4;
}

.card-line2 {
  font-size: 0.9rem;
  color: #888;
  margin: 0;
  line-height: 1.4;
}

/* =========================================
   右侧内容框样式
   ========================================= */
.content-box {
  border: 2px solid #000;
  padding: 1.5rem;
  background: #fff;
  transition: all 0.3s ease;
}

.content-box:hover {
  background: #f8f9fa;
  transform: translateY(-2px);
}

.content-box h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #000;
  margin: 0 0 1rem 0;
}

.content-preview {
  color: #666;
  font-size: 0.9rem;
  line-height: 1.5;
}

.content-preview p {
  margin: 0;
}

/* =========================================
   书籍网格布局
   ========================================= */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.book-card {
  background: #fff;
  border-radius: 8px;
  padding: 1.5rem;
  transition: transform 0.2s ease;
}

.book-card:hover {
  transform: translateY(-2px);
}

.book-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: #2d3748;
}

.book-title a {
  color: inherit;
  text-decoration: none;
}

.book-author {
  color: #718096;
  font-size: 0.9rem;
  margin: 0 0 1rem 0;
}

.book-rating {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.book-rating .star {
  color: #ffd700;
  font-size: 1rem;
}

.book-review {
  color: #4a5568;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* =========================================
   标签样式
   ========================================= */
.tag {
  display: inline-block;
  background: #e2e8f0;
  color: #4a5568;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.875rem;
  margin: 0.25rem 0.25rem 0.25rem 0;
}

.tag:hover {
  background: #cbd5e0;
}

/* =========================================
   响应式设计
   ========================================= */
@media (max-width: 768px) {
  .main-content {
    padding: 3rem 1rem;
  }
  
  .page-title {
    font-size: 2rem;
  }
  
  .page-description {
    font-size: 1rem;
  }
  
  .buttons-container {
    gap: 1rem;
  }
  
  .nav-button {
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
    min-width: 100px;
  }
  
  .knowledge-section {
    padding: 3rem 1rem;
  }
  
  .section-title {
    font-size: 1.8rem;
  }
  
  .knowledge-layout {
    flex-direction: column;
    gap: 1.5rem;
    max-height: none;
    min-height: auto;
  }
  
  .knowledge-left,
  .knowledge-right {
    width: 100%;
    overflow: visible;
  }
  
  .knowledge-left {
    align-items: flex-start;
  }
  
  .article-titles {
    text-align: left;
  }
  
  .article-list {
    align-items: flex-start;
  }
  
  .cover-gallery {
    flex-direction: column;
    gap: 1.5rem;
    max-height: none;
    overflow: visible;
  }
  
  .cover-item {
    max-width: 300px;
    margin: 0 auto;
  }
}

@media (max-width: 480px) {
  .main-content {
    padding: 2rem 1rem;
  }
  
  .page-title {
    font-size: 1.8rem;
  }
  
  .page-description {
    font-size: 0.9rem;
  }
  
  .buttons-container {
    gap: 0.8rem;
  }
  
  .nav-button {
    padding: 0.7rem 1.2rem;
    font-size: 0.85rem;
    min-width: 80px;
  }
  
  .knowledge-section {
    padding: 2rem 1rem;
  }
  
  .section-title {
    font-size: 1.6rem;
  }
  
  .knowledge-layout {
    gap: 1rem;
  }
  
  .cover-gallery {
    gap: 1rem;
  }
  
  .cover-item {
    max-width: 250px;
  }
  
  .knowledge-item {
    padding: 1.2rem;
  }
  
  .knowledge-item h3 {
    font-size: 1.1rem;
  }
  
  .knowledge-content {
    font-size: 0.9rem;
  }
  
  .categories-tags-box {
    height: 250px;
    margin: 2rem auto;
  }
  
  .tag-item {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
  }
  
  .featured-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .featured-image {
    height: 180px;
  }
  
  .featured-content {
    padding: 1.2rem;
  }
  
  .featured-title {
    font-size: 1.1rem;
  }
  
  .featured-excerpt {
    font-size: 0.9rem;
  }
}

/* =========================================
   分类和标签方框样式 - 长方形随机散布
   ========================================= */
/* =========================================
   旧时分类内容样式
   ========================================= */
.categories-content {
  margin-top: 2rem;
}

.categories-text {
  font-size: 1rem;
  line-height: 1.8;
  color: #333;
  text-align: left;
  margin: 0;
  padding: 0;
}

.clickable-item {
  cursor: pointer;
  transition: color 0.2s ease;
}

.clickable-item:hover {
  color: #666;
  text-decoration: underline;
}

/* =========================================
   精选板块样式 - 参考 xing 页面卡片样式
   ========================================= */

/* 卡片网格布局 */
.zhi-featured-grid {
  list-style: none;
  margin: 20px 0;
  padding: 0 16px;
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 1200px) { 
  .zhi-featured-grid { 
    grid-template-columns: repeat(3, minmax(0, 1fr)); 
    gap: 16px;
  } 
}

@media (max-width: 840px) { 
  .zhi-featured-grid { 
    grid-template-columns: repeat(2, minmax(0, 1fr)); 
    gap: 16px;
  } 
}

@media (max-width: 520px) { 
  .zhi-featured-grid { 
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0 8px;
    gap: 8px;
  } 
  
  .zhi-featured-card {
    min-height: 320px;
  }
  
  .zhi-featured-card__title {
    font-size: 16px;
    margin-bottom: 24px;
  }
  
  .zhi-featured-card__summary {
    font-size: 12px;
    -webkit-line-clamp: 2;
  }
  
  .zhi-featured-card__date {
    font-size: 11px;
    margin-bottom: 16px;
  }
  
  .zhi-featured-card__category {
    font-size: 12px;
  }
  
  .zhi-featured-card__tag {
    font-size: 12px;
  }
}

/* 卡片视觉样式 */
.zhi-featured-card {
  border: none;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  transition: transform .18s ease;
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 400px;
  width: 100%;
  max-width: 100%;
}

.zhi-featured-card:hover {
  transform: translateY(-2px);
}

.zhi-featured-card__link {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

/* —— 顶部：日期 + 标题 —— */
.zhi-featured-card__header {
  padding: 16px 0 8px 0;
}

.zhi-featured-card__date {
  font-size: 12px;
  color: #999;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.zhi-featured-card__date-year {
  color: #999;
  font-weight: 500;
}

.zhi-featured-card__date-separator {
  flex: 1;
  height: 1px;
  background-color: #ccc;
  margin: 0 8px;
  align-self: center;
  display: block;
  min-width: 0;
}

.zhi-featured-card__date-month {
  color: #999;
}

.zhi-featured-card__date-day-separator {
  width: 12px;
  height: 1px;
  background-color: #ccc;
  margin: 0 4px;
  align-self: center;
  display: block;
  flex-shrink: 0;
}

.zhi-featured-card__date-day {
  color: #999;
}

.zhi-featured-card__title {
  margin: 0 0 36px 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  color: #000;
  
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* —— 分类标签 —— */
.zhi-featured-card__categories {
  padding: 4px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.zhi-featured-card__category {
  display: inline-block;
  background: transparent;
  color: #666;
  padding: 2px 0;
  font-size: 13px;
  line-height: 1.2;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* —— 封面图片 —— */
.zhi-featured-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  margin: 0;
}

.zhi-featured-card__media > img.zhi-featured-card__cover {
  position: absolute;
  inset: 0;
  width: 100%; 
  height: 100%;
  object-fit: cover;
  display: block;
}

/* —— 底部：标签 + 简介 —— */
.zhi-featured-card__footer {
  padding: 3px 0 48px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

/* 标签样式 */
.zhi-featured-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.zhi-featured-card__tag {
  display: inline-block;
  background: transparent;
  color: #666;
  padding: 2px 0;
  font-size: 13px;
  line-height: 1.2;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* 简介样式 */
.zhi-featured-card__summary {
  font-size: 13px;
  line-height: 1.5;
  color: #666;
  margin: 0;
  
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =========================================
   Writing页面专用样式
   ========================================= */

/* =========================================
   Reading页面专用样式
   ========================================= */

/* Reading页面样式已移动到 reading.css */