/* ============================================
   赛博朋克主题样式
   基于 blog_complete_homepage.html 设计
   ============================================ */

:root {
    --bg-deep-space: #0f0f23;
    --bg-midnight: #1a1a2e;
    --accent-neon-green: #e74c3c;
    --accent-electric-blue: #f39c12;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --glass-bg: rgba(26, 26, 46, 0.7);
}

/* ==================== 基础样式 ==================== */
html {
    scroll-behavior: smooth;
    cursor: none;
}

body {
    font-family: 'Poppins', 'Noto Sans SC', sans-serif;
    background-color: var(--bg-deep-space);
    color: var(--text-primary);
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* 背景网格效果 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 15, 35, 0.8);
    z-index: -1;
    background-image: 
        linear-gradient(rgba(243, 156, 18, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(243, 156, 18, 0.05) 1px, transparent 1px);
    background-size: 30px 30px;
}

/* 扫描线效果 */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: repeating-linear-gradient(0deg, rgba(0,0,0,0.3) 0, rgba(0,0,0,0.3) 1px, transparent 1px, transparent 4px);
    opacity: 0.3;
    z-index: 10001;
    animation: flicker 0.15s infinite;
}

body.focus-mode::after {
    display: none;
}

@keyframes flicker {
    0% { opacity: 0.2; }
    20% { opacity: 0.4; }
    40% { opacity: 0.25; }
    60% { opacity: 0.35; }
    80% { opacity: 0.2; }
    100% { opacity: 0.3; }
}

/* ==================== 自定义光标 ==================== */
#cursor-dot,
#cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10000;
    pointer-events: none;
    border-radius: 50%;
    transition: transform 0.15s ease-out, opacity 0.2s ease-out;
}

#cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-neon-green);
    box-shadow: 0 0 5px var(--accent-neon-green);
}

#cursor-outline {
    width: 40px;
    height: 40px;
    border: 2px solid var(--accent-neon-green);
    opacity: 0.5;
}

#cursor-outline.hover {
    transform: scale(1.5);
    opacity: 1;
}

/* ==================== 预加载器 ==================== */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-deep-space);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

#preloader.loaded {
    opacity: 0;
    visibility: hidden;
}

.loader-logo {
    font-family: 'Poppins', sans-serif;
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent-neon-green);
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% {
        text-shadow: 0 0 5px var(--accent-neon-green), 0 0 10px var(--accent-neon-green);
    }
    50% {
        text-shadow: 0 0 15px var(--accent-neon-green), 0 0 25px var(--accent-neon-green), 0 0 40px #fff;
    }
}

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

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

::-webkit-scrollbar-thumb {
    background: var(--accent-electric-blue);
    border-radius: 4px;
    box-shadow: 0 0 5px var(--accent-electric-blue);
}

/* ==================== 霓虹文本 ==================== */
.neon-text-green {
    color: var(--accent-neon-green);
    text-shadow: 0 0 5px var(--accent-neon-green), 0 0 10px var(--accent-neon-green), 0 0 15px #fff;
}

.neon-text-blue {
    color: var(--accent-electric-blue);
    text-shadow: 0 0 5px var(--accent-electric-blue), 0 0 10px var(--accent-electric-blue), 0 0 15px #fff;
}

