/* WebNav Hub - 主样式文件 */

:root {
  --primary-color: #ff9000;
  --bg-color: #0d0d0d;
  --card-bg-color: #1a1a1a;
  --text-color: #fff;
}

html {
  font-size: 16px;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
}

/* 头部样式 */
header {
  background-color: #000;
  padding: 1rem;
  text-align: center;
}

header h1 {
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary-color);
  margin: 0;
  text-transform: uppercase;
}

/* 导航样式 */
nav {
  background-color: var(--card-bg-color);
  padding: 0.5rem;
  position: sticky;
  top: 0;
  z-index: 1000;
}

nav ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

nav li {
  margin: 0.3rem;
}

nav a {
  color: var(--text-color);
  text-decoration: none;
  font-size: 1rem;
  font-weight: bold;
  padding: 0.5rem 0.8rem;
  border-radius: 1.25rem;
  transition: background-color 0.3s, color 0.3s;
}

nav a:hover,
nav a.active {
  background-color: var(--primary-color);
  color: #000;
}

/* 主内容区域 */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

/* 分类标题 */
.category-title {
  font-size: 1.5rem;
  font-weight: bold;
  margin: 2rem 0 1rem;
  color: var(--primary-color);
  border-left: 4px solid var(--primary-color);
  padding-left: 0.6rem;
  text-transform: uppercase;
}

/* 分类统计 */
.category-stats {
  font-size: 0.9rem;
  color: #888;
  margin-left: 0.5rem;
}

/* 链接网格 */
.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

/* 链接卡片 */
.link-card {
  background-color: var(--card-bg-color);
  border-radius: 8px;
  padding: 1.2rem 0.8rem;
  text-align: center;
  transition: transform 0.2s ease-out;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  position: relative;
  overflow: hidden;
}

.link-card a {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  text-decoration: none;
  z-index: 12;
  display: block;
}

.link-card:hover {
  background-color: #2a2a2a;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.link-card i {
  font-size: 1.8rem;
  margin-bottom: 0.7rem;
  color: var(--primary-color);
  transition: transform 0.2s ease;
  position: relative;
  z-index: 11;
}

.link-card:hover i {
  transform: scale(1.1);
}

.link-card h3 {
  font-size: 0.9rem;
  margin: 0;
  color: var(--text-color);
  line-height: 1.3;
  font-weight: 500;
  max-width: 100%;
  height: 2.6em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
  white-space: normal;
  padding: 0 0.3rem;
  position: relative;
  z-index: 11;
}

/* 链接卡片增强效果 */
.link-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent, rgba(255, 144, 0, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 8px;
}

.link-card:hover::before {
  opacity: 1;
}

/* 性能优化：减少重绘 */
.link-card,
.link-card i,
.link-card h3 {
  will-change: transform;
}

/* 底部样式 */
footer {
  background-color: #000;
  color: #ccc;
  text-align: center;
  padding: 1rem;
  font-size: 0.75rem;
}

footer nav {
  margin-top: 0.6rem;
  background-color: transparent;
}

footer nav a {
  color: #ccc;
  margin: 0 0.6rem;
  font-size: 0.75rem;
}