/*
 * Template Name: 魔法少女变身
 * Author: Manus AI
 * Description: A magical girl themed template for 小旋风蜘蛛池Pro.
 */

:root {
    --primary-pink: #ff6b9d;
    --primary-purple: #c471ed;
    --primary-blue: #8b5cf6;
    --starlight-gold: #ffd700;
    --moonlight-white: #f0f0ff;
    --magic-blue: #4fc3f7;
    --text-color: #e0e0ff;
    --bg-color-dark: #0f0c29;
    --bg-color-light: #24243e;
    --card-bg: rgba(40, 35, 70, 0.85);
    --border-color: rgba(196, 113, 237, 0.3);
}

/* --- Keyframe Animations --- */
@keyframes rainbow-text-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes starry-sky-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes magic-circle-spin {
    0% { transform: rotate(0deg) scale(1); opacity: 1; }
    50% { transform: rotate(180deg) scale(1.2); opacity: 0.7; }
    100% { transform: rotate(360deg) scale(1); opacity: 1; }
}

@keyframes halo-diffuse {
    0% { box-shadow: 0 0 0 0 rgba(255, 107, 157, 0.7); }
    70% { box-shadow: 0 0 20px 30px rgba(255, 107, 157, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 107, 157, 0); }
}

@keyframes light-pillar {
    from { height: 0; opacity: 0.6; }
    to { height: 100px; opacity: 0; }
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- General Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', sans-serif;
    background-color: var(--bg-color-dark);
    color: var(--text-color);
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: url('https://www.transparenttextures.com/patterns/stardust.png') repeat;
    background-color: var(--bg-color-dark);
    z-index: -2;
}

body::after {
    content: '';
    position: fixed;
    top: 50%; left: 50%;
    width: 200vmax; height: 200vmax;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIj48ZGVmcz48cmFkaWFsR3JhZGllbnQgaWQ9ImciIGN4PSI1MCUiIGN5PSI1MCUiIHI9IjUwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0icmdiYSgyNTUsIDI1NSwgMjU1LCAwLjEpIiAvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0icmdiYSgyNTUsIDI1NSwgMjU1LCAwKSIgLz48L3JhZGlhbEdyYWRpZW50PjwvZGVmcz48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSJ1cmwoI2cpIiAvPjwvc3ZnPg==');
    background-size: 10px 10px;
    transform: translate(-50%, -50%);
    animation: starry-sky-rotate 300s linear infinite;
    z-index: -1;
    opacity: 0.5;
}

#star-particles {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
}

a {
    color: var(--magic-blue);
    text-decoration: none;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

a:hover {
    color: var(--starlight-gold);
    text-shadow: 0 0 8px var(--starlight-gold);
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    position: relative;
    z-index: 2;
}

/* --- Loading Effect --- */
.loading-wrapper {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--bg-color-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.magic-circle {
    width: 100px;
    height: 100px;
    border: 3px solid var(--starlight-gold);
    border-radius: 50%;
    position: relative;
    animation: magic-circle-spin 2s linear infinite;
}

.magic-circle::before, .magic-circle::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--primary-pink);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary-pink);
}

.magic-circle::before {
    top: -10px; left: 50%;
    transform: translateX(-50%);
}

.magic-circle::after {
    bottom: -10px; left: 50%;
    transform: translateX(-50%);
    background: var(--magic-blue);
    box-shadow: 0 0 10px var(--magic-blue);
}

/* --- Header --- */
.main-header {
    padding: 20px 0;
    background: rgba(15, 12, 41, 0.5);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    transition: transform 0.3s ease;
}

.logo:hover img {
    transform: scale(1.1) rotate(-5deg);
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 25px;
}

.main-nav a {
    font-size: 1.1em;
    font-weight: bold;
    padding: 10px 15px;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0; left: -100%;
    width: 100%; height: 3px;
    background: linear-gradient(90deg, var(--primary-pink), var(--primary-purple), var(--starlight-gold));
    transition: left 0.4s ease;
}

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

/* --- Main Content Layout --- */
.main-content {
    display: flex;
    gap: 30px;
    padding-top: 40px;
    padding-bottom: 40px;
}

.content-area {
    flex: 1;
    min-width: 0;
}

.sidebar {
    width: 300px;
    flex-shrink: 0;
}

/* --- Section Titles & Dividers --- */
.section-title {
    font-size: 2.5em;
    margin-bottom: 30px;
    text-align: center;
    background: linear-gradient(45deg, var(--primary-pink), var(--primary-purple), var(--starlight-gold), var(--magic-blue));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 400% 400%;
    animation: rainbow-text-flow 10s ease infinite;
    position: relative;
}

.heart-divider {
    width: 100%;
    text-align: center;
    margin: 40px 0;
}

.heart-divider::before {
    content: '\2764'; /* Heart symbol */
    font-size: 2em;
    color: var(--primary-pink);
    text-shadow: 0 0 10px var(--primary-pink);
    position: relative;
}

/* --- Card Layout --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.magic-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(5px);
}

.magic-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px var(--primary-purple);
    animation: halo-diffuse 1.5s infinite alternate;
}

.magic-card::before, .magic-card::after {
    content: '\2728'; /* Star symbol */
    position: absolute;
    font-size: 1.2em;
    color: var(--starlight-gold);
    text-shadow: 0 0 5px var(--starlight-gold);
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.magic-card::before {
    top: 10px; left: 10px;
}

.magic-card::after {
    bottom: 10px; right: 10px;
    transform: rotate(90deg);
}

.magic-card:hover::before, .magic-card:hover::after {
    opacity: 1;
}

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

