/* 妙招盒子 - 生活百科站样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #14b8a6;
  --primary-dark: #0d9488;
  --primary-light: #ccfbf1;
  --accent: #f59e0b;
  --accent-light: #fef3c7;
  --bg: #f0fdfa;
  --card-bg: #ffffff;
  --text: #1f2937;
  --text-light: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 24px rgba(20,184,166,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, #14b8a6 0%, #0d9488 50%, #0f766e 100%);
  color: #fff;
  padding: 16px 0;
  text-align: center;
  border-radius: 16px;
  margin: 12px 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: 24px; margin-bottom: 6px; font-weight: 800; position: relative; }
.hero p { font-size: 13px; opacity: 0.9; margin-bottom: 12px; position: relative; }
.hero-tags {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  position: relative;
}
.hero-tag {
  background: rgba(255,255,255,0.15);
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 12px;
  backdrop-filter: blur(10px);
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  position: relative;
}
.stat-item { text-align: center; }
.stat-number {
  display: block;
  font-size: 20px;
  font-weight: 800;
}
.stat-label { font-size: 13px; opacity: 0.85; }

/* 广告位 */
.ad-banner {
  background: #ecfdf5;
  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: 24px 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;
  border: 1px solid var(--border);
}
.tip-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary);
}
.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-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tip-icon {
  font-size: 56px;
}
.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;
  font-size: 12px;
  color: var(--text-light);
}
.tip-tags { display: flex; gap: 6px; }
.tip-tag {
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
}
.tip-difficulty {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  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: 32px 0;
}
.page-btn {
  padding: 8px 14px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary-dark); }
.page-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.page-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 页脚 */
.footer {
  background: #064e3b;
  color: #fff;
  padding: 32px 0;
  text-align: center;
  margin-top: 40px;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
}
.footer-links a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 14px;
}
.footer-links a:hover { color: #fff; }
.footer-text {
  font-size: 13px;
  opacity: 0.7;
  margin-bottom: 8px;
}
.footer-beian {
  font-size: 12px;
  opacity: 0.6;
}
.footer-beian a { color: rgba(255,255,255,0.6); text-decoration: none; }

/* 回到顶部 */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 20px;
  cursor: pointer;
  box-shadow: var(--shadow);
  display: none;
  z-index: 99;
  transition: all 0.3s;
}
.back-to-top:hover { background: var(--primary-dark); transform: translateY(-2px); }
.back-to-top.show { display: block; }

/* 详情弹窗 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
}
.modal.show { display: block; }
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
}
.modal-content {
  position: relative;
  max-width: 800px;
  margin: 40px auto;
  background: #fff;
  border-radius: 16px;
  max-height: calc(100vh - 80px);
  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: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { background: rgba(0,0,0,0.7); }
.modal-body { padding: 0; }

/* 详情页内容 */
.detail-header {
  padding: 32px;
  background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
  border-radius: 16px 16px 0 0;
}
.detail-category {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 13px;
  margin-bottom: 12px;
}
.detail-title {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--text);
}
.detail-meta {
  display: flex;
  gap: 16px;
  font-size: 14px;
  color: var(--text-light);
  flex-wrap: wrap;
}
.detail-meta span { display: flex; align-items: center; gap: 4px; }
.detail-content { padding: 32px; }
.detail-section { margin-bottom: 28px; }
.detail-section h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 12px;
  padding-left: 12px;
  border-left: 4px solid var(--primary);
}
.detail-section p {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 10px;
}
.detail-section ul, .detail-section ol {
  padding-left: 24px;
  margin-bottom: 10px;
}
.detail-section li {
  font-size: 15px;
  line-height: 1.8;
  margin-bottom: 8px;
}
.detail-tip-box {
  background: var(--accent-light);
  border-left: 4px solid var(--accent);
  padding: 16px;
  border-radius: 0 8px 8px 0;
  margin: 16px 0;
}
.detail-tip-box strong { color: #92400e; }
.detail-warning-box {
  background: #fee2e2;
  border-left: 4px solid #ef4444;
  padding: 16px;
  border-radius: 0 8px 8px 0;
  margin: 16px 0;
}
.detail-warning-box strong { color: #991b1b; }
.detail-faq { margin-top: 24px; }
.detail-faq-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}
.detail-faq-q {
  padding: 14px 16px;
  background: #f9fafb;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.detail-faq-a {
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-light);
  display: none;
}
.detail-faq-item.open .detail-faq-a { display: block; }
.detail-ad {
  margin: 24px 32px;
  height: 100px;
  background: #ecfdf5;
  border: 2px dashed var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 14px;
}

/* 响应式 */
@media (max-width: 768px) {
  .header-inner { flex-wrap: wrap; height: auto; padding: 12px 0; gap: 12px; }
  .search-box { order: 3; max-width: 100%; width: 100%; }
  .nav { order: 2; overflow-x: auto; }
  .hero h1 { font-size: 26px; }
  .hero-stats { gap: 24px; }
  .stat-number { font-size: 24px; }
  .tips-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .tip-cover { height: 120px; font-size: 40px; }
  .tip-title { font-size: 14px; }
  .modal-content { margin: 20px 12px; max-height: calc(100vh - 40px); }
  .detail-header { padding: 24px 20px; }
  .detail-title { font-size: 20px; }
  .detail-content { padding: 20px; }
}
