/* 变量定义 */
:root {
    /* 浅色主题变量 */
    --primary-color: #30a2ff;
    --secondary-color: #42a5f5;
    --accent-color: #0d47a1;
    --bg-color: #e6f7ff;
    --card-bg: rgba(255, 255, 255, 0.5);
    --text-color: #212121;
    --text-secondary: #3b3b3b;
    --shadow: rgba(0, 0, 0, 0.1);
    --nav-bg: rgba(255, 255, 255, 0.68);
    --hover-effect: rgba(255, 255, 255, 0.7);
    --click-effect: rgba(239, 253, 255, 0.9);
    --footer-bg: rgba(208, 240, 255, 0.9);
    --contact-card: rgba(255, 255, 255, 0.5);
    --dividing-line-color: rgba(0, 0, 0, 0.25);
}

.dark-theme {
    /* 深色主题变量 */
    --primary-color: #389af0;
    --secondary-color: #90caf9;
    --accent-color: #0066ff;
    --bg-color: #001529;
    --card-bg: rgba(30, 30, 30, 0.5);
    --text-color: #e0e0e0;
    --text-secondary: #d6d6d6;
    --shadow: rgba(0, 0, 0, 0.3);
    --nav-bg: rgba(0, 21, 41, 0.68);
    --hover-effect: rgba(50, 50, 50, 0.7);
    --click-effect: rgba(0, 15, 29, 0.9);
    --footer-bg: rgba(0, 21, 41, 0.9);
    --contact-card: rgba(30, 30, 30, 0.5);
    --dividing-line-color: rgba(255, 255, 255, 0.25);
}

/* 引入字体 */
@font-face {
    font-family: 'Minecraft';
    src: url(resource/font/5_Minecraft\ AE\(支持中文\).ttf) format('truetype');
}
@font-face {
    font-family: 'MINECRAFT';
    src: url(resource/font/B_Minecrafter.Reg\(主标题\).ttf) format('truetype');
}

/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.3s ease, 
                opacity 0.3s ease, transform 0.3s ease, 
                box-shadow 0.3s ease, border-color 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* 加载动画 */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.loader.hidden {
    opacity: 0;
    pointer-events: none;
}

/* 新的跳动缩放动画 */
.spinner {
    display: flex;
    gap: 12px;
}

.spinner-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    box-shadow: 0 2px 12px var(--primary-color);
    animation: bounceScale 1s infinite;
}

.spinner-dot:nth-child(2) {
    animation-delay: 0.2s;
    background: var(--secondary-color);
    box-shadow: 0 2px 12px var(--secondary-color);
}
.spinner-dot:nth-child(3) {
    animation-delay: 0.4s;
    background: var(--accent-color);
    box-shadow: 0 2px 12px var(--accent-color);
}

@keyframes bounceScale {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    30% {
        transform: translateY(-18px) scale(1.2);
        opacity: 0.8;
    }
    60% {
        transform: translateY(0) scale(0.95);
        opacity: 0.7;
    }
}

/* 导航栏样式 */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    background-color: var(--nav-bg);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    -moz-backdrop-filter: blur(5px);
    z-index: 1000;
    box-shadow: 0 2px 10px var(--shadow);
}

.logo {
    display: flex;
    align-items: center;
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.logo img {
    height: 40px;
    margin-right: 10px;
    border-radius: 50%;
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.2));
    transition: all 0.3s ease;
}

.logo img:hover {
    transform: rotate(10deg);
}

.logo-text {
    font-size: 1.7rem;
    color: var(--primary-color);
    font-weight: bold;
    font-family: 'MINECRAFT';
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 25px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: bold;
    font-size: 1rem;
    padding: 8px 15px;
    position: relative;
}

.nav-links a:after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-links a:hover:after {
    width: 100%;
}

.theme-toggle {
    background: transparent;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    color: var(--primary-color);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 20px;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background-color: var(--primary-color);
    color: white;
    transform: rotate(15deg);
}

