/* ========================================
   Glassmorphism Dark Theme Template
   玻璃拟态深色主题模板
   ======================================== */

/* CSS Variables - Dark Glass Theme */
:root {
    --primary: #00d4ff;
    --primary-glow: rgba(0, 212, 255, 0.3);
    --secondary: #ff006e;
    --accent: #8338ec;
    --background: #0a0a0f;
    --surface: rgba(255, 255, 255, 0.03);
    --surface-hover: rgba(255, 255, 255, 0.08);
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    --shadow-glow: 0 0 40px rgba(0, 212, 255, 0.15);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
    --radius-sm: 8px;
    --radius: 16px;
    --radius-lg: 24px;
    --max-width: 1400px;
    --sidebar-width: 320px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--background);
    background-image: 
        radial-gradient(ellipse at 20% 20%, rgba(0, 212, 255, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(131, 56, 236, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(255, 0, 110, 0.05) 0%, transparent 70%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

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

a:hover {
    color: #fff;
    text-shadow: 0 0 20px var(--primary-glow);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Layout */
#divAll {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

#divPage {
    padding: 0;
}

#divMiddle {
    width: auto;
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
    gap: 30px;
    align-items: start;
}

@media (max-width: 1024px) {
    #divMiddle {
        grid-template-columns: 1fr;
    }
}

/* Header */
#divTop {
    padding: 40px 0;
    text-align: center;
    position: relative;
}

#divTop::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 200px;
    background: radial-gradient(ellipse, var(--primary-glow) 0%, transparent 70%);
    pointer-events: none;
}

#BlogTitle {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 12px;
    position: relative;
    background: linear-gradient(135deg, #fff 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#BlogTitle a {
    color: inherit;
    -webkit-text-fill-color: transparent;
}

#BlogSubTitle {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
    position: relative;
}

/* Navigation */
#divNavBar {
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 8px;
    margin-bottom: 40px;
    position: relative;
}

#divNavBar::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: var(--radius);
    padding: 1px;
    background: linear-gradient(135deg, var(--primary), var(--accent), var(--secondary));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.5;
}

#divNavBar ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    list-style: none;
    position: relative;
}

#divNavBar li {
    display: inline-block;
}

#divNavBar a {
    display: block;
    padding: 12px 24px;
    font-weight: 500;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#divNavBar a::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: var(--radius-sm);
}

#divNavBar a:hover {
    color: #fff;
}

#divNavBar a:hover::before {
    opacity: 0.1;
}

/* Main Content */
#divMain {
    min-width: 0;
}

/* Post Cards - Glass Effect */
.post {
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-card);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.post::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.post:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow), var(--shadow-card);
    border-color: rgba(0, 212, 255, 0.2);
}

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

.post-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 16px;
}

.post-date::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary);
}

.post-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 16px;
    line-height: 1.4;
}

.post-title a {
    color: var(--text-primary);
    position: relative;
}

.post-title a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.3s ease;
}

.post-title a:hover::after {
    width: 100%;
}

.post-body {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 20px;
}

.post-footer {
    font-size: 0.875rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Single Post */
.post.single {
    padding: 40px;
}

.post.single .post-title {
    font-size: 2.25rem;
    margin-bottom: 24px;
}

.post.single .post-body {
    font-size: 1.125rem;
    line-height: 1.9;
    color: var(--text-secondary);
}

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

/* Sidebar */
#divSidebar {
    position: sticky;
    top: 30px;
}

.function {
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-card);
}

.function_t {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    padding-bottom: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--glass-border);
    position: relative;
}

.function_t::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 2px;
}

.function_c ul {
    list-style: none;
}

.function li {
    padding: 12px 0;
    border-bottom: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.function li:last-child {
    border-bottom: none;
}

.function li:hover {
    padding-left: 8px;
}

.function a {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.function a::before {
    content: '→';
    color: var(--primary);
    font-size: 0.75rem;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.function a:hover {
    color: var(--text-primary);
}

.function a:hover::before {
    opacity: 1;
    transform: translateX(0);
}

/* Pagination */
.pagebar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 48px 0;
    flex-wrap: wrap;
}

.pagebar a,
.pagebar span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 48px;
    padding: 0 16px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.pagebar a:hover {
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
}

.now-page a,
.pagebar .current {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-color: transparent;
    box-shadow: 0 0 30px var(--primary-glow);
}

/* Comments */
#divCommentPost {
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 32px;
    margin-top: 40px;
    box-shadow: var(--shadow-card);
}

#divCommentPost p {
    margin-bottom: 20px;
}

#txaArticle {
    width: 100%;
    padding: 16px 20px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    resize: vertical;
    transition: all 0.3s ease;
}

#txaArticle:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
}

.button,
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
}

.button:hover,
input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 212, 255, 0.4);
}

/* Footer */
#divBottom {
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    padding: 40px;
    margin-top: 80px;
    text-align: center;
    border-radius: var(--radius) var(--radius) 0 0;
}

#BlogCopyRight {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

#BlogCopyRight a {
    color: var(--primary);
}

/* Utilities */
.clear {
    clear: both;
}

/* Responsive */
@media (max-width: 768px) {
    #divAll {
        padding: 0 16px;
    }
    
    #BlogTitle {
        font-size: 2rem;
    }
    
    #divNavBar {
        padding: 6px;
    }
    
    #divNavBar a {
        padding: 10px 16px;
        font-size: 0.875rem;
    }
    
    .post {
        padding: 20px;
    }
    
    .post-title {
        font-size: 1.25rem;
    }
    
    .post.single {
        padding: 24px;
    }
    
    .post.single .post-title {
        font-size: 1.5rem;
    }
    
    #divSidebar {
        position: static;
    }
    
    .function {
        padding: 20px;
    }
    
    #divBottom {
        padding: 30px 20px;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px var(--primary-glow);
    }
    50% {
        box-shadow: 0 0 40px var(--primary-glow), 0 0 60px rgba(131, 56, 236, 0.2);
    }
}

.post {
    animation: fadeInUp 0.6s ease forwards;
}

.post:nth-child(1) { animation-delay: 0.05s; }
.post:nth-child(2) { animation-delay: 0.1s; }
.post:nth-child(3) { animation-delay: 0.15s; }
.post:nth-child(4) { animation-delay: 0.2s; }
.post:nth-child(5) { animation-delay: 0.25s; }

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}
