/* Apple Style & Romance Theme */

/* 1. Global Variables */
:root {
    --bg-gradient: linear-gradient(180deg, #fbfbfd 0%, #f5f5f7 100%);
    --card-bg: rgba(255, 255, 255, 0.8);
    --card-border: rgba(0, 0, 0, 0.04);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    --card-hover-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --accent-color: #0071e3; /* Apple Blue */
    --font-stack: "SF Pro Text", "SF Pro Icons", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
    
    /* About Page Wrapper defaults (Light Mode) */
    --about-wrapper-bg: rgba(255, 255, 255, 0.5); /* Transparent/Light for Light Mode */
    --about-card-bg: rgba(255, 255, 255, 0.6);
    --about-text-title: #1d1d1f;
    --about-text-desc: #86868b;
    
    /* Social Buttons (Light Mode Defaults) */
    --about-social-bg: rgba(0, 0, 0, 0.05); /* Slight dark on light */
    --about-social-border: rgba(0, 0, 0, 0.1);
    --about-social-color: #1d1d1f; /* Dark text */
    --about-social-hover-bg: #1d1d1f;
    --about-social-hover-color: #ffffff;
}

/* Dark Mode Overrides */
html[data-mode="dark"] {
    --bg-gradient: linear-gradient(180deg, #1c1c1e 0%, #000000 100%); /* Apple Dark Background */
    --card-bg: rgba(28, 28, 30, 0.7); /* Dark Glass */
    --card-border: rgba(255, 255, 255, 0.1);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --card-hover-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    --text-primary: #f5f5f7;
    --text-secondary: #86868b;
    --accent-color: #0a84ff; /* Apple Blue Dark Mode */
    
    /* About Page Dark Mode */
    --about-wrapper-bg: #0F0F11; /* Keep the original dark look for Dark Mode */
    --about-card-bg: rgba(255, 255, 255, 0.05);
    --about-text-title: #FFFFFF;
    --about-text-desc: #ADB5BD;
    
    /* Social Buttons (Dark Mode) */
    --about-social-bg: rgba(255, 255, 255, 0.1);
    --about-social-border: rgba(255, 255, 255, 0.05);
    --about-social-color: #FFFFFF;
    --about-social-hover-bg: #FFFFFF;
    --about-social-hover-color: #000000;
}

html[data-mode="dark"] body {
    color: var(--text-primary) !important;
    background-color: transparent !important;
    background: rgba(0, 0, 0, 0.6) !important;
}

/* 强制暗黑模式下所有可能的容器元素背景 - 半透明以显示粒子 */
html[data-mode="dark"],
html[data-mode="dark"] #wrapper,
html[data-mode="dark"] #main-wrapper,
html[data-mode="dark"] .wrapper,
html[data-mode="dark"] .main,
html[data-mode="dark"] main {
    background-color: transparent !important;
    background: rgba(0, 0, 0, 0.5) !important;
}

/* 修复移动端背景固定可能导致的问题 */
@media (max-width: 768px) {
    body {
        background-attachment: scroll !important;
    }
    
    /* 移动端暗黑模式强制背景 */
    html[data-mode="dark"],
    html[data-mode="dark"] body,
    html[data-mode="dark"] #wrapper,
    html[data-mode="dark"] #main-wrapper,
    html[data-mode="dark"] .wrapper {
        background-color: #0a0a14 !important;
        background-image: none !important;
        min-height: 100vh;
    }
}

/* 强制 html 元素在暗黑模式下的背景 */
html[data-mode="dark"] {
    background-color: #0a0a14 !important;
    background: #0a0a14 !important;
    min-height: 100vh;
}

/* 覆盖常见容器的背景 - 暗黑模式半透明 */
html[data-mode="dark"] #wrapper,
html[data-mode="dark"] #main-wrapper,
html[data-mode="dark"] .wrapper,
html[data-mode="dark"] .post-content,
html[data-mode="dark"] .post-preview,
html[data-mode="dark"] .card {
    background-color: rgba(0, 0, 0, 0.4) !important;
    background: rgba(0, 0, 0, 0.4) !important;
}


/* 2. Base Styles */
body {
    background: var(--bg-gradient) !important;
    background-attachment: fixed !important;
    color: var(--text-primary) !important;
    font-family: var(--font-stack) !important;
    -webkit-font-smoothing: antialiased;
    margin: 0 !important;
    padding: 0 !important;
}

/* 3. Apple-style Cards (Bento Grid feel) */
#sidebar, .post-preview, .card, #main-wrapper .post-content {
    background: var(--card-bg) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
    border-radius: 20px; /* More rounded */
    margin-bottom: 24px;
    padding: 30px;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); /* Smooth Apple easing */
}

/* Hover Effect - Scale and Lift */
.post-preview:hover, .card:hover {
    transform: scale(1.02) translateY(-5px);
    box-shadow: var(--card-hover-shadow);
}

/* 4. Typography */
h1, h2, h3, h4, h5, h6, .post-title, .site-title {
    color: var(--text-primary) !important;
    font-weight: 600;
    letter-spacing: -0.02em; /* Tight tracking like Apple */
}

.site-subtitle {
    color: var(--text-secondary) !important;
    font-weight: 400;
}

/* Links */
a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover {
    color: var(--text-primary) !important;
    text-decoration: none;
}

/* 5. Tags */
.post-tag, .categories {
    background: rgba(0, 0, 0, 0.03) !important;
    border: none !important;
    border-radius: 12px;
    padding: 6px 14px;
    color: var(--text-secondary) !important;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
}

.post-tag:hover {
    background: var(--accent-color) !important;
    color: white !important;
}

/* Romance Mode Specifics */
body.romance-mode .post-tag {
    background: rgba(255, 105, 180, 0.1) !important;
    color: #ff69b4 !important;
}
body.romance-mode .post-tag:hover {
    background: #ff69b4 !important;
    color: white !important;
}

/* 6. Footer */
footer {
    background: transparent !important;
    background-color: transparent !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
    border: none !important;
}

footer > div {
    background: transparent !important;
}

#tech-stats {
    font-family: var(--font-stack);
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 20px;
    text-align: center;
    font-weight: 500;
}

/* 7. Particles Container */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -99;
    pointer-events: none;
}

/* 7.1 Cosmic Particles (Three.js) */
#cosmic-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -100;
    pointer-events: none;
    overflow: hidden;
}
#cosmic-particles canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* 8. Cursor Spotlight */
#cursor-spotlight {
    position: fixed;
    top: 0;
    left: 0;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0, 113, 227, 0.15) 0%, rgba(0, 113, 227, 0) 70%); /* Apple Blue Glow */
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: -98; /* Above particles, below content */
    opacity: 0;
    transition: opacity 0.5s ease;
}

body.romance-mode #cursor-spotlight {
    background: radial-gradient(circle, rgba(255, 105, 180, 0.2) 0%, rgba(255, 105, 180, 0) 70%); /* Pink Glow */
}
