/* ===== 宸良手纪 | 数字实验室 ===== */
/* 作者：sapchen | 版本：2.0（精简版） */

/* ------------------------------------- */
/* 1. 全局重置与变量                    */
/* ------------------------------------- */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'SF Pro Display', -apple-system, system-ui, sans-serif;
    background: #0a0e17;
    color: #e4e6eb;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ------------------------------------- */
/* 2. 背景效果                         */
/* ------------------------------------- */

.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(90deg, rgba(41, 196, 255, 0.08) 1px, transparent 1px),
        linear-gradient(rgba(41, 196, 255, 0.08) 1px, transparent 1px);
    background-size: 35px 35px;
    z-index: -2;
}

.light-effect {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle 3px at 50% 50%,
        rgba(41, 196, 255, 0.15) 0%,
        transparent 15%
    );
    z-index: 0;
    pointer-events: none;
}

.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: transparent;
}

/* ------------------------------------- */
/* 3. 导航栏                           */
/* ------------------------------------- */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    /* background: rgba(10, 14, 23, 0.1); 原配色*/
    background: rgba(180, 30, 30, 0.3);  /* 半透明红色 */
    z-index: 1000;
    padding: 0.8rem 0;
    transition: all 0.3s ease;
}

.nav.scrolled {
    /* background: rgba(10, 14, 23, 0.3); */
    background: rgba(180, 30, 30, 0.4);   /* 滚动后稍深的红色 */
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-img {
    width: 32px;
    height: 32px;
    object-fit: cover;
}

.brand-text {
    font-size: 1.2rem;
    font-weight: 600;
    background: linear-gradient(90deg, #29c4ff, #9b51e0);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* 新增：新年祝福文字 */
.new-year-wish {
    margin-left: 20px;
    padding-left: 20px;
    border-left: 1px solid rgba(255, 215, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffd700;
    font-size: 1rem;
    font-weight: 500;
}

.new-year-wish i {
    color: #ff6b6b;
    font-size: 1.1rem;
}

.new-year-wish span {
    background: linear-gradient(90deg, #ffd700, #ff8c00);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 600;
}

.nav-menu {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-menu a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-menu a:hover {
    color: #ffffff;
}

.nav-menu a.active {
    color: #ffffff;
}

.nav-menu a.active::before {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 10%;
    width: 80%;
    height: 2px;
    background: linear-gradient(90deg, #29c4ff, #9b51e0);
    border-radius: 2px;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: #a0a8b6;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* ------------------------------------- */
/* 4. 公共容器                         */
/* ------------------------------------- */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
    margin-top: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ------------------------------------- */
/* 5. 首页（hero区域）                 */
/* ------------------------------------- */

.hero {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto 4rem;
    padding-top: 7rem;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 8rem;
}

.hero-img {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 20px;
    transition: all 0.4s ease;
    flex-shrink: 0;
}

.hero-img:hover {
    transform: scale(1.05) rotate(5deg);
}

.hero-text {
    flex: 1;
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.hero-text h1 {
    display: flex;
    flex-direction: column;
    margin: 0;
    gap: 8px;
}

.gradient-text {
    font-size: 2.8rem;
    font-weight: 800;
    background: linear-gradient(90deg, #29c4ff, #9b51e0);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1.5;
}

.hero-sub {
    font-size: 1.5rem;
    color: #a0a8b6;
    font-weight: 400;
    letter-spacing: 3px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.hero-sub i {
    color: #29c4ff;
    font-size: 1.5rem;
}

.hero-motto {
    color: #c3c9d6;
    font-size: 1.2rem;
    margin: 1rem 0 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 300;
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 0;
    justify-content: flex-start;
}

.hero-tags .tag {
    background: rgba(41, 196, 255, 0.1);
    color: #29c4ff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid rgba(41, 196, 255, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.hero-tags .tag:hover {
    background: rgba(41, 196, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(41, 196, 255, 0.1);
}

/* ------------------------------------- */
/* 6. 页面头部（通用）                 */
/* ------------------------------------- */

.page-header {
    text-align: center;
    width: 100%;
}

.page-title {
    font-size: 2.4rem;
    background: linear-gradient(90deg, #29c4ff, #9b51e0);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1rem;
}

.page-title i {
    color: #29c4ff;
    font-size: 2.2rem;
}

.page-desc {
    color: #a0a8b6;
    font-size: 1.2rem;
    font-weight: 300;
    letter-spacing: 2px;
    margin-bottom: 2rem;
}

/* ------------------------------------- */
/* 7. 项目卡片网格                     */
/* ------------------------------------- */

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    width: 100%;
    margin-bottom: 4rem;
}

.card {
    background: transparent;
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-8px);
    border-color: rgba(41, 196, 255, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    display: inline-block;
    background: linear-gradient(135deg, #29c4ff, #9b51e0);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.card-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #ffffff;
    font-weight: 600;
}

.card-desc {
    color: #a0a8b6;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1.5rem;
}

.card-tags .tag {
    background: rgba(41, 196, 255, 0.1);
    color: #29c4ff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    border: 1px solid rgba(41, 196, 255, 0.2);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(90deg, #29c4ff, #9b51e0);
    color: white;
    text-decoration: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(41, 196, 255, 0.3);
}

/* ------------------------------------- */
/* 8. 博客页                           */
/* ------------------------------------- */

.blog-section {
    width: 100%;
    margin-bottom: 2rem;
}

.blog-card {
    background: transparent;
    padding: 3rem;
    text-align: center;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
}

.blog-img {
    width: 700px;
    height: 400px;
    object-fit: contain;
    border-radius: 5px;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

.blog-img:hover {
    transform: scale(1.05);
}

.blog-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 2rem;
    color: #29c4ff;
}

/* ------------------------------------- */
/* 9. 关于我页                         */
/* ------------------------------------- */

.about {
    width: 100%;
    margin-bottom: 3rem;
}

.about-hero {
    display: flex;
    align-items: center;
    gap: 3rem;
    background: transparent;
    border-radius: 24px;
}

.avatar {
    width: 300px;
    height: 250px;
    overflow: hidden;
}

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

.about-text h2 {
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
}

.quote {
    font-size: 1.0rem;
    line-height: 1.8;
    color: #c3c9d6;
    font-style: italic;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(3, 200px);
    gap: 1rem;
    justify-content: center;
    margin: 3rem auto;
    margin-top: 0rem;
}

.contact-card {
    background: transparent;
    border-radius: 16px;
    text-align: center;
    transition: all 0.3s ease;
    padding: 1rem 0;
}

.contact-card:hover {
    transform: translateY(-5px);
}

.contact-card i {
    color: #29c4ff;
    margin-bottom: 1rem;
}

.contact-card h3 {
    color: #ffffff;
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
}

.contact-card p a {
    color: #a0a8b6;
    text-decoration: none;
}

.contact-card p a:hover {
    color: #29c4ff;
}

.qrcode {
    text-align: center;
    background: transparent;
    border-radius: 5px;
    display: flex;           /* 添加 */
    flex-direction: column;  /* 添加：垂直排列 */
    align-items: center;     /* 添加：水平居中 */
    justify-content: center; /* 添加：垂直居中 */
    width: 100%;            /* 确保占满宽度 */
}

.qr-img {
    width: 150px;
    height: 150px;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.qr-label {
    font-size: 1rem;
    color: #a0a8b6;
    font-weight: 500;
    letter-spacing: 1px;
    margin-bottom: 0.8rem;
}
/* ------------------------------------- */
/* 10. 二维码弹窗 （已删除）                  */
/* ------------------------------------- */

/* ------------------------------------- */
/* 11. 页脚                            */
/* ------------------------------------- */

footer {
    text-align: center;
    margin-top: 0rem;
    color: #a0a8b6;
    font-size: 0.9rem;
    width: 100%;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    padding: 3rem 1rem;
}

footer p {
    margin-bottom: 1rem;
}

.social {
    margin: 1rem 0;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social a {
    color: #a0a8b6;
    display: flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.social a:hover {
    color: #ffffff;
}

.icp {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #7a8599;
    flex-wrap: wrap;
}

.icp a {
    color: #7a8599;
    text-decoration: none;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.icp a:hover {
    color: #29c4ff;
}

.beian-icon {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    object-fit: contain;
}

/* ------------------------------------- */
/* 12. 滚动条                          */
/* ------------------------------------- */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(20, 25, 40, 0.5);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #29c4ff, #9b51e0);
    border-radius: 4px;
}

/* ------------------------------------- */
/* 13. 响应式设计（移动端）            */
/* ------------------------------------- */

@media (max-width: 768px) {
    /* 导航栏 */
    .nav-menu {
        display: none;
        position: fixed;
        top: 60px;
        left: 50%;
        transform: translateX(-50%);
        width: 70%;
        max-width: 400px;
        background: rgba(10, 14, 23, 0.95);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(41, 196, 255, 0.2);
        flex-direction: column;
        padding: 1rem;
        border-radius: 12px;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-toggle {
        display: block;
    }
    
    .nav-menu a {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
    
    /* 马年新年 */
    .new-year-wish {
        margin-left: 10px;
        padding-left: 10px;
        font-size: 0.9rem;
    }
    
    .new-year-wish span {
        display: none; /* 在小屏幕上只显示🐴和🧧 */
    }

    /* 容器 */
    .container {
        margin-top: 120px;
        padding: 1rem;
    }
    
    /* 首页 */
    .hero .hero-content {
        flex-direction: column;
        text-align: center;
        padding: 2rem 1rem;
        gap: 2rem;
    }
    
    .hero-img {
        width: 120px;
        height: 120px;
    }
    
    .gradient-text {
        font-size: 1.8rem;
    }
    
    .hero-sub {
        font-size: 1.2rem;
    }
    
    .hero-motto {
        font-size: 1rem;
        flex-direction: column;
        gap: 8px;
    }
    
    /* 项目网格 */
    .project-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    /* 博客 */
    .blog-card {
        padding: 2rem;
    }
    
    .blog-img {
        width: 100%;
        height: auto;
        max-height: 300px;
    }
    
    .blog-meta {
        flex-direction: row;
        gap: 10px;
    }
    
    /* 关于我 */
    .about-hero {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
        gap: 2rem;
    }
    
    .avatar {
        width: 200px;
        height: 150px;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        justify-items: center;
    }
    
    .contact-card {
        max-width: 250px;
    }
    
    /* 页脚 */
    .social {
        flex-direction: row;     /* 改为水平排列 */
        justify-content: center; /* 水平居中 */
        gap: 20px;              /* 调整间距 */
        align-items: center;    /* 垂直居中 */
    }
    
    .icp {
        flex-direction: column;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    /* 弹窗 */
    .dialog {
        width: 95%;
        max-width: 320px;
        padding: 1.5rem;
    }
    
    .dialog-content img {
        width: 180px;
        height: 180px;
    }
    
    /* 标题 */
    .page-title {
        font-size: 1.8rem;
    }
    
    .page-title i {
        font-size: 1.8rem;
    }
    
    /* 卡片 */
    .card {
        padding: 1.2rem;
    }
}