/* CSS 变量 - 主题系统 */
:root {
    /* 亮色主题 */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-card: #ffffff;
    --text-primary: #1a1a2e;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --border-color: #e9ecef;
    --accent-color: #667eea;
    --accent-hover: #5a67d8;
    --shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 5px 25px rgba(0, 0, 0, 0.12);
    --code-bg: #f4f4f5;
    --header-bg: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] {
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a2e;
    --bg-card: #16213e;
    --text-primary: #e4e4e7;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --border-color: #27272a;
    --accent-color: #818cf8;
    --accent-hover: #a5b4fc;
    --shadow: 0 2px 15px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 5px 25px rgba(0, 0, 0, 0.4);
    --code-bg: #1e1e2e;
    --header-bg: rgba(15, 15, 35, 0.95);
}

/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
    height: auto;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部导航 */
.header {
    position: sticky;
    top: 0;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    padding: 15px 0;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo:hover {
    color: var(--accent-color);
}

.nav {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav a {
    color: var(--text-secondary);
    font-weight: 500;
    position: relative;
}

.nav a:hover,
.nav a.active {
    color: var(--accent-color);
}

.nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

.nav a:hover::after,
.nav a.active::after {
    width: 100%;
}

/* 主题切换按钮 */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    padding: 5px;
}

.theme-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.theme-btn:hover {
    color: var(--accent-color);
}

.theme-btn.active {
    background: var(--accent-color);
    color: white;
}

/* 移动端菜单 */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
}

/* 英雄区域 */
.hero {
    padding: 80px 0;
    text-align: center;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--accent-color), #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* 文章卡片 */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    padding: 40px 0;
}

.post-card {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.post-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--bg-secondary);
}

