/* 数码盒子 - 科技蓝风格 */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #3b82f6;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --accent: #8b5cf6;
  --accent-light: #ede9fe;
  --bg: #f0f9ff;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 24px rgba(59,130,246,0.15);
  --radius: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* 顶部导航 */
.header {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-dark);
  white-space: nowrap;
}
.logo-icon { font-size: 28px; }
.search-box {
  flex: 1;
  max-width: 500px;
  display: flex;
  border: 2px solid var(--primary);
  border-radius: 24px;
  overflow: hidden;
}
.search-box input {
  flex: 1;
  border: none;
  padding: 10px 16px;
  font-size: 14px;
  outline: none;
}
.search-box button {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 24px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s;
}
.search-box button:hover { background: var(--primary-dark); }
.nav {
  display: flex;
  gap: 16px;
  white-space: nowrap;
}
.nav-link {
  text-decoration: none;
  color: var(--text-light);
  font-size: 15px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all 0.2s;
}
.nav-link:hover, .nav-link.active {
  color: var(--primary-dark);
  background: var(--primary-light);
}

/* Hero区域 */
.hero {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 50%, #7c3aed 100%);
  color: #fff;
  padding: 28px 0;
  text-align: center;
  border-radius: 16px;
  margin: 16px auto;
  max-width: 1200px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  padding: 4px 14px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
  backdrop-filter: blur(10px);
}
.hero h1 { font-size: 28px; margin-bottom: 8px; font-weight: 800; position: relative; }
.hero p { font-size: 14px; opacity: 0.9; margin-bottom: 16px; position: relative; }
.hero-tags {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  position: relative;
}
.hero-tag {
  background: rgba(255,255,255,0.15);
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 13px;
  backdrop-filter: blur(10px);
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  position: relative;
}
.stat-item { text-align: center; }
.stat-number {
  display: block;
  font-size: 24px;
  font-weight: 800;
}
.stat-label { font-size: 13px; opacity: 0.85; }

/* 广告位 */
.ad-banner {
  background: #eff6ff;
  border: 2px dashed var(--primary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 14px;
  margin: 20px 0;
}
.ad-728x90 { height: 90px; }
.ad-300x250 { height: 250px; }

/* 筛选区域 */
.filter-section {
  background: #fff;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.filter-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed #f0f0f0;
}
.filter-row:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.filter-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  min-width: 50px;
  padding-top: 6px;
  flex-shrink: 0;
}
.filter-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}
.filter-tag {
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.filter-tag:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.filter-tag.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* 技巧卡片网格 */
.main { padding: 24px 0; }
.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.tip-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.3s;
}
.tip-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}
.tip-cover {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.tip-cover-icon {
  font-size: 64px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.2));
}
.tip-category-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(255,255,255,0.95);
  color: var(--primary-dark);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.tip-hot-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #ef4444;
  color: #fff;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.tip-info { padding: 16px; }
.tip-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tip-desc {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tip-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.tip-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.tip-tag {
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
}
.tip-difficulty {
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}
.difficulty-简单 { background: #dcfce7; color: #16a34a; }
.difficulty-中等 { background: #fef3c7; color: #d97706; }
.difficulty-进阶 { background: #fee2e2; color: #dc2626; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
  font-size: 16px;
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 30px 0;
  flex-wrap: wrap;
}
.page-btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.page-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}
.page-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 页脚 */
.footer {
  background: #1e293b;
  color: #94a3b8;
  padding: 40px 0 20px;
  margin-top: 40px;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 20px;
}
.footer-links a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}
.footer-links a:hover { color: #fff; }
.footer-text {
  text-align: center;
  font-size: 13px;
  margin-bottom: 10px;
}
.footer-beian {
  text-align: center;
  font-size: 12px;
}
.footer-beian a {
  color: #64748b;
  text-decoration: none;
}

/* 回到顶部 */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(59,130,246,0.4);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  z-index: 99;
}
.back-to-top.show {
  opacity: 1;
  visibility: visible;
}
.back-to-top:hover { background: var(--primary-dark); }

/* 详情弹窗 */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.show { display: flex; }
.modal-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}
.modal-content {
  position: relative;
  background: #fff;
  border-radius: 16px;
  max-width: 800px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  color: var(--text-light);
  font-size: 20px;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s;
}
.modal-close:hover {
  background: #e2e8f0;
  color: var(--text);
}
.modal-body { padding: 30px; }

.detail-header {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.detail-category {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}
.detail-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.4;
}
.detail-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--text-light);
}
.detail-content .detail-section {
  margin-bottom: 24px;
}
.detail-content h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.detail-content ol {
  padding-left: 20px;
}
.detail-content li {
  margin-bottom: 10px;
  line-height: 1.8;
  color: var(--text);
}
.detail-tip-box {
  background: #f0fdf4;
  border-left: 4px solid #22c55e;
  padding: 16px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 16px;
  line-height: 1.8;
}
.detail-warning-box {
  background: #fef2f2;
  border-left: 4px solid #ef4444;
  padding: 16px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 16px;
  line-height: 1.8;
}
.detail-faq-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
}
.detail-faq-q {
  padding: 12px 16px;
  background: #f8fafc;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 14px;
}
.detail-faq-a {
  padding: 12px 16px;
  display: none;
  line-height: 1.8;
  color: var(--text-light);
  font-size: 14px;
}
.detail-faq-item.open .detail-faq-a { display: block; }
.detail-ad {
  background: #eff6ff;
  border: 2px dashed var(--primary);
  border-radius: 8px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 14px;
  margin-top: 20px;
}

/* 响应式 */
@media (max-width: 768px) {
  .header-inner { flex-wrap: wrap; height: auto; padding: 10px 0; gap: 10px; }
  .nav { order: 3; width: 100%; overflow-x: auto; padding-bottom: 5px; }
  .hero-stats { gap: 24px; }
  .tips-grid { grid-template-columns: 1fr; }
  .modal-body { padding: 20px; }
  .detail-title { font-size: 20px; }
}
