/**
 * 拾光主题 · 资源归档页样式
 * 卡片样式已在 cards.css
 */

.sg-resources-page{
  position: relative;
  z-index: 1;
  padding-bottom: 100px;
}

/* ============================================================
   Hero
   ============================================================ */

.sg-resources-hero{
  padding: 40px 0 0;
  position: relative;
  z-index: 1;
}

.sg-resources-hero-card{
  position: relative;
  padding: 40px 48px 32px;
  border-radius: 32px;
  background: var(--sg-brand);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(59, 91, 253, .26);
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 48px;
  align-items: center;
}

.sg-resources-hero-card::before{
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 10% 10%, rgba(255,255,255,.28), transparent 45%),
    radial-gradient(circle at 90% 90%, rgba(255,255,255,.1), transparent 50%);
  pointer-events: none;
}

.sg-resources-hero-card::after{
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(circle at 20% 30%, black, transparent 75%);
  mask-image: radial-gradient(circle at 20% 30%, black, transparent 75%);
  pointer-events: none;
}

.sg-resources-hero-content{
  position: relative;
  z-index: 2;
  min-width: 0;
}

.sg-resources-hero-label{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  letter-spacing: .04em;
  background: rgba(255,255,255,.16);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 100px;
  margin-bottom: 22px;
  text-transform: uppercase;
}

.sg-resources-hero-content h1{
  font-size: 46px;
  font-weight: 700;
  letter-spacing: -.036em;
  color: #fff;
  line-height: 1.05;
  margin-bottom: 14px;
}

.sg-resources-hero-content p{
  font-size: 15px;
  line-height: 1.65;
  color: rgba(255,255,255,.82);
  max-width: 520px;
}

/* 装饰 */
.sg-resources-hero-deco{
  position: relative;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sg-rs-deco-ring{
  position: absolute;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.32);
  box-shadow:
    inset 0 0 30px rgba(255,255,255,.15),
    0 0 40px rgba(255,255,255,.1);
}

.sg-rs-deco-ring::before{
  content: '';
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.22);
}

.sg-rs-deco-ring::after{
  content: '';
  position: absolute;
  inset: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.15);
}

.sg-rs-deco-center{
  position: relative;
  z-index: 2;
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: rgba(255,255,255,.2);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 12px 32px rgba(0,0,0,.2);
}

.sg-rs-deco-dot{
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,.75);
  box-shadow: 0 0 12px rgba(255,255,255,.8);
}

.sg-rs-deco-dot.d1{ top: 10px; left: 50%; margin-left: -3.5px; animation: sg-rs-pulse 2s ease-in-out infinite; }
.sg-rs-deco-dot.d2{ bottom: 10px; left: 50%; margin-left: -3.5px; animation: sg-rs-pulse 2s ease-in-out infinite .5s; }
.sg-rs-deco-dot.d3{ left: 10px; top: 50%; margin-top: -3.5px; animation: sg-rs-pulse 2s ease-in-out infinite 1s; }
.sg-rs-deco-dot.d4{ right: 10px; top: 50%; margin-top: -3.5px; animation: sg-rs-pulse 2s ease-in-out infinite 1.5s; }

@keyframes sg-rs-pulse{
  0%, 100% { opacity: .4; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.35); }
}

.sg-resources-hero-stats{
  position: relative;
  z-index: 2;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding-top: 26px;
  border-top: 1px solid rgba(255,255,255,.16);
}

.sg-rs-stat{
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.sg-rs-stat-num{
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -.03em;
  color: #fff;
  line-height: 1;
}

.sg-rs-stat-label{
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,.72);
}

/* ============================================================
   分类筛选
   ============================================================ */

.sg-resources-filter{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 28px 0 0;
  position: relative;
  z-index: 1;
}

.sg-rs-chip{
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  color: var(--sg-text-2);
  background: rgba(255,255,255,.75);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--sg-glass-border);
  border-radius: 100px;
  cursor: pointer;
  transition: all var(--sg-dur-base) var(--sg-ease);
  box-shadow: var(--sg-shadow-sm);
  white-space: nowrap;
}

.sg-rs-chip:hover{
  color: var(--sg-text);
  box-shadow: var(--sg-shadow-md);
}

.sg-rs-chip.active{
  color: #fff;
  background: var(--sg-brand);
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(59, 91, 253, .3);
}

/* ============================================================
   工具栏
   ============================================================ */

.sg-resources-toolbar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 22px;
  gap: 16px;
  position: relative;
  z-index: 20;
}

