/*
Theme Name: SEO News Pro
Theme URI: https://example.com/seo-news-pro
Author: AI Assistant
Description: 专为文章资讯网站设计的 SEO 优化主题。内置全套自动化 SEO 系统，响应式设计，开箱即用。
Version: 2.8.0
License: GPL v2 or later
Text Domain: seo-news-pro
Tags: news, blog, seo, responsive, two-columns, right-sidebar, custom-logo, custom-menu, featured-images, sticky-post
*/

:root {
  --primary: #1a56db;
  --primary-dark: #1444b0;
  --primary-light: #e8eefb;
  --accent: #e63946;
  --accent-dark: #c5303c;
  --text: #1f2937;
  --text-secondary: #4b5563;
  --text-light: #9ca3af;
  --bg: #ffffff;
  --bg-light: #f3f5f7;
  --border: #e5e7eb;
  --border-light: #f0f1f3;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.08);
  --radius: 8px;
  --radius-lg: 10px;
  --max-width: 1200px;
  --header-height: 56px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--text); background: var(--bg-light); line-height: 1.7; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; display: block; }

/* ========================================
   Header — Sticky, clean
   ======================================== */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.site-branding { display: flex; align-items: center; gap: 0.625rem; flex-shrink: 0; }
.site-logo img { height: 32px; width: auto; }
.site-title { font-size: 1.125rem; font-weight: 700; color: var(--text); line-height: 1.2; white-space: nowrap; margin: 0; }
.site-title a { color: inherit; }
.site-title a:hover { color: var(--primary); }

/* Navigation */
.primary-nav { flex: 1; overflow-x: auto; }
.nav-menu { display: flex; list-style: none; align-items: center; gap: 0; }
.nav-menu > li { position: relative; }
.nav-menu > li > a {
  display: block; padding: 0.375rem 0.75rem; color: var(--text-secondary);
  font-weight: 500; font-size: 0.9375rem; border-radius: var(--radius);
  transition: all 0.15s; white-space: nowrap;
}
.nav-menu > li > a:hover,
.nav-menu > li.current-menu-item > a { color: var(--primary); background: var(--primary-light); }

/* Header search */
.header-search { position: relative; flex-shrink: 0; }
.header-search-btn {
  background: none; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.375rem 0.625rem; cursor: pointer; color: var(--text-light);
  display: flex; align-items: center; gap: 0.375rem; font-size: 0.8125rem; transition: all 0.15s;
}
.header-search-btn:hover { border-color: var(--primary); color: var(--primary); }
.header-search-btn svg { width: 15px; height: 15px; }
.header-search-form {
  display: none; position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--bg); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border: 1px solid var(--border); padding: 0.625rem; width: 300px; z-index: 200;
}
.header-search-form.active { display: block; }
.header-search-form .search-form { display: flex; }
.header-search-form input[type="search"] {
  flex: 1; padding: 0.5rem 0.75rem; border: 1px solid var(--border);
  border-radius: var(--radius) 0 0 var(--radius); font-size: 0.875rem; outline: none;
}
.header-search-form input[type="search"]:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(26,86,219,0.1); }
.header-search-form button {
  padding: 0.5rem 0.875rem; background: var(--primary); color: #fff; border: none;
  border-radius: 0 var(--radius) var(--radius) 0; cursor: pointer; font-weight: 500; font-size: 0.875rem;
}

/* Mobile toggle */
.menu-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; color: var(--text); padding: 0.375rem; }
.menu-toggle svg { display: block; }

/* ========================================
   Hero Banner
   ======================================== */