.post-card-content {
    padding: 25px;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.post-card-category {
    background: var(--accent-color);
    color: white;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.post-card-title {
    font-size: 1.25rem;
    margin-bottom: 12px;
    line-height: 1.4;
}

.post-card-title a {
    color: var(--text-primary);
}

.post-card-title a:hover {
    color: var(--accent-color);
}

.post-card-excerpt {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 15px;
}

.post-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.read-more {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.read-more:hover {
    gap: 10px;
}

/* 文章详情页 */
.post-header {
    padding: 60px 0 40px;
    text-align: center;
}

.post-header h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    line-height: 1.3;
}

.post-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.post-cover {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 16px;
    margin-bottom: 40px;
}

.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.post-content h1,
.post-content h2,
.post-content h3 {
    margin: 2rem 0 1rem;
    line-height: 1.3;
}

.post-content p {
    margin-bottom: 1.5rem;
}

.post-content img {
    border-radius: 8px;
    margin: 1.5rem 0;
}

.post-content code {
    background: var(--code-bg);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    font-size: 0.9em;
}

.post-content pre {
    background: var(--code-bg);
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.post-content pre code {
    background: none;
    padding: 0;
}

.post-content blockquote {
    border-left: 4px solid var(--accent-color);
    padding-left: 20px;
    margin: 1.5rem 0;
    color: var(--text-secondary);
    font-style: italic;
}

.post-content ul,
.post-content ol {
    margin: 1rem 0 1.5rem 2rem;
}

.post-content li {
    margin-bottom: 0.5rem;
}

/* 标签 */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 30px 0;
}

.tag {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.tag:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* 侧边栏 */
.sidebar {
    position: sticky;
    top: 100px;
}

.sidebar-widget {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
}

.sidebar-widget h3 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-color);
}

/* 搜索框 */
.search-form {
    display: flex;
    gap: 10px;
}

.search-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.search-btn {
    padding: 12px 20px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.search-btn:hover {
    background: var(--accent-hover);
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 40px 0;
}

.pagination a,
.pagination span {
    padding: 10px 18px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.pagination a:hover,
.pagination .current {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* 页脚 */
.footer {
    background: var(--bg-secondary);
    padding: 40px 0;
    margin-top: 60px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-secondary);
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* 响应式 */
@media (max-width: 768px) {
    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-card);
        flex-direction: column;
        padding: 20px;
        gap: 15px;
        border-bottom: 1px solid var(--border-color);
    }

    .nav.active {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .posts-grid {
        grid-template-columns: 1fr;
    }

    .post-header h1 {
        font-size: 1.75rem;
    }

    .theme-toggle {
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 1000;
        box-shadow: var(--shadow);
    }
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* 加载动画 */
.loading {
    display: flex;
    justify-content: center;
    padding: 40px;
}

.loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


/* 新页脚样式 */
.footer {
    background: var(--bg-secondary);
    padding: 0;
    margin-top: 60px;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 40px 0;
    border-bottom: 1px solid var(--border-color);
}

.footer-section h4 {
    font-size: 1rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.footer-section p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.footer-bottom {
    padding: 25px 0;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.footer-links a {
    padding: 5px 15px;
    background: var(--accent-color);
    color: white;
    border-radius: 4px;
    font-size: 0.85rem;
}

.footer-links a:hover {
    background: var(--accent-hover);
    color: white;
}

.footer-bottom p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 10px;
}

.footer-icp {
    margin-top: 15px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer-icp span {
    background: linear-gradient(90deg, #e74c3c, #e67e22, #f1c40f, #2ecc71, #3498db, #9b59b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-links {
        flex-wrap: wrap;
    }
}


/* 免责声明页面样式 */
.disclaimer-page {
    padding: 40px 0;
}

.disclaimer-box {
    background: var(--bg-card);
    border: 2px solid var(--accent-color);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow);
}

.disclaimer-title {
    text-align: center;
    color: var(--accent-color);
    font-size: 1.5rem;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px dashed var(--border-color);
}

.disclaimer-section {
    margin-bottom: 30px;
    padding-left: 30px;
    position: relative;
}

.disclaimer-section::before {
    content: '●';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--accent-color);
    font-size: 1.2rem;
}

.disclaimer-section h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 12px;
    font-weight: 600;
}

.disclaimer-section h3.warning-title {
    color: #e74c3c;
}

.disclaimer-section h3.ip-title {
    color: var(--accent-color);
    text-align: center;
}

.disclaimer-section p {
    color: var(--text-secondary);
    line-height: 1.8;
    text-align: justify;
}

.disclaimer-section a {
    color: var(--accent-color);
    word-break: break-all;
}

.disclaimer-section:last-child p {
    color: #e74c3c;
}

.links-requirements {
    list-style: none;
    padding: 0;
}

.links-requirements li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
    color: var(--text-secondary);
}

.links-requirements li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #2ecc71;
}

.friend-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}


/* 备案信息样式 */
.footer-beian {
    margin: 15px 0;
}

.footer-beian a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-secondary);
    background: var(--bg-card);
    padding: 5px 12px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.footer-beian a:hover {
    color: var(--accent-color);
}

.footer-beian img {
    width: 20px;
    height: 20px;
}

.beian-slogan {
    margin-left: 10px;
    color: var(--text-secondary);
}

.footer-links .qq-link {
    background: #333;
}

.footer-links .qq-link:hover {
    background: #555;
}


/* 下载按钮样式 */
.download-btn {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    color: white !important;
}

.download-btn::before {
    content: '⬇ ';
}

/* 下载区域 */
.download-box {
    background: var(--bg-secondary);
    border: 2px dashed var(--accent-color);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    margin: 20px 0;
}

.download-box h4 {
    margin-bottom: 20px;
    color: var(--text-primary);
}

.download-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* 蓝奏云按钮 */
.btn-lanzou {
    background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
}

/* 百度网盘按钮 */
.btn-baidu {
    background: linear-gradient(135deg, #06b4fd 0%, #0078d4 100%);
}

/* GitHub按钮 */
.btn-github {
    background: linear-gradient(135deg, #333 0%, #24292e 100%);
}
