/* WPS办公技能知识库 - 样式文件 */

/* ==================== 全局样式 ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #E84A3F; /* WPS红色 */
  --primary-dark: #C73E35;
  --primary-light: #FF6B5B;
  --text-primary: #333333;
  --text-secondary: #666666;
  --bg-primary: #FFFFFF;
  --bg-secondary: #F5F5F5;
  --bg-card: #FFFFFF;
  --border-color: #E0E0E0;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* 夜间模式变量 */
body.dark-mode {
  --text-primary: #E0E0E0;
  --text-secondary: #B0B0B0;
  --bg-primary: #1A1A1A;
  --bg-secondary: #2D2D2D;
  --bg-card: #333333;
  --border-color: #444444;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.4);
}

body {
  font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color 0.3s, color 0.3s;
}

a {
  text-decoration: none;
  color: var(--primary-color);
  transition: color 0.3s;
}

a:hover {
  color: var(--primary-dark);
}

/* ==================== 导航栏 ==================== */
.navbar {
  background-color: var(--bg-primary);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: background-color 0.3s;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--primary-color);
}

.logo span {
  color: var(--text-primary);
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 30px;
}

.nav-menu a {
  color: var(--text-primary);
  font-weight: 500;
  padding: 8px 0;
  position: relative;
  transition: color 0.3s;
}

.nav-menu a:hover,
.nav-menu a.active {
  color: var(--primary-color);
}

.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: width 0.3s;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
  width: 100%;
}

.nav-controls {
  display: flex;
  gap: 15px;
  align-items: center;
}

.theme-toggle {
  background: none;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.3s;
  color: var(--text-primary);
}

.theme-toggle:hover {
  border-color: var(--primary-color);
  transform: rotate(180deg);
}

/* 移动端菜单按钮 */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-primary);
}

/* ==================== Hero区域 ==================== */
.hero {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 80px 20px;
  text-align: center;
}

.hero h1 {
  font-size: 48px;
  margin-bottom: 20px;
  animation: fadeInUp 0.8s ease-out;
}

.hero p {
  font-size: 20px;
  opacity: 0.95;
  max-width: 600px;
  margin: 0 auto;
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================== 容器 ==================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

.section-title {
  font-size: 32px;
  margin-bottom: 30px;
  color: var(--text-primary);
  position: relative;
  padding-left: 15px;
}

.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 30px;
  background-color: var(--primary-color);
  border-radius: 3px;
}

/* ==================== 分类卡片 ==================== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 25px;
  margin-bottom: 50px;
}

.category-card {
  background-color: var(--bg-card);
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: all 0.3s;
  cursor: pointer;
  border: 2px solid transparent;
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-color);
}

.category-icon {
  font-size: 48px;
  margin-bottom: 15px;
}

.category-card h3 {
  font-size: 22px;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.category-card p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ==================== 文章卡片 ==================== */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 25px;
}

.article-card {
  background-color: var(--bg-card);
  border-radius: 10px;
  padding: 25px;
  box-shadow: var(--shadow);
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.article-header {
  margin-bottom: 15px;
}

.article-category {
  display: inline-block;
  padding: 4px 12px;
  background-color: var(--primary-color);
  color: white;
  border-radius: 20px;
  font-size: 12px;
  margin-bottom: 10px;
}

.article-title {
  font-size: 20px;
  color: var(--text-primary);
  margin-bottom: 10px;
  line-height: 1.4;
}

.article-title a {
  color: inherit;
  transition: color 0.3s;
}

.article-title a:hover {
  color: var(--primary-color);
}

.article-summary {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 15px;
  flex-grow: 1;
}

.article-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
  font-size: 13px;
  color: var(--text-secondary);
}

.read-more {
  color: var(--primary-color);
  font-weight: 500;
  transition: all 0.3s;
}

.read-more:hover {
  color: var(--primary-dark);
  transform: translateX(5px);
}

