/* 茶具 - 资源导航风格样式 */

/* CSS 变量 */
:root {
  --accent-color: #2196f3;
  --accent-dark: #1976d2;
  --accent-light: #e3f2fd;
  --text-primary: #333;
  --text-secondary: #666;
  --text-muted: #999;
  --bg-primary: #fff;
  --bg-secondary: #f5f5f5;
  --border-color: #e0e0e0;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
  --radius: 8px;
  --max-width: 1200px;
  --header-height: 64px;
}

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

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

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

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 {
  background-color: 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 {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent-color);
}

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

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

.nav a {
  color: var(--text-primary);
  font-weight: 500;
}

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

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

/* 搜索框 */
.search-box {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.search-box input {
  width: 100%;
  padding: 16px 24px;
  font-size: 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.search-box button {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  padding: 10px 24px;
  background-color: var(--accent-color);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s;
}

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

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

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

.hero-desc {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

/* 分类筛选 */
.category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 32px;
}

.category-filter a {
  padding: 10px 20px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 14px;
  transition: all 0.2s;
}

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

/* 内容区域 */
.section {
  padding: 40px 0;
}

.section-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

/* 卡片网格 */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.card {
  background-color: var(--bg-primary);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
}

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

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

.card-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}

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

.card-tag {
  padding: 4px 10px;
  background-color: var(--accent-light);
  color: var(--accent-color);
  border-radius: 12px;
  font-size: 12px;
}

/* 链接列表 */
.link-list {
  background-color: var(--bg-primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.link-item {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

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

.link-icon {
  width: 48px;
  height: 48px;
  background-color: var(--accent-light);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.link-content {
  flex: 1;
}

.link-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.link-url {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.link-desc {
  font-size: 14px;
  color: var(--text-secondary);
}

.link-badge {
  padding: 4px 10px;
  background-color: #e8f5e9;
  color: #4caf50;
  border-radius: 12px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 统计信息 */
.stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--border-color);
}

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

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

.stat-label {
  font-size: 14px;
  color: var(--text-secondary);
}

/* 三栏布局 */
.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.col-section {
  background-color: var(--bg-primary);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.col-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent-light);
}

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

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

.col-list a {
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.col-list .date {
  font-size: 12px;
  color: var(--text-muted);
}

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

.breadcrumb ol {
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb li:not(:last-child)::after {
  content: '>';
  margin-left: 8px;
  color: var(--text-muted);
}

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

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

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

/* 分类头部 */
.category-header {
  background-color: var(--bg-primary);
  padding: 40px 0;
  text-align: center;
}

.category-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

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

/* 子分类 */
.sub-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
}

.sub-categories a {
  padding: 8px 16px;
  background-color: var(--bg-secondary);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 14px;
}

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

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

.pagination a,
.pagination span {
  padding: 10px 16px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-secondary);
  min-width: 40px;
  text-align: center;
}

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

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

/* 文章页 */
.article-header {
  background-color: var(--bg-primary);
  padding: 40px 0;
}

.article-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 16px;
}

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

.article-content {
  background-color: var(--bg-primary);
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 24px 0;
}

.article-content h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent-light);
}

.article-content h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 24px 0 12px;
}

.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 li {
  margin-bottom: 8px;
  color: var(--text-secondary);
}

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

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

/* 详情卡片 */
.detail-card {
  background-color: var(--bg-primary);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.detail-header {
  margin-bottom: 24px;
}

.detail-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.detail-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
}

.detail-box {
  background-color: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}

.detail-url {
  font-size: 16px;
  color: var(--accent-color);
  margin-bottom: 16px;
  word-break: break-all;
}

.detail-actions {
  display: flex;
  gap: 12px;
}

.btn {
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

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

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

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

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

.detail-list {
  margin-bottom: 24px;
}

.detail-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
}

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

.detail-list .label {
  color: var(--text-secondary);
}

.detail-list .value {
  font-weight: 500;
}

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

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

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

/* 相关链接 */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.related-card {
  background-color: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  transition: background-color 0.2s;
}

.related-card:hover {
  background-color: var(--accent-light);
}

.related-card .title {
  font-weight: 500;
  margin-bottom: 4px;
}

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

/* 推荐文章横向 */
.recommended-bar {
  background-color: var(--bg-primary);
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
}

.recommended-bar .container {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.recommended-bar .label {
  font-weight: 500;
  color: var(--text-primary);
}

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

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

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

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

.error-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 12px;
}

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

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

/* 页脚 */
.footer {
  background-color: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  padding: 40px 0 20px;
  margin-top: 40px;
}

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

.footer-brand .logo {
  margin-bottom: 12px;
  display: inline-block;
}

.footer-brand p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.footer-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}

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

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

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

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* 响应式设计 */
@media (max-width: 992px) {
  .three-col {
    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 {
    width: 100%;
    justify-content: center;
    margin-top: 12px;
    gap: 20px;
  }

  .hero {
    padding: 40px 0;
  }

  .hero-title {
    font-size: 24px;
  }

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

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

  .link-item {
    flex-direction: column;
    gap: 12px;
  }

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

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

  .article-content {
    padding: 24px;
  }

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

  .error-code {
    font-size: 80px;
  }
}

@media (max-width: 480px) {
  .search-box button {
    position: static;
    transform: none;
    width: 100%;
    margin-top: 12px;
  }

  .category-filter {
    gap: 8px;
  }

  .category-filter a {
    padding: 8px 14px;
    font-size: 13px;
  }

  .pagination {
    flex-wrap: wrap;
  }
}
