/*
Theme Name: Hongxianyun Blog
Theme URI: https://www.hongxianyun.cn/
Description: 云中红线婚恋系统服务 - WordPress博客主题（匹配现有文章页面风格，mobile-first 优化）
Version: 1.1.0
Author: QClaw
Author URI: https://www.hongxianyun.cn/
*/

:root {
    --primary: #FF4D4F;
    --primary-dark: #E03E3E;
    --primary-light: #FFF1F0;
    --accent: #FF6B35;
    --gradient-start: #FF6B35;
    --gradient-end: #FF2E63;
    --text: #1a1a2e;
    --text-secondary: #555;
    --text-light: #888;
    --bg: #ffffff;
    --bg-warm: #faf8f5;
    --border: #f0f0f0;
    --shadow: 0 4px 20px rgba(0,0,0,0.06);
    --radius: 16px;
    --max-width: 1200px;
    --navbar-height: 64px;
    --tab-height: 48px;
}

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

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--text);
    line-height: 1.7;
    background: var(--bg);
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

/* ========== PC 端 导航栏 ========== */
.navbar {
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 100000;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

body.admin-bar .navbar { top: 32px; }
body.admin-bar .articles-container,
body.admin-bar .article-wrap { padding-top: 132px; }

.navbar-inner {
    max-width: var(--max-width); margin: 0 auto;
    padding: 0 24px; height: var(--navbar-height);
    display: flex; align-items: center; justify-content: space-between;
    gap: 20px;
}

.logo {
    display: flex; align-items: center; gap: 10px;
    font-size: 20px; font-weight: 800; color: var(--text); text-decoration: none;
    flex-shrink: 0; min-width: 0;
}

.logo-icon { width: 32px; height: 32px; border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.logo-icon img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 8px; }
.logo span {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}

.nav-links { display: flex; gap: 28px; align-items: center; flex-shrink: 0; }
.nav-links a { color: var(--text-secondary); text-decoration: none; font-size: 15px; font-weight: 500; transition: color 0.2s; white-space: nowrap; }
.nav-links a:hover { color: var(--primary); }

/* 移动端导航条 - PC 端隐藏 */
.mobile-nav { display: none; }
.hamburger, .mobile-drawer { display: none; }

.home-link {
    display: flex; align-items: center; gap: 6px;
    background: var(--bg-warm); padding: 6px 14px; border-radius: 8px;
    border: 1px solid var(--border);
    cursor: pointer !important; pointer-events: auto !important;
    text-decoration: none; z-index: 1000; position: relative;
    color: var(--text); font-size: 14px; font-weight: 500; white-space: nowrap;
}
.home-link:hover {
    background: var(--primary-light); border-color: var(--primary);
    color: var(--primary);
}
.home-icon { font-size: 16px; pointer-events: none; line-height: 1; }
.nav-cta {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white !important; padding: 8px 20px; border-radius: 100px; font-weight: 600;
    white-space: nowrap;
}

/* ========== 文章列表页（PC 端） ========== */
.articles-container {
    max-width: 1200px; margin: 0 auto; padding: 100px 24px 60px;
    display: flex; gap: 32px; align-items: flex-start;
}

.filter-tabs {
    width: 220px; flex-shrink: 0;
    display: flex; flex-direction: column; gap: 8px;
    padding: 20px; margin: 0;
    background: white; border: 1px solid var(--border); border-radius: 14px;
    box-shadow: var(--shadow); position: sticky; top: 88px;
}

.filter-tab {
    padding: 12px 16px; border-radius: 10px; font-size: 15px; font-weight: 500;
    color: var(--text-secondary); background: transparent; border: none;
    cursor: pointer; transition: all 0.2s ease; user-select: none;
    text-align: left; width: 100%; white-space: nowrap;
    text-decoration: none; display: block;
    font-family: inherit; line-height: 1.5;
}

.filter-tab:hover { background: var(--primary-light); color: var(--primary); }
.filter-tab.active {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white; box-shadow: 0 4px 12px rgba(255,45,99,0.2);
}

.article-list { flex: 1; min-width: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 20px; }

.article-card { display: block; text-decoration: none; color: var(--text); background: white; border: 1px solid var(--border); border-radius: 14px; padding: 28px; transition: all 0.3s ease; }
.article-card:hover { border-color: rgba(255,107,53,0.2); box-shadow: 0 8px 30px rgba(255,45,99,0.08); transform: translateY(-3px); }
.article-card h3 { font-size: 20px; font-weight: 700; margin-bottom: 10px; line-height: 1.4; }
.article-card p { font-size: 15px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-card .meta { display: flex; gap: 14px; font-size: 13px; color: var(--text-light); align-items: center; flex-wrap: wrap; }
.article-card .meta .category { background: var(--text); color: white; padding: 3px 10px; border-radius: 100px; font-weight: 600; }
.article-card .meta .tag { background: var(--primary-light); color: var(--primary); padding: 3px 10px; border-radius: 100px; font-weight: 600; }

/* ========== 文章详情页（PC 端） ========== */
.article-wrap { padding: 100px 24px 60px; max-width: 760px; margin: 0 auto; }
.article-header { margin-bottom: 40px; }
.article-breadcrumb { font-size: 13px; color: var(--text-light); margin-bottom: 16px; }
.article-breadcrumb a { color: var(--text-light); text-decoration: none; }
.article-breadcrumb a:hover { color: var(--primary); }
.article-breadcrumb span { margin: 0 6px; }

.article-title {
    font-size: 32px; font-weight: 800; line-height: 1.3;
    margin-bottom: 20px; letter-spacing: -0.5px;
}

.article-meta {
    display: flex; align-items: center; gap: 16px;
    font-size: 14px; color: var(--text-light); flex-wrap: wrap;
}

.article-meta .tag {
    background: var(--primary-light); color: var(--primary);
    padding: 4px 12px; border-radius: 100px; font-size: 13px; font-weight: 600;
}

.article-meta .category {
    background: var(--text); color: white;
    padding: 4px 12px; border-radius: 100px; font-size: 13px; font-weight: 600;
}

/* ========== 文章内容样式 ========== */
.article-content h2 {
    font-size: 22px; font-weight: 700; margin: 40px 0 16px;
    color: var(--text); line-height: 1.4;
}

.article-content h3 {
    font-size: 18px; font-weight: 700; margin: 28px 0 12px;
    color: var(--text-secondary);
}

.article-content p {
    font-size: 16px; line-height: 1.85; margin-bottom: 18px;
    color: var(--text-secondary); text-align: justify;
}

.article-content strong { color: var(--text); font-weight: 700; }
.article-content ul, .article-content ol {
    margin: 18px 0 18px 24px; color: var(--text-secondary); font-size: 16px; line-height: 1.8;
}
.article-content li { margin-bottom: 10px; }
.article-content a { color: var(--primary); text-decoration: none; }
.article-content a:hover { text-decoration: underline; }

.highlight-box {
    background: linear-gradient(135deg, #fff8f5, #fff1f0);
    border-left: 4px solid var(--primary);
    border-radius: 0 12px 12px 0;
    padding: 24px 28px; margin: 28px 0;
}

.highlight-box p { margin: 0; color: var(--text); font-weight: 500; }

.stats-row {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
    margin: 28px 0; background: var(--bg-warm); border-radius: 12px; padding: 24px;
}

.stats-item { text-align: center; }
.stats-item .num { font-size: 28px; font-weight: 800; color: var(--primary); }
.stats-item .label { font-size: 13px; color: var(--text-light); margin-top: 4px; }

.case-card {
    background: var(--bg-warm); border-radius: 14px; padding: 24px 28px; margin: 24px 0;
    border: 1px solid var(--border);
}

.case-card h4 { font-size: 17px; font-weight: 700; margin-bottom: 10px; color: var(--text); }
.case-card p { margin-bottom: 0; font-size: 15px; }
.case-card .tag-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.case-card .tag-row span { background: white; color: var(--text-secondary); padding: 3px 10px; border-radius: 100px; font-size: 12px; border: 1px solid var(--border); }

.article-cta {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    border-radius: 16px; padding: 36px 32px; margin: 40px 0; text-align: center; color: white;
}

.article-cta h3 { font-size: 22px; font-weight: 700; margin-bottom: 12px; }
.article-cta p { font-size: 15px; opacity: 0.95; margin-bottom: 20px; }
.article-cta .btn {
    display: inline-block; background: white; color: var(--primary);
    padding: 12px 32px; border-radius: 100px; font-weight: 700; text-decoration: none;
    transition: transform 0.2s;
}
.article-cta .btn:hover { transform: translateY(-2px); }

.related-section { margin-top: 60px; padding-top: 40px; border-top: 1px solid var(--border); }
.related-section h3 { font-size: 20px; font-weight: 700; margin-bottom: 20px; }
.related-list { display: flex; flex-direction: column; gap: 14px; }
.related-item {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 20px; background: var(--bg-warm); border-radius: 12px;
    text-decoration: none; color: var(--text); transition: all 0.2s;
}
.related-item:hover { background: var(--primary-light); color: var(--primary); }
.related-item .arrow { font-size: 18px; color: var(--text-light); margin-left: auto; }

/* ========== 分页 ========== */
.pagination {
    display: flex; justify-content: center; gap: 10px; margin: 40px 0;
}

.pagination a, .pagination span {
    padding: 8px 16px; border-radius: 8px;
    background: white; border: 1px solid var(--border);
    text-decoration: none; color: var(--text-secondary);
}

.pagination .current {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white; border: none;
}

/* ========== 底部 ========== */
.footer {
    background: var(--text); color: rgba(255,255,255,0.6);
    padding: 40px 24px 24px; text-align: center; margin-top: 40px;
}

.footer-inner { max-width: var(--max-width); margin: 0 auto; }
.footer-links { display: flex; justify-content: center; gap: 28px; margin-bottom: 20px; flex-wrap: wrap; }
.footer-links a { color: rgba(255,255,255,0.6); text-decoration: none; font-size: 14px; }
.footer-links a:hover { color: white; }
.footer-company { font-size: 13px; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; }
.footer-company a.beian { color: rgba(255,255,255,0.5); text-decoration: none; }
.footer-company a.beian:hover { color: white; }

/* ============================================================ */
/* ========== 移动端响应式（汉堡菜单 v10） ========== */
/* ============================================================ */

/* 平板及以下 768px */
@media (max-width: 768px) {
    
    /* 基础字号调整 */
    body { font-size: 15px; line-height: 1.65; }
    
    /* 顶部导航 */
    .navbar-inner {
        padding: 0 16px;
        height: 56px;
        gap: 12px;
    }
    
    body.admin-bar .navbar { top: 46px; }
    body.admin-bar .articles-container,
    body.admin-bar .article-wrap { padding-top: 102px; }
    
    .logo { font-size: 15px; gap: 8px; }
    .logo-icon { width: 30px; height: 30px; border-radius: 6px; }
    .logo span { font-size: 15px; }
    
    /* PC 端导航隐藏 */
    .nav-links { display: none; }
    
    /* 汉堡按钮显示 */
    .hamburger {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 28px;
        height: 22px;
        background: transparent;
        border: none;
        padding: 0;
        cursor: pointer;
        flex-shrink: 0;
        -webkit-tap-highlight-color: transparent;
        z-index: 100001;
    }
    .hamburger-line {
        display: block;
        width: 100%;
        height: 3px;
        background: var(--text);
        border-radius: 3px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        transform-origin: center;
    }
    /* 汉堡 → X 动画 */
    .hamburger.is-active .hamburger-line:nth-child(1) {
        transform: translateY(9.5px) rotate(45deg);
    }
    .hamburger.is-active .hamburger-line:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }
    .hamburger.is-active .hamburger-line:nth-child(3) {
        transform: translateY(-9.5px) rotate(-45deg);
    }
    
    /* 抽屉菜单 */
    .mobile-drawer { display: block; }
    .mobile-drawer {
        position: fixed;
        inset: 0;
        z-index: 99999;
        pointer-events: none;
    }
    .mobile-drawer.is-open { pointer-events: auto; }
    
    .drawer-mask {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    .mobile-drawer.is-open .drawer-mask { opacity: 1; }
    
    .drawer-panel {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 78%;
        max-width: 320px;
        background: white;
        box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    .mobile-drawer.is-open .drawer-panel { transform: translateX(0); }
    
    .drawer-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 20px;
        border-bottom: 1px solid var(--border);
        flex-shrink: 0;
    }
    .drawer-title {
        font-size: 15px;
        font-weight: 600;
        color: var(--text-secondary);
    }
    .drawer-close {
        background: transparent;
        border: none;
        font-size: 28px;
        line-height: 1;
        color: var(--text-light);
        cursor: pointer;
        padding: 0;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        -webkit-tap-highlight-color: transparent;
    }
    .drawer-close:active { background: var(--bg-warm); }
    
    .drawer-nav {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 12px 0;
    }
    .drawer-link {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 14px 20px;
        color: var(--text);
        text-decoration: none;
        font-size: 15px;
        font-weight: 500;
        border: none;
        background: transparent;
        transition: background 0.15s;
        -webkit-tap-highlight-color: transparent;
    }
    .drawer-link:active { background: var(--bg-warm); }
    .drawer-link.is-active {
        background: var(--primary-light);
        color: var(--primary);
        font-weight: 700;
    }
    .drawer-icon {
        font-size: 18px;
        width: 24px;
        text-align: center;
        flex-shrink: 0;
    }
    .drawer-count {
        margin-left: auto;
        font-size: 12px;
        color: var(--text-light);
        background: var(--bg-warm);
        padding: 2px 8px;
        border-radius: 100px;
        font-weight: 600;
        min-width: 24px;
        text-align: center;
    }
    .drawer-link.is-active .drawer-count {
        background: var(--primary);
        color: white;
    }
    .drawer-actions {
        padding: 8px 0 12px;
        border-top: 1px solid var(--border);
        flex-shrink: 0;
    }
    .drawer-home {
        background: var(--bg-warm);
        margin: 8px 12px 4px;
        border-radius: 10px;
        padding: 12px 16px;
        font-weight: 600;
    }
    .drawer-cta {
        margin: 4px 12px 8px;
        padding: 14px 16px;
        background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
        color: white !important;
        border-radius: 12px;
        font-weight: 700;
        justify-content: center;
    }
    .drawer-cta .drawer-icon { filter: brightness(1.1); }
    .drawer-cta:active { opacity: 0.9; }
    
    .drawer-footer {
        padding: 16px 20px;
        border-top: 1px solid var(--border);
        text-align: center;
        flex-shrink: 0;
        background: var(--bg-warm);
    }
    .drawer-footer p {
        font-size: 13px;
        color: var(--text-secondary);
        margin: 0;
        line-height: 1.5;
    }
    .drawer-footer .drawer-sub {
        font-size: 12px;
        color: var(--text-light);
        margin-top: 4px;
    }
    
    /* 抽屉打开时禁止 body 滚动 */
    body.drawer-open { overflow: hidden; }
    
    /* 文章列表容器 */
    .articles-container {
        padding: 72px 0 32px;
        gap: 0;
        flex-direction: column;
    }
    
    /* 移动端隐藏分类筛选器 */
    .filter-tabs { display: none; }
    
    /* 文章列表 */
    .article-list {
        padding: 0 16px;
        gap: 12px;
    }
    
    /* 文章卡片 */
    .article-card {
        padding: 18px 16px;
        border-radius: 12px;
    }
    .article-card h3 {
        font-size: 17px;
        line-height: 1.45;
        margin-bottom: 8px;
        /* 2 行截断 */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .article-card p {
        font-size: 14px;
        line-height: 1.6;
        margin-bottom: 10px;
        -webkit-line-clamp: 2;
    }
    .article-card .meta {
        gap: 8px;
        font-size: 12px;
    }
    .article-card .meta .category,
    .article-card .meta .tag {
        padding: 2px 8px;
        font-size: 11px;
    }
    
    /* 文章详情页 */
    .article-wrap {
        padding: 72px 16px 32px;
    }
    body.admin-bar .article-wrap { padding-top: 102px; }
    
    .article-header { margin-bottom: 24px; }
    .article-breadcrumb { font-size: 12px; margin-bottom: 12px; }
    
    .article-title {
        font-size: 22px;
        line-height: 1.35;
        margin-bottom: 14px;
        letter-spacing: -0.3px;
    }
    .article-meta {
        gap: 10px;
        font-size: 12px;
    }
    .article-meta .tag,
    .article-meta .category {
        padding: 3px 10px;
        font-size: 11px;
    }
    
    /* 文章正文 */
    .article-content h2 {
        font-size: 19px;
        margin: 28px 0 12px;
    }
    .article-content h3 {
        font-size: 16px;
        margin: 22px 0 10px;
    }
    .article-content p {
        font-size: 15px;
        line-height: 1.8;
        margin-bottom: 14px;
    }
    .article-content ul, .article-content ol {
        margin: 14px 0 14px 20px;
        font-size: 15px;
        line-height: 1.75;
    }
    .article-content li { margin-bottom: 8px; }
    
    /* 高亮框 */
    .highlight-box {
        padding: 16px 18px;
        margin: 20px 0;
        border-radius: 0 8px 8px 0;
    }
    .highlight-box p { font-size: 14px; line-height: 1.7; }
    
    /* 数据统计行 */
    .stats-row {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 18px 16px;
        margin: 20px 0;
        border-radius: 10px;
    }
    .stats-item .num { font-size: 24px; }
    .stats-item .label { font-size: 12px; }
    
    /* 案例卡片 */
    .case-card {
        padding: 16px 18px;
        margin: 18px 0;
        border-radius: 10px;
    }
    .case-card h4 { font-size: 15px; margin-bottom: 8px; }
    .case-card p { font-size: 14px; line-height: 1.7; }
    
    /* CTA 卡片 */
    .article-cta {
        padding: 28px 22px;
        margin: 28px 0;
        border-radius: 14px;
    }
    .article-cta h3 { font-size: 18px; margin-bottom: 8px; }
    .article-cta p { font-size: 13px; margin-bottom: 16px; }
    .article-cta .btn {
        padding: 11px 26px;
        font-size: 14px;
    }
    
    /* 相关文章 */
    .related-section { margin-top: 36px; padding-top: 24px; }
    .related-section h3 { font-size: 17px; margin-bottom: 14px; }
    .related-list { gap: 10px; }
    .related-item {
        padding: 13px 14px;
        font-size: 13px;
        gap: 10px;
        border-radius: 10px;
    }
    .related-item .arrow { font-size: 16px; }
    
    /* 分页（简化：只显示上/下页+当前页） */
    .pagination {
        gap: 6px;
        margin: 24px 16px;
    }
    .pagination a, .pagination span {
        padding: 8px 14px;
        font-size: 13px;
        border-radius: 6px;
        min-width: 36px;
        text-align: center;
    }
    /* 隐藏中间页码（只保留首页/末页/当前/上下页） */
    .pagination .page-numbers:not(.current):not(.prev):not(.next):not(.first):not(.last) {
        display: none;
    }
    
    /* 底部 */
    .footer {
        padding: 32px 16px 20px;
        margin-top: 28px;
    }
    .footer-links {
        gap: 14px 20px;
        margin-bottom: 16px;
    }
    .footer-links a { font-size: 13px; }
    .footer-company { font-size: 12px; padding-top: 16px; }
    .footer-company p { margin-bottom: 4px; }
    
    /* 暂无文章 */
    .empty-tip { padding: 40px 16px; font-size: 14px; }
}

/* 小屏手机 480px 以下（更精细优化） */
@media (max-width: 480px) {
    .navbar-inner { padding: 0 12px; gap: 8px; }
    .logo { font-size: 14px; }
    .logo span { max-width: 140px; }
    .mobile-nav a { padding: 6px 12px; font-size: 12px; }
    .filter-tabs { padding: 10px 12px; }
    .filter-tab { padding: 6px 12px; font-size: 12px; }
    .article-list { padding: 0 12px; }
    .article-card { padding: 16px 14px; }
    .article-card h3 { font-size: 16px; }
    .article-card p { font-size: 13px; }
    .article-wrap { padding: 72px 12px 24px; }
    .article-title { font-size: 20px; }
    .article-content p { font-size: 14px; }
    .article-cta { padding: 24px 18px; }
    .article-cta h3 { font-size: 17px; }
    .footer { padding: 28px 12px 18px; }
}

/* 超小屏 360px 以下 */
@media (max-width: 360px) {
    .logo { font-size: 13px; }
    .logo span { max-width: 100px; }
    .article-title { font-size: 19px; }
    .article-content p { font-size: 13.5px; }
}
