/** ========================================
   初级会计职称考试 - 样式表
   www.chujikuaiji.cn
   ======================================== */

/* CSS 变量定义 */
:root {
  --accent-color: #2196f3;
  --accent-dark: #1976d2;
  --accent-light: #64b5f6;
  --success-color: #4caf50;
  --warning-color: #ff9800;
  --danger-color: #f44336;
  --text-primary: #333;
  --text-secondary: #666;
  --text-muted: #999;
  --bg-primary: #fff;
  --bg-secondary: #f5f7fa;
  --bg-card: #fff;
  --border-color: #e0e0e0;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --max-width: 1200px;
  --header-height: 64px;
}

/* 基础重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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 {
  text-decoration: none;
  color: var(--accent-color);
  transition: color 0.3s;
}

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;
}

/* ========================================
   页头 Header
   ======================================== */
.header {
  background: var(--bg-primary);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

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

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

.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.3s;
}

.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: var(--radius-md);
  padding: 8px 16px;
  width: 280px;
}

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

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

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

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

.hero p {
  font-size: 1.2rem;
  opacity: 0.9;
  margin-bottom: 32px;
}

.hero-search {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  gap: 12px;
  background: #fff;
  padding: 8px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.hero-search input {
  flex: 1;
  border: none;
  padding: 12px 16px;
  font-size: 1rem;
  outline: none;
}

.hero-search button {
  background: var(--accent-color);
  color: #fff;
  border: none;
  padding: 12px 32px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.3s;
}

.hero-search button:hover {
  background: var(--accent-dark);
}

/* ========================================
   分类卡片
   ======================================== */
.section {
  padding: 60px 0;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 32px;
  text-align: center;
  color: var(--text-primary);
}

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

.category-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s;
  border: 1px solid var(--border-color);
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-color);
}

.category-icon {
  width: 56px;
  height: 56px;
  background: var(--accent-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 1.5rem;
  color: var(--accent-color);
}

.category-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.category-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ========================================
   内容卡片
   ======================================== */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.content-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: all 0.3s;
}

.content-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent-color);
}

.content-card .tag {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent-color);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 12px;
}

.content-card h3 {
  font-size: 1.1rem;
  margin-bottom: 12px;
  line-height: 1.4;
}

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

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

.content-card .meta {
  display: flex;
  gap: 16px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.content-card .meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ========================================
   文章列表
   ======================================== */
.article-list {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.article-item {
  display: flex;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.3s;
}

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

.article-item:hover {
  background: var(--bg-secondary);
}

.article-item .num {
  width: 32px;
  height: 32px;
  background: var(--accent-color);
  color: #fff;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  margin-right: 16px;
  flex-shrink: 0;
}

.article-item .num.hot {
  background: var(--danger-color);
}

.article-item .info {
  flex: 1;
}

.article-item .info h4 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.article-item .info h4 a {
  color: var(--text-primary);
}

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

.article-item .info .desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.article-item .date {
  font-size: 0.875rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ========================================
   三栏文章区块
   ======================================== */
.three-col-section {
  background: var(--bg-secondary);
}

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

.col-box {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.col-box h3 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent-color);
  color: var(--text-primary);
}

.col-box ul li {
  padding: 10px 0;
  border-bottom: 1px dashed var(--border-color);
}

.col-box ul li:last-child {
  border-bottom: none;
}

.col-box ul li a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.col-box ul li a:hover {
  color: var(--accent-color);
}

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

.breadcrumb .container {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

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

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

.breadcrumb .current {
  color: var(--text-primary);
  font-weight: 500;
}

/* ========================================
   分类页头部
   ======================================== */
.category-header {
  background: var(--bg-card);
  padding: 40px 0;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.category-header h1 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.category-header p {
  color: var(--text-secondary);
}

/* ========================================
   筛选器
   ======================================== */
.filter-bar {
  background: var(--bg-card);
  padding: 20px 0;
  border-bottom: 1px solid var(--border-color);
}

.filter-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--accent-color);
  color: #fff;
  border-color: var(--accent-color);
}

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

.pagination a,
.pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  transition: all 0.3s;
}

.pagination a {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

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

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

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

/* ========================================
   文章详情页
   ======================================== */
.article-header {
  background: var(--bg-card);
  padding: 40px 0;
  border-bottom: 1px solid var(--border-color);
}

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

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

.article-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.article-body {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  padding: 40px 0;
}

.article-content {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 40px;
  box-shadow: var(--shadow-sm);
}

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

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

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

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

.article-content ul li,
.article-content ol li {
  margin-bottom: 8px;
  color: var(--text-secondary);
}

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

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

.article-content strong {
  color: var(--text-primary);
}

.article-sidebar .widget {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

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

.article-sidebar .widget ul li {
  padding: 10px 0;
  border-bottom: 1px dashed var(--border-color);
}

.article-sidebar .widget ul li:last-child {
  border-bottom: none;
}

.article-sidebar .widget ul li a {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.article-sidebar .widget ul li a:hover {
  color: var(--accent-color);
}

/* ========================================
   404 页面
   ======================================== */
.error-page {
  min-height: calc(100vh - var(--header-height) - 300px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 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-title {
  font-size: 1.75rem;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.error-desc {
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.btn {
  display: inline-block;
  padding: 12px 32px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
}

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

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

.btn-outline {
  background: transparent;
  color: var(--accent-color);
  border: 2px solid var(--accent-color);
  margin-left: 12px;
}

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

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

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

.footer-brand .logo {
  color: #fff;
  margin-bottom: 16px;
  display: inline-block;
}

.footer-brand p {
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  line-height: 1.8;
}

.footer-links h4 {
  font-size: 1rem;
  margin-bottom: 20px;
  color: #fff;
}

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

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

.footer-links ul li a:hover {
  color: #fff;
}

.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;
}

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

  .article-sidebar {
    order: -1;
  }

  .three-col-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .header .nav {
    display: none;
  }

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

  .hero {
    padding: 60px 0;
  }

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

  .hero-search {
    flex-direction: column;
    margin: 0 20px;
  }

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

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

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

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

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

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

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

  .filter-group {
    justify-content: center;
  }
}