/* 欢迎区域样式 */
#home {
    height: 100vh;
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.7)), url('/resource/images/homeBG.webp') no-repeat center center/cover;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    padding: 0 20px;
    position: relative;
}

.welcome-content {
    max-width: 800px;
    animation: fadeInUp 1s ease;
}

.welcome-content h1 {
    font-size: 4.5rem;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.welcome-content h2 {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 30px;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
}

#hitokoto_text {
    color: #6dd6ffb9;
    font-family: 'Minecraft';
    font-size: 1.2rem;
    margin-bottom: 30px;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.cta-button {
    display: inline-block;
    background: transparent;
    border: 2px solid white;
    color: white;
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    text-decoration: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    -moz-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.cta-button:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0) translateX(-50%);}
    40% {transform: translateY(-20px) translateX(-50%);}
    60% {transform: translateY(-10px) translateX(-50%);}
}

/* 卡片通用样式 */
.section {
    padding: 100px 5%;
    position: relative;
    overflow: hidden;
}

.section-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: -1;
    opacity: 0.45;
}

#about .section-bg {
    background-image: url('resource/images/bg1.webp');
}

#github .section-bg {
    background-image: url('resource/images/bg2.webp');
}

#blog .section-bg {
    background-image: url('resource/images/bg3.webp');
}

#contact .section-bg {
    background-image: url('resource/images/bg4.webp');
}

#about-site .section-bg {
    background: linear-gradient(140deg, #003550 0%, #ad47a8 25% , #007fd4 50%, #2000d4 75%, #150050 100%);
    opacity: 0.55;
    /* 或者使用背景图片 */
    /* background-image: url('images/tech-abstract-bg.jpg'); */
    background-size: cover;
    background-position: center;
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
    color: var(--primary-color);
    font-size: 2.5rem;
    position: relative;
}

.section-title:after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: var(--primary-color);
    margin: 15px auto;
}

.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    -moz-backdrop-filter: blur(10px);
    padding: 30px;
    box-shadow: 0 5px 15px var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px var(--shadow);
    background: var(--hover-effect);
}

.card:active {
    background-color: var(--click-effect);
}

.card h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.5rem;
}

/* 关于我部分 */
.about-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 40px;
}

.about-content-column {
    /* 内容布局：每行几列视屏幕宽度而定 */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    width: 100%;
}

.about-text {
    flex: 1;
    min-width: 300px;
}

.about-text p {
    margin-bottom: 10px;
    color: var(--text-secondary);
    line-height: 1.5;
    font-size: 1rem;
}

.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.skill-tag {
    background-color: var(--primary-color);
    color: white;
    padding: 8px 20px;
    font-size: 0.9rem;
    cursor: default;
    transition: all 0.3s ease;
}

.skill-tag:hover {
    background-color: var(--accent-color);
    transform: noen;
}

.about-image {
    flex: 1;
    min-width: 300px;
    text-align: center;
}

.code-snippet {
    background: rgba(0, 0, 0, 0.7);
    padding: 20px;
    text-align: left;
    font-family: 'Courier New', monospace;
    color: #64b5f6;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.code-snippet pre {
    margin: 0;
}

.code-snippet code {
    font-size: 0.9rem;
    line-height: 1.6;
}

/* GitHub部分 */
.github-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    -moz-backdrop-filter: blur(10px);
    padding: 25px;
    text-align: center;
    box-shadow: 0 5px 15px var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px var(--shadow);
    background: var(--hover-effect);
}

.stat-card:active {
    background-color: var(--click-effect);
}

.stat-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.stat-card h4 {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 10px;
}

.stat-card .number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.repo-card {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    height: 100%;
}

