/* ==========================================================================
   文件路径: /public/css/laws/index.css
   文件描述: 法律法规默认展示页（Index）的样式文件
   ========================================================================== */

/* 1. 页面基础设置 */
body.laws-index-page {
  background: #f7f8fa;
}

/* 2. 内容容器 */
.laws-index-content {
  width: 90%;
  max-width: 1200px;
  margin: 40px auto 80px;
}

.laws-index-content .container {
  background: #fff;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* 3. 统计卡片 */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.stat-card {
  background: linear-gradient(135deg, #ffffff, #f8f9fa);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.stat-card-clickable {
  cursor: pointer;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.stat-card-blue {
  border-left: 4px solid #60a5fa;
}
.stat-card-blue:hover {
  border-color: #60a5fa;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
}

.stat-card-green {
  border-left: 4px solid #34d399;
}
.stat-card-green:hover {
  border-color: #34d399;
  background: linear-gradient(135deg, #f0fdf4, #d1fae5);
}

.stat-card-orange {
  border-left: 4px solid #fbbf24;
}
.stat-card-orange:hover {
  border-color: #fbbf24;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
}

.stat-card-purple {
  border-left: 4px solid #a78bfa;
}
.stat-card-purple:hover {
  border-color: #a78bfa;
  background: linear-gradient(135deg, #faf5ff, #ede9fe);
}

.stat-card-red {
  border-left: 4px solid #ef4444;
}
.stat-card-red:hover {
  border-color: #ef4444;
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
}

.stat-card-pink {
  border-left: 4px solid #ec4899;
}
.stat-card-pink:hover {
  border-color: #ec4899;
  background: linear-gradient(135deg, #fdf2f8, #fce7f3);
}

.stat-card-gray {
  border-left: 4px solid #6b7280;
}
.stat-card-gray:hover {
  border-color: #6b7280;
  background: linear-gradient(135deg, #f9fafb, #f3f4f6);
}

.stat-icon {
  font-size: 32px;
  line-height: 1;
  opacity: 0.9;
}

.stat-info {
  flex: 1;
}

.stat-number {
  font-size: 28px;
  font-weight: 700;
  color: #2c2d41;
  line-height: 1.2;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 13px;
  color: #798095;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* 4. 法规板块导航 */
.laws-sections-navigation {
  margin-top: 40px;
}

/* 区域标题 */
.area-title {
  font-size: 20px;
  font-weight: 600;
  color: #2c2d41;
  margin: 0 0 20px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-left: 4px solid #3b82f6;
  border-radius: 8px;
}

/* 区域容器 */
.section-area {
  margin-bottom: 40px;
}

/* 板块行 */
.section-row {
  display: grid;
  gap: 20px;
  margin-bottom: 20px;
}

/* 1:2 布局（新规速递 vs 一法五令） */
.section-row-split {
  grid-template-columns: 1fr 2fr;
}

/* 1:1:1 布局（三等分） */
.section-row-equal {
  grid-template-columns: repeat(3, 1fr);
}

/* 1:1 布局（二等分） */
.section-row-half {
  grid-template-columns: repeat(2, 1fr);
}

/* 板块容器 */
.section-block {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid #e2e6ee;
  transition: all 0.3s ease;
}

.section-block:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

/* 占位符板块（不显示） */
.section-block-placeholder {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  pointer-events: none;
}

/* 板块头部 */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e2e6ee;
}

.section-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-icon {
  font-size: 20px;
  line-height: 1;
  font-style: normal;
  transition: all 0.3s ease;
}




/* 基础图标样式 */
.section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  /* 默认大小，根据你的实际情况调整 */
  margin-right: 8px;
}


/* 1. 区域一：重点高亮 */
.section-icon-gold {
  color: #d97706;
  font-size: 22px;
  /* 皇冠稍大 */
  filter: drop-shadow(0 0 5px rgba(217, 119, 6, 0.25));
  /* 增加一点金色发光质感 */
}

.section-icon-orange {
  color: #f97316;
}

/* 鲜亮的橙色 */

/* 2. 区域二：你最满意的深蓝 (监管执法) */
.section-icon-darkblue {
  color: #1e40af;
}

/* 3. 区域三：业务逻辑色 */
/* 治理层 (内控/风险) - 紫色 */
.section-icon-purple {
  color: #7c3aed;
}

/* 操作层 (尽调/报告) - 青绿色 (Teal) */
.section-icon-teal {
  color: #0d9488;
}

/* 身份层 (受益所有人) - 蓝色 */
.section-icon-blue {
  color: #2563eb;
}

/* 警示层 (特别预防) - 你最满意的红色 */
.section-icon-red {
  color: #dc2626;
}

/* 通用/跨境层 - 亮青色 (Cyan) */
.section-icon-cyan {
  color: #0891b2;
}

/* 4. 区域四：行业基石 */
/* 行业层 - 蓝灰色/商务灰 */
.section-icon-slate {
  color: #475569;
}



/* 图标hover效果 */
.section-header:hover .section-icon {
  transform: scale(1.1);
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: #2c2d41;
  margin: 0;
}

.section-date-label {
  font-size: 12px;
  font-weight: 600;
  color: #798095;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-right: 12px;
  text-align: right;
}

/* 法规列表 */
.law-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* 法规项 */
.law-item {
  display: grid;
  grid-template-columns: 1fr 100px;
  gap: 16px;
  align-items: center;
  padding: 10px 12px;
  /* background: #f8f9fa; */
  border-radius: 6px;
  transition: all 0.2s ease;
  margin-bottom: 6px;
}

.law-item:hover {
  background: #e9ecef;
  transform: translateX(2px);
}

/* 法规链接 */
.law-link {
  display: block;
  text-decoration: none;
  color: #2c2d41;
  font-size: 14px;
  line-height: 1.6;
  overflow: hidden;
}

.law-link:hover {
  color: #3b82f6;
}

/* 法规名称容器 - 使用 flex 布局确保内容排列 */
.law-name {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  overflow: hidden;
  /* 重要：当law-name直接包含文本时（无嵌套），也能正常截断 */
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0; /* 关键！允许 flex 子元素缩小到内容宽度以下 */
}

/* 法规名称文本 - 可截断部分（有NEW徽章的情况） */
.law-name-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 0; /* 关键！允许文本截断生效 */
}

/* NEW徽章 - 紧跟在文本后面，不缩小，贴着右上角 */
.law-badge {
  flex-shrink: 0;
  padding: 0px 4px;
  font-size: 9px;
  font-weight: 700;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1.5;
  white-space: nowrap;
  /* margin-top: 1px; */
  margin-left:1px;
}

.new-badge {
  background: #10b981;
  color: #fff;
  box-shadow: 0 1px 2px rgba(16, 185, 129, 0.3);
}

.updated-badge {
  background: #3b82f6;
  color: #fff;
  box-shadow: 0 1px 2px rgba(59, 130, 246, 0.3);
}

/* 法规日期 */
.law-date {
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
}

/* 子板块 */
.subsection-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.subsection {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 16px;
}

.subsection-title {
  font-size: 14px;
  font-weight: 600;
  color: #2c2d41;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e6ee;
}

.subsection .law-list {
  gap: 0;
}

.subsection .law-item {
  padding: 8px 10px;
  font-size: 13px;
  margin-bottom: 4px;
}

.subsection .law-link {
  font-size: 13px;
  padding-right: 0;
}

.subsection .law-date {
  font-size: 12px;
}

/* 无数据提示 */
.no-data {
  text-align: center;
  padding: 20px;
  color: #9ca3af;
  font-size: 14px;
}

/* 响应式布局 - 板块 */
@media (max-width: 1200px) {
  .section-row-equal {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .section-row-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .section-row-equal,
  .section-row-split,
  .section-row-half {
    grid-template-columns: 1fr;
  }
  
  .law-list-header,
  .law-item {
    grid-template-columns: 1fr 0px;
    gap: 12px;
  }
  
  .law-link {
    font-size: 13px;
  }
  
  .law-date {
    font-size: 12px;
    display: none;
  }
}

/* 5. 占位区域样式（已废弃，保留备用） */
.placeholder-section {
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.placeholder-card {
  text-align: center;
  padding: 60px 40px;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-radius: 16px;
  border: 2px dashed #dee2e6;
  max-width: 600px;
}

.placeholder-card h2 {
  font-size: 24px;
  font-weight: 600;
  color: #2c2d41;
  margin: 0 0 16px;
}

.placeholder-card p {
  font-size: 16px;
  color: #6c757d;
  margin: 0;
  line-height: 1.6;
}

/* 4. 预留：分类导航卡片样式 */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.category-card {
  background: #fff;
  border: 1px solid #e2e6ee;
  border-radius: 12px;
  padding: 24px;
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  border-color: #798095;
}

.category-card h3 {
  font-size: 18px;
  font-weight: 600;
  color: #2c2d41;
  margin: 0 0 12px;
}

.category-card .count {
  font-size: 14px;
  color: #798095;
}

/* 5. 预留：推荐法规列表样式 */
.recommended-laws {
  margin-bottom: 40px;
}

.recommended-laws h2 {
  font-size: 22px;
  font-weight: 600;
  color: #2c2d41;
  margin: 0 0 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e2e6ee;
}

/* 6. 响应式设计 */
@media (max-width: 768px) {

  .laws-index-content {
    width: 95%;
    margin: 20px auto 40px;
  }

  .laws-index-content .container {
    padding: 12px;
  }
  .section-block{
    padding:10px;
  }
  .stats-cards{
    display:none;
  }
  .laws-sections-navigation {
    margin-top:10px;
  }
  .law-name-text{
    font-size:14px;
  }
  .section-area,.section-row  {
    margin-bottom:10px;
  }
  .placeholder-card {
    padding: 40px 20px;
  }

  .placeholder-card h2 {
    font-size: 20px;
  }

  .category-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .section-date-label {
    display:none;
  }
}

/* 法规导航区域需要相对定位，以便loading overlay正确定位 */
.laws-sections-navigation {
  position: relative;
  min-height: 400px;
}

/* 加载动画 */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: opacity 0.3s ease;
  border-radius: 12px;
}

.loading-spinner {
  text-align: center;
}

.spinner {
  width: 50px;
  height: 50px;
  margin: 0 auto 20px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #2c5aa0;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-text {
  color: #333;
  font-size: 16px;
  font-weight: 500;
}