.hero-banner {
  background: linear-gradient(135deg, #1e3a5f 0%, #1a56db 100%);
  color: #fff; padding: 2rem 0;
}
.hero-inner {
  max-width: var(--max-width); margin: 0 auto; padding: 0 1.25rem;
  display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: center;
}
.hero-text h2 { font-size: 1.625rem; font-weight: 800; line-height: 1.3; margin-bottom: 0.625rem; }
.hero-text p { font-size: 0.9375rem; color: rgba(255,255,255,0.8); line-height: 1.7; margin-bottom: 1rem; }
.hero-cta { display: flex; gap: 0.75rem; }
.hero-cta .btn { display: inline-block; padding: 0.5625rem 1.375rem; border-radius: var(--radius); font-weight: 600; font-size: 0.9375rem; transition: all 0.15s; }
.hero-cta .btn-primary { background: var(--accent); color: #fff; }
.hero-cta .btn-primary:hover { background: var(--accent-dark); color: #fff; }
.hero-cta .btn-outline { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.4); }
.hero-cta .btn-outline:hover { background: rgba(255,255,255,0.12); color: #fff; }
.hero-image img { border-radius: var(--radius-lg); box-shadow: 0 8px 24px rgba(0,0,0,0.2); width: 100%; }

/* ========================================
   Header Operator Quick Links
   ======================================== */
.header-operators { display: flex; align-items: center; gap: 0.375rem; flex-shrink: 0; }
.header-op-link { display: flex; align-items: center; opacity: 0.6; transition: opacity 0.15s; }
.header-op-link:hover { opacity: 1; }
.header-op-link img { height: 22px; width: auto; }

/* ========================================
   Operator Tab Icons in Category Tabs
   ======================================== */
.tab-operator {
  display: inline-flex !important; align-items: center; gap: 0.25rem;
  padding: 0.3125rem 0.625rem !important;
}
.tab-operator img { height: 16px; width: auto; flex-shrink: 0; }
.tab-operator span { font-size: 0.75rem; white-space: nowrap; }
.tab-operator.active { background: var(--primary) !important; color: #fff !important; }
.tab-operator.active span { color: #fff; }

/* ========================================
   Features / Trust
   ======================================== */
.features-section { background: var(--bg); padding: 1.5rem 0; }
.features-inner { max-width: var(--max-width); margin: 0 auto; padding: 0 1.25rem; }
.features-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.feature-item { text-align: center; padding: 1rem 0.75rem; border-radius: var(--radius); transition: background 0.15s; }
.feature-item:hover { background: var(--bg-light); }
.feature-icon { font-size: 1.75rem; margin-bottom: 0.375rem; display: block; }
.feature-item h3 { font-size: 0.875rem; font-weight: 700; margin-bottom: 0.25rem; }
.feature-item p { font-size: 0.75rem; color: var(--text-light); line-height: 1.4; }

/* ========================================
   Main Layout
   ======================================== */
.site-main {
  max-width: var(--max-width); margin: 0 auto 2rem; padding: 0 1.25rem;
  display: grid; grid-template-columns: 1fr 280px; gap: 1.25rem;
}
.content-area { min-width: 0; }
.widget-area { position: sticky; top: calc(var(--header-height) + 1rem); height: fit-content; }

/* ========================================
   Category Tabs
   ======================================== */
.category-tabs {
  background: var(--bg); border-radius: var(--radius-lg); padding: 0.625rem 0.875rem;
  margin-bottom: 1.25rem; box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 0.375rem; overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.category-tabs::-webkit-scrollbar { display: none; }
.category-tab {
  display: inline-block; padding: 0.3125rem 0.875rem; border-radius: 9999px;
  font-size: 0.8125rem; font-weight: 500; color: var(--text-secondary);
  white-space: nowrap; transition: all 0.15s;
}
.category-tab:hover { color: var(--primary); background: var(--primary-light); }
.category-tab.active { background: var(--primary); color: #fff; }

/* ========================================
   Article Cards — Left Image + Right Text
   ======================================== */
.posts-grid { display: grid; gap: 0.625rem; }
.post-card {
  background: var(--bg); border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: box-shadow 0.15s, transform 0.1s;
  display: grid; grid-template-columns: 160px 1fr; border: 1px solid var(--border-light);
}
.post-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.post-card .post-thumbnail { position: relative; overflow: hidden; min-height: 110px; background: var(--bg-light); }
.post-card .post-thumbnail img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.25s; }
.post-card:hover .post-thumbnail img { transform: scale(1.03); }
.post-card .post-thumbnail.no-image {
  display: flex; align-items: center; justify-content: center; color: var(--text-light);
}
.post-card .post-content { padding: 0.625rem 0.875rem; display: flex; flex-direction: column; justify-content: center; }
.post-category {
  display: inline-block; font-size: 0.6875rem; font-weight: 600; color: #fff;
  background: var(--primary); padding: 0.0625rem 0.5rem; border-radius: 3px;
  margin-bottom: 0.375rem; width: fit-content; text-decoration: none;
}
.post-category:hover { filter: brightness(1.1); color: #fff; }
.post-categories-row { display: flex; flex-wrap: wrap; gap: 0.1875rem; margin-bottom: 0.375rem; }

/* Operator brand colors */
.cat-tag-lt  { background: #dc2626; } /* 联通 — red */
.cat-tag-dx  { background: #2563eb; } /* 电信 — blue */
.cat-tag-gd  { background: #1e3a5f; } /* 广电 — dark blue */
.cat-tag-yd  { background: #166534; } /* 移动 — dark green */

/* Region pseudo-random palette */
.cat-tag-r0 { background: #7c3aed; }
.cat-tag-r1 { background: #0891b2; }
.cat-tag-r2 { background: #c2410c; }
.cat-tag-r3 { background: #4338ca; }
.cat-tag-r4 { background: #be185d; }
.cat-tag-r5 { background: #0f766e; }
.post-card .entry-title {
  font-size: 0.9375rem; font-weight: 700; line-height: 1.4; margin-bottom: 0.25rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card .entry-title a { color: var(--text); }
.post-card .entry-title a:hover { color: var(--primary); }
.post-excerpt {
  color: var(--text-light); font-size: 0.8125rem; line-height: 1.5; margin-bottom: 0.375rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-meta { display: flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; color: var(--text-light); margin-top: auto; }
.post-meta span { display: flex; align-items: center; gap: 0.1875rem; }
.post-meta svg { width: 12px; height: 12px; flex-shrink: 0; }

/* Sticky */
.post-card.sticky { grid-template-columns: 1fr; border: 2px solid var(--accent); }
.post-card.sticky .post-thumbnail { height: 200px; }
.post-card.sticky .entry-title { font-size: 1.125rem; }
.post-card.sticky .post-excerpt { -webkit-line-clamp: 3; }

/* ========================================
   Single Article — Desktop optimized
   ======================================== */
.single-post { margin-bottom: 1.25rem; }
.single-post .entry-header {
  background: var(--bg); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 1.5rem 1.75rem 1.25rem; box-shadow: var(--shadow-sm); border: 1px solid var(--border-light); border-bottom: none;
}
.single-post .entry-title { font-size: 1.5rem; font-weight: 800; line-height: 1.35; margin-bottom: 0.625rem; color: var(--text); }
.single-post .entry-meta { display: flex; flex-wrap: wrap; gap: 0.75rem; font-size: 0.8125rem; color: var(--text-light); }
.single-post .entry-meta span { display: flex; align-items: center; gap: 0.25rem; }
.single-post .entry-meta svg { width: 13px; height: 13px; }

.entry-featured-image {
  background: var(--bg); box-shadow: var(--shadow-sm); border-left: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
}
.entry-featured-image img { width: 100%; max-height: 420px; object-fit: cover; }

.single-post .entry-content {
  background: var(--bg); border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 1.5rem 1.75rem 1.75rem; box-shadow: var(--shadow-sm); border: 1px solid var(--border-light); border-top: none;
  font-size: 1rem; line-height: 1.85; color: var(--text-secondary); max-width: 780px;
}
.entry-content h2 { font-size: 1.3125rem; font-weight: 700; margin: 1.75rem 0 0.625rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--primary-light); }
.entry-content h3 { font-size: 1.125rem; font-weight: 700; margin: 1.375rem 0 0.375rem; }
.entry-content p { margin-bottom: 1rem; }
.entry-content img { border-radius: var(--radius); margin: 1rem 0; }
/* Center images that are the only child of a paragraph (e.g. customer service image) */
.entry-content p > img:only-child,
.entry-content p:has(> img:only-child) {
  display: flex; justify-content: center; align-items: center;
}
.entry-content p > img:only-child {
  margin: 0.875rem auto; max-width: 100%;
}
/* Also center images wrapped in links inside paragraphs */
.entry-content p > a:only-child > img,
.entry-content p:has(> a:only-child > img) {
  display: flex; justify-content: center;
}
.entry-content p > a:only-child {
  display: flex; justify-content: center;
}
.entry-content blockquote { border-left: 4px solid var(--primary); padding: 0.875rem 1rem; margin: 1rem 0; background: var(--primary-light); border-radius: 0 var(--radius) var(--radius) 0; }
.entry-content ul, .entry-content ol { margin: 0.875rem 0 1rem 1.125rem; }
.entry-content li { margin-bottom: 0.25rem; }
.entry-content a { text-decoration: underline; text-underline-offset: 2px; }
.entry-content table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.9375rem; }
.entry-content th, .entry-content td { padding: 0.5rem 0.75rem; border: 1px solid var(--border); text-align: left; }
.entry-content th { background: var(--bg-light); font-weight: 600; }

/* Breadcrumb */
.breadcrumb { font-size: 0.8125rem; color: var(--text-light); margin-bottom: 0.75rem; display: flex; align-items: center; flex-wrap: wrap; padding: 0 0.25rem; }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { margin: 0 0.375rem; color: var(--border); }
.breadcrumb .current { color: var(--text-light); }

/* Tags */
.post-tags { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.post-tags strong { font-size: 0.875rem; margin-right: 0.5rem; }
.post-tags a { display: inline-block; padding: 0.1875rem 0.625rem; background: var(--bg-light); border: 1px solid var(--border); border-radius: 9999px; font-size: 0.8125rem; margin: 0 0.25rem 0.25rem 0; color: var(--text-secondary); }
.post-tags a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Post Navigation */
.post-navigation { display: grid; grid-template-columns: 1fr 1fr; gap: 0.875rem; margin-top: 1.25rem; }
.nav-previous, .nav-next { background: var(--bg); padding: 0.875rem 1rem; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--border-light); }
.nav-next { text-align: right; }
.nav-label { font-size: 0.6875rem; color: var(--text-light); margin-bottom: 0.1875rem; }
.nav-title { font-weight: 600; font-size: 0.9375rem; line-height: 1.4; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; overflow: hidden; }

/* ========================================
   Widgets
   ======================================== */
.widget { background: var(--bg); border-radius: var(--radius-lg); padding: 1rem 1.125rem; margin-bottom: 0.875rem; box-shadow: var(--shadow-sm); border: 1px solid var(--border-light); }
.widget-title { font-size: 0.9375rem; font-weight: 700; margin-bottom: 0.75rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--primary); }
.widget ul { list-style: none; }
.widget li { padding: 0.4375rem 0; border-bottom: 1px solid var(--border-light); font-size: 0.8125rem; }
.widget li:last-child { border-bottom: none; }
.widget a { color: var(--text-secondary); }
.widget a:hover { color: var(--primary); }
.search-form { display: flex; }
.search-form input[type="search"] { flex: 1; padding: 0.4375rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius) 0 0 var(--radius); font-size: 0.8125rem; outline: none; }
.search-form input[type="search"]:focus { border-color: var(--primary); }
.search-form button { padding: 0.4375rem 0.875rem; background: var(--primary); color: #fff; border: none; border-radius: 0 var(--radius) var(--radius) 0; cursor: pointer; }

/* ========================================
   Pagination
   ======================================== */
.pagination { display: flex; justify-content: center; gap: 0.25rem; margin: 1.25rem 0; }
.pagination a, .pagination .current, .pagination span { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 0.5rem; border-radius: var(--radius); font-size: 0.8125rem; font-weight: 500; }
.pagination a { background: var(--bg); color: var(--text-secondary); border: 1px solid var(--border); }
.pagination a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .current { background: var(--primary); color: #fff; border: 1px solid var(--primary); }

/* ========================================
   Footer
   ======================================== */
.site-footer { background: #1f2937; color: #9ca3af; padding: 0; margin-top: 1rem; }
.footer-bottom { max-width: var(--max-width); margin: 0 auto; padding: 1.25rem 1.25rem; text-align: center; font-size: 0.8125rem; color: #6b7280; }
.footer-bottom p { margin-bottom: 0.1875rem; }
.footer-bottom a { color: #6b7280; }
.footer-bottom a:hover { color: #9ca3af; }
.footer-icp { display: flex; align-items: center; justify-content: center; gap: 0.875rem; flex-wrap: wrap; margin-top: 0.1875rem; }
.footer-icp img { height: 16px; width: auto; display: inline; vertical-align: middle; }

/* ========================================
   Archive / Category / Search / 404 / Page
   ======================================== */
.archive-header { background: var(--bg); border-radius: var(--radius-lg); padding: 1.25rem 1.5rem; margin-bottom: 1rem; box-shadow: var(--shadow-sm); border: 1px solid var(--border-light); }
.archive-title { font-size: 1.25rem; font-weight: 800; }
.archive-description { color: var(--text-light); margin-top: 0.25rem; font-size: 0.9375rem; }

.error-404 { text-align: center; padding: 3rem 1.5rem; }
.error-404 .error-code { font-size: 4.5rem; font-weight: 800; color: var(--primary); line-height: 1; }
.error-404 .error-title { font-size: 1.25rem; margin: 0.875rem 0 0.375rem; }
.error-404 .error-description { color: var(--text-light); margin-bottom: 1.25rem; }
.error-404 .error-search { max-width: 380px; margin: 0 auto 1.25rem; }
.error-404 .error-actions { margin-bottom: 2rem; }
.btn { display: inline-block; padding: 0.5625rem 1.375rem; border-radius: var(--radius); font-weight: 600; font-size: 0.9375rem; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.error-suggestions { text-align: left; max-width: 640px; margin: 0 auto; }
.error-suggestions h2 { font-size: 1.0625rem; margin-bottom: 0.875rem; }
.recent-posts-list { display: grid; gap: 0.625rem; }
.recent-post-item { display: flex; gap: 0.75rem; align-items: center; background: var(--bg); padding: 0.625rem; border-radius: var(--radius); border: 1px solid var(--border-light); }
.recent-post-thumb { width: 56px; height: 56px; border-radius: 6px; overflow: hidden; flex-shrink: 0; }
.recent-post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.recent-post-body { flex: 1; min-width: 0; }
.recent-post-title { font-size: 0.8125rem; font-weight: 600; line-height: 1.4; margin-bottom: 0.0625rem; }
.recent-post-title a { color: var(--text); }
.recent-post-title a:hover { color: var(--primary); }
.recent-post-body time { font-size: 0.75rem; color: var(--text-light); }
.category-cloud { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.category-cloud a { padding: 0.3125rem 0.75rem; background: var(--bg); border: 1px solid var(--border); border-radius: 9999px; font-size: 0.8125rem; color: var(--text-secondary); }
.category-cloud a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.page-article { background: var(--bg); border-radius: var(--radius-lg); padding: 1.75rem; box-shadow: var(--shadow-sm); border: 1px solid var(--border-light); }
.page-featured-image { margin-bottom: 1.25rem; border-radius: var(--radius); overflow: hidden; }
.page-featured-image img { width: 100%; }

/* Reading Progress */
.reading-progress { position: fixed; top: 0; left: 0; height: 3px; background: var(--accent); z-index: 9999; width: 0%; transition: width 0.1s; }

/* Back to Top */
.back-to-top { position: fixed; bottom: 1.25rem; right: 1.25rem; width: 38px; height: 38px; background: var(--primary); color: #fff; border: none; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: opacity 0.2s, visibility 0.2s, transform 0.15s; box-shadow: var(--shadow-md); z-index: 99; }
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { transform: translateY(-2px); background: var(--primary-dark); }

/* ========================================
   Floating Customer Service
   ======================================== */
.kefu-float { position: fixed; right: 0; top: 50%; transform: translateY(-50%); z-index: 98; display: none; }
.kefu-panel { background: var(--bg); border: 1px solid var(--border); border-right: none; border-radius: var(--radius-lg) 0 0 var(--radius-lg); padding: 0.5rem; box-shadow: var(--shadow-md); width: 110px; text-align: center; }
.kefu-panel img { width: 90px; height: 90px; margin: 0 auto 0.25rem; object-fit: contain; }
.kefu-panel p { font-size: 0.6875rem; color: var(--text-secondary); margin: 0; line-height: 1.3; }

/* Desktop only */
@media (min-width: 769px) {
  .kefu-float { display: block; }
}

/* ========================================
   Responsive — Tablet (≤1024px)
   ======================================== */
@media (max-width: 1024px) {
  .site-main { grid-template-columns: 1fr; }
  .widget-area { position: static; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.875rem; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-image { display: none; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ========================================
   Responsive — Large Phone (≤768px)
   ======================================== */
@media (max-width: 768px) {
  :root { --header-height: 48px; }
  .header-inner { padding: 0 0.875rem; }
  .site-title { font-size: 0.9375rem; }
  .menu-toggle { display: flex; }
  .primary-nav {
    position: absolute; top: var(--header-height); left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1); padding: 0.5rem 0.875rem; display: none; z-index: 150;
  }
  .primary-nav.toggled { display: block; }
  .nav-menu { flex-direction: column; }
  .nav-menu > li > a { padding: 0.5rem 0.625rem; font-size: 0.875rem; }
  .header-search { display: none; }
  .header-operators { display: none; }

  /* Hero */
  .hero-banner { padding: 1.25rem 0; }
  .hero-text h2 { font-size: 1.125rem; }
  .hero-text p { font-size: 0.8125rem; }
  .hero-cta .btn { padding: 0.4375rem 1rem; font-size: 0.8125rem; }
  .hero-cta { gap: 0.5rem; }

  /* Features — 4 inline */
  .features-section { padding: 0.75rem 0; }
  .features-grid { grid-template-columns: repeat(4, 1fr); gap: 0; }
  .feature-item { padding: 0.5rem 0.25rem; border-radius: 0; }
  .feature-icon { font-size: 1.125rem; margin-bottom: 0.125rem; }
  .feature-item h3 { font-size: 0.6875rem; }
  .feature-item p { display: none; }

  /* Category tabs with operator logos */
  .category-tabs {
    padding: 0.5rem; margin-bottom: 0.75rem; border-radius: var(--radius);
    gap: 0.25rem; flex-wrap: wrap;
  }
  .tab-separator { display: none; }
  .category-tab { padding: 0.25rem 0.625rem; font-size: 0.75rem; }
  .tab-operator { padding: 0.25rem 0.5rem !important; gap: 0.1875rem; }
  .tab-operator img { height: 18px; }
  .tab-operator span { font-size: 0.6875rem; }

  /* Layout — no sidebar, full width */
  .site-main { margin: 0 auto 1rem; padding: 0 0.75rem; display: block; }
  .widget-area { display: none; }

  /* Article cards — left image, right text (compact) */
  .posts-grid { gap: 0.625rem; }
  .post-card {
    grid-template-columns: 110px 1fr;
    border-radius: var(--radius);
    overflow: hidden;
  }
  .post-card .post-thumbnail { min-height: 80px; height: auto; aspect-ratio: 1/1; }
  .post-card .post-thumbnail img { width: 100%; height: 100%; }
  .post-card .post-content { padding: 0.5rem 0.625rem; }
  .post-card .entry-title { font-size: 0.8125rem; font-weight: 700; line-height: 1.4; -webkit-line-clamp: 2; margin-bottom: 0.125rem; }
  .post-excerpt { font-size: 0.6875rem; line-height: 1.4; -webkit-line-clamp: 1; margin-bottom: 0.125rem; }
  .post-meta { font-size: 0.625rem; gap: 0.375rem; }
  .post-category { font-size: 0.625rem; padding: 0.0625rem 0.375rem; margin-bottom: 0.25rem; }
  .post-card.sticky { grid-template-columns: 1fr; }
  .post-card.sticky .post-thumbnail { height: 180px; aspect-ratio: auto; }
  .post-card.sticky .entry-title { font-size: 0.9375rem; }
  .post-card.sticky .post-excerpt { -webkit-line-clamp: 2; }

  /* Single article */
  .single-post .entry-header { padding: 0.875rem; border-radius: var(--radius); }
  .single-post .entry-title { font-size: 1.0625rem; }
  .single-post .entry-meta { font-size: 0.75rem; gap: 0.5rem; }
  .single-post .entry-content { padding: 0.875rem; max-width: 100%; border-radius: 0 0 var(--radius) var(--radius); font-size: 0.9375rem; line-height: 1.75; }
  .entry-featured-image { border-radius: var(--radius) var(--radius) 0 0; }
  .entry-featured-image img { max-height: 200px; }
  .breadcrumb { margin-bottom: 0.5rem; font-size: 0.75rem; }
  .post-tags { margin-top: 1rem; }
  .post-navigation { grid-template-columns: 1fr; gap: 0.5rem; margin-top: 1rem; }
  .nav-previous, .nav-next { padding: 0.625rem 0.75rem; }
  .nav-title { font-size: 0.8125rem; }

  /* Archive */
  .archive-header { padding: 1rem; margin-bottom: 0.75rem; border-radius: var(--radius); }
  .archive-title { font-size: 1.0625rem; }
  .archive-description { font-size: 0.8125rem; }

  /* Pagination */
  .pagination { margin: 1rem 0; }
  .pagination a, .pagination .current, .pagination span { min-width: 30px; height: 30px; font-size: 0.75rem; }

  /* Footer */
  .footer-bottom { padding: 1rem 0.875rem; font-size: 0.75rem; }
  .footer-icp { gap: 0.5rem; }

  /* Misc */
  .error-404 { padding: 1.5rem 0.875rem; }
  .error-404 .error-code { font-size: 3rem; }
  .back-to-top { bottom: 0.75rem; right: 0.75rem; width: 34px; height: 34px; }
  .page-article { padding: 1rem; }
}

/* ========================================
   Responsive — Medium Phone (≤480px)
   ======================================== */
@media (max-width: 480px) {
  :root { --header-height: 44px; }
  .header-inner { padding: 0 0.625rem; }
  .site-branding { gap: 0.375rem; }
  .site-title { font-size: 0.8125rem; }
  .site-logo img { height: 24px; }

  /* Hero */
  .hero-banner { padding: 0.875rem 0; }
  .hero-text h2 { font-size: 1rem; line-height: 1.35; }
  .hero-text p { font-size: 0.75rem; -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
  .hero-cta .btn { padding: 0.375rem 0.875rem; font-size: 0.75rem; }

  /* Features — hide text on very small screens */
  .features-grid { grid-template-columns: repeat(4, 1fr); }
  .feature-item { padding: 0.375rem 0.125rem; }
  .feature-icon { font-size: 1rem; }
  .feature-item h3 { font-size: 0.625rem; }

  /* Category tabs — more compact */
  .category-tabs { padding: 0.375rem; gap: 0.1875rem; }
  .category-tab { padding: 0.1875rem 0.5rem; font-size: 0.6875rem; }
  .tab-operator { padding: 0.1875rem 0.375rem !important; }
  .tab-operator img { height: 16px; }
  .tab-operator span { font-size: 0.625rem; }

  /* Layout */
  .site-main { padding: 0 0.5rem; }

  /* Article cards — smaller left image */
  .posts-grid { gap: 0.5rem; }
  .post-card { border-radius: 6px; grid-template-columns: 90px 1fr; }
  .post-card .post-thumbnail { aspect-ratio: 1/1; min-height: 70px; }
  .post-card .post-content { padding: 0.375rem 0.5rem; }
  .post-card .entry-title { font-size: 0.75rem; }
  .post-excerpt { font-size: 0.625rem; }
  .post-meta { font-size: 0.5625rem; }
  .post-category { font-size: 0.5625rem; padding: 0.0625rem 0.3125rem; }

  /* Single article */
  .single-post .entry-header { padding: 0.75rem 0.625rem; }
  .single-post .entry-title { font-size: 1rem; }
  .single-post .entry-content { padding: 0.625rem; font-size: 0.875rem; line-height: 1.7; }
  .entry-featured-image img { max-height: 160px; }
  .breadcrumb { font-size: 0.6875rem; }

  /* Footer */
  .footer-bottom { padding: 0.75rem 0.625rem; font-size: 0.6875rem; }
  .footer-icp img { height: 14px; }
}

/* ========================================
   Responsive — Small Phone (≤360px)
   ======================================== */
@media (max-width: 360px) {
  :root { --header-height: 42px; }
  .header-inner { padding: 0 0.5rem; }
  .site-title { font-size: 0.75rem; }
  .site-logo img { height: 22px; }
  .menu-toggle { padding: 0.25rem; }

  /* Hero */
  .hero-banner { padding: 0.625rem 0; }
  .hero-text h2 { font-size: 0.9375rem; }
  .hero-text p { font-size: 0.6875rem; }
  .hero-cta .btn { padding: 0.3125rem 0.75rem; font-size: 0.6875rem; }
  .hero-cta { flex-direction: column; gap: 0.375rem; }
  .hero-cta .btn-outline { display: none; }

  /* Features */
  .feature-icon { font-size: 0.875rem; }
  .feature-item h3 { font-size: 0.5625rem; }

  /* Category tabs */
  .category-tabs { padding: 0.25rem 0.375rem; }
  .category-tab { padding: 0.125rem 0.375rem; font-size: 0.625rem; }
  .tab-operator { padding: 0.125rem 0.25rem !important; gap: 0.125rem; }
  .tab-operator img { height: 14px; }
  .tab-operator span { font-size: 0.5625rem; }

  /* Article cards */
  .post-card { grid-template-columns: 80px 1fr; }
  .post-card .post-thumbnail { aspect-ratio: 1/1; min-height: 60px; }
  .post-card .post-content { padding: 0.3125rem 0.375rem; }
  .post-card .entry-title { font-size: 0.6875rem; }
  .post-excerpt { display: none; }
  .post-meta { font-size: 0.5rem; }

  /* Single */
  .single-post .entry-title { font-size: 0.9375rem; }
  .single-post .entry-content { padding: 0.5rem; font-size: 0.8125rem; }
  .entry-featured-image img { max-height: 140px; }
}

/* ========================================
   Responsive — Extra Small (≤320px)
   ======================================== */
@media (max-width: 320px) {
  :root { --header-height: 40px; }
  .site-title { font-size: 0.6875rem; }
  .site-logo img { height: 20px; }

  .hero-text h2 { font-size: 0.875rem; }
  .hero-text p { font-size: 0.625rem; -webkit-line-clamp: 1; }

  /* Article cards */
  .post-card { grid-template-columns: 72px 1fr; }
  .post-card .post-thumbnail { aspect-ratio: 1/1; min-height: 56px; }
  .post-card .entry-title { font-size: 0.625rem; -webkit-line-clamp: 1; }
  .post-meta span:nth-child(2),
  .post-meta span:nth-child(3) { display: none; }
}

/* ========================================
   Accessibility
   ======================================== */
.screen-reader-text { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
body.using-mouse :focus-visible { outline: none; }

@media print {
  .site-header, .widget-area, .post-navigation, .back-to-top, .reading-progress, .hero-banner, .features-section, .category-tabs, .kefu-float { display: none !important; }
  .site-main { grid-template-columns: 1fr; margin: 0; padding: 0; }
  .single-post .entry-header, .single-post .entry-content { box-shadow: none; padding: 0; border: none; border-radius: 0; }
  .single-post .entry-content { font-size: 12pt; }
}