/* ============================================================
   健康生活小贴士 - 主样式表
   全端自适应，移动优先
   ============================================================ */

/* Reset & Base */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{font-size:16px;scroll-behavior:smooth;scroll-padding-top:65px}
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;line-height:1.7;color:#1a1a2e;background:#fafafa;-webkit-font-smoothing:antialiased;padding-bottom:65px}
@media(min-width:769px){body{padding-bottom:0}}
img{max-width:100%;height:auto;display:block}
a{color:#2563eb;text-decoration:none}
a:hover{color:#1d4ed8;text-decoration:underline}
a:focus-visible{outline:2px solid #2563eb;outline-offset:2px;border-radius:4px}
.container{max-width:1200px;margin:0 auto;padding:0 16px}
@media(min-width:768px){.container{padding:0 24px}}

/* Skip link */
.skip-link{position:absolute;top:-100px;left:8px;padding:8px 16px;background:#2563eb;color:#fff;z-index:1000;border-radius:0 0 8px 8px}
.skip-link:focus{top:0;text-decoration:none}

/* Header */
.site-header{background:#fff;border-bottom:1px solid #e5e7eb;position:sticky;top:0;z-index:100}
.header-inner{display:flex;align-items:center;justify-content:space-between;height:54px;gap:8px}
@media(min-width:768px){.header-inner{height:60px}}
.site-logo{display:flex;align-items:center;gap:8px;font-size:1.05rem;font-weight:700;color:#1a1a2e;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;flex:1}
@media(min-width:768px){.site-logo{font-size:1.2rem;gap:10px;flex:none}}
.site-logo img{width:32px;height:32px;border-radius:6px;flex-shrink:0}
.site-logo-img{max-height:36px!important;width:auto!important;height:auto!important;max-width:140px!important;object-fit:contain;border-radius:0}
@media(min-width:768px){.site-logo-img{max-height:44px!important;max-width:180px!important}}

/* Navigation */
.site-nav{display:none}
@media(min-width:769px){.site-nav{display:flex;gap:4px}}
body.nav-open .site-nav{display:flex;flex-direction:column;position:absolute;top:54px;left:0;right:0;background:#fff;border-bottom:1px solid #e5e7eb;padding:10px 16px;box-shadow:0 10px 20px rgba(0,0,0,.1);max-height:80vh;overflow-y:auto;z-index:99}
@media(min-width:769px){body.nav-open .site-nav{position:static;flex-direction:row;padding:0;box-shadow:none;border:none;max-height:none}}
.nav-link{padding:6px 12px;border-radius:6px;font-size:.85rem;font-weight:500;color:#4b5563;transition:background .2s;white-space:nowrap}
@media(min-width:768px){.nav-link{font-size:.9rem;padding:6px 14px}}
.nav-link:hover,.nav-link.active{background:#eff6ff;color:#2563eb;text-decoration:none}
.nav-cat{font-size:.8rem}

/* Nav category dropdown */
.nav-more{position:relative}
.nav-more .nav-sub{display:none;position:absolute;top:100%;left:0;margin-top:4px;background:#fff;border:1px solid #e5e7eb;border-radius:8px;box-shadow:0 10px 25px rgba(0,0,0,.1);min-width:150px;z-index:200;padding:6px 0}
@media(max-width:768px){.nav-more .nav-sub{position:static;box-shadow:none;border:none;padding-left:16px}}
.nav-more:hover .nav-sub,.nav-more:focus-within .nav-sub{display:block}
.nav-sub a{display:block;padding:8px 16px;font-size:.82rem;color:#4b5563}
.nav-sub a:hover{background:#f3f4f6;color:#2563eb;text-decoration:none}

/* Language Switcher */
.header-right{display:flex;align-items:center;gap:4px;flex-shrink:0}
@media(min-width:768px){.header-right{gap:6px}}
.lang-switcher{position:relative}
.lang-btn{display:flex;align-items:center;gap:4px;padding:5px 10px;border:1px solid #d1d5db;border-radius:6px;background:#fff;font-size:.82rem;cursor:pointer;color:#374151;font-weight:600;transition:border-color .2s;font-family:inherit}
.lang-btn:hover{border-color:#2563eb}
.lang-dropdown{display:none;position:absolute;top:100%;right:0;margin-top:4px;background:#fff;border:1px solid #e5e7eb;border-radius:8px;box-shadow:0 10px 25px rgba(0,0,0,.1);min-width:60px;z-index:200;overflow:hidden}
.lang-switcher:hover .lang-dropdown,.lang-switcher:focus-within .lang-dropdown{display:block}
.lang-option{display:block;padding:7px 14px;font-size:.82rem;color:#374151;font-weight:600;text-align:center;transition:background .15s}
.lang-option:hover{background:#f3f4f6;text-decoration:none}
.lang-option.active{background:#eff6ff;color:#2563eb}

/* Mobile menu button */
.mobile-menu-btn{display:flex;flex-direction:column;gap:4px;padding:8px;border:none;background:none;cursor:pointer}
.mobile-menu-btn span{display:block;width:20px;height:2px;background:#374151;border-radius:1px;transition:.3s}
@media(min-width:769px){.mobile-menu-btn{display:none}}

/* Hero */
.hero{padding:40px 0 30px;text-align:center;background:linear-gradient(135deg,#eff6ff 0%,#faf5ff 100%)}
@media(min-width:768px){.hero{padding:60px 0 40px}}
.hero h1{font-size:1.4rem;font-weight:800;color:#111827;margin-bottom:10px}
@media(min-width:768px){.hero h1{font-size:2.2rem}}
.hero-desc{font-size:.95rem;color:#6b7280;max-width:600px;margin:0 auto;padding:0 16px}
@media(min-width:768px){.hero-desc{font-size:1.05rem}}

/* Article Grid */
.articles-section{padding:30px 0 50px}
.section-title{font-size:1.2rem;font-weight:700;margin-bottom:18px;color:#111827}
@media(min-width:768px){.section-title{font-size:1.4rem;margin-bottom:24px}}
.section-title a{color:inherit}
.section-title a:hover{color:#2563eb;text-decoration:none}
.category-section{padding-top:8px}
.category-section+.category-section{margin-top:-16px}
.article-grid{display:grid;grid-template-columns:1fr;gap:16px}
@media(min-width:600px){.article-grid{grid-template-columns:repeat(2,1fr);gap:20px}}
@media(min-width:900px){.article-grid{grid-template-columns:repeat(3,1fr);gap:24px}}
.article-card{background:#fff;border-radius:10px;overflow:hidden;box-shadow:0 1px 3px rgba(0,0,0,.06);transition:transform .2s}
.article-card:hover{transform:translateY(-2px);box-shadow:0 8px 25px rgba(0,0,0,.1)}
.card-link{display:block;color:inherit}
.card-link:hover{text-decoration:none}
.card-image{aspect-ratio:16/9;overflow:hidden;background:#f3f4f6}
.card-image img{width:100%;height:100%;object-fit:cover;transition:transform .3s}
.article-card:hover .card-image img{transform:scale(1.05)}
.card-body{padding:14px}
@media(min-width:768px){.card-body{padding:18px}}
.card-category{display:inline-block;padding:2px 8px;background:#eff6ff;color:#2563eb;border-radius:10px;font-size:.72rem;font-weight:600;margin-bottom:6px}
.card-title{font-size:1rem;font-weight:700;color:#111827;margin-bottom:6px;line-height:1.4;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
@media(min-width:768px){.card-title{font-size:1.1rem}}
.card-excerpt{font-size:.85rem;color:#6b7280;margin-bottom:10px;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.card-time{font-size:.78rem;color:#9ca3af}

/* Related Articles - 移动端一行一篇，标题完整显示 */
.related-grid{display:grid;grid-template-columns:1fr;gap:12px}
@media(min-width:600px){.related-grid{grid-template-columns:repeat(2,1fr);gap:16px}}
@media(min-width:900px){.related-grid{grid-template-columns:repeat(3,1fr);gap:20px}}
.related-grid .card-title{-webkit-line-clamp:3}

/* Breadcrumb */
.article-breadcrumb{padding:12px 0;font-size:.82rem;color:#6b7280;display:flex;align-items:center;gap:4px;flex-wrap:wrap}
.article-breadcrumb a{color:#2563eb}
.article-breadcrumb a:hover{color:#1d4ed8;text-decoration:underline}
.crumb-sep{color:#d1d5db;user-select:none}

/* Detail */
.page-list,.page-detail{padding-top:20px}
.page-title{font-size:1.3rem;font-weight:800;margin-bottom:20px;color:#111827}
@media(min-width:768px){.page-title{font-size:1.6rem}}
.article-container{max-width:750px;margin:0 auto;padding-bottom:40px}
.article-header{margin-bottom:20px}
.article-title{font-size:1.3rem;font-weight:800;color:#111827;line-height:1.3;margin-bottom:10px}
@media(min-width:768px){.article-title{font-size:1.8rem}}
.article-meta{display:flex;gap:12px;font-size:.85rem;color:#9ca3af}
.article-content{font-size:.95rem;line-height:1.8;color:#374151;word-wrap:break-word}
@media(min-width:768px){.article-content{font-size:1.05rem}}
.article-content h2{font-size:1.2rem;font-weight:700;color:#111827;margin:28px 0 12px}
@media(min-width:768px){.article-content h2{font-size:1.35rem}}
.article-content h3{font-size:1.05rem;font-weight:600;color:#1f2937;margin:22px 0 10px}
.article-content p{margin-bottom:16px}
.article-content ul,.article-content ol{margin:0 0 16px 20px}
.article-content li{margin-bottom:6px}
.article-content img{border-radius:8px;margin:16px auto;height:auto}
.article-content a{color:#2563eb;text-decoration:underline}
.article-content blockquote{border-left:3px solid #2563eb;padding:10px 16px;margin:20px 0;background:#f8fafc;border-radius:0 8px 8px 0;font-style:italic;color:#4b5563}
.article-content table{width:100%;border-collapse:collapse;margin:16px 0;font-size:.9rem;display:block;overflow-x:auto}
.article-content th,.article-content td{padding:8px 10px;border:1px solid #e5e7eb;text-align:left}
.article-content th{background:#f8fafc;font-weight:600}
.article-content code{background:#f3f4f6;padding:2px 5px;border-radius:3px;font-size:.88em;word-break:break-word}
.article-content pre{background:#1e293b;color:#e2e8f0;padding:14px 16px;border-radius:8px;overflow-x:auto;font-size:.85rem;line-height:1.5;margin:16px 0}

/* Article Tags */
.article-tags{display:flex;flex-wrap:wrap;gap:6px;margin:24px 0 8px;padding-top:16px;border-top:1px solid #e5e7eb}
.tag-link{padding:4px 12px;background:#f3f4f6;color:#6b7280;border-radius:16px;font-size:.8rem}
.tag-link:hover{background:#eff6ff;color:#2563eb;text-decoration:none}

/* Previous & Next */
.article-prev-next{margin-top:30px;padding-top:20px;border-top:1px solid #e5e7eb}
.prev-next-inner{display:flex;flex-direction:column;gap:12px}
@media(min-width:500px){.prev-next-inner{flex-direction:row}}
.prev-link,.next-link{flex:1;padding:14px;border:1px solid #e5e7eb;border-radius:8px;color:inherit}
.prev-link:hover,.next-link:hover{border-color:#2563eb;background:#f8faff;text-decoration:none}
.next-link{text-align:left}
@media(min-width:500px){.next-link{text-align:right}}
.pn-label{display:block;font-size:.78rem;color:#9ca3af;margin-bottom:3px}
.pn-title{font-size:.85rem;font-weight:600;color:#1f2937;line-height:1.4;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}

/* Related */
.related-articles{margin-top:30px;padding-top:20px;border-top:1px solid #e5e7eb}
.related-articles h3{font-size:1.1rem;font-weight:700;margin-bottom:16px}

/* Pagination */
.pagination{display:flex;justify-content:center;align-items:center;gap:4px;margin-top:30px;flex-wrap:wrap}
.pagination a,.pagination span{padding:7px 12px;border-radius:6px;font-size:.85rem}
.pagination a{border:1px solid #d1d5db;color:#374151}
.pagination a:hover{background:#eff6ff;border-color:#2563eb;color:#2563eb;text-decoration:none}
.page-current{background:#2563eb;color:#fff;font-weight:600}

/* View All */
.view-all{text-align:center;margin-top:24px}
.btn-view-all{display:inline-block;padding:8px 22px;border:2px solid #2563eb;border-radius:8px;color:#2563eb;font-weight:600;font-size:.85rem}
.btn-view-all:hover{background:#2563eb;color:#fff;text-decoration:none}

/* Empty State */
.empty-state{text-align:center;padding:50px 20px;color:#9ca3af}

/* 404 */
.page-404{text-align:center;padding:80px 20px}
.page-404 h1{font-size:4rem;font-weight:800;color:#2563eb}
@media(min-width:768px){.page-404 h1{font-size:5rem}}
.page-404 a{display:inline-block;padding:10px 24px;background:#2563eb;color:#fff;border-radius:8px;font-weight:600}
.page-404 a:hover{background:#1d4ed8;color:#fff;text-decoration:none}

/* Ad Slots */
.ad-slot:empty{display:none}
.ad-slot{margin:16px auto;max-width:1200px;text-align:center;overflow:hidden}

/* Footer */
.site-footer{background:#111827;color:#d1d5db;padding:30px 0 80px;margin-top:40px}
@media(min-width:769px){.site-footer{padding:40px 0 30px}}
.footer-links{margin-bottom:20px}
.footer-links h4{font-size:.9rem;font-weight:600;color:#fff;margin-bottom:10px}
.footer-links ul{list-style:none;display:flex;flex-wrap:wrap;gap:10px}
.footer-links a{color:#9ca3af;font-size:.82rem}
.footer-links a:hover{color:#fff;text-decoration:none}

/* Footer Search */
.footer-search{margin-bottom:20px}
.footer-search form{display:flex;gap:8px;max-width:400px}
.footer-search input{flex:1;padding:10px 14px;border:1px solid #374151;border-radius:8px;background:#1f2937;color:#e5e7eb;font-size:.85rem;font-family:inherit}
.footer-search input::placeholder{color:#6b7280}
.footer-search button{padding:10px 18px;background:#2563eb;color:#fff;border:none;border-radius:8px;font-weight:600;font-size:.85rem;cursor:pointer;white-space:nowrap}
.footer-search button:hover{background:#1d4ed8}

.footer-info{text-align:center;padding-top:16px;border-top:1px solid #1f2937;font-size:.82rem}
.footer-lang-links{margin-top:6px;display:flex;justify-content:center;gap:10px;flex-wrap:wrap}
.footer-lang-links a{color:#6b7280;font-size:.78rem}
@media(max-width:600px){.footer-lang-links a{width:25%;text-align:center;font-size:.75rem}}
.footer-lang-links a:hover{color:#d1d5db}

/* Mobile Bottom Bar */
.mobile-bottom-bar{position:fixed;bottom:0;left:0;right:0;background:#fff;border-top:1px solid #e5e7eb;display:flex;z-index:999;height:56px;box-shadow:0 -2px 10px rgba(0,0,0,.06)}
@media(min-width:769px){.mobile-bottom-bar{display:none}}
.mob-bar-item{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:6px 0;color:#6b7280;font-size:.7rem;cursor:pointer;border:none;background:none;font-family:inherit}
.mob-bar-item:hover{color:#2563eb;text-decoration:none}
.mob-bar-item svg{display:block}

/* Mobile Category Drawer */
.mob-cats-drawer{position:fixed;bottom:0;left:0;right:0;background:#fff;border-radius:16px 16px 0 0;z-index:1000;transform:translateY(100%);transition:transform .3s ease;max-height:70vh;overflow-y:auto;box-shadow:0 -4px 20px rgba(0,0,0,.15)}
.mob-cats-drawer.open{transform:translateY(0)}
.mob-cats-header{display:flex;justify-content:space-between;align-items:center;padding:16px 20px;border-bottom:1px solid #e5e7eb;font-weight:700;font-size:.95rem;position:sticky;top:0;background:#fff;z-index:1}
.mob-cats-header button{border:none;background:none;font-size:1.5rem;cursor:pointer;color:#6b7280;padding:0 4px}
.mob-cats-list{padding:8px 0}
.mob-cats-list a{display:block;padding:12px 20px;font-size:.9rem;color:#374151;border-bottom:1px solid #f3f4f6}
.mob-cats-list a:hover{background:#f8faff;color:#2563eb;text-decoration:none}
.mob-cats-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.4);z-index:999;display:none}
.mob-cats-overlay.show{display:block}

/* Cookie Banner */
.cookie-banner{position:fixed;bottom:56px;left:0;right:0;background:#111827;color:#d1d5db;padding:12px 16px;z-index:998;display:none;font-size:.82rem}
@media(min-width:769px){.cookie-banner{bottom:0}}
.cookie-banner.show{display:block}
.cookie-inner{max-width:1200px;margin:0 auto;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.cookie-text{flex:1;min-width:180px}
.cookie-text a{color:#93c5fd}
.cookie-btn{flex-shrink:0;padding:7px 20px;background:#2563eb;color:#fff;border:none;border-radius:6px;font-weight:600;font-size:.82rem;cursor:pointer;white-space:nowrap}

/* Print */
@media print{
  .site-header,.site-footer,.mobile-bottom-bar,.mob-cats-drawer,.mob-cats-overlay,.ad-slot,.cookie-banner,.related-articles,.article-prev-next{display:none!important}
  body{padding-bottom:0;background:#fff;color:#000;font-size:12pt}
  .hero{background:none;padding:20px 0}
  .article-card{box-shadow:none;border:1px solid #ddd;break-inside:avoid}
}

.list-grid .article-card{margin-bottom:0}
