/* =====================================================
   青湾信息平台 — 主样式表
   移动优先，适配微信 WebView（iOS/Android）
   ===================================================== */

/* ── CSS 变量 ─────────────────────────────────────── */
:root {
  --primary:      #0d9488;   /* 青湾主色（深青绿） */
  --primary-dark: #0f766e;
  --primary-light:#ccfbf1;
  --accent:       #f59e0b;   /* 强调色（琥珀） */
  --text-main:    #1e293b;
  --text-sub:     #64748b;
  --text-light:   #94a3b8;
  --bg:           #f8fafc;
  --bg-card:      #ffffff;
  --border:       #e2e8f0;
  --radius:       12px;
  --radius-sm:    8px;
  --shadow:       0 2px 12px rgba(0,0,0,.08);
  --shadow-hover: 0 6px 24px rgba(13,148,136,.18);
}

/* ── 重置 & 基础 ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, 'PingFang SC', 'Helvetica Neue',
               'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text-main);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* ── 顶部导航栏 ───────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 52px;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.navbar-brand {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.navbar-search-btn {
  background: rgba(255,255,255,.2);
  border: none;
  border-radius: 20px;
  color: #fff;
  font-size: 14px;
  padding: 6px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── 搜索栏（顶部弹出） ──────────────────────────── */
.search-bar {
  background: var(--primary-dark);
  padding: 10px 16px;
  display: none;
}
.search-bar.open { display: flex; gap: 8px; }
.search-bar input {
  flex: 1;
  border: none;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 15px;
  outline: none;
}
.search-bar button {
  background: var(--accent);
  border: none;
  border-radius: 20px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  cursor: pointer;
}

/* ── 容器 ─────────────────────────────────────────── */
.container { max-width: 600px; margin: 0 auto; padding: 0 16px; }

/* ── Hero Banner（轮播） ─────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  padding: 24px 16px 28px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 140px; height: 140px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.hero-tag {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
  letter-spacing: .5px;
}
.hero-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
}
.hero-summary {
  font-size: 13px;
  opacity: .85;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-dots {
  display: flex;
  gap: 6px;
  margin-top: 14px;
}
.hero-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,.4);
  cursor: pointer;
  transition: all .2s;
}
.hero-dot.active { width: 18px; border-radius: 3px; background: #fff; }

/* ── 分类卡片区 ───────────────────────────────────── */
.section { padding: 20px 0 8px; }
.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.section-title::before {
  content: '';
  display: inline-block;
  width: 3px; height: 16px;
  background: var(--primary);
  border-radius: 2px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.category-card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 14px 8px 12px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
  cursor: pointer;
}
.category-card:active { transform: scale(.96); }
.category-card .icon { font-size: 26px; margin-bottom: 6px; }
.category-card .name {
  font-size: 12px;
  color: var(--text-sub);
  font-weight: 500;
}

/* ── 文章列表 ─────────────────────────────────────── */
.article-list { padding-bottom: 20px; }

.article-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 12px;
  transition: box-shadow .2s;
  cursor: pointer;
}
.article-item:active { box-shadow: var(--shadow-hover); }

.article-cover {
  flex-shrink: 0;
  width: 58px; height: 58px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}
.article-body { flex: 1; min-width: 0; }
.article-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-meta {
  font-size: 12px;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 8px;
}
.article-cat-badge {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}
.top-badge {
  background: #fef3c7;
  color: #d97706;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

/* ── 文章详情页 ───────────────────────────────────── */
.article-header {
  background: var(--bg-card);
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
}
.article-header .cat-link {
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 10px;
}
.article-header h1 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 12px;
}
.article-header .meta {
  font-size: 12px;
  color: var(--text-light);
  display: flex;
  gap: 12px;
}

.article-content {
  background: var(--bg-card);
  padding: 20px 16px;
  font-size: 15px;
  line-height: 1.85;
  color: var(--text-main);
}
.article-content h2 {
  font-size: 17px;
  font-weight: 700;
  margin: 20px 0 10px;
  color: var(--primary-dark);
}
.article-content h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 16px 0 8px;
}
.article-content p { margin-bottom: 14px; }
.article-content ul, .article-content ol {
  padding-left: 20px;
  margin-bottom: 14px;
}
.article-content li { margin-bottom: 6px; }
.article-content blockquote {
  border-left: 3px solid var(--primary);
  background: var(--primary-light);
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  margin: 14px 0;
  font-size: 14px;
  color: var(--primary-dark);
}

/* ── 相关推荐 ─────────────────────────────────────── */
.related-section {
  padding: 16px;
  background: var(--bg);
}
.related-item {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow);
}
.related-item .r-icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 38px; height: 38px;
  background: var(--primary-light);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.related-item .r-title {
  font-size: 14px;
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── 分页 ─────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 16px 0 24px;
}
.page-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  color: var(--text-sub);
  cursor: pointer;
}
.page-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ── 返回按钮 ─────────────────────────────────────── */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--primary);
  font-size: 14px;
  padding: 10px 16px;
  font-weight: 500;
}

/* ── 空状态 ───────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-light);
}
.empty-state .emoji { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ── 底部 ─────────────────────────────────────────── */
.footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,.6);
  text-align: center;
  font-size: 12px;
  padding: 16px;
}
.footer a { color: rgba(255,255,255,.8); }

/* ── 搜索结果页 ───────────────────────────────────── */
.search-keyword {
  color: var(--primary);
  font-weight: 700;
}

/* ── 404 页 ───────────────────────────────────────── */
.not-found {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px;
}
.not-found .code { font-size: 64px; font-weight: 900; color: var(--primary-light); }
.not-found h2 { font-size: 18px; color: var(--text-sub); margin: 8px 0 20px; }
.btn-primary {
  background: var(--primary);
  color: #fff;
  border-radius: 24px;
  padding: 10px 28px;
  font-size: 15px;
  font-weight: 600;
  display: inline-block;
}