/* ==================== 玻璃态效果 ==================== */
.glassmorphism {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

/* ==================== 导航栏 ==================== */
.top-navbar {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    border-radius: 9999px;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    height: 4rem;
}

.top-navbar a,
.top-navbar button {
    color: #d1d5db;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
    background: transparent;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.top-navbar a i,
.top-navbar button i {
    font-size: 1rem;
    line-height: 1;
}

.top-navbar a:hover,
.top-navbar button:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

.top-navbar a.active {
    color: var(--accent-electric-blue);
    background-color: rgba(243, 156, 18, 0.1);
    box-shadow: 0 0 10px var(--accent-electric-blue);
}

.top-navbar .text-xs {
    font-size: 0.75rem;
}

.theme-toggle-button {
    position: relative;
    width: 1rem;
    height: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle-button .theme-icon {
    transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out;
    font-size: 1rem;
    line-height: 1;
}

.theme-toggle-button .sun-icon {
    transform: scale(0) rotate(180deg);
    opacity: 0;
    position: absolute;
}

.theme-toggle-button .moon-icon {
    transform: scale(1) rotate(0deg);
    opacity: 1;
}

body.focus-mode .sun-icon {
    transform: scale(1) rotate(0deg);
    opacity: 1;
    position: static;
}

body.focus-mode .moon-icon {
    transform: scale(0) rotate(-180deg);
    opacity: 0;
    position: absolute;
}

/* ==================== Hero 区域 ==================== */
.hero-section {
    position: relative;
    padding-top: 10rem;
    padding-bottom: 8rem;
    color: white;
    text-align: center;
    overflow: hidden;
}

#particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 64rem;
    margin: 0 auto;
    padding: 0 1rem;
}

#hero-title::after {
    content: '_';
    display: inline-block;
    animation: blink 0.7s infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* ==================== 内容区域 ==================== */
.content-wrap {
    max-width: 90rem;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
}

.site-container {
    width: 100%;
}

.centered-content-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .centered-content-wrapper {
        grid-template-columns: 280px 1fr;
        gap: 2rem;
    }
}

@media (min-width: 1280px) {
    .centered-content-wrapper {
        grid-template-columns: 300px 1fr;
        gap: 3rem;
    }
}

/* ==================== 侧边栏 ==================== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.author-profile {
    padding: 1.5rem;
    border-radius: 0.75rem;
    text-align: center;
}

.author-avatar-main {
    width: 6rem;
    height: 6rem;
    border-radius: 50%;
    margin: 0 auto;
    transition: all 0.3s ease;
    cursor: pointer;
}

.author-avatar-main:hover {
    box-shadow: 0 0 15px var(--accent-electric-blue);
    transform: rotate(360deg) scale(1.05);
}

.author-name-main {
    margin-top: 0.5rem;
    font-size: 1.25rem;
    font-weight: bold;
}

.author-bio-main {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.author-stats {
    display: flex;
    justify-content: space-around;
    text-align: center;
    font-size: 0.875rem;
    margin: 1rem 0;
    padding: 1rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.author-stats div {
    display: flex;
    flex-direction: column;
}

.author-stats span {
    font-weight: bold;
    font-size: 1.125rem;
    color: var(--accent-electric-blue);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 1rem 0;
}

.social-links a {
    color: var(--text-secondary);
    font-size: 1.25rem;
    transition: color 0.3s;
    text-decoration: none;
}

.social-links a:hover {
    color: white;
}

.sidebar-announcement {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-announcement h3 {
    font-size: 1.125rem;
    font-weight: bold;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.announcement-content {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ==================== 文章列表 ==================== */
.main-content-area {
    width: 100%;
}

.view-toggle {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 0.5rem;
}

.view-toggle button {
    padding: 0.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.3s;
    background: transparent;
    border: none;
    color: var(--text-secondary);
}

.view-toggle button.active {
    color: var(--accent-electric-blue);
    box-shadow: 0 0 10px var(--accent-electric-blue);
    background-color: rgba(243, 156, 18, 0.1);
}

.view-toggle button:hover {
    color: var(--text-primary);
}

.view-toggle svg {
    width: 1.25rem;
    height: 1.25rem;
}

.post-list-cards {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
}

#articles-wrapper.grid-view .post-list-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 768px) {
    #articles-wrapper.grid-view .post-list-cards {
        grid-template-columns: 1fr;
    }
}

/* ==================== 文章卡片 ==================== */
.post-card {
    position: relative;
    overflow: hidden;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 0 25px var(--accent-electric-blue);
}

.post-card::before {
    content: '';
    position: absolute;
    left: var(--mouse-x, 50%);
    top: var(--mouse-y, 50%);
    width: 300px;
    height: 300px;
    background: radial-gradient(circle at center, rgba(243, 156, 18, 0.3), transparent 70%);
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.post-card:hover::before {
    opacity: 1;
}

.post-card-image {
    overflow: hidden;
}

.post-card-image img {
    width: 100%;
    height: 16rem;
    object-fit: cover;
    border-radius: 0.75rem 0.75rem 0 0;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.post-card:hover .post-card-image img {
    transform: scale(1.05);
}

#articles-wrapper.grid-view .post-card-image img {
    height: 14rem;
}

.post-card-content {
    padding: 1.5rem;
}

.post-card-header {
    margin-bottom: 0.5rem;
}

.post-card-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0;
}

