/* --- 洛天依主题 - 明亮风格 with Background & Particles --- */

:root {
    --tianyi-blue: #66CCFF;
    --tianyi-blue-dark: #55bbee;
    --text-color: #333333;
    --text-secondary-color: #666666; /* 新增次要文本颜色 */
    --section-bg: rgba(255, 255, 255, 0.7); /* 更低的透明度，让背景更明显 */
    --card-bg: rgba(253, 253, 253, 0.7); /* 更低的透明度 */
    --border-color: rgba(102, 204, 255, 0.3);
    --highlight-color: #66CCFF; /* 主强调色 */

    /* 博客代码块颜色 */
    --code-bg-color: #f5f5f5;
    --code-text-color: #333333;
    --code-inline-bg-color: rgba(0, 0, 0, 0.08);
}

body {
    font-family: 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.8;
    color: var(--text-color);
    background-color: transparent; /* 背景由伪元素处理 */
    margin: 0;
    padding: 20px;
    transition: color 0.5s ease;
}

body::before,
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    z-index: -1; /* 置于所有内容之后 */
    transition: opacity 0.5s ease-in-out;
}

body::before {
    background-image: linear-gradient(rgba(200, 220, 240, 0.7), rgba(180, 200, 220, 0.8)), url('../images/A星.webp');
    opacity: 1;
}

body::after {
    background-image: linear-gradient(rgba(10, 15, 25, 0.8), rgba(10, 15, 25, 0.9)), url('../images/A星.webp');
    opacity: 0;
}

h1, h2, h3, .tagline, .project-card p, .skill-tag, footer {
    transition: color 0.5s ease, background-color 0.5s ease, border-color 0.5s ease;
}

#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0; /* 置于最底层 */
}

.overall-wrapper {
    display: flex;
    max-width: 1200px; /* Adjust as needed */
    width: 100%;
    margin: 20px auto; /* Add vertical margin */
    position: relative;
    z-index: 1;
    gap: 30px; /* Space between columns */
    padding: 0 20px; /* Horizontal padding for smaller screens */
}

/* Left Sidebar */
.left-sidebar {
    width: 300px; /* Fixed width for left sidebar */
    display: flex;
    flex-direction: column;
    gap: 20px; /* Space between top-left and bottom-left */
    position: sticky;
    top: 20px; /* Distance from top of viewport */
    height: fit-content; /* Only take content height */
}

