/* ============ 基础重置与变量 ============ */
:root {
  --primary: #4f6ef7;
  --primary-light: #7b93fa;
  --primary-bg: #f0f3ff;
  --text: #2c3e50;
  --text-light: #6b7b8d;
  --text-lighter: #9ba8b4;
  --bg: #f5f7fa;
  --white: #ffffff;
  --border: #e8ecf1;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-hover: 0 6px 24px rgba(79,110,247,0.15);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ============ 顶部导航 ============ */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(255,255,255,0.95);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
}

.logo-icon {
  font-size: 28px;
}

.nav {
  display: flex;
  gap: 4px;
}

.nav-link {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-light);
  transition: var(--transition);
}

.nav-link:hover {
  background: var(--primary-bg);
  color: var(--primary);
}

.admin-link {
  font-size: 20px;
  opacity: 0.5;
  transition: var(--transition);
}

.admin-link:hover {
  opacity: 1;
}

/* ============ 搜索区域 ============ */
.hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 60px 0 50px;
  text-align: center;
}

.hero-title {
  color: var(--white);
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 8px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hero-subtitle {
  color: rgba(255,255,255,0.85);
  font-size: 14px;
  font-weight: 400;
  margin-bottom: 24px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.search-box {
  display: flex;
  max-width: 560px;
  margin: 0 auto;
  background: var(--white);
  border-radius: 40px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  padding: 16px 24px;
  font-size: 16px;
  background: transparent;
}

.search-box input::placeholder {
  color: var(--text-lighter);
}

.search-btn {
  padding: 16px 32px;
  background: var(--primary);
  color: var(--white);
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.search-btn:hover {
  background: var(--primary-light);
}

.search-result {
  max-width: 560px;
  margin: 20px auto 0;
  color: rgba(255,255,255,0.9);
  font-size: 14px;
}

.search-result a {
  color: var(--white);
  text-decoration: underline;
}

/* ============ 公告栏 ============ */
.notice-bar {
  background: #fff8e1;
  border-bottom: 1px solid #ffe082;
  padding: 10px 0;
  font-size: 14px;
  color: #f57c00;
}

.notice-bar .container {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============ 内容板块 ============ */
.main {
  padding: 32px 0 60px;
}

.section {
  margin-bottom: 40px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-icon {
  font-size: 22px;
}

.section-more {
  font-size: 14px;
  color: var(--text-light);
  cursor: pointer;
  transition: var(--transition);
}

.section-more:hover {
  color: var(--primary);
}

/* ============ 资源卡片网格 ============ */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.resource-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: var(--transition);
  display: block;
}

.resource-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.resource-card .card-image {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  background: linear-gradient(135deg, #e0e5ec, #f0f3f8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-lighter);
  font-size: 40px;
}

.resource-card .card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.resource-card .card-info {
  padding: 12px;
}

.resource-card .card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-card .card-desc {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-card .card-time {
  font-size: 11px;
  color: var(--text-lighter);
  margin-top: 6px;
}

.empty-tip {
  text-align: center;
  padding: 40px 0;
  color: var(--text-lighter);
  font-size: 14px;
}

/* ============ 底部 ============ */
.footer {
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-lighter);
}

/* ============ 加载动画 ============ */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-sm);
}

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

/* ============ 响应式 ============ */
@media (max-width: 768px) {
  .nav {
    display: none;
  }

  .hero {
    padding: 40px 0 36px;
  }

  .hero-title {
    font-size: 22px;
  }

  .search-box {
    margin: 0 20px;
  }

  .search-box input {
    padding: 12px 16px;
    font-size: 14px;
  }

  .search-btn {
    padding: 12px 20px;
    font-size: 14px;
  }

  .resource-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

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

  .card-info {
    padding: 8px !important;
  }

  .card-title {
    font-size: 13px !important;
  }

  .card-desc {
    display: none;
  }
}

@media (max-width: 480px) {
  .resource-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

/* ============ 回到顶部 ============ */
.back-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(79,110,247,0.3);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 99;
}

.back-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-top:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79,110,247,0.4);
}

/* ============ 每日更新列表 ============ */
.daily-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.daily-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  transition: var(--transition);
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
}

.daily-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  color: var(--primary);
}

.daily-item .daily-index {
  width: 24px;
  height: 24px;
  background: var(--primary-bg);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  margin-right: 12px;
  flex-shrink: 0;
}

.daily-item .daily-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

/* 每日更新列表前三名高亮 */
.daily-item:nth-child(1) .daily-index,
.daily-item:nth-child(2) .daily-index {
  background: #ff4757;
  color: #fff;
}

.daily-item:nth-child(3) .daily-index,
.daily-item:nth-child(4) .daily-index {
  background: #ff6348;
  color: #fff;
}

/* 每日更新列表响应式 */
@media (max-width: 768px) {
  .daily-list {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .daily-item {
    padding: 10px 12px;
    font-size: 13px;
  }
}