#articles-wrapper.grid-view .post-card-title {
    font-size: 1.25rem;
}

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

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

.post-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.post-card-excerpt {
    color: var(--text-secondary);
    margin: 1rem 0;
    line-height: 1.6;
}

.post-card-author {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0.5rem 0;
}

.post-card-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

.post-card-tags span {
    font-weight: 600;
    text-transform: uppercase;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    background-color: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

/* ==================== 淡入动画 ==================== */
.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==================== 订阅区域 ==================== */
.newsletter-section {
    padding: 5rem 0;
    background-color: var(--bg-midnight);
}

.newsletter-container {
    max-width: 48rem;
    margin: 0 auto;
    text-align: center;
    padding: 0 1rem;
}

.newsletter-title {
    font-size: 1.875rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.newsletter-description {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1rem;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 32rem;
    margin: 0 auto;
}

@media (min-width: 640px) {
    .newsletter-form {
        flex-direction: row;
        gap: 1rem;
    }
    
    .newsletter-title {
        font-size: 2.25rem;
    }
}

.newsletter-input {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--accent-electric-blue);
    box-shadow: 0 0 10px var(--accent-electric-blue);
    transition: all 0.3s ease;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 9999px;
    outline: none;
    flex: 1;
    width: 100%;
}

.newsletter-input:focus {
    outline: none;
    box-shadow: 0 0 20px var(--accent-electric-blue);
}

.newsletter-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.neon-border-button {
    border: 2px solid var(--accent-neon-green);
    box-shadow: 0 0 10px var(--accent-neon-green);
    transition: all 0.3s ease;
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    background: transparent;
    color: white;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
}

/* 订阅消息样式 */
.subscribe-message {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    text-align: center;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.subscribe-message.success {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid var(--accent-neon-green);
    color: var(--accent-neon-green);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
}

.subscribe-message.error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--accent-hot-pink);
    color: var(--accent-hot-pink);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.neon-border-button:hover {
    background-color: var(--accent-neon-green);
    color: var(--bg-deep-space);
    box-shadow: 0 0 20px var(--accent-neon-green);
}

/* ==================== 搜索浮层 ==================== */
#search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

#search-box {
    width: 90%;
    max-width: 600px;
    padding: 2rem;
    border-radius: 1rem;
    position: relative;
}

#search-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--accent-electric-blue);
    color: white;
    font-size: 1.5rem;
    padding: 0.5rem 0;
    outline: none;
}

#search-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
}

#search-results {
    margin-top: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.search-result-item a {
    display: block;
    padding: 1rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
    text-decoration: none;
    color: var(--text-primary);
}

.search-result-item a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* ==================== 功能按钮 ==================== */
.action-button {
    display: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    color: var(--accent-neon-green);
    border: 2px solid var(--accent-neon-green);
    box-shadow: 0 0 10px var(--accent-neon-green);
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    background: transparent;
}

.action-button.show {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.action-button:hover {
    background: var(--accent-neon-green);
    color: var(--bg-deep-space);
    box-shadow: 0 0 20px var(--accent-neon-green);
}

/* ==================== 归档页面链接 ==================== */
.archive-post-link {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.archive-post-link:hover {
    color: var(--accent-electric-blue);
    text-decoration: underline;
}

/* ==================== 页脚 ==================== */
footer {
    text-align: center;
    padding: 1.25rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ==================== Live2D ==================== */
#waifu {
    z-index: 100 !important;
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .hero-section {
        padding-top: 8rem;
        padding-bottom: 4rem;
    }

    #hero-title {
        font-size: 2rem;
    }

    .top-navbar {
        padding: 0 0.5rem;
        width: 95%;
    }

    .top-navbar a,
    .top-navbar button {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }

    .author-avatar-main {
        width: 5rem;
        height: 5rem;
    }
}
