/* 重置所有默认样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 页面背景：淡青蓝渐变 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 50%, #7dd3fc 100%);
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* 圆润五角星背景 - 使用 SVG 星星 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-image: 
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fbbf24'%3E%3Cpath d='M12 2L15 8.5L22 9.5L17 14L18.5 21L12 17.5L5.5 21L7 14L2 9.5L9 8.5L12 2Z'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23fcd34d'%3E%3Cpath d='M10 1.5L12.5 7L18.5 7.5L14 11L15.5 16.5L10 13.5L4.5 16.5L6 11L1.5 7.5L7.5 7L10 1.5Z'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fde047'%3E%3Cpath d='M8 1L9.5 5.5L14 6L10.5 9L12 13.5L8 11L4 13.5L5.5 9L2 6L6.5 5.5L8 1Z'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='%23fef9c3'%3E%3Cpath d='M6 1L7 4L10 4.5L7.5 6.5L8.5 9.5L6 7.5L3.5 9.5L4.5 6.5L2 4.5L5 4L6 1Z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 32px 32px, 24px 24px, 18px 18px, 12px 12px;
    opacity: 0.7;
    animation: starTwinkle 3s ease-in-out infinite;
}

/* 星星位置分布 */
body::before {
    background-position: 
        15% 20%, 72% 15%, 45% 70%, 88% 45%,
        25% 85%, 55% 12%, 92% 75%, 8% 55%,
        35% 40%, 68% 90%, 5% 18%, 82% 95%,
        48% 50%, 62% 28%, 75% 62%, 20% 50%,
        50% 80%, 10% 85%, 95% 30%, 40% 10%;
    background-size: 
        32px 32px, 24px 24px, 18px 18px, 12px 12px,
        28px 28px, 16px 16px, 22px 22px, 14px 14px,
        26px 26px, 20px 20px, 12px 12px, 18px 18px,
        24px 24px, 16px 16px, 28px 28px, 14px 14px,
        22px 22px, 12px 12px, 26px 26px, 18px 18px;
}

/* 星星闪烁动画 */
@keyframes starTwinkle {
    0%, 100% { 
        opacity: 0.5;
        filter: brightness(0.8);
    }
    50% { 
        opacity: 1;
        filter: brightness(1.2);
    }
}

/* 名片主卡片 */
.container {
    max-width: 800px;
    margin: 0 auto;
    background-color: rgba(255, 255, 255, 0.96);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    padding: 40px;
    animation: fadeIn 0.8s ease-in;
    position: relative;
    z-index: 1;
}

/* 页面淡入动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== 头部区域 ========== */
.header {
    text-align: center;
    margin-bottom: 30px;
}

/* 头像容器 */
.avatar-container {
    width: 150px;
    height: 150px;
    margin: 0 auto 20px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #38bdf8;
    box-shadow: 0 10px 30px rgba(56, 189, 248, 0.2);
}

/* 头像图片 */
.avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 姓名 */
.name {
    font-size: 32px;
    color: #0c4a6e;
    margin-bottom: 10px;
}

/* 学号和专业 */
.student-id, .major {
    color: #0284c7;
    font-size: 16px;
    margin-bottom: 5px;
}

/* 个性签名 */
.signature {
    color: #0ea5e9;
    font-style: italic;
    font-size: 18px;
    margin-top: 15px;
}

/* ========== 联系方式区域 ========== */
.contact {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f0f9ff;
    border-radius: 10px;
}

.contact h2 {
    color: #0c4a6e;
    margin-bottom: 15px;
    font-size: 24px;
    border-bottom: 2px solid #38bdf8;
    padding-bottom: 5px;
}

.contact-info {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.contact-item {
    color: #0284c7;
    font-size: 16px;
}

.contact-item a {
    color: #0284c7;
    text-decoration: none;
    transition: color 0.3s;
}

.contact-item a:hover {
    color: #0c4a6e;
    text-decoration: underline;
}

/* ========== 自我介绍区域 ========== */
.about {
    margin-bottom: 30px;
}

.about h2 {
    color: #0c4a6e;
    margin-bottom: 15px;
    font-size: 24px;
    border-bottom: 2px solid #38bdf8;
    padding-bottom: 5px;
}

.intro {
    color: #334155;
    line-height: 1.8;
    font-size: 16px;
    text-align: justify;
}

/* ========== 标签区域 ========== */
.interests, .skills {
    margin-bottom: 30px;
}

.interests h2, .skills h2 {
    color: #0c4a6e;
    margin-bottom: 15px;
    font-size: 24px;
    border-bottom: 2px solid #38bdf8;
    padding-bottom: 5px;
}

/* 标签容器 */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* 普通标签 */
.tag {
    background-color: #dbeafe;
    color: #1e40af;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    cursor: default;
}

/* 兴趣标签添加手型光标 */
.interests .tag {
    cursor: pointer;
}

/* 技能标签 */
.tag.skill {
    background-color: #bfdbfe;
    color: #1e3a8a;
}

/* 鼠标悬停效果 */
.tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(56, 189, 248, 0.3);
}

