/* 摄影社区 - 样式表
 * www.xingkongjiaocheng.cn
 * 专注于摄影培训的在线社区
 */

/* ===== CSS 变量 ===== */
:root {
  --accent-color: #20c997;
  --primary-color: #2c3e50;
  --secondary-color: #34495e;
  --text-color: #333;
  --text-light: #666;
  --text-muted: #999;
  --bg-color: #fff;
  --bg-light: #f8f9fa;
  --bg-dark: #e9ecef;
  --border-color: #dee2e6;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.15);
  --radius: 8px;
  --radius-sm: 4px;
  --max-width: 1200px;
  --header-height: 64px;
  --transition: all 0.3s ease;
}

/* ===== 重置样式 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: #1ba87e;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul {
  list-style: none;
}

/* ===== 布局容器 ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== 头部导航 ===== */
.header {
  background: var(--bg-color);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

.logo span {
  color: var(--accent-color);
}

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

.nav a {
  color: var(--text-color);
  font-weight: 500;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
}

.nav a:hover,
.nav a.active {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-light);
  border-radius: var(--radius);
  padding: 8px 16px;
  width: 240px;
}

.search-box input {
  border: none;
  background: none;
  outline: none;
  flex: 1;
  font-size: 14px;
}

.search-box button {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
}

/* ===== Hero 区域 ===== */
.hero {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: var(--bg-color);
  padding: 80px 0;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 16px;
  font-weight: 700;
}

.hero p {
  font-size: 1.25rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 32px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
}

/* ===== 按钮样式 ===== */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.btn-primary {
  background: var(--accent-color);
  color: var(--bg-color);
}

.btn-primary:hover {
  background: #1ba87e;
  color: var(--bg-color);
}

.btn-outline {
  background: transparent;
  color: var(--bg-color);
  border: 2px solid var(--bg-color);
}

.btn-outline:hover {
  background: var(--bg-color);
  color: var(--primary-color);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 14px;
}

/* ===== 统计卡片 ===== */
.stats-section {
  padding: 40px 0;
  background: var(--bg-light);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.stat-card {
  background: var(--bg-color);
  padding: 32px;
  border-radius: var(--radius);
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent-color);
}

.stat-label {
  color: var(--text-light);
  margin-top: 8px;
}

/* ===== 课程进度卡片 ===== */
.progress-section {
  padding: 60px 0;
}

.section-title {
  font-size: 1.75rem;
  margin-bottom: 24px;
  color: var(--primary-color);
}

.progress-card {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.progress-thumb {
  width: 120px;
  height: 80px;
  background: var(--bg-dark);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 14px;
}

.progress-info {
  flex: 1;
}

.progress-info h3 {
  font-size: 1.125rem;
  margin-bottom: 4px;
  color: var(--primary-color);
}

.progress-info p {
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: 12px;
}

.progress-bar {
  height: 8px;
  background: var(--bg-dark);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent-color);
  border-radius: 4px;
}

