/*
Theme Name: 小红书风格主题
Description: 一个小红书风格的WordPress主题，适合文章展示网站
Version: 1.0.0
*/

:root {
    --primary: #1e88e5;
    --primary-light: #e3f2fd;
    --primary-dark: #1565c0;
    --text-dark: #333;
    --text-gray: #666;
    --text-light: #999;
    --border: #f0f0f0;
    --bg: #fff;
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.1);
    --radius: 12px;
    --sidebar-width: 240px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', sans-serif; color: var(--text-dark); background: var(--bg); line-height: 1.6; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary); }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }
button { border: none; background: none; cursor: pointer; font-family: inherit; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* 顶部导航 */
.header { position: sticky; top: 0; z-index: 100; background: var(--bg); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; padding: 0 24px; max-width: 1200px; margin: 0 auto; }
.logo { font-size: 24px; font-weight: 700; color: var(--primary); }
.header-actions { display: flex; gap: 12px; }
.header-btn { padding: 8px 16px; border-radius: 20px; font-size: 14px; transition: all 0.3s; }
.header-btn-outline { border: 1px solid var(--border); color: var(--text-dark); }
.header-btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.header-btn-primary { background: var(--primary); color: #fff; }
.header-btn-primary:hover { background: var(--primary-dark); color: #fff; }

/* 搜索 */
.search-section { padding: 24px 0; text-align: center; background: linear-gradient(180deg, var(--primary-light) 0%, var(--bg) 100%); }
.search-box { display: flex; align-items: center; max-width: 600px; margin: 0 auto; padding: 10px 16px; background: var(--bg); border-radius: 24px; box-shadow: var(--shadow); border: 2px solid transparent; transition: all 0.3s; }
.search-box:focus-within { border-color: var(--primary); box-shadow: var(--shadow-hover); }
.search-icon { width: 18px; height: 18px; margin-right: 10px; color: var(--text-light); flex-shrink: 0; }
.search-input { flex: 1; border: none; outline: none; font-size: 14px; background: transparent; }
.search-input::placeholder { color: var(--text-light); }
.search-btn { padding: 6px 16px; background: var(--primary); color: #fff; border-radius: 16px; font-size: 13px; font-weight: 500; }
.search-btn:hover { background: var(--primary-dark); color: #fff; }

/* 分类导航 */
.category-nav { padding: 12px 0; background: var(--bg); position: sticky; top: 0; z-index: 90; border-bottom: 1px solid var(--border); }
.category-list { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; padding: 0 24px; max-width: 1200px; margin: 0 auto; }
.category-list::-webkit-scrollbar { display: none; }
.category-item { flex-shrink: 0; padding: 6px 16px; border-radius: 20px; font-size: 13px; color: var(--text-gray); background: var(--bg); border: 1px solid var(--border); transition: all 0.3s; cursor: pointer; }
.category-item:hover { color: var(--primary); border-color: var(--primary); }
.category-item.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 文章列表 */
.posts-section { padding: 20px 24px; max-width: 1200px; margin: 0 auto; }
.posts-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.post-card { background: var(--bg); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: all 0.3s; cursor: pointer; }
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.post-card-image { position: relative; width: 100%; padding-top: 100%; overflow: hidden; background: var(--primary-light); }
.post-card-image img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.post-card:hover .post-card-image img { transform: scale(1.05); }
.post-card-content { padding: 12px; }
.post-card-title { font-size: 14px; font-weight: 600; line-height: 1.4; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-card-meta { display: flex; align-items: center; justify-content: space-between; }
.post-card-author { display: flex; align-items: center; gap: 6px; }
.post-card-avatar { width: 20px; height: 20px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 10px; font-weight: 600; }
.post-card-name { font-size: 12px; color: var(--text-gray); }
.post-card-stats { font-size: 12px; color: var(--text-light); display: flex; gap: 8px; }
.post-card-stats span { display: flex; align-items: center; gap: 2px; }
.no-image { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--primary-light) 0%, #bbdefb 100%); color: var(--primary); font-size: 32px; }

/* 加载更多 */
.load-more { text-align: center; padding: 40px 0; }
.load-more-btn { display: inline-block; padding: 12px 40px; background: var(--bg); border: 1px solid var(--border); border-radius: 24px; font-size: 14px; color: var(--text-gray); }
.load-more-btn:hover { border-color: var(--primary); color: var(--primary); }

/* 分页 */
.pagination { display: flex; justify-content: center; gap: 8px; padding: 40px 0; }
.pagination a, .pagination span { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 12px; border-radius: 18px; font-size: 14px; color: var(--text-gray); background: var(--bg); border: 1px solid var(--border); }
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 文章详情 */
.single-post { max-width: 1200px; margin: 0 auto; padding: 20px 24px; }
.single-post-header { margin-bottom: 20px; }
.single-post-title { font-size: 22px; font-weight: 700; line-height: 1.4; margin-bottom: 12px; }
.single-post-meta { display: flex; align-items: center; gap: 16px; font-size: 14px; color: var(--text-gray); }
.single-post-author { display: flex; align-items: center; gap: 8px; }
.single-post-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; }
.single-post-content { font-size: 16px; line-height: 1.8; }
.single-post-content p { margin-bottom: 16px; }
.single-post-content img { max-width: 100%; border-radius: var(--radius); margin: 16px 0; }
.single-post-content h2, .single-post-content h3, .single-post-content h4 { margin: 24px 0 12px; font-weight: 600; }

/* Footer */
.footer { padding: 40px 0; text-align: center; border-top: 1px solid var(--border); margin-top: 60px; }
.footer-text { font-size: 14px; color: var(--text-light); }

/* 侧边栏 */
.sidebar { position: fixed; left: 0; top: 0; width: var(--sidebar-width); height: 100vh; z-index: 200; }
.sidebar-overlay { display: none; }
.sidebar-nav { width: 100%; height: 100%; background: var(--bg); border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow-y: auto; }
.sidebar-logo { padding: 20px; border-bottom: 1px solid var(--border); text-align: center; }
.sidebar-logo a { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.sidebar-logo-img { width: 80px; height: auto; margin: 0 auto; }
.sidebar-logo-text { font-size: 18px; font-weight: 700; color: var(--primary); }
.sidebar-logo-subtitle { font-size: 12px; color: var(--text-light); line-height: 1.4; text-align: center; }
.sidebar-menu { flex: 1; padding: 16px 12px; }
.sidebar-item { margin-bottom: 4px; }
.sidebar-item a { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius); color: var(--text-gray); font-size: 14px; transition: all 0.3s; }
.sidebar-item a:hover { background: var(--primary-light); color: var(--primary); }
.sidebar-item.active a { background: var(--primary-light); color: var(--primary); font-weight: 500; }
.sidebar-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.sidebar-toggle { display: none; align-items: center; justify-content: center; position: fixed; left: 16px; top: 16px; width: 40px; height: 40px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; z-index: 150; cursor: pointer; }
.sidebar-toggle svg { width: 20px; height: 20px; color: var(--text-dark); }
.sidebar-toggle-mobile { display: none; align-items: center; justify-content: center; width: 36px; height: 36px; background: none; border: none; cursor: pointer; }
.sidebar-toggle-mobile svg { width: 20px; height: 20px; color: var(--text-dark); }
.main-content { margin-left: var(--sidebar-width); min-height: 100vh; background: var(--bg); }
.mobile-header { display: none; }
.mobile-header .logo { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; color: var(--primary); }
.mobile-header .header-logo-img { width: 32px; height: auto; }

/* 弹窗 */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; opacity: 0; visibility: hidden; transition: all 0.3s; }
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-content { background: #fff; border-radius: var(--radius); padding: 32px; max-width: 400px; width: 90%; text-align: center; position: relative; transform: scale(0.9); transition: transform 0.3s; }
.modal-overlay.active .modal-content { transform: scale(1); }
.modal-close { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 50%; background: var(--border); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.3s; }
.modal-close:hover { background: var(--text-light); }
.modal-close svg { width: 16px; height: 16px; color: var(--text-dark); }
.modal-title { font-size: 20px; font-weight: 600; margin-bottom: 20px; }
.modal-qrcode { width: 200px; height: 200px; margin: 0 auto 16px; background: var(--primary-light); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.modal-qrcode img { width: 100%; height: 100%; object-fit: contain; }
.modal-qrcode-placeholder { color: var(--primary); font-size: 14px; }
.modal-hint { font-size: 14px; color: var(--text-light); }
.wechat-id-display { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 20px; }
.wechat-id-text { font-size: 24px; font-weight: 600; font-family: monospace; letter-spacing: 2px; }
.copy-btn { padding: 8px 16px; background: var(--primary); color: #fff; border-radius: 8px; font-size: 14px; cursor: pointer; transition: all 0.3s; }
.copy-btn:hover { background: var(--primary-dark); }
.copy-btn.copied { background: #4caf50; }
.modal-footer-text { font-size: 13px; color: var(--text-light); }

/* 响应式 */
@media (max-width: 1024px) { .posts-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) {
    .sidebar { width: 100%; transform: translateX(-100%); transition: transform 0.3s; }
    .sidebar.active { transform: translateX(0); }
    .sidebar.active .sidebar-overlay { display: block; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: -1; }
    .sidebar-nav { max-width: 280px; }
    .sidebar-toggle { display: flex; }
    .main-content { margin-left: 0; }
    .mobile-header { display: block; position: sticky; top: 0; z-index: 100; background: var(--bg); border-bottom: 1px solid var(--border); }
    .mobile-header .header-inner { display: flex; align-items: center; gap: 12px; }
    .mobile-header .logo { flex: 1; text-align: center; font-size: 18px; }
    .mobile-header .header-actions { display: none; }
    .posts-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .posts-section { padding: 16px; }
    .search-section { padding: 24px 0; }
}
@media (min-width: 769px) { .mobile-header { display: none !important; } }

/* 空状态 */
.no-posts { text-align: center; padding: 60px 20px; color: var(--text-light); }

/* 底部预约区域 */
.appointment-bar {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-width);
    right: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.appointment-bar-content {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    color: #fff;
    transition: transform 0.3s;
}

.appointment-bar-content:hover {
    transform: scale(1.02);
}

.appointment-bar-icon {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.appointment-bar-icon svg {
    width: 20px;
    height: 20px;
}

.appointment-bar-text {
    font-size: 16px;
    font-weight: 600;
}

.appointment-bar-arrow {
    width: 20px;
    height: 20px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .appointment-bar {
        left: 0;
    }
    .appointment-bar-text {
        font-size: 14px;
    }
}

/* 为底部预约条留出空间 */
.posts-section {
    padding-bottom: 80px;
}
