/* ========================================
   邮票收藏网 - 样式表
   www.youpiaoshang.cn
   配色: #ff9800 (accent)
   ======================================== */

/* CSS 变量 */
:root {
  --accent-color: #ff9800;
  --accent-light: #ffb74d;
  --accent-dark: #f57c00;
  --text-primary: #333;
  --text-secondary: #666;
  --text-muted: #999;
  --bg-primary: #fff;
  --bg-secondary: #f8f9fa;
  --bg-card: #fff;
  --border-color: #e0e0e0;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
  --radius: 8px;
  --radius-sm: 4px;
  --max-width: 1200px;
  --header-height: 64px;
}

/* 重置 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

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

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

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

ul {
  list-style: none;
}

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

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

.main-content {
  min-height: calc(100vh - var(--header-height) - 200px);
  padding: 24px 0;
}

/* ========================================
   页头 Header
   ======================================== */
.header {
  background: var(--bg-primary);
  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 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-color);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
}

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

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

.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-secondary);
  border-radius: 24px;
  padding: 8px 16px;
  width: 280px;
}

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

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

/* ========================================
   Hero 区域
   ======================================== */
.hero {
  background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-dark) 100%);
  color: #fff;
  padding: 60px 0;
  text-align: center;
}

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

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

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

/* ========================================
   按钮
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

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

.btn-primary:hover {
  background: var(--accent-dark);
  color: #fff;
}

.btn-secondary {
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.3);
}

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

.btn-outline:hover {
  background: var(--accent-color);
  color: #fff;
}

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

/* ========================================
   分类标签
   ======================================== */
.categories {
  padding: 40px 0;
}

.section-title {
  font-size: 1.5rem;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 24px;
  background: var(--accent-color);
  border-radius: 2px;
}

.category-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.category-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: all 0.2s;
}

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

.category-icon {
  width: 48px;
  height: 48px;
  background: var(--bg-secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 1.5rem;
}

.category-item h3 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.category-item span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ========================================
   问题卡片
   ======================================== */
.question-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.question-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 20px;
  transition: all 0.2s;
}

.question-card:hover {
  box-shadow: var(--shadow-hover);
}

.question-stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 80px;
}

.stat-item {
  text-align: center;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}

.stat-item.answered {
  background: var(--accent-light);
  color: #fff;
}

.stat-item .num {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
}

.stat-item .label {
  font-size: 0.75rem;
}

.question-content {
  flex: 1;
}

.question-content h3 {
  font-size: 1.125rem;
  margin-bottom: 8px;
  line-height: 1.4;
}

.question-content h3 a {
  color: var(--text-primary);
}

.question-content h3 a:hover {
  color: var(--accent-color);
}

.question-excerpt {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.question-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.875rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.question-meta .tag {
  background: var(--bg-secondary);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
}

.best-answer-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--accent-color);
  color: #fff;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
}

/* ========================================
   面包屑
   ======================================== */
.breadcrumb {
  padding: 16px 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

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

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

.breadcrumb .separator {
  margin: 0 8px;
}

/* ========================================
   筛选器
   ======================================== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-options {
  display: flex;
  gap: 16px;
}

.filter-options a {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}

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

/* ========================================
   分页
   ======================================== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 40px 0;
}

.pagination a,
.pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  border-radius: var(--radius);
  font-size: 0.9375rem;
}

.pagination a {
  background: var(--bg-card);
  color: var(--text-secondary);
  box-shadow: var(--shadow);
}

.pagination a:hover {
  background: var(--accent-color);
  color: #fff;
}

.pagination .current {
  background: var(--accent-color);
  color: #fff;
}

.pagination .disabled {
  color: var(--text-muted);
  cursor: not-allowed;
}

/* ========================================
   文章详情页
   ======================================== */
.article-header {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.article-header h1 {
  font-size: 1.75rem;
  margin-bottom: 16px;
  line-height: 1.4;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--text-muted);
  font-size: 0.9375rem;
  flex-wrap: wrap;
}

.article-author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
}

.article-body {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.article-body h2 {
  font-size: 1.375rem;
  margin: 32px 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.article-body h3 {
  font-size: 1.125rem;
  margin: 24px 0 12px;
}

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

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

.article-body li {
  margin-bottom: 8px;
  color: var(--text-secondary);
}

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

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

/* 答案区域 */
.answers-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px 32px;
  box-shadow: var(--shadow);
}

.answers-header {
  font-size: 1.25rem;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

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

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

.answer-item.best-answer {
  background: #fff8e1;
  margin: 0 -32px;
  padding: 24px 32px;
  border-bottom: none;
}

.answer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.answer-content {
  color: var(--text-secondary);
  line-height: 1.8;
}

.answer-content p {
  margin-bottom: 12px;
}

/* ========================================
   侧边栏组件
   ======================================== */
.sidebar-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.sidebar-title {
  font-size: 1rem;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--bg-secondary);
}

.sidebar-list li:last-child {
  border-bottom: none;
}

.sidebar-list a {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.sidebar-list .num {
  color: var(--text-muted);
  font-size: 0.75rem;
  min-width: 24px;
}

/* 两栏布局 */
.two-column {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
}

/* ========================================
   页脚
   ======================================== */
.footer {
  background: var(--text-primary);
  color: #fff;
  padding: 48px 0 24px;
  margin-top: 48px;
}

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

.footer-brand p {
  color: rgba(255,255,255,0.7);
  margin-top: 16px;
  font-size: 0.9375rem;
}

.footer-title {
  font-size: 1rem;
  margin-bottom: 20px;
}

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

.footer-links a {
  color: rgba(255,255,255,0.7);
  font-size: 0.9375rem;
}

.footer-links a:hover {
  color: var(--accent-light);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  text-align: center;
  color: rgba(255,255,255,0.5);
  font-size: 0.875rem;
}

/* ========================================
   404 页面
   ======================================== */
.error-page {
  text-align: center;
  padding: 80px 20px;
}

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

.error-title {
  font-size: 1.75rem;
  margin-bottom: 16px;
}

.error-desc {
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 992px) {
  .two-column {
    grid-template-columns: 1fr;
  }

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

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

  .nav {
    order: 3;
    width: 100%;
    gap: 20px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
  }

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

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

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

  .question-card {
    flex-direction: column;
    gap: 16px;
  }

  .question-stats {
    flex-direction: row;
    justify-content: flex-start;
  }

  .stat-item {
    min-width: 80px;
  }

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

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

  .article-header,
  .article-body {
    padding: 20px;
  }

  .article-header h1 {
    font-size: 1.375rem;
  }
}

@media (max-width: 480px) {
  .category-list {
    grid-template-columns: 1fr;
  }

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

  .btn {
    width: 100%;
    max-width: 280px;
  }

  .filter-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

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