/* ===== Articles Page Styles ===== */

/* --- Nav link active state --- */
.nav-link.active {
  color: #3b82f6;
  font-weight: 600;
}

/* --- Section Icon SVG --- */
.section-icon svg {
  display: block;
}

/* --- Main Content --- */
.articles-main {
  padding: 0 0 80px;
  background: #f8fafc;
}

.articles-main-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

/* --- Sidebar Navigation --- */
.articles-sidebar {
  position: sticky;
  top: 80px;
  width: 200px;
  min-width: 200px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e8ecf1;
  padding: 16px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.sidebar-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e8ecf1;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 500;
  color: #64748b;
  transition: all 0.2s;
  cursor: pointer;
}

.sidebar-link:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.sidebar-link.active {
  background: #ecfdf5;
  color: #059669;
  font-weight: 600;
}

.sidebar-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sidebar-count {
  margin-left: auto;
  font-size: 11px;
  color: #94a3b8;
  font-weight: 400;
}

.sidebar-link.active .sidebar-count {
  color: #6ee7b7;
}

/* --- Articles Content Area --- */
.articles-content {
  flex: 1;
  min-width: 0;
}

/* --- Section Anchor (for sticky + scroll) --- */
.section-anchor {
  scroll-margin-top: 64px;
}

/* --- Section Header (sticky) --- */
.articles-content > .section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding: 16px 0 16px;
  border-bottom: 2px solid #f1f5f9;
  position: -webkit-sticky;
  position: sticky;
  top: 64px;
  background: #f8fafc;
  z-index: 10;
}

/* --- Grid spacing for flat layout --- */
.article-grid-spaced {
  margin-bottom: 16px;
}

.article-grid-spaced:last-child {
  margin-bottom: 0;
}

.section-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  color: #fff;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 2px;
}

.section-subtitle {
  font-size: 13px;
  color: #94a3b8;
}

/* --- Article Grid --- */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

/* 分页隐藏 */
.article-card-hidden {
  display: none !important;
}

/* --- 分页控件 --- */
.article-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
  margin-bottom: 40px;
}

.page-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
  background: #f1f5f9;
  color: #3b82f6;
  border-color: #3b82f6;
}

.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.page-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: #cbd5e1;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s;
}

.page-dot:hover {
  background: #94a3b8;
}

.page-dot.active {
  background: #3b82f6;
  width: 20px;
  border-radius: 4px;
}

.page-info {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
  margin-left: 4px;
  min-width: 36px;
  text-align: center;
}

/* --- Article Card --- */
.article-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e8ecf1;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

/* --- Pinned Badge --- */
.article-pinned-badge {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 11px;
  font-weight: 600;
  font-family: 'Noto Sans SC', sans-serif;
  color: #fff;
  background: linear-gradient(135deg, #f97316, #ef4444);
  padding: 2px 10px;
  border-radius: 0 0 0 8px;
  line-height: 1.5;
  z-index: 2;
}

.article-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}

.article-card:hover .article-link-icon {
  opacity: 1;
  color: #059669;
}

.article-link-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 14px;
  font-weight: 700;
  color: #94a3b8;
  opacity: 0;
  transition: all 0.25s;
}

/* --- Card Header --- */
.article-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.article-avatar {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}

.article-avatar img {
  display: block;
  width: 26px !important;
  height: 26px !important;
  max-width: 26px !important;
  max-height: 26px !important;
  object-fit: contain;
  border-radius: 4px;
}

.article-meta {
  flex: 1;
  min-width: 0;
}

.article-name {
  font-size: 14.5px;
  font-weight: 650;
  color: #0f172a;
  display: block;
  margin-bottom: 2px;
}

.article-source {
  font-size: 11.5px;
  color: #94a3b8;
  font-weight: 500;
}

/* --- Card Body --- */
.article-desc {
  font-size: 12.5px;
  color: #64748b;
  line-height: 1.7;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Card Tags --- */
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: auto;
}

.article-tags .article-visit {
  margin-left: auto;
  padding-left: 8px;
}

.article-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
}

