/* ==================== 趣味效果通用样式 ==================== */

/* 粒子背景层 */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* 桌面宠物容器 */
#desk-pet-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    cursor: pointer;
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    transition: transform 0.3s ease;
}
#desk-pet-container:hover {
    transform: scale(1.1);
}

/* 宠物气泡 */
.pet-bubble {
    position: absolute;
    bottom: 90px;
    right: 10px;
    background: white;
    border: 2px solid #3498db;
    border-radius: 16px;
    padding: 10px 16px;
    font-size: 14px;
    max-width: 200px;
    color: #333;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    animation: bubblePop 0.3s ease-out;
    white-space: nowrap;
}
.pet-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 30px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid white;
}
@keyframes bubblePop {
    0% { opacity: 0; transform: translateY(10px) scale(0.8); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* 宠物emoji大小 */
.pet-emoji {
    font-size: 48px;
    line-height: 1;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    animation: petFloat 2s ease-in-out infinite;
}
@keyframes petFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
.pet-happy {
    animation: petHappy 0.5s ease-in-out 3;
}
@keyframes petHappy {
    0%, 100% { transform: translateY(0) rotate(0); }
    25% { transform: translateY(-10px) rotate(-10deg); }
    75% { transform: translateY(-10px) rotate(10deg); }
}

/* 职位卡牌翻转 */
.position-card {
    perspective: 1000px;
    cursor: pointer;
}
.position-card-inner {
    position: relative;
    width: 100%;
    height: 200px;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}
.position-card.flipped .position-card-inner {
    transform: rotateY(180deg);
}
.position-card-front, .position-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.position-card-front {
    background: linear-gradient(135deg, #3498db, #2c3e50);
    color: white;
}
.position-card-back {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    transform: rotateY(180deg);
}
.position-card-emoji {
    font-size: 48px;
    margin-bottom: 10px;
}
.position-card-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
}
.position-card-desc {
    font-size: 13px;
    opacity: 0.9;
    text-align: center;
}

/* 撒花遮罩 */
.confetti-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    pointer-events: none;
    overflow: hidden;
}
.confetti-piece {
    position: absolute;
    font-size: 24px;
    pointer-events: none;
    animation: confettiFall linear forwards;
}
@keyframes confettiFall {
    0% {
        opacity: 1;
        transform: translateY(-20px) rotate(0deg) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(100vh) rotate(720deg) scale(0.5);
    }
}

/* 页面内容容器 Z-index 调整 */
.container, .content-wrapper {
    position: relative;
    z-index: 1;
}

/* 主题切换按钮 */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9998;
    background: rgba(255,255,255,0.9);
    border: 2px solid #ddd;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s;
}
.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* 暗色主题 */
body.dark-theme {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%) !important;
}
body.dark-theme .container {
    background: #1e1e2e;
    color: #e0e0e0;
}
body.dark-theme .container .header {
    background: linear-gradient(135deg, #0f0f23, #1a1a3e);
}
body.dark-theme .container .nav-bar,
body.dark-theme .container .nav-tabs {
    background: #12122a;
}
body.dark-theme .container .nav-tab {
    color: #aaa;
}
body.dark-theme .container .nav-tab.active {
    background: #2c2c5e;
    color: white;
}
body.dark-theme .project-card,
body.dark-theme .info-item {
    background: #2a2a3e;
    border-color: #3a3a5e;
    color: #ddd;
}
body.dark-theme .project-card h3 {
    color: #8ab4f8;
}

/* 加载骨架屏 */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    border-radius: 6px;
}
@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
body.dark-theme .skeleton {
    background: linear-gradient(90deg, #2a2a3e 25%, #3a3a4e 50%, #2a2a3e 75%);
    background-size: 200% 100%;
}

/* 使用手册弹窗动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}