:root {
  --primary-color: #3498db;
  --secondary-color: #2c3e50;
  --accent-color: #9b59b6;
  --light-color: #f8f9fa;
  --dark-color: #2c3e50;
  --success-color: #2ecc71;
  --warning-color: #f39c12;
  --danger-color: #e74c3c;
  --border-radius: 8px;
  --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
}

body {
  background-color: #f5f7fa;
  color: #333;
  line-height: 1.6;
  background-image: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
  min-height: 100vh;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* 头部样式 */
header {
  background: linear-gradient(
    135deg,
    var(--secondary-color),
    var(--primary-color)
  );
  color: white;
  padding: 2rem 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.2;
}

.header-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

h1 {
  font-size: 2.8rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.subtitle {
  font-size: 1.2rem;
  opacity: 0.9;
  max-width: 700px;
  margin: 0 auto 1.5rem;
}

/* 搜索栏样式 */
.search-container {
  max-width: 700px;
  margin: 0 auto;
  position: relative;
}

#searchInput {
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 1.1rem;
  border: none;
  border-radius: 50px;
  box-shadow: var(--box-shadow);
  padding-left: 3.5rem;
  transition: var(--transition);
}

#searchInput:focus {
  outline: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.search-icon {
  position: absolute;
  left: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary-color);
  font-size: 1.2rem;
}

/* 主内容区样式 */
main {
  padding: 2rem 0;
}

/* 分类筛选 */
.category-filter {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 2rem;
}

.category-btn {
  padding: 0.6rem 1.2rem;
  background-color: white;
  border: 2px solid #e0e0e0;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
  color: var(--secondary-color);
}

.category-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-2px);
}

.category-btn.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* 网址卡片网格 */
.sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.site-card {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.site-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.15);
}

.site-card-header {
  padding: 1.2rem 1.2rem 0.5rem;
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-logo {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  flex-shrink: 0;
  overflow: hidden;
}

.site-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.site-info h3 {
  font-size: 1.2rem;
  margin-bottom: 0.3rem;
  color: var(--secondary-color);
}

.site-category {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background-color: #eef5ff;
  color: var(--primary-color);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.site-card-body {
  padding: 0.8rem 1.2rem;
  flex-grow: 1;
}

.site-description {
  color: #666;
  font-size: 0.95rem;
  line-height: 1.5;
}

.site-card-footer {
  padding: 1rem 1.2rem;
  background-color: #f9f9f9;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-link {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition);
}

.site-link:hover {
  color: var(--accent-color);
}

.favorite-btn {
  background: none;
  border: none;
  color: #ddd;
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition);
}

.favorite-btn:hover {
  color: var(--warning-color);
}

.favorite-btn.favorited {
  color: var(--warning-color);
}

/* 页脚 */
footer {
  background-color: var(--secondary-color);
  color: white;
  padding: 2rem 0;
  text-align: center;
  margin-top: 3rem;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.copyright {
  color: #aaa;
  font-size: 0.9rem;
  margin-top: 1rem;
}

/* 名言样式 */
.quote {
  font-style: italic;
  color: #bbb;
  margin: 0.5rem 0;
  font-size: 1rem;
}

/* 备案信息样式 */
.beian {
  font-size: 0.8rem;
  margin-top: 0.5rem;
}
.beian a {
  color: #aaa;
}

/* 响应式设计 */
@media (max-width: 768px) {
  h1 {
    font-size: 2.2rem;
  }

  .sites-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.8rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .sites-grid {
    grid-template-columns: 1fr;
  }

  .category-filter {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 10px;
  }
}

/* 加载动画 */
.loading {
  text-align: center;
  padding: 3rem;
  font-size: 1.2rem;
  color: var(--primary-color);
}

.no-results {
  text-align: center;
  padding: 3rem;
  color: #666;
  grid-column: 1 / -1;
}

/* 滚动到顶部按钮 */
.scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background-color: var(--primary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 100;
}

.scroll-top.show {
  opacity: 1;
  visibility: visible;
}

.scroll-top:hover {
  background-color: var(--secondary-color);
  transform: translateY(-5px);
}
