/* ========== 健康养生知识平台 - 蓝色主题 ========== */
:root {
    --primary: #3B82F6;
    --primary-dark: #2563EB;
    --primary-light: #93C5FD;
    --bg-body: #F0F5FF;
    --bg-card: #FFFFFF;
    --text-dark: #1E293B;
    --text-gray: #64748B;
    --text-light: #94A3B8;
    --border: #E2E8F0;
    --radius: 10px;
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
    --tag-bg: #EFF6FF;
    --tag-color: #3B82F6;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; background: var(--bg-body); color: var(--text-dark); line-height: 1.6; }
a { color: var(--text-dark); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary); }
img { max-width: 100%; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ========== Header ========== */
.site-header { position: sticky; top: 0; z-index: 100; background: #fff; border-bottom: 1px solid var(--border); box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.site-logo { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; color: var(--primary); }
.site-logo i { font-size: 22px; }
.main-nav { display: flex; gap: 24px; }
.main-nav a { font-size: 15px; color: var(--text-dark); font-weight: 500; padding: 4px 0; border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav a.active { color: var(--primary); border-bottom-color: var(--primary); }
.header-right { display: flex; align-items: center; gap: 16px; }
.search-box { display: flex; align-items: center; background: var(--bg-body); border-radius: 20px; padding: 6px 14px; }
.search-box input { border: none; background: none; outline: none; font-size: 14px; width: 160px; }
.search-box button { border: none; background: none; cursor: pointer; color: var(--text-gray); font-size: 16px; }
.header-links a { font-size: 14px; color: var(--text-gray); }
.header-links a:hover { color: var(--primary); }

/* ========== Carousel ========== */
.carousel-section { margin-top: 0; }
.carousel { position: relative; width: 100%; height: 420px; overflow: hidden; }
.carousel-slide { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity .6s ease; pointer-events: none; }
.carousel-slide.active { opacity: 1; pointer-events: auto; }
.carousel-overlay { position: absolute; bottom: 0; left: 0; right: 0; padding: 40px 60px; background: linear-gradient(transparent, rgba(0,0,0,.65)); color: #fff; }
.carousel-overlay h2 { font-size: 28px; margin-bottom: 8px; }
.carousel-overlay h2 a { color: #fff; }
.carousel-overlay p { font-size: 15px; opacity: .85; }
.carousel-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.3); border: none; color: #fff; font-size: 24px; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; backdrop-filter: blur(4px); transition: background .2s; }
.carousel-btn:hover { background: rgba(255,255,255,.5); }
.carousel-btn.prev { left: 16px; }
.carousel-btn.next { right: 16px; }

/* ========== Info Cards (热门/最赞/标签) ========== */
.info-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 30px 0; }
.info-card { background: var(--bg-card); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.info-card h3 { font-size: 17px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; color: var(--text-dark); }
.info-card h3 i { color: var(--primary); }
.rank-list { list-style: none; }
.rank-list li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid #f5f5f5; }
.rank-list li:last-child { border-bottom: none; }
.rank-num { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 6px; font-size: 12px; font-weight: 700; background: #f1f5f9; color: var(--text-gray); flex-shrink: 0; }
.rank-num.top { background: var(--primary); color: #fff; }
.rank-info { flex: 1; min-width: 0; }
.rank-info a { font-size: 14px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-meta { font-size: 12px; color: var(--text-light); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-item { display: inline-block; padding: 5px 14px; background: var(--tag-bg); color: var(--tag-color); border-radius: 16px; font-size: 13px; transition: all .2s; }
.tag-item:hover { background: var(--primary); color: #fff; }

/* ========== Latest Articles (横向卡片) ========== */
.latest-section { margin-bottom: 40px; }
.section-title { font-size: 22px; font-weight: 700; margin-bottom: 20px; padding-left: 12px; border-left: 4px solid var(--primary); }
.article-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.article-row-card { display: flex; background: var(--bg-card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
.article-row-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.1); }
.row-card-image { position: relative; width: 140px; min-height: 120px; flex-shrink: 0; overflow: hidden; }
.row-card-image img { width: 100%; height: 100%; object-fit: cover; }
.row-card-cat { position: absolute; bottom: 6px; left: 6px; background: var(--primary); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.row-card-body { flex: 1; padding: 14px; display: flex; flex-direction: column; justify-content: center; }
.row-card-body h3 { font-size: 15px; margin-bottom: 6px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row-card-body p { font-size: 13px; color: var(--text-gray); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 8px; }
.row-card-meta { display: flex; gap: 12px; font-size: 12px; color: var(--text-light); }
.row-card-meta i { margin-right: 3px; }

/* ========== Pagination ========== */
.pagination { display: flex; justify-content: center; gap: 6px; margin: 30px 0; flex-wrap: wrap; }
.pagination a { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; color: var(--text-gray); background: #fff; }
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ========== Article Detail ========== */
.article-layout { display: grid; grid-template-columns: 1fr 300px; gap: 24px; margin: 24px 0; }
.article-main { background: var(--bg-card); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }
.article-main h1 { font-size: 26px; line-height: 1.4; margin-bottom: 16px; }
.article-meta { display: flex; gap: 16px; color: var(--text-gray); font-size: 14px; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.article-content { font-size: 16px; line-height: 1.8; }
.article-content h2 { font-size: 20px; margin: 24px 0 12px; padding-left: 10px; border-left: 3px solid var(--primary); }
.article-content h3 { font-size: 18px; margin: 20px 0 10px; }
.article-content p { margin-bottom: 14px; }
.article-content img { border-radius: 8px; margin: 12px 0; }
.article-tags { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 8px; }
.article-actions { display: flex; gap: 12px; margin-top: 20px; }
.action-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 20px; border: 1px solid var(--border); border-radius: 20px; background: #fff; cursor: pointer; font-size: 14px; color: var(--text-gray); transition: all .2s; }
.action-btn:hover, .action-btn.active { border-color: var(--primary); color: var(--primary); }
.prev-next { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.prev-next a { display: block; padding: 14px; background: var(--bg-body); border-radius: var(--radius); font-size: 14px; }
.prev-next a span { display: block; font-size: 12px; color: var(--text-light); margin-bottom: 4px; }

/* ========== Sidebar ========== */
.sidebar { display: flex; flex-direction: column; gap: 20px; }
.sidebar-card { background: var(--bg-card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.sidebar-card h3 { font-size: 16px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid var(--primary); }
.sidebar-article { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f5f5f5; }
.sidebar-article:last-child { border-bottom: none; }
.sidebar-article img { width: 70px; height: 50px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.sidebar-article-info h4 { font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sidebar-article-info span { font-size: 12px; color: var(--text-light); }

/* ========== Category/Tag/Search Page ========== */
.page-header { background: var(--primary); color: #fff; padding: 32px 0; margin-bottom: 24px; }
.page-header h1 { font-size: 24px; }
.page-header p { opacity: .85; font-size: 15px; margin-top: 6px; }
.article-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 30px; }

/* ========== Footer ========== */
.site-footer { background: #1E293B; color: #CBD5E1; padding: 40px 0 20px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.footer-grid h4 { color: #fff; font-size: 16px; margin-bottom: 14px; }
.footer-grid p { font-size: 14px; line-height: 1.7; }
.footer-grid a { color: #94A3B8; font-size: 14px; }
.footer-grid a:hover { color: #fff; }
.footer-grid ul { list-style: none; }
.footer-grid ul li { margin-bottom: 8px; }
.footer-bottom { text-align: center; padding-top: 20px; margin-top: 30px; border-top: 1px solid #334155; font-size: 13px; color: #64748B; max-width: 1200px; margin-left: auto; margin-right: auto; padding-left: 20px; padding-right: 20px; }

/* ========== Auth Pages ========== */
.auth-container { max-width: 400px; margin: 60px auto; background: var(--bg-card); border-radius: var(--radius); padding: 40px; box-shadow: var(--shadow); }
.auth-container h2 { text-align: center; margin-bottom: 24px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; outline: none; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,130,246,.1); }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 24px; border: none; border-radius: 8px; font-size: 14px; cursor: pointer; transition: all .2s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: #10B981; color: #fff; }
.btn-success:hover { background: #059669; }
.btn-danger { background: #EF4444; color: #fff; }
.btn-danger:hover { background: #DC2626; }
.btn-block { width: 100%; }
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.alert-success { background: #D1FAE5; color: #065F46; }
.alert-error { background: #FEE2E2; color: #991B1B; }

/* ========== 404 ========== */
.error-page { text-align: center; padding: 80px 20px; }
.error-page h1 { font-size: 72px; color: var(--primary); }
.error-page p { font-size: 18px; color: var(--text-gray); margin: 16px 0 24px; }

/* ========== Admin ========== */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.admin-sidebar { background: #1E293B; color: #fff; padding: 20px 0; }
.admin-sidebar .brand { padding: 0 20px 20px; font-size: 18px; font-weight: 700; border-bottom: 1px solid #334155; margin-bottom: 10px; }
.admin-sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 12px 20px; color: #94A3B8; font-size: 14px; transition: all .2s; }
.admin-sidebar nav a:hover, .admin-sidebar nav a.active { background: #334155; color: #fff; }
.admin-main { padding: 24px; background: #F8FAFC; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.admin-header h1 { font-size: 22px; }
.card { background: #fff; border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 20px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); text-align: center; }
.stat-card .num { font-size: 32px; font-weight: 700; color: var(--primary); }
.stat-card .label { font-size: 14px; color: var(--text-gray); margin-top: 4px; }
table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
table th { background: #F8FAFC; font-weight: 600; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 12px; }
.badge-success { background: #D1FAE5; color: #065F46; }
.badge-danger { background: #FEE2E2; color: #991B1B; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ========== Responsive ========== */
@media (max-width: 768px) {
    html, body { overflow-x: hidden; }
    .info-cards { grid-template-columns: 1fr; }
    .article-list, .article-grid { grid-template-columns: 1fr; }
    .article-layout { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .hamburger { display: block; }
    .main-nav { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.1); padding: 12px 0; z-index: 999; }
    .main-nav.open { display: flex; }
    .main-nav a { padding: 10px 20px; border-bottom: none; }
    .carousel { height: 200px; }
    .carousel-slide h2 { font-size: 18px; }
    .carousel-slide p { font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar { display: none; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .header-inner { flex-wrap: wrap; height: auto; padding: 8px 12px; }
    .header-top-row { padding: 8px 0; gap: 8px; }
    .header-bottom-row { position: relative; padding: 6px 0; }
    .search-box { max-width: 200px; }
    .site-logo { font-size: 16px; }
    .user-menu { margin-left: auto; gap: 6px; }
    .btn-small { padding: 3px 10px; font-size: 12px; }
    .container { padding: 0 12px; }
    .row-card-meta { font-size: 11px; gap: 6px; }
    .row-card-meta span { white-space: nowrap; }
    .article-row-card { flex-direction: column; }
    .row-card-image { width: 100%; height: 180px; }
    .row-card-image img { width: 100%; height: 100%; object-fit: cover; }
    .row-card-body h3 { font-size: 16px; }
    .row-card-body p { font-size: 13px; }
    .page-header h1 { font-size: 22px; }
    .section-title { font-size: 20px; }
    .pagination { flex-wrap: wrap; }
    .footer { padding: 30px 0 20px; }
    .footer-grid { gap: 20px; }
}


/* Hamburger menu */
.hamburger { display: none; background: none; border: none; font-size: 22px; color: var(--text-dark); cursor: pointer; padding: 4px 8px; }
/* ========== 两行Header布局 ========== */
.site-header { position: sticky; top: 0; z-index: 100; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.header-inner { padding: 0 20px; }
.header-top-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid #f0f0f0; }
.header-bottom-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; }
.user-menu { display: flex; align-items: center; gap: 12px; font-size: 14px; margin-left: 24px; }
.user-name { color: #64748B; }
.user-name i { margin-right: 4px; }
.btn-small { display: inline-block; padding: 4px 14px; border-radius: 16px; font-size: 13px; background: #3B82F6; color: #fff; }
.btn-small:hover { background: #2563EB; color: #fff; }
.btn-small.btn-outline { background: transparent; color: #64748B; border: 1px solid #E2E8F0; }
.btn-small.btn-outline:hover { border-color: #3B82F6; color: #3B82F6; }

/* Logo与搜索框间距 */
.header-top-row { gap: 40px; }
.search-box { flex: 1; max-width: 400px; }
.site-logo { white-space: nowrap; flex-shrink: 0; }
.pagination .dots { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; font-size: 14px; color: var(--text-gray); }
