/* ========================================
   职业小百科 - 样式表
   www.qzmod.cn - 职业科普 岗位解析 技能要求
   ======================================== */

/* CSS 变量 */
:root {
  --accent-color: #607d8b;
  --accent-dark: #455a64;
  --accent-light: #90a4ae;
  --text-primary: #333;
  --text-secondary: #666;
  --text-muted: #999;
  --bg-primary: #fff;
  --bg-secondary: #f5f7f9;
  --bg-tertiary: #eef2f5;
  --border-color: #e0e4e8;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --radius-sm: 4px;
  --radius-md: 8px;
  --max-width: 1400px;
  --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-primary);
}

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

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

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

ul, ol {
  list-style: none;
}

/* ========================================
   布局
   ======================================== */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.main-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px;
}

/* ========================================
   页头
   ======================================== */

.header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

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

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

.nav a {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
}

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

.search-box {
  position: relative;
}

.search-box input {
  width: 280px;
  padding: 10px 16px 10px 40px;
  border: 1px solid var(--border-color);
  border-radius: 24px;
  font-size: 0.875rem;
  background: var(--bg-secondary);
  transition: all 0.2s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent-color);
  background: var(--bg-primary);
}

.search-box::before {
  content: "🔍";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.875rem;
  opacity: 0.6;
}

/* ========================================
   页脚
   ======================================== */

.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 48px 0 24px;
  margin-top: 64px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

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

.footer-brand p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 12px;
  line-height: 1.7;
}

.footer-links h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.footer-links ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

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

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ========================================
   面包屑
   ======================================== */

.breadcrumb {
  background: var(--bg-secondary);
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.breadcrumb-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

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

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

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

/* ========================================
   Hero 区域
   ======================================== */

.hero {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  padding: 64px 0;
  border-bottom: 1px solid var(--border-color);
}

.hero-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.hero p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 32px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 64px;
  margin-top: 48px;
}

.hero-stat {
  text-align: center;
}

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

.hero-stat .label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ========================================
   卡片
   ======================================== */

.card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}

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

.card-image {
  width: 100%;
  height: 160px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.card-content {
  padding: 20px;
}

.card-title {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
}

.card-title a {
  color: inherit;
}

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

.card-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

/* ========================================
   区块
   ======================================== */

.section {
  margin-bottom: 48px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.section-title {
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--text-primary);
}

.section-more {
  font-size: 0.875rem;
  color: var(--accent-color);
}

/* ========================================
   网格布局
   ======================================== */

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

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

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

/* ========================================
   特色内容
   ======================================== */

.featured-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 32px;
}

.featured-main {
  grid-row: span 2;
}

.featured-main .card-image {
  height: 100%;
  min-height: 320px;
}

.featured-main .card-title {
  font-size: 1.25rem;
}

.featured-side .card {
  height: 100%;
}

/* ========================================
   列表组件
   ======================================== */

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

.list-widget h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.list-widget ul {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.list-widget li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.list-widget li::before {
  content: "•";
  color: var(--accent-color);
  font-weight: bold;
}

.list-widget a {
  color: var(--text-primary);
  font-size: 0.9375rem;
  line-height: 1.5;
}

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

.list-widget .meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: auto;
  white-space: nowrap;
}

/* ========================================
   分类页头部
   ======================================== */

.category-header {
  background: var(--bg-secondary);
  padding: 48px 0;
  border-bottom: 1px solid var(--border-color);
}

.category-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

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

.category-header p {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 600px;
}

.category-stats {
  display: flex;
  gap: 32px;
  margin-top: 24px;
}

.category-stat {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.category-stat strong {
  color: var(--text-primary);
  font-size: 1.25rem;
  margin-right: 4px;
}

/* ========================================
   分页
   ======================================== */

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 48px;
}

.pagination a,
.pagination span {
  min-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: all 0.2s;
}

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

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

/* ========================================
   文章页
   ======================================== */

.article-header {
  background: var(--bg-secondary);
  padding: 48px 0;
  border-bottom: 1px solid var(--border-color);
}

.article-header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

.article-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 20px;
}

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

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

.article-body {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 24px;
}

.article-content {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--text-primary);
}

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

.article-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 32px 0 16px;
}

.article-content p {
  margin-bottom: 20px;
}

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

.article-content ul li {
  list-style: disc;
  margin-bottom: 8px;
}

.article-content ol li {
  list-style: decimal;
  margin-bottom: 8px;
}

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

/* 信息框 */
.info-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin: 32px 0;
}

.info-box h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--accent-color);
}

.info-box dl {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px 16px;
}

.info-box dt {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.info-box dd {
  font-size: 0.9375rem;
  color: var(--text-primary);
  font-weight: 500;
}

/* 参见链接 */
.see-also {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 24px;
  margin: 32px 0;
}

.see-also h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.see-also ul {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.see-also li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.see-also li::before {
  content: "→";
  color: var(--accent-color);
}

/* 参考文献 */
.references {
  border-top: 1px solid var(--border-color);
  padding-top: 32px;
  margin-top: 48px;
}

.references h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.references ol {
  padding-left: 24px;
}

.references li {
  list-style: decimal;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  padding-left: 8px;
}

/* 引用标注 */
.citation {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  background: var(--accent-light);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: 50%;
  margin-left: 2px;
  cursor: help;
}

/* ========================================
   404 页面
   ======================================== */

.error-page {
  min-height: calc(100vh - var(--header-height) - 300px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 64px 24px;
}

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

.error-content h2 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 16px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--accent-color);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

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

/* ========================================
   响应式设计
   ======================================== */

@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(3, 1fr);
  }

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

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

  .featured-main {
    grid-row: span 1;
  }

  .featured-main .card-image {
    min-height: 200px;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 56px;
  }

  .header-inner {
    padding: 0 16px;
  }

  .nav {
    display: none;
  }

  .search-box input {
    width: 180px;
  }

  .hero {
    padding: 40px 0;
  }

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

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

  .hero-stats {
    gap: 32px;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .main-wrapper {
    padding: 16px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

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

  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .category-header h1 {
    font-size: 1.5rem;
  }

  .category-stats {
    flex-wrap: wrap;
    gap: 16px;
  }

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

  .article-meta {
    flex-direction: column;
    gap: 8px;
  }

  .article-content {
    font-size: 1rem;
  }

  .article-content h2 {
    font-size: 1.25rem;
  }

  .article-content h3 {
    font-size: 1.125rem;
  }

  .info-box dl {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .info-box dt {
    font-weight: 600;
  }

  .see-also ul {
    grid-template-columns: 1fr;
  }

  .error-content h1 {
    font-size: 5rem;
  }

  .error-content h2 {
    font-size: 1.375rem;
  }
}

@media (max-width: 480px) {
  .logo-text {
    display: none;
  }

  .search-box input {
    width: 140px;
    padding: 8px 12px 8px 36px;
  }

  .hero-stats {
    flex-direction: column;
    gap: 24px;
  }
}
