/*
 * Template Name: 暗夜吸血姬
 * Description: 哥特萝莉吸血鬼美少女风格
 * Author: Manus AI
 */

/* 基础和全局样式 */
:root {
    --primary-bg: #1a0a2e; /* 深紫黑 */
    --accent-blood: #dc143c; /* 血红 */
    --accent-silver: #c0c0c0; /* 月光银 */
    --accent-rose: #9b59b6; /* 蔷薇紫 */
    --text-bone: #fdf6e3; /* 骨白 */
    --gothic-font: 'Cinzel', serif; /* 哥特风格字体 */
}

body {
    background-color: var(--primary-bg);
    color: var(--text-bone);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    overflow-x: hidden;
    background-image: url('../images/gothic-bg.jpg');
    background-attachment: fixed;
    background-size: cover;
}

a {
    color: var(--accent-rose);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-blood);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--gothic-font);
    color: var(--accent-silver);
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

/* 头部样式 */
.gothic-header {
    background: rgba(10, 5, 20, 0.8);
    border-bottom: 1px solid var(--accent-blood);
    backdrop-filter: blur(5px);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 50px;
    max-width: 1400px;
    margin: 0 auto;
}

.logo img {
    transition: transform 0.5s ease-in-out;
}

.logo img:hover {
    transform: rotateY(180deg);
}

/* 月相动画 */
#moon-phase-container {
    width: 50px;
    height: 50px;
    background-image: url('../images/moon-phases.png');
    background-size: cover;
    animation: moon-cycle 60s linear infinite;
}

@keyframes moon-cycle {
    0% { background-position: 0 0; }
    12.5% { background-position: -50px 0; }
    25% { background-position: -100px 0; }
    37.5% { background-position: -150px 0; }
    50% { background-position: -200px 0; }
    62.5% { background-position: -250px 0; }
    75% { background-position: -300px 0; }
    87.5% { background-position: -350px 0; }
    100% { background-position: -400px 0; }
}

/* 导航菜单 */
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.main-nav li {
    margin: 0 15px;
}

.main-nav a {
    font-family: var(--gothic-font);
    font-size: 1.2em;
    color: var(--accent-silver);
    padding: 10px;
    position: relative;
    overflow: hidden;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: var(--accent-blood);
    transition: left 0.4s ease;
}

.main-nav a:hover::after {
    left: 0;
}

/* 搜索框 */
.header-search input {
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--accent-rose);
    border-radius: 20px;
    color: var(--text-bone);
    padding: 8px 15px;
}

.header-search button {
    background: var(--accent-rose);
    border: none;
    color: var(--text-bone);
    border-radius: 20px;
    padding: 8px 15px;
    cursor: pointer;
    transition: background 0.3s;
}

.header-search button:hover {
    background: var(--accent-blood);
}

/* 血滴效果 */
#blood-drip-container {
    position: fixed;
    top: 0;
    width: 100%;
    height: 50px;
    pointer-events: none;
    z-index: 9999;
}

.blood-drip {
    position: absolute;
    width: 4px;
    height: 15px;
    background: var(--accent-blood);
    border-radius: 50%;
    animation: drip 5s linear infinite;
}

@keyframes drip {
    0% { top: -15px; opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100vh; opacity: 0; }
}

/* 主体内容 */
.main-content-wrapper {
    display: flex;
    max-width: 1400px;
    margin: 20px auto;
    gap: 20px;
    padding: 0 20px;
}

.main-content {
    flex: 3;
    background: rgba(10, 5, 20, 0.7);
    padding: 20px;
    border: 1px solid var(--accent-rose);
    border-radius: 10px;
}

/* 哥特柱装饰 */
.main-content-wrapper::before, .main-content-wrapper::after {
    content: '';
    flex-basis: 50px;
    background-image: url('../images/gothic-pillar.png');
    background-repeat: repeat-y;
    background-size: contain;
}

/* 首页 - 推荐区域 */
.featured-section h2, .latest-section h2 {
    text-align: center;
    font-size: 2em;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--accent-rose);
    padding-bottom: 10px;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

/* 哥特拱窗卡片 & 棺材开启效果 */
.post-card.coffin-card {
    background: #2c1a4d;
    border: 1px solid var(--accent-rose);
    clip-path: polygon(0% 100%, 0% 10%, 10% 0%, 90% 0%, 100% 10%, 100% 100%);
    position: relative;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.post-card .card-link {
    display: block;
    text-decoration: none;
}

.post-card .card-image {
    position: relative;
}

.post-card .card-image img {
    width: 100%;
    height: auto;
    display: block;
}

.post-card .card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
}

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

