/* 烘焙工具 - 资源导航风格样式 */

/* CSS 变量 */
:root {
  --accent-color: #e67e22;
  --accent-hover: #d35400;
  --bg-primary: #faf8f5;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --text-primary: #2c3e50;
  --text-secondary: #7f8c8d;
  --text-muted: #95a5a6;
  --border-color: #e8e4df;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --max-width: 1200px;
  --header-height: 64px;
}

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

html {
  scroll-behavior: smooth;
}

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

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

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

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

/* 头部导航 */
.header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--accent-color);
}

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

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

.nav a {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s;
}

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

/* Hero 区域 */
.hero {
  background: linear-gradient(135deg, #fff9f0 0%, #fff5e6 100%);
  padding: 60px 0;
  text-align: center;
}

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

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

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

.search-input {
  width: 100%;
  padding: 16px 24px 16px 52px;
  font-size: 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  transition: all 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 4px rgba(230, 126, 34, 0.1);
}

.search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 18px;
}

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

.category-btn {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
}

.category-btn:hover,
.category-btn.active {
  color: white;
  background: var(--accent-color);
  border-color: var(--accent-color);
}

/* 统计信息 */
.stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  font-size: 14px;
  color: var(--text-secondary);
}

.stat-item strong {
  color: var(--accent-color);
  font-size: 20px;
  margin-right: 4px;
}

/* 内容区块 */
.section {
  padding: 48px 0;
}

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

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

/* 链接卡片 */
.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.link-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: all 0.2s;
}

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

.link-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.link-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #f39c12, #e67e22);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  flex-shrink: 0;
}

.link-info {
  flex: 1;
  min-width: 0;
}

.link-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-url {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.link-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.link-category {
  padding: 4px 10px;
  background: rgba(230, 126, 34, 0.1);
  color: var(--accent-color);
  border-radius: 20px;
  font-weight: 500;
}

.link-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #27ae60;
  font-weight: 500;
}

/* 评分星星 */
.rating {
  display: flex;
  gap: 2px;
  color: #f1c40f;
}

/* 文章列表 */
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.article-list {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
}

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

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

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

.article-item a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-primary);
  transition: color 0.2s;
}

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

.article-item a::before {
  content: '•';
  color: var(--accent-color);
}

/* 面包屑 */
.breadcrumb {
  padding: 16px 0;
  font-size: 14px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
}

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

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

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

/* 分类页头部 */
.category-header {
  background: linear-gradient(135deg, #fff9f0 0%, #fff5e6 100%);
  padding: 40px 0;
  margin-bottom: 32px;
}

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

.category-count {
  font-size: 15px;
  color: var(--text-secondary);
}

/* 子分类 */
.subcategory-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
}

.subcategory-item {
  padding: 10px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  transition: all 0.2s;
}

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

/* 链接列表 */
.link-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.link-list-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all 0.2s;
}

.link-list-item:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--accent-color);
}

.link-list-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #f39c12, #e67e22);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  flex-shrink: 0;
}

.link-list-content {
  flex: 1;
  min-width: 0;
}

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

.link-list-url {
  font-size: 13px;
  color: var(--accent-color);
  margin-bottom: 6px;
}

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

.link-list-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

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

.page-btn {
  min-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.page-btn:hover,
.page-btn.active {
  color: white;
  background: var(--accent-color);
  border-color: var(--accent-color);
}

.page-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 文章详情页 */
.article-header {
  background: linear-gradient(135deg, #fff9f0 0%, #fff5e6 100%);
  padding: 48px 0;
  margin-bottom: 32px;
}

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

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

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

.article-url-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 32px;
}

.url-display {
  font-size: 14px;
  color: var(--accent-color);
  word-break: break-all;
  margin-bottom: 16px;
  padding: 12px;
  background: rgba(230, 126, 34, 0.05);
  border-radius: var(--radius-sm);
}

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

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

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

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

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

.btn-secondary:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

/* 文章内容 */
.article-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 32px;
  margin-bottom: 32px;
}

.article-content h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 32px 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.article-content h2:first-child {
  margin-top: 0;
}

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

.article-content ul {
  margin-bottom: 16px;
  padding-left: 20px;
}

.article-content li {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 8px;
  list-style: disc;
}

/* 详情信息 */
.detail-list {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 32px;
}

.detail-item {
  display: flex;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

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

.detail-label {
  width: 140px;
  font-weight: 500;
  color: var(--text-primary);
}

.detail-value {
  flex: 1;
  color: var(--text-secondary);
}

/* 标签 */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}

.tag {
  padding: 6px 14px;
  background: rgba(230, 126, 34, 0.1);
  color: var(--accent-color);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}

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

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

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

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

.related-card-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

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

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

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

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

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

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

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

.footer-brand {
  max-width: 300px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-color);
  margin-bottom: 12px;
}

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

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

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

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

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

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

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

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

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

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

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

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

  .link-list-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .link-list-meta {
    flex-direction: row;
    width: 100%;
    justify-content: space-between;
  }

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

  .category-filter {
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    padding-bottom: 8px;
  }

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

  .article-content {
    padding: 20px;
  }

  .detail-item {
    flex-direction: column;
    gap: 4px;
  }

  .detail-label {
    width: auto;
  }

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

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

@media (max-width: 480px) {
  .hero {
    padding: 40px 0;
  }

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

  .section {
    padding: 32px 0;
  }

  .section-title {
    font-size: 18px;
  }

  .pagination {
    flex-wrap: wrap;
  }
}