.sg-rs-result-count{
  font-size: 13.5px;
  font-weight: 500;
  color: var(--sg-text-3);
}

.sg-rs-toolbar-actions{
  display: flex;
  gap: 10px;
  align-items: center;
}

.sg-rs-view-btn{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px 9px 15px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  color: var(--sg-text);
  background: rgba(255,255,255,.75);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--sg-glass-border);
  border-radius: 100px;
  cursor: pointer;
  box-shadow: var(--sg-shadow-sm);
  transition: all var(--sg-dur-base) var(--sg-ease);
  position: relative;
  overflow: hidden;
}

.sg-rs-view-btn::before{
  content: '';
  position: absolute;
  inset: 0;
  background: var(--sg-brand);
  opacity: 0;
  transition: opacity var(--sg-dur-base) var(--sg-ease);
  border-radius: inherit;
}

.sg-rs-view-btn:hover{
  box-shadow: var(--sg-shadow-md);
}

.sg-rs-view-btn:active{
  transform: scale(.97);
}

.sg-rs-view-btn.switching{
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(59, 91, 253, .32);
}

.sg-rs-view-btn.switching::before{
  opacity: 1;
}

.sg-rs-view-icon{
  position: relative;
  z-index: 1;
  width: 17px;
  height: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sg-accent);
  transition: color var(--sg-dur-base) var(--sg-ease);
}

.sg-rs-view-label{
  position: relative;
  z-index: 1;
}

.sg-rs-view-btn.switching .sg-rs-view-icon{
  color: #fff;
}

/* ============================================================
   视图
   ============================================================ */

.sg-rs-view{
  position: relative;
  z-index: 1;
}

.sg-rs-masonry{
  column-count: 4;
  column-gap: 18px;
  padding-bottom: 20px;
}

.sg-rs-masonry > .sg-card{
  margin-bottom: 18px;
}

.sg-rs-list{
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 20px;
}

/* ============================================================
   响应式
   ============================================================ */

@media (max-width: 1100px){
  .sg-rs-masonry{ column-count: 3; }
  .sg-resources-hero-card{ padding: 32px 36px 28px; grid-template-columns: 1fr 180px; gap: 32px; }
  .sg-resources-hero-content h1{ font-size: 38px; }
}

@media (max-width: 900px){
  .sg-resources-hero-card{
    grid-template-columns: 1fr;
    padding: 28px 28px 24px;
    gap: 20px;
  }
  .sg-resources-hero-deco{ display: none; }
  .sg-resources-hero-content h1{ font-size: 32px; }
  .sg-resources-hero-stats{ gap: 14px; }
  .sg-rs-stat-num{ font-size: 24px; }
}

@media (max-width: 768px){

  .sg-resources-page{
    padding-bottom: calc(64px + 40px + env(safe-area-inset-bottom, 0px));
  }

  .sg-resources-hero{ padding: 20px 0 0; }

  .sg-resources-hero-card{
    padding: 22px 22px 20px;
    border-radius: 22px;
    box-shadow: 0 12px 32px rgba(59, 91, 253, .24);
  }

  .sg-resources-hero-label{
    padding: 4px 10px;
    font-size: 10px;
    margin-bottom: 14px;
  }

  .sg-resources-hero-content h1{
    font-size: 26px;
    margin-bottom: 8px;
  }

  .sg-resources-hero-content p{
    font-size: 12.5px;
  }

  .sg-resources-hero-stats{
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding-top: 16px;
    margin-top: 16px;
  }

  .sg-rs-stat{
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }

  .sg-rs-stat-num{ font-size: 20px; }
  .sg-rs-stat-label{ font-size: 10px; }

  /* 分类横滑 */
  .sg-resources-filter{
    padding: 18px 0 0;
    gap: 6px;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-left: 16px;
    padding-right: 16px;
    margin-left: -16px;
    margin-right: -16px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .sg-resources-filter::-webkit-scrollbar{ display: none; }

  .sg-rs-chip{
    padding: 8px 14px;
    font-size: 13px;
    flex-shrink: 0;
  }

  /* 工具栏 */
  .sg-resources-toolbar{ padding: 14px 0; }
  .sg-rs-result-count{ font-size: 12px; }

  .sg-rs-view-btn{ padding: 7px 10px; }
  .sg-rs-view-label{ display: none; }

  /* 瀑布流 */
  .sg-rs-masonry{
    column-count: 2;
    column-gap: 10px;
  }

  .sg-rs-masonry > .sg-card{
    margin-bottom: 10px;
  }
}