/* ===== 公告/新闻通用样式（S1 布局移植，主题色 #9D9ECB，企业化圆角） ===== */
/* 注意：变量必须挂在 body 上而非 :root，因为 public/header 里后加载的 main.css
   会在 :root 上把 --primary-dark/--primary-light 覆盖成蓝色(#0056d6/#4d94ff) */
body {
  --primary: #9D9ECB;
  --primary-light: #f0f0f8;
  --primary-dark: #7a7ba8;
  --gradient-blue: linear-gradient(135deg, #9D9ECB 0%, #7a7ba8 100%);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --bg-light: #f8fafc;
  --border-color: #e2e8f0;
}

/* 页面顶部面包屑 */
.page-breadcrumb {
  background: transparent;
  border-bottom: none;
  padding: 0;
  margin-bottom: 16px;
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #94a3b8;
  list-style: none;
  margin: 0;
  padding: 0;
}

.breadcrumb-list li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.breadcrumb-list li::after {
  content: '/';
  color: #cbd5e1;
  font-size: 12px;
}

.breadcrumb-list li:last-child::after {
  display: none;
}

.breadcrumb-list a {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.3s;
}

.breadcrumb-list a:hover {
  color: var(--primary);
}

.breadcrumb-list .current {
  color: #64748b;
  font-weight: 400;
  max-width: 480px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 内容区域 */
.content-section {
  padding: 20px 0 80px;
  padding-top: 110px;
  position: relative;
  background: #fff;
}

.content-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse 50% 60% at 10% 30%, rgba(157, 158, 203, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse 40% 50% at 90% 70%, rgba(139, 92, 246, 0.04) 0%, transparent 70%);
  pointer-events: none;
}

.content-section .section-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

/* 页面标题 */
.page-title {
  margin-bottom: 40px;
}

.page-title h1 {
  font-size: 28px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 8px;
}

.page-title p {
  font-size: 15px;
  color: #64748b;
}

/* 分类标签 */
.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}

.category-tabs .tab-item {
  display: inline-block;
  padding: 8px 20px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #475569;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.3s;
  cursor: pointer;
  background: #fff;
}

.category-tabs .tab-item:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.category-tabs .tab-item.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* 列表容器 */
.list-container {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  border: 1px solid #f1f5f9;
  overflow: hidden;
}

/* 列表项 */
.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.2s;
}

.list-item:last-child {
  border-bottom: none;
}

.list-item:hover {
  background: #f8fafc;
}

.list-item-title {
  flex: 1;
  margin-right: 20px;
  min-width: 0;
}

.list-item-title a {
  font-size: 15px;
  color: #1e293b;
  text-decoration: none;
  transition: color 0.3s;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.list-item-time {
  font-size: 13px;
  color: #94a3b8;
  white-space: nowrap;
}

/* 分页器 */
.pagination-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 32px;
}

.pagination-info {
  font-size: 13px;
  color: #94a3b8;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.pagination li a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #475569;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.3s;
}

.pagination li a:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.pagination li a.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.pagination li a.page-ellipsis {
  border: none;
  pointer-events: none;
}

/* ===== 详情页 ===== */
.detail-layout {
  display: flex;
  gap: 32px;
}

.detail-main {
  flex: 1;
  min-width: 0;
}

.detail-sidebar {
  width: 320px;
  flex-shrink: 0;
}

/* 详情卡片 */
.detail-card {
  background: #fff;
  border-radius: 16px;
  padding: 48px 40px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  border: 1px solid #f1f5f9;
}

.detail-card .detail-title {
  font-size: 24px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.4;
  margin-bottom: 16px;
}

.detail-card .detail-meta {
  font-size: 14px;
  color: #94a3b8;
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.detail-card .detail-meta .meta-source,
.detail-card .detail-meta .meta-time {
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-card .detail-meta .meta-tag {
  display: inline-block;
  padding: 3px 12px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  border-radius: 6px;
  font-weight: 500;
}

.detail-card .detail-content {
  font-size: 15px;
  color: #334155;
  line-height: 1.8;
  word-break: break-word;
}

.detail-card .detail-content img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}

.detail-card .detail-content p {
  margin-bottom: 16px;
}

.detail-card .detail-content h1,
.detail-card .detail-content h2,
.detail-card .detail-content h3,
.detail-card .detail-content h4 {
  margin: 28px 0 14px;
  color: #1e293b;
  font-weight: 700;
  line-height: 1.4;
}

.detail-card .detail-content a {
  color: var(--primary);
  text-decoration: none;
}

.detail-card .detail-content a:hover {
  color: var(--primary-dark);
}

.detail-card .detail-content blockquote {
  margin: 18px 0;
  padding: 12px 18px;
  background: var(--primary-light);
  border-left: 3px solid var(--primary);
  border-radius: 0 8px 8px 0;
  color: #4b5563;
}

.detail-card .detail-content pre {
  padding: 16px;
  background: #f8f9fc;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow-x: auto;
}

/* 附件下载 */
.detail-attachment {
  margin-top: 36px;
  padding: 20px 22px;
  background: var(--primary-light);
  border-radius: 12px;
  border: 1px dashed rgba(157, 158, 203, 0.4);
}

.detail-attachment .attachment-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #1e293b;
  display: flex;
  align-items: center;
}

