﻿/* ============================================================
   critical.css - 关键内联样式（从base.html提取）
   包含：夜间模式、页面加载器、页脚、自定义前端样式
   ============================================================ */

/* ========== 1. 夜间模式 CSS 变量 ========== */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --card-bg: #1e293b;
    --hover-bg: #334155;
}

:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --card-bg: #ffffff;
    --hover-bg: #f1f5f9;
}

/* ========== 2. 夜间模式适配 ========== */
[data-theme="dark"] body {
    background: var(--bg-primary);
    color: var(--text-primary);
}

[data-theme="dark"] .card,
[data-theme="dark"] .article-card,
[data-theme="dark"] .footer-section {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .text-muted {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .bg-light {
    background: var(--bg-secondary) !important;
}

[data-theme="dark"] .border {
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .navbar {
    background: rgba(15, 23, 42, 0.95) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
}

[data-theme="dark"] .nav-link:hover,
[data-theme="dark"] .nav-link.active {
    color: white !important;
}

[data-theme="dark"] .search-input {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
}

[data-theme="dark"] .search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] .search-btn {
    color: rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] .search-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

[data-theme="dark"] .theme-toggle {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
}

[data-theme="dark"] .theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .dropdown-menu {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .dropdown-item {
    color: rgba(255, 255, 255, 0.85);
}

/* ========== 3. 页面加载器 (Page Loader) ========== */
.page-loader {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(248, 250, 252, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    opacity: 1;
    visibility: visible;
    transition: opacity 0.45s ease, visibility 0.45s ease;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.page-loader__bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.45);
    animation: loaderBar 1.8s ease-in-out infinite;
}

@keyframes loaderBar {
    0% { width: 0; left: 0; }
    50% { width: 65%; left: 15%; }
    100% { width: 0; left: 100%; }
}

/* ========== 4. 页脚样式 (Footer) ========== */
.site-footer {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #94a3b8;
    padding: 3rem 0 1.5rem;
    margin-top: 5rem;
}

.footer-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
}

.social-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: white;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.footer-links a:hover {
    color: white;
    padding-left: 0.5rem;
}

.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}
