/*
Theme Name: macOS White
Theme URI: https://yourwebsite.com
Description: 简约白色macOS风格主题，支持搜索功能
Version: 3.0
Author: Your Name
*/

/* CSS变量 */
:root {
    --bg-body: #f5f5f7;
    --bg-white: #ffffff;
    --bg-card: #ffffff;
    --bg-sidebar: rgba(255, 255, 255, 0.98);
    --text-primary: #1d1d1f;
    --text-secondary: #6c6c70;
    --text-tertiary: #8e8e93;
    --accent: #0071e3;
    --accent-hover: #005bb5;
    --border: #e9e9ef;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --bg-body: #000000;
    --bg-white: #1c1c1e;
    --bg-card: #1c1c1e;
    --bg-sidebar: rgba(28, 28, 30, 0.98);
    --text-primary: #ffffff;
    --text-secondary: #8e8e93;
    --text-tertiary: #6c6c70;
    --accent: #0a84ff;
    --accent-hover: #409cff;
    --border: #2c2c2e;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.5;
    transition: var(--transition);
}

/* 布局容器 */
.app {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: var(--bg-sidebar);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.sidebar-header {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.sidebar-title {
    font-size: 26px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.sidebar-desc {
    font-size: 13px;
    color: var(--text-tertiary);
    line-height: 1.4;
}

/* ========== 搜索框样式 ========== */
.sidebar-search {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.search-form {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: 10px 40px 10px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-white);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
    font-family: inherit;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

.search-btn {
    position: absolute;
    right: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 6px;
    color: var(--text-tertiary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    color: var(--accent);
    transform: scale(1.05);
}

/* 侧边栏导航 */
.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    transition: var(--transition);
    font-size: 14px;
    font-weight: 500;
}

.sidebar-nav a:hover {
    background: rgba(0, 113, 227, 0.08);
    color: var(--accent);
    transform: translateX(4px);
}

.sidebar-nav a.active {
    background: rgba(0, 113, 227, 0.12);
    color: var(--accent);
}

.nav-icon {
    font-size: 18px;
    width: 28px;
    text-align: center;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-tertiary);
    text-align: center;
}

.sidebar-footer a {
    color: var(--text-tertiary);
    text-decoration: none;
    transition: var(--transition);
}

.sidebar-footer a:hover {
    color: var(--accent);
}

/* 主内容 */
.main {
    flex: 1;
    margin-left: 280px;
    padding: 40px 48px;
    min-height: 100vh;
}

/* macOS窗口 */
.mac-window {
    background: var(--bg-white);
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--border);
    margin-bottom: 32px;
}

.mac-window:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

/* 窗口控制栏 */
.window-bar {
    background: var(--bg-sidebar);
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 8px;
}

.window-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.window-btn.close { background: #ff5f57; }
.window-btn.minimize { background: #ffbd2e; }
.window-btn.maximize { background: #28c840; }

.window-btn:hover {
    transform: scale(1.1);
}

.window-content {
    padding: 40px;
}

/* 文章卡片 */
.post-card {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 32px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.post-card:last-child {
    margin-bottom: 0;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.post-title {
    font-size: 28px;
    margin-bottom: 16px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.post-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
}

.post-title a:hover {
    color: var(--accent);
}

.post-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-tertiary);
    font-size: 13px;
    flex-wrap: wrap;
}

.post-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.post-excerpt {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 24px;
    font-size: 15px;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.read-more:hover {
    gap: 10px;
}

/* ========== 分页样式 - 水平显示 ========== */
.pagination-box {
    margin: 48px 0 24px;
    text-align: center;
}

.pagination-list {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.pagination-list span,
.pagination-list a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 40px !important;
    height: 40px !important;
    padding: 0 12px !important;
    border-radius: 10px !important;
    text-decoration: none !important;
    transition: all 0.25s ease !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    cursor: pointer !important;
    background: var(--bg-white) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border) !important;
}

.pagination-list a:hover {
    background: var(--accent) !important;
    color: white !important;
    border-color: var(--accent) !important;
    transform: translateY(-2px) !important;
}

.pagination-list .current-page {
    background: var(--accent) !important;
    color: white !important;
    border-color: var(--accent) !important;
    cursor: default !important;
}

.pagination-list .prev-page,
.pagination-list .next-page {
    padding: 0 16px !important;
}

/* 文章页样式 */
.article-content {
    background: var(--bg-white);
    border-radius: 14px;
    padding: 48px;
    border: 1px solid var(--border);
    margin-bottom: 32px;
}

.article-content h1 {
    font-size: 38px;
    margin-bottom: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.article-content h2 {
    font-size: 30px;
    margin: 32px 0 16px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.article-content h3 {
    font-size: 24px;
    margin: 28px 0 12px;
    font-weight: 600;
}

.article-content p {
    margin-bottom: 20px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.article-content img {
    max-width: 100%;
    border-radius: 12px;
    margin: 24px 0;
}

.article-content blockquote {
    border-left: 3px solid var(--accent);
    padding: 16px 24px;
    margin: 24px 0;
    background: var(--bg-body);
    border-radius: 0 12px 12px 0;
    color: var(--text-secondary);
}

.article-content code {
    background: var(--bg-body);
    padding: 2px 6px;
    border-radius: 6px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.9em;
}

.article-content pre {
    background: var(--bg-body);
    padding: 20px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 20px 0;
}

.article-content pre code {
    background: none;
    padding: 0;
}

/* 评论 */
.comments {
    background: var(--bg-white);
    border-radius: 14px;
    padding: 32px;
    border: 1px solid var(--border);
}

.comments h3 {
    font-size: 20px;
    margin-bottom: 24px;
    font-weight: 600;
}

.comment-list {
    list-style: none;
    margin: 24px 0;
}

.comment-item {
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-author {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 15px;
}

.comment-meta {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 10px;
}

.comment-content {
    line-height: 1.6;
    color: var(--text-secondary);
}

/* 表单 */
.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-white);
    color: var(--text-primary);
    margin-bottom: 16px;
    transition: var(--transition);
    font-family: inherit;
    font-size: 14px;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

.comment-form .submit {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 28px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    width: auto;
    transition: var(--transition);
}

.comment-form .submit:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

/* 主题切换按钮 */
.theme-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-white);
    border: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: var(--transition);
    z-index: 1000;
    box-shadow: var(--shadow);
}

.theme-toggle:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-hover);
}

/* 返回顶部 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-white);
    border: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: var(--transition);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    box-shadow: var(--shadow);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

/* 移动端菜单按钮 */
.menu-toggle {
    display: none;
}

/* 响应式 */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 280px;
        z-index: 1001;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main {
        margin-left: 0;
        padding: 20px;
    }
    
    .window-content {
        padding: 24px;
    }
    
    .post-card {
        padding: 20px;
    }
    
    .post-title {
        font-size: 22px;
    }
    
    .article-content {
        padding: 24px;
    }
    
    .article-content h1 {
        font-size: 28px;
    }
    
    .article-content h2 {
        font-size: 24px;
    }
    
    .menu-toggle {
        display: flex;
        position: fixed;
        top: 20px;
        left: 20px;
        width: 44px;
        height: 44px;
        background: var(--bg-white);
        border: 1px solid var(--border);
        border-radius: 12px;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 1002;
        font-size: 20px;
        backdrop-filter: blur(10px);
        box-shadow: var(--shadow);
    }
    
    .theme-toggle {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
    }
    
    .back-to-top {
        bottom: 20px;
        left: 20px;
        width: 44px;
        height: 44px;
    }
    
    .post-meta {
        gap: 12px;
        font-size: 12px;
    }
    
    .pagination-list span,
    .pagination-list a {
        min-width: 36px !important;
        height: 36px !important;
        font-size: 13px !important;
    }
    
    /* 移动端搜索框 */
    .sidebar-search {
        margin-bottom: 20px;
        padding-bottom: 16px;
    }
    
    .search-input {
        padding: 8px 36px 8px 12px;
        font-size: 13px;
    }
    
    .search-btn {
        font-size: 14px;
    }
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-card {
    animation: fadeIn 0.4s ease forwards;
}

/* 滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* 选中文本样式 */
::selection {
    background: rgba(0, 113, 227, 0.2);
    color: var(--text-primary);
}