/* ==========================================================================
   博客扩展样式 extra.css
   说明：搜索、关于、友链、书架、404 等次级页面的专用样式
   主色调：莫兰迪蓝灰 #64748B
   ========================================================================== */

/* ---------- 次级页面通用容器（窄居中） ---------- */
.page-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 30px 20px;
}

/* ==========================================================================
   搜索页
   ========================================================================== */

/* 搜索框：大号输入框 + 按钮，居中 */
.search-box {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  max-width: 640px;
  margin: 0 auto 30px;
}
.search-box input {
  flex: 1;
  height: 52px;
  padding: 0 18px;
  font-size: 16px;
  color: var(--color-text);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-box input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.15);
}
.search-box button {
  height: 52px;
  padding: 0 28px;
  font-size: 15px;
  color: #fff;
  background: var(--color-primary);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}
.search-box button:hover {
  background: var(--color-primary-hover);
}

/* 搜索结果统计 */
.search-stat {
  margin-bottom: 20px;
  color: var(--color-text-secondary);
  font-size: 14px;
}

/* 搜索结果列表 */
.search-result-list {
  margin-bottom: 30px;
}
.search-result-item {
  display: block;
  padding: 20px;
  margin-bottom: 16px;
  background: var(--color-bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
}
.search-result-item:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.search-result-item .title {
  font-size: 17px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 8px;
}
.search-result-item .excerpt {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: 12px;
}
.search-result-item .meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--color-text-light);
}
.search-result-item .tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* 关键词高亮 */
.highlight {
  background: #FEF3C7;
  color: #92400E;
  padding: 0 2px;
  border-radius: 2px;
}

/* 搜索历史 */
.search-history {
  max-width: 640px;
  margin: 0 auto 30px;
}
.search-history .history-title {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.search-history .history-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.search-history .history-tag {
  padding: 4px 12px;
  font-size: 13px;
  color: var(--color-text-secondary);
  background: var(--color-primary-light);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.search-history .history-tag:hover {
  color: #fff;
  background: var(--color-primary);
}
.search-history .clear-btn {
  font-size: 12px;
  color: var(--color-text-light);
  cursor: pointer;
  background: none;
  border: none;
}
.search-history .clear-btn:hover {
  color: var(--color-primary);
}

/* ==========================================================================
   关于页
   ========================================================================== */

.about-section {
  margin-bottom: 40px;
}
.about-section .section-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--color-primary-light);
  position: relative;
}
.about-section .section-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 60px;
  height: 2px;
  background: var(--color-primary);
}

/* 个人介绍（位于 about-banner 内，整体居中，头像在上文字在下） */
.about-intro {
  display: flex;
  flex-direction: column;       /* 纵向排列：头像 → 昵称 → 简介 → 社交链接 */
  align-items: center;          /* 水平居中 */
  justify-content: center;      /* 垂直居中 */
  text-align: center;           /* 文字居中 */
  gap: 12px;                    /* 各元素间距 */
  padding: 20px 0;
}
.about-intro .avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255, 255, 255, 0.6);   /* 白色半透明描边，在彩色背景上更突出 */
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);   /* 轻投影，立体感 */
}
.about-intro .info {
  display: flex;
  flex-direction: column;       /* 信息区也纵向 */
  align-items: center;          /* 信息区内容居中 */
  gap: 8px;
}
.about-intro .info .name {
  font-size: 26px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;                    /* 去掉单独 margin，用 gap 统一控制间距 */
}
.about-intro .info .bio {
  font-size: 15px;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0;
}
.about-intro .info .social-links {
  margin-top: 8px;              /* 社交链接与上方文字拉开一点距离 */
  justify-content: center;      /* 社交链接居中 */
}

/* 社交链接 */
.social-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
/* 文字型社交链接（保留兼容旧用法，但关于页已改用图标按钮 .social-btn） */
.social-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  font-size: 13px;
  color: var(--color-primary);
  background: var(--color-primary-light);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}
.social-links a:hover {
  color: #fff;
  background: var(--color-primary);
}

/* 关于页：圆形图标按钮（替代文字按钮，更精致） */
.about-intro .social-links .social-btn {
  width: 40px;                    /* 固定正方形尺寸 */
  height: 40px;
  padding: 0;                     /* 覆盖 .social-links a 的 6px 16px */
  font-size: 0;                   /* 隐藏文字，只显示 SVG */
  color: var(--color-primary);
  background: rgba(255, 255, 255, 0.85);   /* 白色半透明底，在彩色 banner 上更突出 */
  border-radius: 50%;             /* 圆形按钮 */
  justify-content: center;        /* SVG 水平居中 */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.25s ease;
}
.about-intro .social-links .social-btn:hover {
  color: #fff;
  background: var(--color-primary);
  transform: translateY(-2px);            /* 上浮效果 */
  box-shadow: 0 4px 12px rgba(18, 107, 103, 0.3);
}
.about-intro .social-links .social-btn svg {
  display: block;
}

/* 技能进度条 */
.skill-list {
  padding: 24px 30px;
  background: var(--color-bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.skill-item {
  margin-bottom: 18px;
}
.skill-item:last-child {
  margin-bottom: 0;
}
.skill-item .skill-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--color-text);
}
.skill-item .skill-percent {
  color: var(--color-primary);
  font-weight: 600;
}
.skill-bar {
  height: 8px;
  background: var(--color-primary-light);
  border-radius: 4px;
  overflow: hidden;
}
.skill-bar .skill-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  border-radius: 4px;
  width: 0;
  transition: width 0.8s ease;
}

