/* ==========================================================================
   Cyberpunk Theme - Global Styles
   Tema: High-Tech, Dark, Neon Purple, Glitch
   ========================================================================== */

/* 设置全局基础样式 - 黑色底色，等宽字体更有科技感 */
body {
    background-color: #050505; /* 极黑背景 */
    color: #e0e0e0;
    font-family: 'Courier New', Courier, monospace; /* 复古终端字体 */
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    line-height: 1.6;
    overflow-x: hidden; /* 防止光效溢出出现滚动条 */
    position: relative;
    min-height: 100vh;
}

/* --- 动态赛博朋克背景 --- */
/* (原有的 CSS 背景已移除，改为使用 JavaScript Canvas 实现更复杂的随机激光效果) */

/* 依然保留一个基础的呼吸光晕，作为 Canvas 的底层氛围 */
.background-glow {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 60vw;
    height: 60vh;
    transform: translate(-50%, -50%);
    /* 调低了不透明度，让 Canvas 激光更明显 */
    background: radial-gradient(circle, rgba(138, 43, 226, 0.1) 0%, transparent 60%);
    z-index: -3; /* 放在最底层 */
    animation: pulse 6s ease-in-out infinite alternate;
    pointer-events: none;
}

/* 头部样式 */
.header {
    text-align: center;
    padding: 60px 0;
    margin-bottom: 20px;
    position: relative;
}

/* 霓虹标题 */
.header h1 {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 10px;
    color: #fff;
    /* text-transform: uppercase;  已移除强制大写 */
    letter-spacing: 4px;
    text-shadow: 
        0 0 5px #fff,
        0 0 10px #fff,
        0 0 20px #bc13fe,
        0 0 40px #bc13fe,
        0 0 80px #bc13fe; /* 强烈的紫色霓虹光圈 */
    animation: neon-flicker 3s infinite alternate; /* 微微闪烁 */
}

.header p {
    color: #00f3ff; /* 赛博蓝 */
    letter-spacing: 2px;
    text-shadow: 0 0 5px rgba(0, 243, 255, 0.7);
}

/* 头像样式 - 全息投影感 */
.avatar {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #00f3ff;
    box-shadow: 0 0 20px #00f3ff, inset 0 0 20px #00f3ff;
    filter: contrast(1.2) brightness(1.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 0 40px #00f3ff, inset 0 0 30px #00f3ff;
}

/* 内容区块样式 */
.section {
    margin: 60px 0;
}

.section h2 {
    font-size: 2rem;
    margin-bottom: 30px;
    border-left: 5px solid #bc13fe;
    padding-left: 15px;
    color: #fff;
    text-shadow: 0 0 10px #bc13fe;
}

/* --- 核心：Grid 网格布局 (保持之前的布局但换皮肤) --- */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.project-card {
    background: rgba(20, 20, 20, 0.7); /* 半透明黑 */
    padding: 30px;
    border: 1px solid #333;
    border-radius: 4px; /* 硬朗的直角或微圆角 */
    position: relative;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    overflow: hidden; /* 隐藏发光边框溢出 */
}

/* 卡片悬停特效 - 边框发光 */
.project-card:hover {
    transform: translateY(-5px);
    border-color: #bc13fe;
    box-shadow: 
        0 0 10px rgba(188, 19, 254, 0.4), 
        inset 0 0 20px rgba(188, 19, 254, 0.1);
}

/* 装饰性的小角标 */
.project-card::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 20px;
    background: linear-gradient(45deg, transparent 50%, #00f3ff 50%);
    opacity: 0.5;
}

.project-card h3 {
    margin-top: 0;
    font-size: 1.5rem;
    color: #00f3ff;
}

.project-card p {
    color: #aaa;
}

.project-card a {
    display: inline-block;
    margin-top: 15px;
    font-weight: bold;
    color: #bc13fe;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
    padding: 5px 10px;
    border: 1px solid #bc13fe;
    transition: all 0.3s;
}

.project-card a:hover {
    background-color: #bc13fe;
    color: #000;
    box-shadow: 0 0 15px #bc13fe;
}

/* 链接通用样式 */
.section ul li a, p a {
    color: #00f3ff;
    text-decoration: none;
    border-bottom: 1px dashed #00f3ff;
    transition: text-shadow 0.3s;
}
.section ul li a:hover, p a:hover {
    text-shadow: 0 0 8px #00f3ff;
}

/* --- Shared list-page styles (Course Notes + Reading Papers + Course sections) --- */
.paper-list-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.paper-item {
    background: rgba(20, 20, 20, 0.7);
    border: 1px solid #333;
    border-left: 3px solid #bc13fe;
    padding: 25px;
    margin-bottom: 30px;
    border-radius: 4px;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    position: relative;
}

.paper-item:hover {
    transform: translateX(10px);
    border-color: #00f3ff;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.1);
    border-left-color: #00f3ff;
}

.paper-title {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 10px;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(188, 19, 254, 0.5);
}

.paper-abstract {
    color: #ccc;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.paper-meta {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 15px;
    font-style: italic;
}

.read-btn {
    display: inline-block;
    padding: 8px 20px;
    background: transparent;
    border: 1px solid #bc13fe;
    color: #bc13fe;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    transition: all 0.3s;
}

.read-btn:hover {
    background: #bc13fe;
    color: #000;
    box-shadow: 0 0 15px #bc13fe;
}

.paper-number {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.05);
    font-weight: 900;
    pointer-events: none;
}

