* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
}

body {
    width: 100%;
    min-height: 100vh;
    background-image: url("../img/star.png");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: #ffffff;
    position: relative; /* 新增：为伪元素提供定位上下文 */
    /* 加载优化 */
    opacity: 1;
    transition: opacity 0.5s ease;
}

/* 页面加载完成后的效果 */
body.loaded {
    opacity: 1;
}

/* 初始加载时的轻微淡入 */
@keyframes fadeIn {
    from { opacity: 0.95; }
    to { opacity: 1; }
}

body {
    animation: fadeIn 0.8s ease-out;
}

/* 新增：半透明遮罩层，让背景图变淡 */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    /* background-color: rgba(0, 0, 0, 0.4); /* 半透明黑色遮罩，值越大背景越暗 */
    /* 也可以用白色：rgba(255, 255, 255, 0.3)，让背景更亮更淡 */ */
    z-index: -1; /* 让遮罩在页面内容下方 */
}

/* 顶部导航 - 固定高度 + 内部居中 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 64px; /* 固定导航栏高度 */
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    z-index: 999;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center; /* 让内部元素垂直居中 */
}

.nav-container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center; /* 让 Logo 和导航文字垂直居中 */
}

.logo {
    color: #ffffff;
    font-size: 20px;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.5px;
}

/* 中间导航：首页 材质库 */
.nav-center {
    display: flex;
    gap: 32px;
}
.nav-center a {
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    opacity: 0.8;
    transition: opacity 0.3s;
}
.nav-center a:hover {
    opacity: 1;
}

.nav-links {
    display: flex;
    align-items: center;
}
.nav-links a {
    color: #ffffff;
    text-decoration: none;
    margin-left: 32px;
    font-size: 14px;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.nav-links a:hover {
    opacity: 1;
}

.nav-links .btn {
    background: #0071e3;
    padding: 8px 16px;
    border-radius: 20px;
    opacity: 1;
}

.nav-links .btn:hover {
    background: #0077ED;
}

/* 主视觉 */
.hero {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding-top: 80px;
    position: relative;
}

#typer-text {
  position: fixed;
  top: 70px; /* 垂直位置不变，可按需调整 */
  left: 50%; /* 左边缘到视口中点 */
  transform: translateX(-50%); /* 左移自身一半宽度，实现真正居中 */
  font-size: 16px;
  color: #e0e7ff;
  font-family: Consolas, monospace;
  border-right: 2px solid #60a5fa;
  padding-right: 6px;
  white-space: nowrap;
  animation: blink 1s step-end infinite;
  z-index: 998;
  text-align: center; /* 确保文本内部也居中 */
}
/* 打完字隐藏光标 */
#typer-text.done {
  border-right: none;
  animation: none;
}
@keyframes blink {
  50% { border-color: transparent; }
}

/* 滚动指示器 */
.scroll-indicator {
  position: absolute;
  bottom: 40px;
  right: 40px;
  width: 30px;
  height: 50px;
  border: 2px solid #fff;
  border-radius: 20px;
  display: flex;
  justify-content: center;
  padding-top: 8px;
}

.scroll-indicator span {
  width: 4px;
  height: 12px;
  background: #fff;
  border-radius: 2px;
  animation: scroll 2s infinite;
}

@keyframes scroll {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(16px);
    opacity: 0;
  }
}

/* 粒子 */
#particles-js {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: transparent;
}

/* 底部 */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 16px 0;
    text-align: center;
    font-size: 12px;
    opacity: 0.6;
    background: rgba(0, 0, 0, 0.2);
}

/* 导航栏当前页高亮样式 */
.nav-center a.active {
  color: #60a5fa; /* 蓝色文字 */
  border-bottom: 2px solid #60a5fa; /* 蓝色下划线 */
  padding-bottom: 4px; /* 让下划线和文字有一点距离 */
  opacity: 1;
}

/* 让 hover 时也有下划线效果 */
.nav-center a:hover {
  color: #60a5fa;
  border-bottom: 2px solid #60a5fa;
  padding-bottom: 4px;
  opacity: 1;
}