.detail-attachment .attachment-title i {
  margin-right: 8px;
  color: var(--primary);
}

.detail-attachment .attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.detail-attachment .attachment-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: #475569;
  text-decoration: none;
  font-size: 13px;
  transition: all 0.2s;
}

.detail-attachment .attachment-link i {
  margin-right: 8px;
  color: var(--primary);
}

.detail-attachment .attachment-link:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.detail-attachment .attachment-link:hover i {
  color: #fff;
}

/* 前后篇导航 */
.detail-nav {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 0;
  margin-top: 48px;
  padding: 0;
  border-top: 1px solid #f1f5f9;
  background: #f8fafc;
  border-radius: 0 0 12px 12px;
  overflow: hidden;
}

.detail-nav:empty {
  display: none;
}

.detail-nav-item {
  flex: 1;
  font-size: 14px;
  color: #64748b;
  padding: 16px 24px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-nav-item.nav-prev {
  text-align: left;
  border-right: 1px solid #f1f5f9;
}

.detail-nav-item.nav-next {
  text-align: right;
}

.detail-nav-item a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.3s;
}

.detail-nav-item a:hover {
  color: var(--primary-dark);
}

/* 侧边栏卡片 */
.sidebar-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  border: 1px solid #f1f5f9;
  overflow: hidden;
}

.sidebar-card-title {
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
  padding: 20px 24px;
  border-bottom: 1px solid #f1f5f9;
  position: relative;
}

.sidebar-card-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

.sidebar-list {
  padding: 12px 0;
}

.sidebar-list-item {
  display: flex;
  align-items: center;
  padding: 12px 24px;
  gap: 12px;
  transition: background 0.2s;
}

.sidebar-list-item:hover {
  background: #f8fafc;
}

.sidebar-list-item .item-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: #e2e8f0;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  flex-shrink: 0;
}

.sidebar-list-item:nth-child(1) .item-number,
.sidebar-list-item:nth-child(2) .item-number,
.sidebar-list-item:nth-child(3) .item-number {
  background: var(--primary);
  color: #fff;
}

.sidebar-item-info {
  flex: 1;
  min-width: 0;
}

.sidebar-item-info a {
  display: block;
  font-size: 14px;
  color: #1e293b;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.3s;
  margin-bottom: 6px;
}

.sidebar-item-info a:hover {
  color: var(--primary);
}

.sidebar-item-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.meta-tag-sm {
  display: inline-block;
  padding: 1px 8px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  border-radius: 4px;
  font-weight: 500;
  white-space: nowrap;
}

.sidebar-item-time {
  font-size: 12px;
  color: #94a3b8;
  white-space: nowrap;
}

/* 加载/空状态 */
.list-loading,
.list-empty {
  text-align: center;
  padding: 60px 0;
  color: #94a3b8;
}

.list-loading i,
.list-empty i {
  font-size: 32px;
  margin-bottom: 14px;
  display: block;
  color: var(--primary);
}

.list-loading i {
  animation: announce-spin 1s linear infinite;
}

@keyframes announce-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 响应式 */
@media (max-width: 1024px) {
  .detail-layout {
    flex-direction: column;
  }

  .detail-sidebar {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .content-section {
    padding-top: 90px;
    padding-bottom: 60px;
  }

  .detail-card {
    padding: 24px 20px;
    border-radius: 14px;
  }

  .detail-card .detail-title {
    font-size: 20px;
  }

  .detail-card .detail-meta {
    gap: 12px;
  }

  .list-item {
    padding: 16px 20px;
  }

  .page-title h1 {
    font-size: 22px;
  }

  .pagination-wrap {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }

  .detail-nav {
    flex-direction: column;
  }

  .detail-nav-item.nav-prev {
    border-right: none;
    border-bottom: 1px solid #f1f5f9;
  }

  .detail-nav-item.nav-next {
    text-align: left;
  }

  .breadcrumb-list .current {
    max-width: 200px;
  }
}