/* Top Left Profile */
.top-left-profile {
    background-color: var(--section-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(102, 204, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    text-align: center; /* Center content like avatar */
    position: relative; /* Add position relative for theme-toggle absolute positioning */
}

.top-left-profile header { /* Adjust original header styling */
    all: unset; /* Remove all default header styles */
    display: block; /* Make it a block element again */
}

.top-left-profile .avatar-container {
    margin-bottom: 20px;
}




/* Bottom Left Contact Display */
.bottom-left-contact-display {
    background-color: var(--section-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(102, 204, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    flex-grow: 1; /* Allow it to grow and fill vertical space */
}

/* Right Main Content */
.right-main-content {
    flex-grow: 1;
}

/* Responsive adjustments */
@media (max-width: 900px) { /* Adjust breakpoint as needed */
    .overall-wrapper {
        flex-direction: column;
        margin: 10px auto;
        gap: 20px;
        padding: 0 10px; /* Adjust padding for smaller screens */
    }

    .left-sidebar {
        width: 100%;
        position: static; /* Disable sticky on small screens */
        gap: 20px;
    }

    .right-main-content {
        max-width: 100%;
    }
    

}


header h1 {
    font-size: 2.5em;
    color: var(--text-color);
    margin-bottom: 0.5em;
    text-shadow: 1px 1px 5px rgba(255,255,255,0.5); /* 给文字加点阴影以突出 */
}

h1 .highlight {
    color: var(--tianyi-blue);
}

.tagline {
    font-size: 1.2em;
    color: #555;
    margin-bottom: 20px;
    text-shadow: 1px 1px 3px rgba(255,255,255,0.5);
}

h2 {
    color: var(--tianyi-blue);
    border-bottom: 2px solid var(--tianyi-blue);
    padding-bottom: 5px;
    display: inline-block;
    margin-bottom: 20px;
    font-weight: 600;
}

h2 i {
    margin-right: 10px;
}

section {
    background-color: var(--section-bg);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 8px 16px rgba(102, 204, 255, 0.15);
    transition: transform 0.5s ease, box-shadow 0.5s ease, background-color 0.5s ease, border-color 0.5s ease;
    backdrop-filter: blur(10px); /* 毛玻璃效果 */
    -webkit-backdrop-filter: blur(10px); /* 兼容 Safari */
    border: 1px solid var(--border-color);
}

section:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(102, 204, 255, 0.25);
}

.skills {
    margin-top: 20px;
}

.skill-tag {
    display: inline-block;
    background-color: rgba(234, 246, 255, 0.9);
    color: #5599cc;
    padding: 8px 15px;
    border-radius: 20px;
    margin: 5px;
    font-size: 0.9em;
    border: 1px solid #cceeff;
    font-weight: 500;
}

#language-chart {
    max-height: 300px;
    margin-left: auto;
    margin-right: auto;
}


.project-card {
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    text-align: left;
    transition: transform 0.4s ease, background-color 0.5s ease, border-color 0.5s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.project-card > div:first-child {
    flex-grow: 1;
}

.project-card:hover {
    transform: translateY(-3px);
}

.project-card h3 {
    color: var(--tianyi-blue);
    margin-top: 0;
    margin-bottom: 10px;
}

.project-card p {
    font-size: 1em;
    color: #555555;
    margin-bottom: 0; /* 移除原有p标签的下边距，由meta统一控制 */
}

.project-meta {
    display: flex;
    align-items: center;
    gap: 15px; /* 项目间的间距 */
    margin-top: 15px; /* 上边距 */
    margin-bottom: 15px; /* 下边距 */
    color: var(--text-secondary-color);
    font-size: 0.9em;
}

.project-meta .language {
    background-color: var(--code-inline-bg-color);
    padding: 3px 8px;
    border-radius: 5px;
    font-weight: 500;
}

.project-meta .stars,
.project-meta .forks {
    display: flex;
    align-items: center;
    gap: 5px; /* 图标和数字的间距 */
}

.project-meta i {
    color: var(--tianyi-blue);
}


.project-link, .button {
    display: inline-block;
    background-color: var(--tianyi-blue);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1em;
    transition: background-color 0.5s ease, transform 0.4s ease, box-shadow 0.5s ease;
    border: none;
    box-shadow: 0 4px 10px rgba(102, 204, 255, 0.4);
}

.project-link {
    padding: 8px 15px;
    font-size: 1em;
}

.project-link:hover, .button:hover {
    background-color: var(--tianyi-blue-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(85, 187, 238, 0.5);
}

.social-links {
    margin-top: 20px;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    background-color: rgba(240, 240, 240, 0.9);
    color: #555;
    padding: 8px 15px; /* Smaller padding */
    border-radius: 20px;
    text-decoration: none;
    margin: 5px; /* Smaller margin */
    font-size: 0.9em; /* Slightly smaller font size */
    transition: all 0.5s ease;
}

.social-btn i {
    margin-right: 8px;
    color: var(--tianyi-blue);
}

.social-btn:hover {
    background-color: #e0e0e0;
    transform: translateY(-2px);
}

.email-tooltip {
    position: relative;
    cursor: pointer;
}

.email-tooltip span {
    transition: opacity 0.5s ease;
}

.email-tooltip::after {
    content: attr(data-email);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--tianyi-blue);
    color: #ffffff;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9em;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease, transform 0.5s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.email-tooltip:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

.qq-tooltip {
    position: relative;
    cursor: pointer;
}

.qq-tooltip span {
    transition: opacity 0.5s ease;
}

.qq-tooltip::after {
    content: attr(data-qq);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--tianyi-blue);
    color: #ffffff;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9em;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease, transform 0.5s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.qq-tooltip:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

footer {
    margin-top: 40px;
    font-size: 0.9em;
    color: #666;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.5);
}

.footer-note {
    font-size: 0.8em;
    margin-top: 5px;
    color: #999;
}

.avatar-container {
    margin-bottom: 20px;
}

.avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 20px;
    box-shadow: 0 0 20px rgba(102, 204, 255, 0.5);
    animation: pulse 2s infinite;
    background-color: white;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.typing-container {
    margin-top: 25px;
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    font-family: 'Press Start 2P', cursive;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--tianyi-blue);
    box-shadow: 0 4px 8px rgba(102, 204, 255, 0.2);
}

.typing-text {
    font-size: 0.8em;
    color: var(--tianyi-blue);
    margin-right: 5px;
}

.cursor {
    font-size: 0.8em;
    color: var(--tianyi-blue);
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.dark-mode .typing-container {
    background-color: rgba(102, 204, 255, 0.1);
    border-color: var(--highlight-color);
}

.dark-mode .typing-text,
.dark-mode .cursor {
    color: var(--highlight-color);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 20px rgba(102, 204, 255, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 30px rgba(102, 204, 255, 0.7);
        transform: scale(1.05);
    }
    100% {
        box-shadow: 0 0 20px rgba(102, 204, 255, 0.4);
        transform: scale(1);
    }
}

.loading-message {
    text-align: center;
    font-size: 1.1em;
    color: var(--text-color);
    padding: 40px 0;
}

/* --- Theme Toggle Button --- */
.theme-toggle-button {
    position: fixed; /* Changed to fixed */
    top: 20px;
    right: 20px;
    background-color: var(--section-bg);
    border: 1px solid var(--border-color);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 9999; /* Increased z-index to ensure it's on top */
    font-size: 20px;
    color: var(--tianyi-blue);
    transition: all 0.5s ease;
    backdrop-filter: blur(5px);
}

.theme-toggle-button:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 4px 12px rgba(102, 204, 255, 0.3);
}


/* --- Dark Mode Styles --- */
.dark-mode {
    --text-color: #e0e0e0;
    --text-secondary-color: #aaaaaa; /* 暗色模式下次要文本颜色 */
    --highlight-color: #88EEFF; /* 暗色模式下强调色 */
    --section-bg: rgba(25, 30, 40, 0.75);
    --card-bg: rgba(35, 40, 50, 0.8);
    --border-color: rgba(102, 204, 255, 0.2);

    /* 博客代码块颜色 */
    --code-bg-color: #2b2b2b;
    --code-text-color: #dcdcdc;
    --code-inline-bg-color: rgba(255, 255, 255, 0.1);
}

html.dark-mode body::before {
    opacity: 0;
}

html.dark-mode body::after {
    opacity: 1;
}

.dark-mode h1,
.dark-mode .tagline,
.dark-mode footer {
    color: #999;
}

.dark-mode .project-card p {
    color: var(--text-secondary-color);
}

.dark-mode .avatar {
    background-color: #333;
}

.dark-mode .skill-tag {
    background-color: rgba(102, 204, 255, 0.1);
    color: var(--tianyi-blue);
    border-color: rgba(102, 204, 255, 0.3);
}

.dark-mode .social-btn {
    background-color: rgba(50, 55, 65, 0.9);
    color: #c5c5c5;
}

.dark-mode .social-btn:hover {
    background-color: rgba(60, 65, 75, 1);
}




/* --- Project Grid Styles --- */
#projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.project-card.hidden {
    display: none;
}

#show-more-container {
    text-align: center;
    margin-top: 20px;
}

.show-more-btn {
    background-color: transparent;
    border: 2px solid var(--tianyi-blue);
    color: var(--tianyi-blue);
    padding: 10px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: all 0.5s ease;
}

.show-more-btn:hover {
    background-color: var(--tianyi-blue);
    color: #fff;
    transform: translateY(-2px);
}

.project-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px; /* 与下方项目的间距 */
}