.play-icon {
    width: 50px;
    height: 50px;
    background: var(--accent-blood);
    clip-path: polygon(0 0, 100% 50%, 0 100%);
    transform: scale(0);
    transition: transform 0.3s;
}

.post-card:hover .play-icon {
    transform: scale(1);
}

.post-card .card-content {
    padding: 15px;
}

.post-card h3 {
    font-size: 1.1em;
    margin: 0 0 10px;
    color: var(--text-bone);
    height: 40px; /* 限制标题高度 */
    overflow: hidden;
}

.post-card .card-meta {
    font-size: 0.8em;
    color: var(--accent-silver);
    display: flex;
    justify-content: space-between;
}

/* 棺材开启悬停效果 */
.coffin-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1a0a2e;
    clip-path: polygon(0% 100%, 0% 10%, 10% 0%, 90% 0%, 100% 10%, 100% 100%);
    transform-origin: bottom;
    transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1);
    z-index: 1;
}

.coffin-card:hover::before {
    transform: perspective(1000px) rotateX(-90deg);
}

.coffin-card .card-link {
    position: relative;
    z-index: 2;
}

/* 首页 - 最新更新 */
.post-list-style .list-item {
    border-bottom: 1px dashed var(--accent-rose);
    padding: 10px 0;
}

.post-list-style .list-item a {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.list-cat {
    color: var(--accent-rose);
    font-family: var(--gothic-font);
}

.list-title {
    flex-grow: 1;
    margin: 0 15px;
    color: var(--text-bone);
}

.list-date {
    color: var(--accent-silver);
    font-size: 0.9em;
}

/* 侧边栏 */
.gothic-sidebar {
    flex: 1;
    background: rgba(10, 5, 20, 0.7);
    padding: 20px;
    border: 1px solid var(--accent-rose);
    border-radius: 10px;
    position: relative;
}

/* 烛光效果 */
.candle-container {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 20px;
    height: 50px;
}

.candle {
    width: 100%;
    height: 80%;
    background: var(--text-bone);
    position: absolute;
    bottom: 0;
    border-radius: 5px 5px 0 0;
}

.flame {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 20px;
    background: orange;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: flicker 1.5s infinite alternate;
}

@keyframes flicker {
    0% { transform: translateX(-50%) scaleY(1); }
    50% { transform: translateX(-45%) scaleY(1.05); }
    100% { transform: translateX(-55%) scaleY(0.95); }
}

.sidebar-widget {
    margin-bottom: 30px;
}

.sidebar-widget h3 {
    font-size: 1.5em;
    border-bottom: 1px solid var(--accent-blood);
    padding-bottom: 10px;
    margin-top: 0;
}

.ranking-list ul, .random-posts ul, .category-list ul {
    list-style: none;
    padding: 0;
}

.ranking-list li {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.rank-number {
    background: var(--accent-blood);
    color: var(--text-bone);
    width: 20px;
    height: 20px;
    text-align: center;
    line-height: 20px;
    border-radius: 50%;
    margin-right: 10px;
    font-family: var(--gothic-font);
}

.random-post-link {
    display: flex;
    align-items: center;
    gap: 10px;
}

.random-post-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border: 1px solid var(--accent-rose);
}

.category-list li a {
    display: block;
    padding: 8px;
    background: rgba(255,255,255,0.05);
    margin-bottom: 5px;
    border-left: 3px solid transparent;
    transition: all 0.3s;
}

.category-list li a:hover {
    border-left-color: var(--accent-blood);
    background: rgba(255,255,255,0.1);
    padding-left: 15px;
}

/* 十字架装饰 */
.cross-decoration {
    width: 30px;
    height: 40px;
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-silver);
    clip-path: polygon(30% 0%, 70% 0%, 70% 30%, 100% 30%, 100% 70%, 70% 70%, 70% 100%, 30% 100%, 30% 70%, 0% 70%, 0% 30%, 30% 30%);
    animation: rotate-cross 10s linear infinite;
}

@keyframes rotate-cross {
    from { transform: translateX(-50%) rotate(0deg); }
    to { transform: translateX(-50%) rotate(360deg); }
}

/* 列表页 - 古书翻页 */
.book-layout {
    display: flex;
    perspective: 1500px;
}

.book-page {
    flex: 1;
    padding: 20px;
    transition: transform 1s;
}

.left-page {
    background: rgba(0,0,0,0.2);
    transform-origin: right;
}

.right-page {
    background: rgba(0,0,0,0.3);
    transform-origin: left;
}

