/* ==============================================
   青岛本地网 — 本地宝风格样式 v3（精美版）
   ============================================== */

:root {
  --primary: #1a56db;
  --primary-dark: #1e3a8a;
  --primary-light: #3b82f6;
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --bg: #f0f2f5;
  --card: #ffffff;
  --text: #0f172a;
  --text-light: #475569;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px -2px rgba(0,0,0,.08);
  --shadow-lg: 0 10px 25px -5px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.04);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --font-heading: 'Space Grotesk', 'Noto Sans SC', sans-serif;
  --font-body: 'Inter', 'Noto Sans SC', system-ui, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin:0; padding:0; box-sizing:border-box; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); letter-spacing: -0.02em; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; height: auto; display: block; }

/* ===== Container ===== */
.container { max-width: 720px; margin: 0 auto; padding: 0 10px; }
@media(min-width:768px){ .container { max-width: 800px; } }

/* ==============================================
   HEADER
   ============================================== */
.site-header {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 12px rgba(26,86,219,.25);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 50px;
  padding: 0 12px;
}
.header-logo { 
  font-size: 19px; font-weight: 800; letter-spacing: .5px;
  display: flex; align-items: center; gap: 6px;
}
.header-logo span { color: #fcd34d; }
.header-logo .logo-icon { 
  width: 28px; height: 28px; background: #fcd34d; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--primary-dark);
}
.header-right { display: flex; align-items: center; gap: 6px; }
.header-btn {
  font-size: 12px; padding: 5px 14px; border-radius: 18px;
  border: 1px solid rgba(255,255,255,.3); color: #fff;
  background: rgba(255,255,255,.1);
  transition: all .2s; white-space: nowrap;
}
.header-btn:hover { background: rgba(255,255,255,.2); }

/* ==============================================
   导航药丸
   ============================================== */
.nav-pills {
  background: var(--card);
  padding: 10px 12px 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 50px;
  z-index: 199;
  display: flex;
  gap: 4px;
  scrollbar-width: none;
}
.nav-pills::-webkit-scrollbar { display: none; }
.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 6px 12px;
  border-radius: 18px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-light);
  background: transparent;
  white-space: nowrap;
  transition: all .25s;
  flex-shrink: 0;
  position: relative;
}
.nav-pill.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(26,86,219,.3);
}
.nav-pill:not(.active)::after {
  content: ''; position: absolute; bottom: -2px; left: 50%;
  width: 0; height: 2px; background: var(--primary);
  transition: all .25s; transform: translateX(-50%);
}
.nav-pill:not(.active):hover { color: var(--primary); background: #f0f4ff; }

/* ==============================================
   搜索条
   ============================================== */
.search-bar {
  background: var(--card);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.search-box {
  display: flex;
  align-items: center;
  background: var(--bg);
  border-radius: 22px;
  padding: 0 14px;
  height: 38px;
  border: 1px solid transparent;
  transition: border .2s;
}
.search-box:focus-within { border-color: var(--primary-light); background: #fff; }
.search-box input {
  flex: 1; border: none; background: transparent;
  font-size: 13px; padding: 0 6px; outline: none; color: var(--text);
}
.search-box input::placeholder { color: var(--text-muted); font-size: 13px; }

/* ==============================================
   子分类药丸
   ============================================== */
.sub-nav {
  background: var(--card);
  padding: 10px 12px;
  overflow-x: auto;
  white-space: nowrap;
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}
.sub-nav::-webkit-scrollbar { display: none; }
.sub-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  color: var(--text-light);
  min-width: 48px;
  transition: all .2s;
  flex-shrink: 0;
  cursor: pointer;
}
.sub-pill .icon { width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 18px; background: var(--bg); }
.sub-pill:hover { background: #f0f4ff; }
.sub-pill.active { color: var(--primary); font-weight: 600; }
.sub-pill.active .icon { background: #eef2ff; }

/* ==============================================
   热门服务
   ============================================== */
.hot-section {
  background: var(--card);
  margin: 8px 10px;
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.hot-section h3 {
  font-size: 14px; font-weight: 600; margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.hot-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.hot-link {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 10px; background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 12.5px; color: var(--text);
  transition: all .2s;
}
.hot-link:hover { background: #dbeafe; color: var(--primary); }

/* ==============================================
   分类标题
   ============================================== */
.category-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 10px 6px;
}
.category-header h2 {
  font-size: 15px; font-weight: 700;
  display: flex; align-items: center; gap: 6px;
}
.category-header .more {
  font-size: 12px; color: var(--text-light);
  transition: color .2s;
}
.category-header .more:hover { color: var(--primary); }

/* ==============================================
   资讯列表（核心组件）
   ============================================== */
.news-list { background: var(--card); margin: 0 10px; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.news-item {
  display: flex; align-items: flex-start;
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
  cursor: pointer;
}
.news-item:hover { background: #f8faff; }
.news-item:last-child { border-bottom: none; }
.news-content { flex: 1; min-width: 0; }
.news-title {
  font-size: 14px; font-weight: 500; color: var(--text);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 5px;
  transition: color .2s;
}
.news-item:hover .news-title { color: var(--primary); }
.news-meta {
  display: flex; align-items: center; gap: 10px;
  font-size: 11.5px; color: var(--text-muted);
}
.news-reads { display: flex; align-items: center; gap: 2px; }
.news-date {}
.news-tag {
  font-size: 10.5px; padding: 1px 6px; border-radius: 3px;
  background: #fef3c7; color: #92400e; white-space: nowrap;
  font-weight: 500;
}
/* Tag color variants */
.news-tag.tag-社保 { background: #dbeafe; color: #1e40af; }
.news-tag.tag-公积金 { background: #fce7f3; color: #9d174d; }
.news-tag.tag-教育 { background: #d1fae5; color: #065f46; }
.news-tag.tag-交通 { background: #e0e7ff; color: #3730a3; }
.news-tag.tag-地铁 { background: #e0e7ff; color: #3730a3; }
.news-tag.tag-油价 { background: #fed7aa; color: #9a3412; }
.news-tag.tag-景点 { background: #d1fae5; color: #065f46; }
.news-tag.tag-活动 { background: #fce7f3; color: #9d174d; }
.news-tag.tag-美食 { background: #fef3c7; color: #92400e; }
.news-tag.tag-生活 { background: #e0e7ff; color: #3730a3; }
.news-tag.tag-公务员 { background: #dcfce7; color: #166534; }
.news-tag.tag-事业单位 { background: #ede9fe; color: #5b21b6; }
.news-tag.tag-央企国企 { background: #dbeafe; color: #1e40af; }
.news-tag.tag-政府单位 { background: #f0fdf4; color: #166534; }

/* News thumbnail image */
.news-img {
  width: 88px; height: 66px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  margin-left: 12px;
  flex-shrink: 0;
  background: var(--bg);
}
.news-img-wrapper {
  width: 88px; height: 66px;
  border-radius: var(--radius-sm);
  margin-left: 12px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: rgba(255,255,255,.5);
  overflow: hidden;
  position: relative;
}
.news-img-wrapper img {
  width: 100%; height: 100%; object-fit: cover;
  position: absolute; top: 0; left: 0;
}

/* ==============================================
   精选大图（Featured Hero Article）
   ============================================== */
.featured-section { margin: 6px 10px; }
.featured-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  display: block;
  height: 220px;
  background: var(--primary-dark);
}
.featured-card img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s ease;
}
.featured-card:hover img { transform: scale(1.05); }
.featured-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 20px 16px 14px;
  background: linear-gradient(transparent, rgba(0,0,0,.85));
  color: #fff;
}
.featured-overlay .featured-tag {
  display: inline-block; font-size: 11px; padding: 2px 10px;
  border-radius: 10px; background: rgba(255,255,255,.2);
  margin-bottom: 6px; font-weight: 500;
}
.featured-overlay h2 {
  font-size: 17px; font-weight: 700; line-height: 1.4;
  margin-bottom: 4px;
}
.featured-overlay .featured-meta {
  font-size: 12px; opacity: .7;
  display: flex; gap: 12px;
}

/* ===== 双图精选 ===== */
.featured-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 6px 10px;
}
.featured-sm {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  height: 150px;
  display: block;
  background: var(--primary-dark);
}
.featured-sm img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s ease;
}
.featured-sm:hover img { transform: scale(1.05); }
.featured-sm .featured-overlay { padding: 14px 12px 10px; }
.featured-sm .featured-overlay h2 { font-size: 14px; }

/* ===== 图片资讯列表（新式，带大图） ===== */
.photo-feed { background: transparent; margin: 0; box-shadow: none; }
.photo-feed .news-item {
  background: var(--card);
  margin-bottom: 8px;
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: block;
  border-bottom: none;
}
.photo-feed .news-item:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.photo-feed .news-img-wrapper {
  width: 100%;
  height: 180px;
  margin: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: 48px;
}
.photo-feed .news-img-wrapper img { border-radius: var(--radius) var(--radius) 0 0; }
.photo-feed .news-content { padding: 12px 14px 14px; }
.photo-feed .news-title { font-size: 15px; -webkit-line-clamp: 2; }
.photo-feed .news-meta { padding-top: 2px; }

/* 响应式 */
@media(min-width:600px){
  .featured-card { height: 280px; }
  .featured-grid { grid-template-columns: 1fr 1fr; }
  .featured-sm { height: 180px; }
  .photo-feed { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .photo-feed .news-item { margin-bottom: 0; }
  .photo-feed .news-img-wrapper { height: 150px; }
}

/* ==============================================
   加载更多
   ============================================== */
.load-more {
  display: block; text-align: center;
  padding: 14px; font-size: 13px; color: var(--primary-light);
  cursor: pointer; background: var(--card);
  border-radius: 0 0 var(--radius) var(--radius);
  transition: background .2s;
}
.load-more:hover { background: #f0f4ff; color: var(--primary); }

/* ==============================================
   Footer
   ============================================== */
.site-footer {
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 20px 12px 28px;
  margin-top: 12px;
}
.footer-links {
  display: flex; flex-wrap: wrap; gap: 4px;
  justify-content: center; margin-bottom: 10px;
}
.footer-links a {
  font-size: 12px; color: var(--text-light);
  padding: 3px 10px; border-radius: 14px;
  transition: all .2s;
}
.footer-links a:hover { color: var(--primary); background: #f0f4ff; }
.footer-copy {
  text-align: center; font-size: 11px; color: var(--text-muted);
  margin-top: 8px;
}

/* ==============================================
   阅读量动画
   ============================================== */
@keyframes countPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.read-count.pop { animation: countPop .3s ease; }

/* ==============================================
   Article Detail Page
   ============================================== */
.article-page { background: var(--card); min-height: 100vh; }
.article-hero {
  position: relative;
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #60a5fa 100%);
  color: #fff; padding: 36px 16px 28px; text-align: center;
  overflow: hidden;
}
.article-hero::before {
  content: ''; position: absolute; top: -60%; right: -20%;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,.06) 0%, transparent 70%);
  border-radius: 50%;
}
.article-hero::after {
  content: ''; position: absolute; bottom: -40%; left: -10%;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(255,255,255,.04) 0%, transparent 70%);
  border-radius: 50%;
}
.article-hero .hero-tag {
  display: inline-block; font-size: 11px; padding: 2px 10px;
  border-radius: 10px; background: rgba(255,255,255,.2);
  margin-bottom: 10px; font-weight: 500;
}
.article-hero h1 {
  font-size: 20px; font-weight: 700; line-height: 1.45;
  margin-bottom: 12px; position: relative; z-index: 1;
}
.article-hero .meta {
  font-size: 12px; opacity: .8;
  display: flex; justify-content: center; gap: 16px;
  position: relative; z-index: 1;
}
.article-body {
  padding: 16px 12px 32px;
  max-width: 700px; margin: 0 auto;
}
.article-body .section {
  background: var(--card); border-radius: var(--radius);
  padding: 18px 16px; margin-bottom: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.article-body .section h2 {
  font-size: 15px; font-weight: 600; color: var(--primary-dark);
  margin-bottom: 10px; padding-left: 10px;
  border-left: 3px solid var(--accent);
}
.article-body .section p {
  font-size: 14px; color: var(--text-light);
  line-height: 1.75; margin-bottom: 10px;
}
.article-body .section ul { padding-left: 16px; margin: 8px 0; list-style: none; }
.article-body .section li {
  margin-bottom: 6px; font-size: 13.5px; color: var(--text-light);
  line-height: 1.6; padding-left: 18px; position: relative;
}
.article-body .section li::before {
  content: '▸'; position: absolute; left: 0; color: var(--accent);
}
.article-body .section a { color: var(--primary); font-weight: 500; }
.article-body .section a:hover { text-decoration: underline; }

/* ==============================================
   Empty State / Loading
   ============================================== */
.empty-state {
  text-align: center; padding: 40px 20px; color: var(--text-muted);
  font-size: 14px;
}
.loading-state {
  text-align: center; padding: 40px; color: var(--text-muted);
}
.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--primary-light);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==============================================
   Skeleton Loading
   ============================================== */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, #f0f2f5 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ==============================================
   Utilities
   ============================================== */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-4 { margin-top: 4px; }
.mb-4 { margin-bottom: 4px; }

/* ==============================================
   Back to Top
   ============================================== */
.back-top {
  position: fixed; bottom: 24px; right: 16px;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; box-shadow: var(--shadow-md);
  cursor: pointer; transition: all .3s; z-index: 100;
  border: none; opacity: 0; pointer-events: none;
}
.back-top.show { opacity: 1; pointer-events: auto; }
.back-top:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(26,86,219,.3); }