.filter-btn {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary-color);
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.5s ease;
}

.filter-btn:hover {
    color: #fff;
    background-color: var(--tianyi-blue-dark);
    border-color: var(--tianyi-blue-dark);
}

.filter-btn.active {
    color: #fff;
    background-color: var(--tianyi-blue);
    border-color: var(--tianyi-blue);
}

.dark-mode .show-more-btn {
    border-color: var(--tianyi-blue);
    color: var(--tianyi-blue);
}

.dark-mode .show-more-btn:hover {
    background-color: var(--tianyi-blue);
    color: var(--card-bg);
}

.dark-mode .filter-btn {
    color: var(--text-secondary-color);
    border-color: var(--border-color);
}

.dark-mode .filter-btn.active,
.dark-mode .filter-btn:hover {
    background-color: var(--highlight-color);
    border-color: var(--highlight-color);
    color: #1a1a1a; /* 在高亮背景上使用深色文字以保证对比度 */
}

/* --- Back to Top Button --- */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--tianyi-blue);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(102, 204, 255, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 9999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background-color: var(--tianyi-blue-dark);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(85, 187, 238, 0.5);
}

.back-to-top:active {
    transform: translateY(-1px);
}

.dark-mode .back-to-top {
    background-color: var(--highlight-color);
    box-shadow: 0 4px 12px rgba(136, 238, 255, 0.4);
}

.dark-mode .back-to-top:hover {
    background-color: #66CCFF;
    box-shadow: 0 6px 16px rgba(102, 204, 255, 0.5);
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}