.magic-card .card-image img {
    width: 100%;
    display: block;
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

.card-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.play-icon {
    width: 50px; height: 50px;
    background: rgba(255,255,255,0.8);
    border-radius: 50%;
    position: relative;
}

.play-icon::after {
    content: '';
    position: absolute;
    top: 50%; left: 55%;
    transform: translate(-50%, -50%);
    width: 0; height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 15px solid var(--primary-pink);
}

.card-content {
    padding: 15px;
}

.card-title {
    font-size: 1.1em;
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--moonlight-white);
}

.card-info {
    font-size: 0.9em;
    color: var(--text-color);
    opacity: 0.8;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Light Pillar Effect */
.magic-card a::after {
    content: '';
    position: absolute;
    bottom: 0; left: 50%;
    transform: translateX(-50%);
    width: 80%;
    background: linear-gradient(to top, rgba(196, 113, 237, 0.5), transparent);
    border-radius: 50% 50% 0 0;
}

.magic-card:hover a::after {
    animation: light-pillar 0.5s ease-out;
}

/* --- Sidebar Widgets --- */
.widget {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 25px;
    backdrop-filter: blur(5px);
}

.widget-title {
    font-size: 1.5em;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-purple);
    color: var(--moonlight-white);
    text-align: center;
}

.widget-ranking ul, .widget-category ul {
    list-style: none;
}

.widget-ranking li a {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-color);
}

.widget-ranking li:last-child a {
    border-bottom: none;
}

.widget-ranking i {
    font-style: normal;
    font-weight: bold;
    margin-right: 15px;
    width: 24px; height: 24px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background: var(--primary-purple);
    color: white;
}

.widget-ranking li:nth-child(1) i { background: #ffd700; color: #333; }
.widget-ranking li:nth-child(2) i { background: #c0c0c0; color: #333; }
.widget-ranking li:nth-child(3) i { background: #cd7f32; color: #333; }

.random-posts {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.random-post-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.random-post-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--primary-pink);
}

.random-post-item span {
    flex: 1;
    font-size: 0.95em;
}

.widget-category ul {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.widget-category li a {
    display: block;
    padding: 8px 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    transition: background 0.3s, color 0.3s;
}

.widget-category li a:hover {
    background: var(--primary-pink);
    color: white;
}

/* --- Footer --- */
footer {
    background: rgba(15, 12, 41, 0.7);
    border-top: 1px solid var(--border-color);
    padding: 40px 0;
    margin-top: 40px;
    text-align: center;
}

footer .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 30px;
}

.links-section, .domains-section {
    flex: 1;
    min-width: 200px;
}

footer h3 {
    color: var(--starlight-gold);
    margin-bottom: 15px;
}

footer ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 15px;
}

.copyright {
    width: 100%;
    margin-top: 30px;
    opacity: 0.7;
}

/* --- List & Show Page Specifics --- */
.breadcrumb {
    padding: 15px 20px;
    background: var(--card-bg);
    border-radius: 15px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.pagination a {
    padding: 10px 15px;
    border: 1px solid var(--primary-purple);
    border-radius: 10px;
}

.pagination a.current, .pagination a:hover {
    background: var(--primary-purple);
    color: white;
    box-shadow: 0 0 10px var(--primary-purple);
}

.post-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 30px;
}

.post-title {
    font-size: 2.8em;
    text-align: center;
    margin-bottom: 20px;
    background: linear-gradient(45deg, var(--primary-pink), var(--primary-purple), var(--starlight-gold));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 300% 300%;
    animation: rainbow-text-flow 8s ease infinite;
}

.post-meta {
    text-align: center;
    margin-bottom: 30px;
    opacity: 0.8;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.video-player-container {
    position: relative;
    margin-bottom: 30px;
    cursor: pointer;
}

.video-poster {
    width: 100%;
    border-radius: 15px;
}

.play-button-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 15px;
    transition: background 0.3s;
}

.play-button-overlay:hover {
    background: rgba(0,0,0,0.2);
}

.play-icon-large {
    width: 80px; height: 80px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    position: relative;
    transition: transform 0.3s;
}

.play-button-overlay:hover .play-icon-large {
    transform: scale(1.1);
}

.play-icon-large::after {
    content: '';
    position: absolute;
    top: 50%; left: 55%;
    transform: translate(-50%, -50%);
    width: 0; height: 0;
    border-top: 20px solid transparent;
    border-bottom: 20px solid transparent;
    border-left: 30px solid var(--primary-pink);
}

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

.post-body p {
    margin-bottom: 1.5em;
}

.post-navigation {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px dashed var(--border-color);
    display: flex;
    justify-content: space-between;
}

/* --- Responsive Design --- */

/* Tablet (<= 1024px) */
@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
    }
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .main-header .container {
        flex-direction: column;
        gap: 15px;
    }
}

/* Mobile Large (<= 768px) */
@media (max-width: 768px) {
    .card-grid {
        grid-template-columns: 1fr;
    }
    .section-title {
        font-size: 2em;
    }
    .post-title {
        font-size: 2.2em;
    }
    .main-nav ul {
        gap: 10px;
        flex-wrap: wrap;
        justify-content: center;
    }
    .main-nav a {
        font-size: 1em;
        padding: 8px 10px;
    }
    footer .container {
        flex-direction: column;
    }
}

/* Mobile Small (<= 480px) */
@media (max-width: 480px) {
    .container {
        width: 95%;
    }
    .post-content {
        padding: 20px;
    }
    .post-meta {
        flex-direction: column;
        gap: 10px;
    }
    .play-icon-large {
        width: 60px; height: 60px;
    }
    .play-icon-large::after {
        border-top-width: 15px;
        border-bottom-width: 15px;
        border-left-width: 22px;
    }
    .post-navigation {
        flex-direction: column;
        gap: 15px;
    }
}