/* 导航栏 logo 图片 */
.logo-img {
  height: 80px;       /* 调整这个值来改变 Logo 大小 */
  width: auto;
  display: block;
}

/* 科幻星空搜索框 */
.search-box-wrap {
  position: absolute;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: 100%;
  max-width: 800px;
}

.search-box {
  display: flex;
  align-items: center;
  background: rgba(10, 15, 35, 0.5);
  border: 1px solid rgba(100, 160, 255, 0.25);
  border-radius: 50px;
  padding: 8px 24px;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 30px rgba(80, 120, 255, 0.1);
  transition: all 0.3s ease;
}

.search-box:focus-within {
  border-color: rgba(100, 160, 255, 0.6);
  box-shadow: 0 0 40px rgba(100, 160, 255, 0.2);
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #e0f0ff;
  font-size: 15px;
  padding: 4px 10px;
}

.search-input::placeholder {
  color: rgba(180, 200, 230, 0.6);
}

.search-btn {
  background: linear-gradient(90deg, #4a8cff, #6cb9ff);
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: 30px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
}

.search-btn:hover {
  background: linear-gradient(90deg, #5e9bff, #7ec5ff);
  box-shadow: 0 0 15px rgba(100, 160, 255, 0.4);
}

/* 热门资源板块整体 */
.featured-section {
    position: absolute;
    top: 180px; /* 上移40px，避免遮挡底部版权信息 */
    left: 50%;
    transform: translateX(-50%); /* 水平居中 */
    width: 98%; /* 进一步增加宽度 */
    max-width: 1500px; /* 增加最大宽度限制 */
    z-index: 90;
    padding: 25px 0; /* 减少上下内边距，进一步节省空间 */
}

/* 板块标题 - 增强科幻感 */
.section-title {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.section-title h2 {
    color: #e0f0ff;
    font-size: 26px;
    margin-bottom: 12px;
    text-shadow: 
        0 0 15px rgba(100, 160, 255, 0.5),
        0 0 30px rgba(100, 160, 255, 0.2);
    letter-spacing: 1px;
    font-weight: 600;
    position: relative;
    display: inline-block;
    padding: 0 20px;
}

.section-title h2::before,
.section-title h2::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #60a5fa);
}

.section-title h2::before {
    left: -50px;
    transform: translateY(-50%);
}

.section-title h2::after {
    right: -50px;
    transform: translateY(-50%) scaleX(-1);
    background: linear-gradient(90deg, transparent, #60a5fa);
}

.section-title p {
    color: rgba(200, 220, 255, 0.8);
    font-size: 15px;
    text-shadow: 0 0 8px rgba(100, 160, 255, 0.3);
    letter-spacing: 0.5px;
}

/* 卡片轮播容器 - 优化性能 */
.cards-wrapper {
    width: 100%;
    overflow: hidden; /* 隐藏超出部分 */
    position: relative;
    margin: 0 auto;
    max-width: 1400px; /* 增加最大宽度 */
    border-radius: 16px; /* 添加圆角，与卡片风格一致 */
    background: rgba(10, 15, 35, 0.15); /* 减少背景色透明度 */
    backdrop-filter: blur(3px); /* 减少背景模糊程度 */
    border: 1px solid rgba(100, 160, 255, 0.08); /* 减少边框透明度 */
    box-shadow: 
        0 0 20px rgba(80, 120, 255, 0.08), /* 减少外发光强度 */
        inset 0 0 15px rgba(100, 160, 255, 0.03); /* 减少内发光强度 */
    /* 性能优化 */
    transform: translateZ(0); /* 触发GPU加速 */
    -webkit-backface-visibility: hidden; /* 防止闪烁 */
    backface-visibility: hidden;
}

/* 创建无缝循环的渐变遮罩 - 优化性能 */
.cards-wrapper::before,
.cards-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 120px; /* 减少渐变区域宽度 */
    z-index: 2;
    pointer-events: none;
    /* 性能优化 */
    transform: translateZ(0);
}

.cards-wrapper::before {
    left: 0;
    background: linear-gradient(
        to right,
        rgba(10, 15, 35, 0.95) 0%,
        rgba(10, 15, 35, 0.6) 40%,
        rgba(10, 15, 35, 0.2) 80%,
        rgba(10, 15, 35, 0) 100%
    );
}

.cards-wrapper::after {
    right: 0;
    background: linear-gradient(
        to left,
        rgba(10, 15, 35, 0.95) 0%,
        rgba(10, 15, 35, 0.6) 40%,
        rgba(10, 15, 35, 0.2) 80%,
        rgba(10, 15, 35, 0) 100%
    );
}

/* 卡片容器 - 轮播效果 - 优化性能 */
.cards-container {
    display: flex;
    gap: 20px; /* 增加卡片组之间的间距 */
    flex-wrap: nowrap;
    padding: 10px 0; /* 减少上下内边距，节省空间 */
    width: max-content;
    /* 性能优化 */
    will-change: transform; /* 提示浏览器优化 */
    transform: translateZ(0); /* GPU加速 */
    -webkit-font-smoothing: antialiased; /* 字体抗锯齿 */
}

/* 卡片组 */
.cards-group {
    display: flex;
    gap: 20px; /* 增加卡片组内的卡片间距 */
    flex-wrap: nowrap;
    /* 性能优化 */
    transform: translateZ(0);
}

/* 资源卡片核心样式 - 优化性能 */
.resource-card {
    width: 190px; /* 稍微增大一点，看起来更舒服 */
    background: rgba(10, 15, 35, 0.6);
    border: 1px solid rgba(100, 160, 255, 0.2);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    flex-shrink: 0; /* 防止卡片被压缩 */
    /* 性能优化 */
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    will-change: transform, box-shadow, border-color;
}

/* 鼠标悬浮特效 */
.resource-card:hover {
    transform: translateY(-5px) translateZ(0); /* 添加translateZ保持GPU加速 */
    border-color: rgba(100, 160, 255, 0.6);
    box-shadow: 0 0 25px rgba(100, 160, 255, 0.25);
}

/* 卡片图片 - 优化加载 */
.card-img {
    width: 100%;
    height: 120px; /* 稍微增高一点，保持比例 */
    overflow: hidden;
    border-bottom: 1px solid rgba(100, 160, 255, 0.1);
    /* 性能优化 */
    transform: translateZ(0);
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 保持比例填充 */
    transition: transform 0.5s ease;
    /* 性能优化 */
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    /* 图片优化 */
    image-rendering: -webkit-optimize-contrast; /* 图片渲染优化 */
    image-rendering: crisp-edges;
    /* 懒加载优化 */
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* 图片加载时的占位符 */
.card-img img.loading {
    opacity: 0.3;
    background: linear-gradient(90deg, #1a2b4a 25%, #2a3b5a 50%, #1a2b4a 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 平滑滚动优化 */
.cards-container {
    transition: transform 0.1s linear;
}

/* 当动画暂停时的平滑过渡 */
.cards-wrapper:hover .cards-container {
    transition: transform 0.3s ease-out;
}

/* 资源卡片核心样式 */
.resource-card {
    width: 190px; /* 稍微增大一点，看起来更舒服 */
    background: rgba(10, 15, 35, 0.6);
    border: 1px solid rgba(100, 160, 255, 0.2);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    flex-shrink: 0; /* 防止卡片被压缩 */
}

/* 鼠标悬浮特效 */
.resource-card:hover {
    transform: translateY(-5px);
    border-color: rgba(100, 160, 255, 0.6);
    box-shadow: 0 0 25px rgba(100, 160, 255, 0.25);
}

/* 卡片图片 */
.card-img {
    width: 100%;
    height: 120px; /* 稍微增高一点，保持比例 */
    overflow: hidden;
    border-bottom: 1px solid rgba(100, 160, 255, 0.1);
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 保持比例填充 */
    transition: transform 0.5s ease;
}

.resource-card:hover .card-img img {
    transform: scale(1.05); /* 悬浮轻微放大 */
}

/* 卡片信息 */
.card-info {
    padding: 12px; /* 减少内边距 */
}

.card-info h3 {
    color: #e0f0ff;
    font-size: 14px; /* 减小字体大小 */
    margin-bottom: 8px; /* 减少下边距 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 标签样式 */
.card-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.card-tags span {
    font-size: 12px;
    color: #60a5fa;
    background: rgba(100, 160, 255, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid rgba(100, 160, 255, 0.2);
}

/* 评分和下载量 */
.card-stats {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: rgba(200, 220, 255, 0.7);
}

/* 实时数据看板 - 悬浮控制台风格 */
.data-dashboard {
    position: fixed;
    bottom: 80px; /* 距离底部，避开版权栏 */
    right: 40px;  /* 距离右侧，和滚动指示器呼应 */
    width: 280px;
    background: rgba(10, 15, 35, 0.7);
    border: 1px solid rgba(100, 160, 255, 0.3);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 20px rgba(80, 120, 255, 0.15);
    z-index: 990;
    overflow: hidden;
}

/* 看板头部 */
.dashboard-header {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(100, 160, 255, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #60a5fa;
    font-weight: 600;
}

/* 刷新按钮 */
.refresh {
    cursor: pointer;
    color: #e0f0ff;
    transition: transform 0.5s ease;
}

.refresh:hover {
    transform: rotate(180deg);
}

/* 看板内容区 */
.dashboard-body {
    padding: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr; /* 两列布局 */
    gap: 12px;
}

/* 单个数据项 */
.data-item {
    text-align: center;
}

.data-label {
    font-size: 11px;
    color: rgba(200, 220, 255, 0.7);
    margin-bottom: 6px;
}

.data-value {
    font-size: 18px;
    font-weight: bold;
    color: #60a5fa;
    font-family: 'Consolas', monospace; /* 数字用等宽字体，更像控制台 */
    text-shadow: 0 0 8px rgba(100, 160, 255, 0.4);
}

/* 可视化仪表盘 - 放在导航栏下面 */
.visual-dashboard {
  position: fixed;
  top: 70px; /* 导航栏下面 */
  right: 20px;
  width: 180px;      /* 稍微增大一点，给内容更多空间 */
  background: rgba(10, 15, 35, 0.7);
  border: 1px solid rgba(100, 160, 255, 0.3);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  box-shadow: 0 0 20px rgba(80, 120, 255, 0.2);
  z-index: 990;
  overflow: hidden;
}

.gauge-container {
  position: relative;
  width: 45px;       /* 按比例缩小 */
  height: 45px;
  margin: 0 auto 4px;
}

.dashboard-header {
  padding: 8px 10px; /* 更小的内边距 */
  border-bottom: 1px solid rgba(100, 160, 255, 0.15);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px; /* 更小的字体 */
  color: #60a5fa;
  font-weight: 600;
  line-height: 1.2;
}

.refresh {
  cursor: pointer;
  color: #e0f0ff;
  transition: transform 0.5s ease;
  font-size: 10px; /* 刷新图标也缩小 */
}

.refresh:hover {
  transform: rotate(180deg);
}

.dashboard-body {
  padding: 10px; /* 更小的内边距 */
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px; /* 更小的间距 */
}

.gauge-item {
  text-align: center;
}

.gauge-svg {
  width: 100%;
  height: 100%;
}

/* 缩小SVG中的圆环 */
.gauge-bg,
.gauge-progress {
  stroke-width: 6; /* 从8减小到6 */
}

.gauge-progress {
  transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.gauge-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 10px; /* 更小的字体 */
  font-weight: bold;
  color: #60a5fa;
  font-family: 'Consolas', monospace;
  text-shadow: 0 0 4px rgba(100, 160, 255, 0.4);
  line-height: 1;
}

.gauge-label {
  font-size: 9px; /* 更小的标签字体 */
  color: rgba(200, 220, 255, 0.7);
  line-height: 1.2;
}