.progress-text {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ===== 课程列表 ===== */
.course-section {
  padding: 60px 0;
  background: var(--bg-light);
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.course-card {
  background: var(--bg-color);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

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

.course-image {
  height: 160px;
  background: var(--bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.course-content {
  padding: 20px;
}

.course-content h3 {
  font-size: 1.125rem;
  margin-bottom: 8px;
  color: var(--primary-color);
}

.course-content p {
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: 16px;
}

.course-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--text-muted);
}

.course-level {
  background: var(--bg-light);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
}

/* ===== 文章列表 ===== */
.articles-section {
  padding: 60px 0;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.article-list {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
}

.article-list h3 {
  font-size: 1.125rem;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent-color);
  color: var(--primary-color);
}

.article-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.article-item:last-child {
  border-bottom: none;
}

.article-item a {
  color: var(--text-color);
  display: block;
}

.article-item a:hover {
  color: var(--accent-color);
}

.article-item span {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===== 面包屑导航 ===== */
.breadcrumb {
  padding: 20px 0;
  background: var(--bg-light);
  border-bottom: 1px solid var(--border-color);
}

.breadcrumb a {
  color: var(--text-light);
}

.breadcrumb a:hover {
  color: var(--accent-color);
}

.breadcrumb span {
  margin: 0 8px;
  color: var(--text-muted);
}

.breadcrumb .current {
  color: var(--text-color);
}

/* ===== 分类页头部 ===== */
.category-header {
  padding: 48px 0;
  background: var(--bg-light);
  text-align: center;
}

.category-header h1 {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 12px;
}

.category-header p {
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto;
}

/* ===== 筛选标签 ===== */
.filter-tabs {
  display: flex;
  gap: 12px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 32px;
}

.filter-tab {
  padding: 8px 20px;
  border-radius: 20px;
  background: var(--bg-light);
  color: var(--text-color);
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.filter-tab:hover,
.filter-tab.active {
  background: var(--accent-color);
  color: var(--bg-color);
}

/* ===== 课程列表（分类页） ===== */
.course-list {
  padding: 40px 0;
}

.course-list-item {
  display: flex;
  gap: 24px;
  padding: 24px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-bottom: 16px;
  transition: var(--transition);
}

.course-list-item:hover {
  box-shadow: var(--shadow);
}

.course-list-thumb {
  width: 200px;
  height: 130px;
  background: var(--bg-dark);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.course-list-info {
  flex: 1;
}

.course-list-info h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
  color: var(--primary-color);
}

.course-list-info p {
  color: var(--text-light);
  margin-bottom: 16px;
  line-height: 1.6;
}

.course-list-meta {
  display: flex;
  gap: 24px;
  font-size: 14px;
  color: var(--text-muted);
}

.course-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.course-status.completed {
  color: var(--accent-color);
}

/* ===== 文章详情页 ===== */
.article-header {
  padding: 48px 0;
  background: var(--bg-light);
}

.article-header h1 {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 16px;
}

.article-meta {
  display: flex;
  gap: 24px;
  color: var(--text-light);
  font-size: 14px;
}

.article-content {
  padding: 48px 0;
  max-width: 800px;
  margin: 0 auto;
}

.article-content h2 {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin: 32px 0 16px;
}

.article-content h3 {
  font-size: 1.25rem;
  color: var(--primary-color);
  margin: 24px 0 12px;
}

.article-content p {
  margin-bottom: 16px;
  line-height: 1.8;
  color: var(--text-color);
}

.article-content ul,
.article-content ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.article-content li {
  margin-bottom: 8px;
  line-height: 1.6;
}

.article-content ul li {
  list-style: disc;
}

.article-content ol li {
  list-style: decimal;
}

.article-content img {
  border-radius: var(--radius);
  margin: 24px 0;
}

.article-content blockquote {
  border-left: 4px solid var(--accent-color);
  padding-left: 20px;
  margin: 24px 0;
  color: var(--text-light);
  font-style: italic;
}

.article-content code {
  background: var(--bg-light);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-family: "Monaco", "Consolas", monospace;
  font-size: 14px;
}

.article-content pre {
  background: var(--primary-color);
  color: var(--bg-color);
  padding: 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 24px 0;
}

.article-content pre code {
  background: none;
  padding: 0;
}

/* ===== 章节导航 ===== */
.chapter-nav {
  background: var(--bg-light);
  border-radius: var(--radius);
  padding: 24px;
  margin: 32px 0;
}

.chapter-nav h4 {
  font-size: 1rem;
  margin-bottom: 16px;
  color: var(--primary-color);
}

.chapter-nav ul {
  list-style: none;
  padding: 0;
}

.chapter-nav li {
  margin-bottom: 8px;
}

.chapter-nav a {
  color: var(--text-light);
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

.chapter-nav a:hover,
.chapter-nav a.active {
  background: var(--bg-color);
  color: var(--accent-color);
}

.chapter-nav .active {
  font-weight: 600;
}

/* ===== 标签 ===== */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0;
}

.tag {
  background: var(--bg-light);
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 14px;
  color: var(--text-light);
}

.tag:hover {
  background: var(--accent-color);
  color: var(--bg-color);
}

/* ===== 相关推荐 ===== */
.related-section {
  padding: 48px 0;
  background: var(--bg-light);
  border-top: 1px solid var(--border-color);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.related-card {
  background: var(--bg-color);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.related-thumb {
  height: 120px;
  background: var(--bg-dark);
}

.related-content {
  padding: 16px;
}

.related-content h4 {
  font-size: 14px;
  color: var(--primary-color);
  margin-bottom: 4px;
}

.related-content span {
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== 404 页面 ===== */
.error-page {
  min-height: calc(100vh - var(--header-height) - 300px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px;
}

.error-content {
  max-width: 500px;
}

.error-code {
  font-size: 8rem;
  font-weight: 700;
  color: var(--accent-color);
  line-height: 1;
  margin-bottom: 16px;
}

.error-content h1 {
  font-size: 1.75rem;
  color: var(--primary-color);
  margin-bottom: 16px;
}

.error-content p {
  color: var(--text-light);
  margin-bottom: 32px;
}

/* ===== 页脚 ===== */
.footer {
  background: var(--primary-color);
  color: var(--bg-color);
  padding: 48px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 32px;
}

.footer-brand p {
  opacity: 0.8;
  margin-top: 16px;
  line-height: 1.6;
}

.footer-links h4 {
  font-size: 1rem;
  margin-bottom: 16px;
}

.footer-links ul li {
  margin-bottom: 8px;
}

.footer-links a {
  color: var(--bg-color);
  opacity: 0.8;
}

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

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  text-align: center;
  opacity: 0.6;
  font-size: 14px;
}

/* ===== 响应式设计 ===== */
@media (max-width: 1024px) {
  .course-grid,
  .articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .header .container {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 20px;
  }

  .nav {
    order: 3;
    width: 100%;
    gap: 16px;
    margin-top: 12px;
    justify-content: center;
  }

  .search-box {
    width: auto;
    flex: 1;
    margin-left: 16px;
  }

  .hero {
    padding: 48px 0;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .course-grid,
  .articles-grid {
    grid-template-columns: 1fr;
  }

  .progress-card {
    flex-direction: column;
    text-align: center;
  }

  .course-list-item {
    flex-direction: column;
  }

  .course-list-thumb {
    width: 100%;
    height: 180px;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .article-content {
    padding: 24px 0;
  }

  .filter-tabs {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .stat-number {
    font-size: 2rem;
  }

  .error-code {
    font-size: 5rem;
  }
}
