/* TARDIS Theme Styles */

:root {
    --tardis-blue: #003b6f;
    --tardis-light: #005696;
    --space-black: #0b0f19;
    --star-white: #e2e8f0;
    --sonic-green: #00ff00;
    --regeneration-gold: #fbbf24;
}

body {
    background-color: var(--space-black);
    color: var(--star-white);
    font-family: 'Lato', sans-serif;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, .brand-font {
    font-family: 'Orbitron', sans-serif;
}

/* Time Vortex Background */
.time-vortex {
    background: radial-gradient(circle at center, #1a202c 0%, #000000 100%);
    position: relative;
    overflow: hidden;
}

.stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #eee, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 40px 70px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 50px 160px, #ddd, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 90px 40px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 130px 80px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 160px 120px, #ddd, rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 200px 200px;
    animation: moveStars 10s linear infinite;
    opacity: 0.5;
}

@keyframes moveStars {
    from {transform: translateY(0);}
    to {transform: translateY(-200px);}
}

/* TARDIS Animation */
.tardis-container {
    position: relative;
    width: 120px;
    height: 200px;
    margin: 0 auto;
    animation: spinTardis 8s ease-in-out infinite;
    transform-style: preserve-3d;
}

.tardis-box {
    width: 100%;
    height: 100%;
    background: var(--tardis-blue);
    border: 4px solid #00284d;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 59, 111, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tardis-light {
    width: 20px;
    height: 25px;
    background: rgba(255, 255, 255, 0.8);
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px 2px 0 0;
    box-shadow: 0 0 15px #fff;
    animation: pulseLight 2s infinite;
}

.tardis-sign {
    width: 90%;
    height: 20px;
    background: #000;
    color: #fff;
    font-size: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    margin-top: 10px;
    border: 1px solid #fff;
    text-align: center;
    line-height: 1;
}

.tardis-windows {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    margin-top: 10px;
    width: 80%;
}

.window {
    height: 30px;
    background: #e2e8f0;
    border: 2px solid #00284d;
    opacity: 0.9;
}

.door-panel {
    width: 80%;
    flex-grow: 1;
    margin-top: 10px;
    margin-bottom: 10px;
    border: 2px solid #002244;
    background: var(--tardis-light);
    display: grid;
    grid-template-rows: repeat(3, 1fr);
    gap: 2px;
    padding: 2px;
}

.panel-rect {
    background: var(--tardis-blue);
    border: 1px solid rgba(0,0,0,0.2);
}

@keyframes pulseLight {
    0%, 100% { opacity: 0.5; box-shadow: 0 0 5px #fff; }
    50% { opacity: 1; box-shadow: 0 0 25px #fff; }
}

@keyframes spinTardis {
    0% { transform: translateY(0) rotate(0deg) scale(0.9); }
    50% { transform: translateY(-20px) rotate(5deg) scale(1); }
    100% { transform: translateY(0) rotate(0deg) scale(0.9); }
}

/* Glitch Effect (Sonic Screwdriver Effect) */
.glitch-active {
    animation: glitch-anim 0.3s infinite;
    filter: hue-rotate(90deg);
}

@keyframes glitch-anim {
    0% { transform: translate(0) }
    20% { transform: translate(-2px, 2px) }
    40% { transform: translate(-2px, -2px) }
    60% { transform: translate(2px, 2px) }
    80% { transform: translate(2px, -2px) }
    100% { transform: translate(0) }
}

/* Post Card Hover Glow */
.post-card {
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.1);
}
.post-card:hover {
    border-color: var(--regeneration-gold);
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.3);
    transform: translateY(-5px);
}

.glass-panel {
    background: rgba(11, 15, 25, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Container */
.container {
    width: 100%;
    max-width: 1400px; /* 增加最大宽度以提供更多空间 */
    margin: 0 auto;
    padding: 0 20px;
}

/* Links */
a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

/* Main Layout */
main {
    display: flex;
    gap: 40px;
    margin-bottom: 60px;
}

#main-content {
    flex: 1;
    min-width: 0; /* 允许内容区域收缩 */
}

#main-content .article-page {
    max-width: 100%;
    margin: 0;
}

/* 文章网格布局优化 */
#main-content .grid {
    grid-template-columns: 1fr; /* 默认单列 */
}

@media (min-width: 768px) {
    #main-content .grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* 响应式多列 */
    }
}

#main-content .article-page {
    max-width: 100%;
    margin: 0;
}

aside {
    flex: 0 0 300px; /* 固定侧边栏宽度为300px */
}

/* Article Card */
.article-card {
    background: rgba(26, 26, 26, 0.3);
    border: 1px solid #333;
    margin-bottom: 32px;
    position: relative;
    transition: all 0.3s ease;
}

.article-card::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: -5px;
    width: 100%;
    height: 100%;
    border: 1px solid var(--text-dim);
    z-index: -1;
    pointer-events: none;
}

.article-card:hover {
    border-color: var(--text-main);
    transform: translate(-2px, -2px);
}

.article-image {
    height: 220px;
    background-color: var(--concrete);
    background-size: cover;
    background-position: center;
    position: relative;
    filter: grayscale(100%) contrast(120%) brightness(80%);
    transition: filter 0.3s ease;
}

.article-card:hover .article-image {
    filter: grayscale(0%) contrast(100%) sepia(20%);
}

.article-title {
    font-size: 1.5rem;
    color: #e0e0e0;
    margin-bottom: 10px;
    font-weight: bold;
}

.article-content {
    padding: 20px;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    color: var(--text-dim);
    font-size: 0.8rem;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.article-excerpt {
    color: var(--text-main);
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Sidebar Widgets */
.sidebar-widget {
    background: rgba(26, 26, 26, 0.3);
    border: 1px solid #333;
    padding: 20px;
    margin-bottom: 30px;
}

.widget-title {
    color: var(--regeneration-gold);
    font-size: 1.1rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #333;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#category-list {
    list-style: none;
}

#category-list a {
    display: block;
    padding: 8px 0;
    color: var(--star-white);
    border-bottom: 1px dashed #333;
}

#category-list a:hover {
    color: var(--regeneration-gold);
    padding-left: 5px;
}

/* Tags */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    background: transparent;
    border: 1px solid #333;
    color: var(--star-white);
    padding: 4px 10px;
    font-size: 0.8rem;
    cursor: pointer;
}

.tag:hover {
    border-color: var(--regeneration-gold);
    color: var(--regeneration-gold);
}

/* Footer */
footer {
    background: var(--tardis-blue);
    border-top: 1px solid #00284d;
    padding: 40px 0;
    color: var(--star-white);
}

/* Article Page */
.article-page {
    max-width: 100%;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    main {
        flex-direction: column;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .search-box input {
        border-radius: 0;
        margin-bottom: 10px;
    }
    
    .search-box button {
        border-radius: 0;
        padding: 10px;
    }
    
    .tardis-container {
        width: 80px;
        height: 150px;
    }
    
    .hero-text h1 {
        font-size: 2rem;
    }
}