.article-tag.green { color: #059669; background: #ecfdf5; }
.article-tag.blue { color: #2563eb; background: #eff6ff; }
.article-tag.purple { color: #7c3aed; background: #f5f3ff; }
.article-tag.orange { color: #ea580c; background: #fff7ed; }
.article-tag.pink { color: #db2777; background: #fdf2f8; }
.article-tag.cyan { color: #0891b2; background: #ecfeff; }
.article-tag.yellow { color: #b45309; background: #fffbeb; }
.article-tag.indigo { color: #4f46e5; background: #eef2ff; }
.article-tag.teal { color: #0d9488; background: #f0fdfa; }
.article-tag.red { color: #dc2626; background: #fef2f2; }

.article-visit {
  font-size: 12px;
  font-weight: 600;
  color: #3b82f6;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}

.article-card:hover .article-visit {
  color: #2563eb;
}

/* --- WeChat Card Special Styles --- */
.wechat-card {
  cursor: pointer;
}

.wechat-card:hover {
  border-color: #a7f3d0;
  box-shadow: 0 4px 20px rgba(5, 150, 105, 0.08);
}

.wechat-card .article-link-icon.wechat-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: #07c160;
  padding: 2px 8px;
  border-radius: 4px;
  opacity: 1;
  letter-spacing: 0.5px;
}

.wechat-hint {
  color: #07c160 !important;
  font-size: 12px;
  font-weight: 600;
}

.wechat-card:hover .wechat-hint {
  color: #059669 !important;
}

/* --- WeChat Compact Card --- */
.wechat-grid {
  grid-template-columns: repeat(3, 1fr);
}

.wechat-compact {
  padding: 14px 16px;
}

.wechat-compact .article-card-header {
  margin-bottom: 6px;
}

.wechat-compact .article-meta {
  gap: 1px;
}

.wechat-compact .article-name {
  font-size: 14px;
}

.wechat-compact .article-source {
  font-size: 11px;
}

.wechat-compact .article-desc {
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 8px;
  -webkit-line-clamp: 2;
}

.wechat-compact .article-tags {
  margin-bottom: 0;
}

.wechat-compact .article-tag {
  font-size: 10px;
  padding: 2px 6px;
}

/* --- WeChat Toast --- */
.wechat-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.wechat-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.wechat-toast-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid #d1fae5;
  border-radius: 16px;
  padding: 14px 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(7, 193, 96, 0.08);
  white-space: nowrap;
}

.wechat-toast-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.wechat-toast-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wechat-toast-title {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

.wechat-toast-name {
  font-size: 16px;
  font-weight: 700;
  color: #07c160;
}

.wechat-toast-copy {
  font-size: 12px;
  font-weight: 600;
  color: #07c160;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.wechat-toast-copy:hover {
  background: #d1fae5;
  border-color: #6ee7b7;
}

.wechat-toast-close {
  font-size: 14px;
  color: #94a3b8;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.wechat-toast-close:hover {
  background: #f1f5f9;
  color: #475569;
}


/* --- Mobile TOC --- */
.mobile-toc-fab{display:none;position:fixed;bottom:124px;right:18px;width:44px;height:44px;border-radius:14px;background:rgba(255,255,255,0.92);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border:1px solid rgba(0,0,0,0.08);box-shadow:0 4px 20px rgba(0,0,0,0.1);align-items:center;justify-content:center;cursor:pointer;z-index:89;color:#059669;transition:all .3s}
.mobile-toc-fab svg{width:20px;height:20px}
.mobile-toc-fab:active{transform:scale(.92)}
.mobile-toc-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,0.35);backdrop-filter:blur(4px);z-index:299;opacity:0;pointer-events:none;transition:opacity .3s}
.mobile-toc-overlay.active{opacity:1;pointer-events:auto}
.mobile-toc-panel{display:none;position:fixed;bottom:0;left:0;right:0;max-height:55vh;background:#fff;border-radius:20px 20px 0 0;box-shadow:0 -8px 40px rgba(0,0,0,0.12);z-index:300;transform:translateY(100%);pointer-events:none;transition:transform .35s cubic-bezier(.16,1,.3,1);overflow:hidden;flex-direction:column}
.mobile-toc-panel.active{transform:translateY(0);pointer-events:auto}
.mobile-toc-header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px 12px;border-bottom:1px solid #f1f5f9}
.mobile-toc-title{font-size:15px;font-weight:700;color:#0f172a}
.mobile-toc-close{width:30px;height:30px;border-radius:8px;border:none;background:#f1f5f9;color:#64748b;display:flex;align-items:center;justify-content:center;cursor:pointer}
.mobile-toc-list{flex:1;overflow-y:auto;padding:8px 12px 24px;-webkit-overflow-scrolling:touch}
.mobile-toc-item{display:flex;align-items:center;gap:10px;padding:12px 14px;border-radius:10px;font-size:14px;font-weight:500;color:#475569;text-decoration:none;transition:all .2s}
.mobile-toc-item:active{background:#f1f5f9}
.mobile-toc-item.active{background:linear-gradient(135deg,#ecfdf5,#f0fdf4);color:#059669;font-weight:600}
.mobile-toc-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}
.mobile-toc-count{margin-left:auto;font-size:11px;color:#94a3b8}

@media (max-width: 1100px) {
  .articles-sidebar {
    display: none;
  }
  .mobile-toc-fab, .mobile-toc-overlay, .mobile-toc-panel {
    display: flex;
  }
  .articles-main-inner {
    max-width: 1200px;
  }
}

@media (max-width: 900px) {
  .article-grid {
    grid-template-columns: 1fr;
  }

  .section-title {
    font-size: 17px;
  }
}

@media (max-width: 600px) {
  .articles-main-inner {
    padding: 0 16px;
  }

  .article-card {
    padding: 16px;
  }

  .articles-content > .section-header {
    gap: 12px;
  }

  .section-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
}