.header-back-link {
    color: #bc13fe;
    text-decoration: none;
    border: 1px solid #bc13fe;
    padding: 5px 10px;
    font-size: 0.8rem;
    margin-top: 15px;
    display: inline-block;
    transition: all 0.3s;
}

.header-back-link:hover {
    background-color: #bc13fe;
    color: #000;
    box-shadow: 0 0 15px #bc13fe;
}

/* Markdown note pages: keep author-entered soft line breaks inside blockquotes */
.markdown-body blockquote p {
    white-space: pre-line;
}

/* --- Shared Markdown note page styles (CourseNotes + ReadingPaper) --- */
.note-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 30px;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(10px);
    border-left: 1px solid #333;
    border-right: 1px solid #333;
    min-height: 80vh;
}

.markdown-body {
    color: #ccc;
    line-height: 1.8;
    font-size: 1.05rem;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3 {
    color: #fff;
    margin-top: 1.5em;
    margin-bottom: 0.8em;
    text-shadow: 0 0 10px rgba(188, 19, 254, 0.3);
}

.markdown-body h1 {
    font-size: 2.2rem;
    border-bottom: 2px solid #bc13fe;
    padding-bottom: 15px;
}

.markdown-body h2 {
    font-size: 1.6rem;
    border-left: 4px solid #00f3ff;
    padding-left: 15px;
}

.markdown-body p {
    margin-bottom: 1.2em;
    text-align: justify;
}

.markdown-body strong {
    color: #00f3ff;
}

.markdown-body em {
    color: #bc13fe;
    font-style: italic;
}

.markdown-body blockquote {
    border-left: 4px solid #555;
    margin: 20px 0;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    color: #aaa;
}

.markdown-body code {
    background: #222;
    color: #ff00de;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.markdown-body pre {
    background: #111;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #333;
    overflow-x: auto;
    margin: 20px 0;
}

.markdown-body pre code {
    color: #eee;
    background: transparent;
    padding: 0;
}

.markdown-body img {
    max-width: 100%;
    border-radius: 4px;
    border: 1px solid #333;
    margin: 20px 0;
    transition: all 0.3s ease;
}

.markdown-body img.align-right { float: right; margin: 0 0 20px 20px; clear: right; }
.markdown-body img.align-left { float: left; margin: 0 20px 20px 0; clear: left; }
.markdown-body img.width-small { max-width: 30%; min-width: 200px; }
.markdown-body img.width-medium { max-width: 50%; min-width: 300px; }
.markdown-body img.width-large { max-width: 80%; }
.markdown-body::after { content: ""; display: table; clear: both; }

.markdown-body ul, .markdown-body ol {
    padding-left: 20px;
    margin-bottom: 20px;
}

.markdown-body li {
    margin-bottom: 8px;
}

.note-loading {
    color: #666;
    text-align: center;
}

/* --- 摄影集样式适配 --- */
.gallery-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    column-count: 3;
    column-gap: 20px;
}

@media (max-width: 800px) { .gallery-container { column-count: 2; } }
@media (max-width: 500px) { .gallery-container { column-count: 1; } }

.photo-item {
    break-inside: avoid;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    border: 1px solid #333;
    transition: border-color 0.3s;
}

.photo-item:hover {
    border-color: #00f3ff;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.3);
}

.photo-item img {
    width: 100%;
    display: block;
    filter: grayscale(30%); /* 让照片稍微带点冷感 */
    transition: all 0.5s ease;
}

.photo-item:hover img {
    transform: scale(1.05);
    filter: grayscale(0%); /* 悬停恢复原色 */
}

.photo-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.85); /* 更深的遮罩 */
    color: #00f3ff;
    padding: 15px;
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.3s;
    border-top: 1px solid #00f3ff;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.photo-item:hover .photo-overlay {
    opacity: 1;
    transform: translateY(0);
}

/* --- 灯箱效果 (保持功能，适配暗黑风) --- */
.lightbox {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.95); /* 更黑的背景 */
    backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 0.25s ease;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
}
.lightbox.show { opacity: 1; }
.lightbox-content {
    margin: 0 auto;
    display: block;
    width: auto;
    height: auto;
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border: 2px solid #333;
    box-shadow: 0 0 30px rgba(188, 19, 254, 0.2);
    opacity: 0;
    transform: scale(0.98);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
#caption {
    color: #00f3ff;
    text-shadow: 0 0 5px #00f3ff;
    font-family: 'Courier New', monospace;
    text-align: center;
    margin: 0 auto;
    max-width: 80%;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    order: 0;
}
.lightbox.show .lightbox-content {
    opacity: 1;
    transform: scale(1);
}
.lightbox.show #caption {
    opacity: 1;
    transform: translateY(0);
}
.lightbox-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.lightbox-meta {
    color: #aaa;
    font-size: 0.85rem;
}
.close-btn {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    text-shadow: 0 0 10px #ff00de;
}

/* --- 关键帧动画定义 --- */
@keyframes neon-flicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        text-shadow: 
            0 0 5px #fff,
            0 0 10px #fff,
            0 0 20px #bc13fe,
            0 0 40px #bc13fe,
            0 0 80px #bc13fe;
        opacity: 1;
    }
    20%, 24%, 55% {
        text-shadow: none;
        opacity: 0.8;
    }
}

@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.5; }
    100% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.8; }
}

@keyframes scanlines {
    0% { background-position: 0% 0%; }
    100% { background-position: 0% 100%; }
}