.book-layout:hover .left-page {
    transform: rotateY(-30deg);
}

.book-layout:hover .right-page {
    transform: rotateY(30deg);
}

.list-post-item {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--accent-rose);
    padding-bottom: 20px;
}

.list-post-item a {
    display: flex;
    gap: 15px;
}

.list-post-item img {
    width: 120px;
    height: 150px;
    object-fit: cover;
    border: 2px solid var(--accent-silver);
}

.list-post-item h3 {
    color: var(--accent-silver);
}

.list-post-item p {
    color: var(--text-bone);
    font-size: 0.9em;
}

/* 分页 */
.pagination-container {
    text-align: center;
    margin-top: 30px;
}

.pagination {
    list-style: none;
    padding: 0;
    display: inline-flex;
    border-radius: 25px;
    overflow: hidden;
    border: 1px solid var(--accent-rose);
}

.pagination li a {
    display: block;
    padding: 10px 15px;
    background: rgba(220, 20, 60, 0.2);
    color: var(--text-bone);
    transition: background 0.3s;
}

.pagination li a:hover, .pagination li.active a {
    background: var(--accent-blood);
}

/* 内容页 */
.post-header h1 {
    font-size: 2.5em;
    text-align: center;
    color: var(--accent-blood);
}

.post-meta {
    text-align: center;
    margin-bottom: 30px;
    color: var(--accent-silver);
}

.post-meta span {
    margin: 0 15px;
}

.post-body {
    line-height: 1.8;
    font-size: 1.1em;
}

.post-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    border: 3px solid var(--accent-silver);
}

.post-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--accent-rose);
}

/* FAQ 区域 */
.faq-section {
    margin-top: 40px;
    border-top: 1px dashed var(--accent-rose);
    padding-top: 20px;
}

.faq-title {
    text-align: center;
    font-size: 2em;
}

.faq-item {
    margin-bottom: 20px;
}

.faq-item h3 {
    background: rgba(220, 20, 60, 0.2);
    padding: 10px;
    cursor: pointer;
    border-left: 3px solid var(--accent-blood);
}

.faq-item div[itemprop="acceptedAnswer"] {
    padding: 15px;
    background: rgba(0,0,0,0.2);
}

/* 页脚 */
.gothic-footer {
    background: rgba(10, 5, 20, 0.9);
    border-top: 1px solid var(--accent-blood);
    padding: 30px 50px;
    margin-top: 30px;
}

.footer-container {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
    text-align: center;
}

.footer-links h3, .footer-domains h3 {
    color: var(--accent-silver);
    font-family: var(--gothic-font);
}

.footer-links ul, .footer-domains ul {
    list-style: none;
    padding: 0;
}

.footer-links li, .footer-domains li {
    margin: 5px 0;
}

.footer-info {
    width: 100%;
    text-align: center;
    margin-top: 20px;
    font-size: 0.9em;
    color: var(--accent-silver);
}

/* Canvas 特效容器 */
#bat-canvas, #petal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

/* 蔷薇花瓣 */
.petal {
    position: absolute;
    width: 15px;
    height: 15px;
    background-color: var(--accent-rose);
    border-radius: 100% 0;
    animation: fall linear infinite;
    transform: rotate(-45deg);
}

@keyframes fall {
    to {
        transform: translateY(100vh) rotate(360deg);
    }
}

/* 响应式设计 */

/* 1024px */
@media (max-width: 1024px) {
    .header-container {
        flex-direction: column;
        padding: 10px 20px;
    }

    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }

    .main-content-wrapper {
        flex-direction: column;
    }

    .main-content-wrapper::before, .main-content-wrapper::after {
        display: none; /* 在较小屏幕上隐藏哥特柱 */
    }

    .post-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

/* 768px */
@media (max-width: 768px) {
    .header-container {
        padding: 10px;
    }

    .main-nav li {
        margin: 5px;
    }

    .main-content-wrapper {
        padding: 0 10px;
        margin: 10px auto;
    }

    .book-layout {
        flex-direction: column;
    }

    .book-layout:hover .left-page, .book-layout:hover .right-page {
        transform: none;
    }

    .list-post-item a {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .post-navigation {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

/* 480px */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    .header-search {
        margin-top: 10px;
        width: 100%;
        display: flex;
    }

    .header-search input {
        flex-grow: 1;
    }

    .post-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .post-card h3 {
        font-size: 1em;
        height: 36px;
    }

    .post-header h1 {
        font-size: 2em;
    }

    .footer-container {
        flex-direction: column;
    }
}
