/* 矿物 www.kuangshijia.cn - 专注于矿物收藏 鉴定的综合平台 提供最新矿物资讯 */

/* ===== CSS 变量 ===== */
:root {
  --accent-color: #795548;
  --accent-light: #8d6e63;
  --accent-dark: #5d4037;
  --bg-primary: #faf8f5;
  --bg-secondary: #f5f0eb;
  --bg-card: #ffffff;
  --text-primary: #2c1810;
  --text-secondary: #6d4c41;
  --text-muted: #8d6e63;
  --border-color: #d7ccc8;
  --shadow-sm: 0 2px 4px rgba(44, 24, 16, 0.06);
  --shadow-md: 0 4px 12px rgba(44, 24, 16, 0.08);
  --shadow-lg: 0 8px 24px rgba(44, 24, 16, 0.12);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --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-color: 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;
  display: block;
}

ul, ol {
  list-style: none;
}

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

/* ===== Header ===== */
.header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

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

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

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-color), var(--accent-light));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
}

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

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

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

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-secondary);
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  width: 160px;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

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

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

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

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

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

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

.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ===== Section Title ===== */
.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  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;
}

/* ===== Card ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.3s, transform 0.3s;
}

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

.card-image {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  background: var(--bg-secondary);
}

.card-body {
  padding: 20px;
}

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

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

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

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

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

/* ===== Category Tags ===== */
.category-tags {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.tag {
  padding: 8px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: all 0.2s;
}

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

.tag.active {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

/* ===== Section ===== */
.section {
  padding: 48px 0;
}

.section-alt {
  background: var(--bg-secondary);
}

/* ===== Featured Section ===== */
.featured-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.featured-main .card-image {
  aspect-ratio: 16/9;
}

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

.featured-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.featured-list .card {
  display: flex;
  gap: 16px;
}

.featured-list .card-image {
  width: 120px;
  aspect-ratio: 1;
  flex-shrink: 0;
}

.featured-list .card-body {
  padding: 16px;
  flex: 1;
}

.featured-list .card-title {
  font-size: 1rem;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  padding: 16px 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  background: var(--bg-secondary);
}

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

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

.breadcrumb span {
  margin: 0 8px;
}

/* ===== Page Header ===== */
.page-header {
  padding: 40px 0;
  background: var(--bg-secondary);
  text-align: center;
}

.page-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.page-desc {
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* ===== Article List ===== */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.article-item {
  display: flex;
  gap: 20px;
  padding: 20px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s;
}

.article-item:hover {
  box-shadow: var(--shadow-md);
}

.article-thumb {
  width: 200px;
  aspect-ratio: 16/10;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.article-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.article-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.article-excerpt {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 12px;
  flex: 1;
}

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

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

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

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

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

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

/* ===== Article Detail ===== */
.article-detail {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 0;
}

.article-header {
  text-align: center;
  margin-bottom: 40px;
}

.article-category {
  display: inline-block;
  padding: 6px 16px;
  background: var(--bg-secondary);
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--accent-color);
  margin-bottom: 16px;
}

.article-headline {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  line-height: 1.4;
}

.article-info {
  display: flex;
  justify-content: center;
  gap: 24px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.article-cover {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 40px;
}

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

.article-body h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 40px 0 20px;
  color: var(--text-primary);
}

.article-body h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 32px 0 16px;
  color: var(--text-primary);
}

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

.article-body img {
  width: 100%;
  border-radius: var(--radius-md);
  margin: 24px 0;
}

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

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

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

/* ===== Q&A Section ===== */
.qa-section {
  margin: 40px 0;
}

.qa-item {
  margin-bottom: 32px;
  padding: 24px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
}

.qa-question {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent-color);
  margin-bottom: 16px;
  display: flex;
  gap: 12px;
}

.qa-question::before {
  content: 'Q';
  width: 28px;
  height: 28px;
  background: var(--accent-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.qa-answer {
  color: var(--text-secondary);
  line-height: 1.8;
  padding-left: 40px;
}

/* ===== Sidebar ===== */
.sidebar-section {
  margin-bottom: 32px;
}

.sidebar-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border-color);
}

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

.sidebar-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  transition: background 0.2s;
}

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

.sidebar-thumb {
  width: 80px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.sidebar-content {
  flex: 1;
}

.sidebar-item-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.4;
}

.sidebar-item-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

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

.error-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

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

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s;
}

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

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

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

.btn-secondary:hover {
  background: var(--border-color);
  color: var(--text-primary);
}

/* ===== Footer ===== */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 48px 0 24px;
}

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

.footer-brand .logo {
  margin-bottom: 16px;
}

.footer-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

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

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

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

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

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

/* ===== Three Column Section ===== */
.three-column {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

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

.column-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

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

.column-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.column-item::before {
  content: '';
  width: 4px;
  height: 4px;
  background: var(--accent-color);
  border-radius: 50%;
}

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

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

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

  .three-column {
    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%;
    justify-content: center;
    gap: 20px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
  }

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

  .hero-stats {
    gap: 24px;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

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

  .featured-list .card {
    flex-direction: column;
  }

  .featured-list .card-image {
    width: 100%;
    aspect-ratio: 16/9;
  }

  .article-item {
    flex-direction: column;
  }

  .article-thumb {
    width: 100%;
  }

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

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

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

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

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

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

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

  .category-tags {
    justify-content: center;
  }

  .tag {
    padding: 6px 14px;
    font-size: 0.85rem;
  }

  .qa-item {
    padding: 16px;
  }

  .qa-answer {
    padding-left: 0;
    margin-top: 12px;
  }

  .qa-question {
    flex-direction: column;
    gap: 8px;
  }

  .error-actions {
    flex-direction: column;
  }
}