/* ========== 底部区域 ========== */
.footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #bae6fd;
    color: #7c9bc0;
    font-size: 14px;
}

/* ========== 弹窗样式 ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    max-width: 80%;
    max-height: 80%;
    background-color: white;
    border-radius: 20px;
    padding: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: zoomIn 0.3s ease-out;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-content img {
    width: 100%;
    height: auto;
    max-height: 70vh;
    border-radius: 15px;
    object-fit: cover;
}

.close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 35px;
    height: 35px;
    background-color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
    z-index: 1001;
    line-height: 1;
    padding-bottom: 2px;
}

.close:hover {
    background-color: #f0f0f0;
    color: #333;
    transform: scale(1.05);
}

/* ========== 手机适配 ========== */
@media (max-width: 600px) {
    .container {
        padding: 20px;
    }
    
    .name {
        font-size: 24px;
    }
    
    .contact-info {
        flex-direction: column;
        align-items: center;
    }
    
    .avatar-container {
        width: 120px;
        height: 120px;
    }
    
    .tags {
        justify-content: center;
    }
    
    body::before {
        background-size: 24px 24px, 18px 18px, 14px 14px, 10px 10px;
    }
    
    .modal-content {
        max-width: 90%;
    }
    
    .close {
        top: -10px;
        right: -10px;
        width: 30px;
        height: 30px;
        font-size: 20px;
        line-height: 1;
        padding-bottom: 2px;
    }
    
    /* 点击提示样式 - 手机适配 */
    .click-hint {
        font-size: 10px;
        margin-left: 5px;
        padding: 2px 8px;
        display: block;
        margin-top: 8px;
        text-align: center;
    }
    
    .interests h2 {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }
}

/* 点击提示样式 - 电脑版 */
.click-hint {
    font-size: 14px;
    font-weight: normal;
    color: #0284c7;
    background-color: #e0f2fe;
    padding: 4px 12px;
    border-radius: 20px;
    margin-left: 10px;
    display: inline-block;
    vertical-align: middle;
}
/* ========== 深色主题样式 ========== */
body.dark-theme {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
}

body.dark-theme .container {
    background-color: rgba(30, 41, 59, 0.96);
}

body.dark-theme .name,
body.dark-theme .contact h2,
body.dark-theme .about h2,
body.dark-theme .interests h2,
body.dark-theme .skills h2 {
    color: #94a3b8;
}

body.dark-theme .student-id,
body.dark-theme .major,
body.dark-theme .signature,
body.dark-theme .contact-item,
body.dark-theme .intro {
    color: #cbd5e1;
}

body.dark-theme .contact {
    background-color: #1e293b;
}

body.dark-theme .tag {
    background-color: #334155;
    color: #94a3b8;
}

body.dark-theme .tag.skill {
    background-color: #2d3a4e;
    color: #94a3b8;
}

body.dark-theme .footer {
    border-top-color: #334155;
    color: #64748b;
}

/* ========== 主题切换按钮 ========== */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: all 0.3s;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

/* ========== 音乐控制按钮 ========== */
.music-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 10px 20px;
    border-radius: 30px;
    background-color: white;
    border: none;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: all 0.3s;
}

.music-toggle:hover {
    transform: scale(1.05);
}

body.dark-theme .music-toggle,
body.dark-theme .theme-toggle {
    background-color: #334155;
    color: white;
}

/* ========== 动态问候样式 ========== */
.greeting {
    text-align: center;
    padding: 15px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #e0f2fe, #bae6fd);
    border-radius: 30px;
    font-size: 18px;
    font-weight: 500;
    color: #0c4a6e;
}

body.dark-theme .greeting {
    background: linear-gradient(135deg, #1e293b, #334155);
    color: #94a3b8;
}

/* ========== 技能进度条样式 ========== */
.skills-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.skill-item {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.skill-name {
    width: 100px;
    font-size: 14px;
    font-weight: 500;
    color: #1e40af;
}

body.dark-theme .skill-name {
    color: #94a3b8;
}

.skill-bar {
    flex: 1;
    height: 10px;
    background-color: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.skill-progress {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #38bdf8, #0ea5e9);
    border-radius: 10px;
    transition: width 1s ease-out;
}

.skill-percent {
    width: 45px;
    font-size: 12px;
    color: #0284c7;
    font-weight: 500;
}

body.dark-theme .skill-percent {
    color: #94a3b8;
}

/* 手机适配 */
@media (max-width: 600px) {
    .skill-item {
        flex-wrap: wrap;
    }
    
    .skill-name {
        width: 80px;
        font-size: 12px;
    }
    
    .theme-toggle {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .music-toggle {
        bottom: 10px;
        right: 10px;
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .greeting {
        font-size: 14px;
        padding: 10px;
    }
}