/* ==================== 分页 ==================== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.pagination button {
  padding: 10px 16px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-primary);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 14px;
}

.pagination button:hover:not(:disabled) {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.pagination button.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==================== 详情页 ==================== */
.detail-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
}

.detail-header {
  background-color: var(--bg-card);
  padding: 40px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 30px;
}

.detail-meta {
  display: flex;
  gap: 20px;
  margin-top: 15px;
  font-size: 14px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.detail-content {
  background-color: var(--bg-card);
  padding: 40px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  line-height: 1.8;
}

.detail-content h2 {
  font-size: 26px;
  color: var(--text-primary);
  margin: 30px 0 15px 0;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary-color);
}

.detail-content h3 {
  font-size: 22px;
  color: var(--text-primary);
  margin: 25px 0 12px 0;
}

.detail-content p {
  margin-bottom: 15px;
  color: var(--text-secondary);
}

.detail-content ul,
.detail-content ol {
  margin: 15px 0;
  padding-left: 30px;
}

.detail-content li {
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.detail-content code {
  background-color: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 14px;
  color: var(--primary-color);
}

.detail-content strong {
  color: var(--text-primary);
  font-weight: 600;
}

.back-link {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--primary-color);
  font-weight: 500;
  transition: all 0.3s;
}

.back-link:hover {
  transform: translateX(-5px);
}

/* ==================== 资源页 ==================== */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 25px;
}

.resource-card {
  background-color: var(--bg-card);
  border-radius: 10px;
  padding: 25px;
  box-shadow: var(--shadow);
  transition: all 0.3s;
}

.resource-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.resource-title {
  font-size: 18px;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.resource-description {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 15px;
  line-height: 1.6;
}

.resource-info {
  display: flex;
  gap: 15px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.download-btn {
  display: inline-block;
  padding: 10px 24px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s;
  width: 100%;
}

.download-btn:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(232, 74, 63, 0.3);
}

/* ==================== 关于页面 ==================== */
.about-content {
  background-color: var(--bg-card);
  padding: 40px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  max-width: 900px;
  margin: 0 auto;
}

.about-content h2 {
  font-size: 28px;
  color: var(--text-primary);
  margin: 30px 0 15px 0;
}

.about-content h2:first-child {
  margin-top: 0;
}

.about-content p {
  color: var(--text-secondary);
  margin-bottom: 15px;
  line-height: 1.8;
}

.about-content ul {
  margin: 15px 0;
  padding-left: 30px;
}

.about-content li {
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.6;
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.feature-item {
  padding: 20px;
  background-color: var(--bg-secondary);
  border-radius: 8px;
  border-left: 4px solid var(--primary-color);
}

.feature-item h4 {
  color: var(--text-primary);
  margin-bottom: 8px;
  font-size: 18px;
}

.feature-item p {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0;
}

/* ==================== 页脚 ==================== */
.footer {
  background-color: var(--bg-primary);
  padding: 30px 20px;
  text-align: center;
  border-top: 1px solid var(--border-color);
  margin-top: 60px;
  transition: background-color 0.3s;
}

.footer p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background-color: var(--bg-primary);
    flex-direction: column;
    padding: 20px;
    gap: 15px;
    box-shadow: var(--shadow);
  }

  .nav-menu.active {
    display: flex;
  }

  .hero h1 {
    font-size: 32px;
  }

  .hero p {
    font-size: 16px;
  }

  .article-grid {
    grid-template-columns: 1fr;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  .detail-header,
  .detail-content {
    padding: 25px;
  }

  .detail-meta {
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 50px 15px;
  }

  .hero h1 {
    font-size: 28px;
  }

  .container {
    padding: 25px 15px;
  }

  .section-title {
    font-size: 26px;
  }
}

/* ==================== 加载动画 ==================== */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

.loading::after {
  content: '...';
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}

/* ==================== 空状态 ==================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 20px;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.empty-state p {
  font-size: 14px;
}