.repo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.repo-name {
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.repo-name:hover {
    color: var(--accent-color);
}

.repo-stats {
    display: flex;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.repo-description {
    flex-grow: 1;
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.6;
}

.repo-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.repo-language {
    display: flex;
    align-items: center;
}

.language-color {
    width: 12px;
    height: 12px;
    margin-right: 5px;
    background-color: var(--primary-color);
}

/* 按钮样式 */
.btn {
    display: inline-block;
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    -moz-backdrop-filter: blur(10px);
    padding: 10px 25px;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px var(--shadow);
}

/* 博客部分 */
.blog-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.blog-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    -moz-backdrop-filter: blur(10px);
    padding: 30px;
    text-align: center;
    box-shadow: 0 5px 15px var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px var(--shadow);
    background: var(--hover-effect);
}

.blog-card:active {
    background-color: var(--click-effect);
}

.blog-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.blog-card h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.blog-card p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.6;
}

/* 联系部分 */
.contact-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.contact-card {
    background: var(--contact-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    -moz-backdrop-filter: blur(10px);
    padding: 30px;
    text-align: center;
    box-shadow: 0 5px 15px var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.contact-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px var(--shadow);
    background-color: var(--hover-effect);
}

.contact-card:active {
    background-color: var(--click-effect);
}

.contact-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2rem;
    color: white;
    transition: all 0.3s ease;
}

.contact-card:hover .contact-icon {
    transform: rotate(15deg) scale(1.1);
    background: var(--accent-color);
}

.contact-card h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.contact-card p {
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.6;
}

.contact-card a {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    padding: 8px 15px;
    border: 2px solid var(--primary-color);
    transition: all 0.3s ease;
}

.contact-card a:hover {
    background: var(--primary-color);
    color: white;
}

/* 页脚 */
footer {
    background: var(--footer-bg);
    padding: 60px 5% 30px;
    border-top: 1px solid var(--dividing-line-color);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.footer-logo img {
    height: 45px;
    border-radius: 50%;
    margin-right: 10px;
}

.footer-logo h3 {
    font-size: 1.8rem;
    color: var(--primary-color);
}

footer p {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 30px;
    line-height: 1.8;
}

.footer-social {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    text-decoration: none;
    background: var(--primary-color);
    color: white;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.footer-social a:hover {
    transform: translateY(-5px) rotate(10deg);
    background: var(--accent-color);
}

.copyright {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid var(--dividing-line-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
}
/* 音乐卡片样式 */
.music-card-container {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
}

.music-card {
    flex: 1;
    margin: 0 8px;
    text-align: center;
    text-decoration: none;
    color: inherit;
}

.music-card img {
    width: 100%;
    border-radius: 8px;
}

.music-card p {
    margin-top: 8px;
    font-size: 14px;
}

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

.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 响应式设计 */
@media (max-width: 992px) {
    .nav-links {
        display: none;
    }
    
    .welcome-content h2 {
        font-size: 2.5rem;
    }
    
    .welcome-content p {
        font-size: 1.2rem;
    }
    
    .section {
        padding: 80px 5%;
    }
}

@media (max-width: 768px) {
    .section {
        padding: 60px 20px;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .about-content {
        flex-direction: column;
    }
    
    .github-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 576px) {
    .github-stats {
        grid-template-columns: 1fr;
    }
    
    .welcome-content h2 {
        font-size: 2rem;
    }
    
    .welcome-content p {
        font-size: 1rem;
    }
    
    .logo h1 {
        font-size: 1.2rem;
    }
    
    .theme-toggle {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    .code-snippet {
        font-size: 0.9rem;
    }
}

@media (max-width: 400px) {
    .github-stats {
        grid-template-columns: 1fr;
    }

    .welcome-content h2 {
        font-size: 1.3rem;
        word-break: break-word;
    }

    .welcome-content p {
        font-size: 0.95rem;
    }

    .logo h1 {
        font-size: 1rem;
    }

    .theme-toggle {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
        margin-left: 10px;
    }

    .code-snippet {
        font-size: 0.8rem;
        padding: 10px;
    }

    .section {
        padding: 35px 5px;
    }

    .section-title {
        font-size: 1.2rem;
    }

    .card,
    .blog-card,
    .contact-card {
        padding: 15px;
    }

    .footer-logo h3 {
        font-size: 1.1rem;
    }

    .footer-social a {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }
    .footer-content p {
        font-size: 0.9rem;
    }
}