/* 自定义样式 */
:root {
    --color-energy: #fbbf24;
    --color-primary: #2563eb;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
}

/* Vue v-cloak 指令样式 - 在Vue应用挂载前隐藏内容 */
[v-cloak] {
    display: none !important;
}

/* 能量值样式 */
.energy-display {
    color: var(--color-energy);
    font-weight: 600;
}

/* 成就分数样式 */
.achievement-display {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

.energy-button {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.energy-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.4);
}

.energy-button:active {
    transform: translateY(0);
}

/* 卡片样式 */
.galaxy-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.galaxy-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

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

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* 防止移动端页面被撑开 */
    body {
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    #app {
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    /* 确保所有容器不会超出视口 */
    .container {
        max-width: 100%;
        overflow-x: hidden;
    }
}

/* 加载状态 */
.loading-spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid #2563eb;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 骨架屏样式 */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 0.5rem;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 页面加载状态 */
.page-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    gap: 1rem;
}

.page-loading .loading-spinner {
    width: 48px;
    height: 48px;
}

/* 骨架屏卡片 */
.skeleton-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.skeleton-line {
    height: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 0.25rem;
}

.skeleton-line:last-child {
    margin-bottom: 0;
}

.skeleton-avatar {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
}

.skeleton-title {
    height: 1.5rem;
    width: 60%;
}

.skeleton-text {
    height: 1rem;
    width: 100%;
}

.skeleton-text.short {
    width: 80%;
}

.skeleton-button {
    height: 2.5rem;
    width: 8rem;
    border-radius: 0.5rem;
}

/* 页面内容过渡 */
.page-content {
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

.page-content.loaded {
    opacity: 1;
}

/* 页面内容初始隐藏，加载后显示 */
.page-content:not(.loaded) {
    min-height: 400px;
    position: relative;
    /* 不要完全隐藏，只是透明度降低，这样 Vue 可以找到挂载目标 */
    opacity: 0;
    pointer-events: none;
}

/* 页面加载时的全局加载指示器 */
.page-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.page-loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