/* 经历时间线 */
.timeline {
  position: relative;
  padding-left: 28px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--color-border);
}
.timeline-item {
  position: relative;
  padding: 0 0 24px 20px;
}
.timeline-item:last-child {
  padding-bottom: 0;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -28px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 2px solid var(--color-bg);
  box-shadow: 0 0 0 2px var(--color-primary);
}
.timeline-item .time {
  font-size: 13px;
  color: var(--color-primary);
  font-weight: 600;
  margin-bottom: 4px;
}
.timeline-item .title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
}
.timeline-item .desc {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.7;
}

/* 赞赏按钮 */
.reward-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  font-size: 15px;
  color: #fff;
  background: var(--color-primary);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.reward-btn:hover {
  background: var(--color-primary-hover);
  transform: translateY(-2px);
}

/* 赞赏弹层（复用文章详情页结构） */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-mask.show {
  display: flex;
}
.modal-box {
  width: 320px;
  padding: 24px;
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  text-align: center;
  animation: modal-in 0.25s ease;
}
@keyframes modal-in {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.modal-box .modal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 16px;
}
.modal-box .qr {
  width: 220px;
  height: 220px;
  margin: 0 auto 16px;
  border-radius: var(--radius);
  object-fit: cover;
}
.modal-box .modal-tip {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
}
.modal-box .modal-close {
  padding: 8px 24px;
  font-size: 14px;
  color: var(--color-text-secondary);
  background: var(--color-primary-light);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}
.modal-box .modal-close:hover {
  background: var(--color-primary);
  color: #fff;
}

/* ==========================================================================
   友链页
   ========================================================================== */
.link-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.link-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px;
  background: var(--color-bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
}
.link-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}
.link-card .avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-primary-light);
  margin-bottom: 12px;
}
.link-card .name {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
}
.link-card .desc {
  font-size: 13px;
  color: var(--color-text-secondary);
  text-align: center;
  line-height: 1.6;
}

/* ==========================================================================
   书架页
   ========================================================================== */
.bookshelf-section {
  margin-bottom: 40px;
}
.bookshelf-section .section-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.bookshelf-section .section-title .small-btn {
  font-size: 13px;
  font-weight: normal;
  padding: 6px 14px;
  color: #fff;
  background: var(--color-primary);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
}
.bookshelf-section .section-title .small-btn:hover {
  background: var(--color-primary-hover);
}
.bookshelf-list {
  background: var(--color-bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.bookshelf-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border-light);
  transition: background 0.2s;
  color: var(--color-text);
}
.bookshelf-item:last-child {
  border-bottom: none;
}
.bookshelf-item:hover {
  background: var(--color-bg-hover);
}
.bookshelf-item .icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.bookshelf-item .body {
  flex: 1;
  min-width: 0;
}
.bookshelf-item .name {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bookshelf-item .sub {
  font-size: 13px;
  color: var(--color-text-light);
}
.bookshelf-item .progress {
  width: 120px;
  height: 6px;
  background: var(--color-primary-light);
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
}
.bookshelf-item .progress .progress-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 3px;
}
.bookshelf-item .progress-text {
  width: 40px;
  text-align: right;
  font-size: 13px;
  color: var(--color-primary);
  font-weight: 600;
  flex-shrink: 0;
}

/* ==========================================================================
   404 页面
   ========================================================================== */
.error-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  background: var(--color-bg);
}
.error-page .error-code {
  font-size: 120px;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1;
  margin-bottom: 16px;
}
.error-page .error-msg {
  font-size: 18px;
  color: var(--color-text-secondary);
  margin-bottom: 28px;
}
.error-page .error-actions {
  margin-bottom: 36px;
}
.error-page .error-actions a {
  display: inline-block;
  padding: 12px 32px;
  font-size: 15px;
  color: #fff;
  background: var(--color-primary);
  border-radius: var(--radius);
  transition: background 0.2s, transform 0.2s;
}
.error-page .error-actions a:hover {
  background: var(--color-primary-hover);
  transform: translateY(-2px);
}
.error-page .recommend {
  max-width: 460px;
  width: 100%;
  padding: 20px;
  background: var(--color-bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.error-page .recommend .rec-title {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}
.error-page .recommend .rec-link {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-primary);
}

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 1024px) {
  .link-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 768px) {
  .search-box {
    flex-direction: column;
  }
  .search-box input,
  .search-box button {
    width: 100%;
  }
  .about-intro {
    gap: 10px;                 /* 移动端间距收紧 */
  }
  .about-intro .avatar {
    width: 90px;               /* 移动端头像缩小 */
    height: 90px;
  }
  .about-intro .info .name {
    font-size: 22px;
  }
  .social-links {
    justify-content: center;
  }
  .link-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .bookshelf-item .progress {
    display: none;
  }
  .bookshelf-item .progress-text {
    display: none;
  }
  .error-page .error-code {
    font-size: 80px;
  }
}
@media (max-width: 480px) {
  .link-grid {
    grid-template-columns: 1fr;
  }
}