/* OneBetter - 自定义样式 */

/* 全局样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #eff6ff 0%, #e0e7ff 100%);
    color: #2d3748;
    line-height: 1.6;
}

/* 主内容区域 */
.main-content {
    overflow-y: auto;
    height: calc(100vh - 56px);
    scroll-behavior: smooth;
}

@media (min-width: 768px) {
    .main-content {
        height: calc(100vh - 56px);
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #e2e8f0;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* 页面切换动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); }
}

.page {
    display: none;
}

.page-active {
    display: block;
    animation: fadeIn 0.3s ease-out forwards;
}

/* 卡片悬浮效果 */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* 按钮反馈效果 */
.btn-feedback {
    transition: all 0.2s ease;
}

.btn-feedback:active {
    transform: scale(0.98);
}

/* 打卡按钮动画 */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.btn-pulse {
    animation: pulse 2s infinite;
}

/* 能量币跳动动画 */
@keyframes energyBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.energy-bounce {
    animation: energyBounce 1.5s infinite;
}

/* 进度条动画 */
@keyframes progressAnimate {
    0% { width: 0%; }
}

.progress-animate {
    animation: progressAnimate 1s ease-out;
}

/* 图表增长动画 */
@keyframes chartGrow {
    from { height: 0; }
}

.chart-bar {
    animation: chartGrow 0.8s ease-out forwards;
    transition: height 0.3s ease;
}

/* 现代化卡片样式 */
.modern-card {
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.modern-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* 现代化按钮样式 */
.modern-btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.modern-btn:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}


/* 模态框样式 */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Toast通知样式 */
.toast {
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: toastSlideIn 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast-success {
    background: #10b981;
    color: white;
}

.toast-error {
    background: #ef4444;
    color: white;
}

.toast-warning {
    background: #f59e0b;
    color: white;
}

.toast-info {
    background: #3b82f6;
    color: white;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* 成就徽章样式 */
.achievement-badge {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.achievement-badge.locked {
    background: #e5e7eb;
    color: #9ca3af;
}

.achievement-badge.unlocked {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}

/* 小尺寸成就徽章 */
.achievement-badge-sm {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.achievement-badge-sm.locked {
    background: #e5e7eb;
    color: #9ca3af;
}

.achievement-badge-sm.unlocked {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
}

@keyframes achievementUnlock {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.achievement-unlock-animation {
    animation: achievementUnlock 0.5s ease-out;
}

/* 日历格子样式 */
.calendar-day {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calendar-day:hover {
    transform: scale(1.1);
}

.calendar-day.success {
    background: #dcfce7;
    color: #16a34a;
}

.calendar-day.fail {
    background: #fee2e2;
    color: #dc2626;
}

.calendar-day.today {
    border: 2px solid #4f46e5;
}

.calendar-day.other-month {
    color: #9ca3af;
}

/* 血条样式 */
.health-bar {
    height: 12px;
    border-radius: 6px;
    background: #e5e7eb;
    overflow: hidden;
}

.health-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s ease, background-color 0.3s ease;
}

.health-bar-fill.high {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

.health-bar-fill.medium {
    background: linear-gradient(90deg, #f97316 0%, #ea580c 100%);
}

.health-bar-fill.low {
    background: linear-gradient(90deg, #991b1b 0%, #7f1d1d 100%);
}

/* 决策评分圆环 */
.score-ring {
    position: relative;
    width: 64px;
    height: 64px;
}

.score-ring svg {
    transform: rotate(-90deg);
}

.score-ring-bg {
    fill: none;
    stroke: #e5e7eb;
    stroke-width: 6;
}

.score-ring-progress {
    fill: none;
    stroke-width: 6;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
}

.score-ring-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
}

/* 加载动画 */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e5e7eb;
    border-top-color: #4f46e5;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* 输入框样式 */
.input-field {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.input-field:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* 选择框样式 */
.select-field {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.select-field:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* 标签样式 */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.tag-blue {
    background: #dbeafe;
    color: #1d4ed8;
}

.tag-green {
    background: #dcfce7;
    color: #16a34a;
}

.tag-red {
    background: #fee2e2;
    color: #dc2626;
}

.tag-yellow {
    background: #fef3c7;
    color: #ca8a04;
}

.tag-purple {
    background: #f3e8ff;
    color: #7c3aed;
}

/* 响应式调整 */
@media (max-width: 767px) {
    .main-content {
        padding-bottom: 70px;
    }
    
    h2 {
        font-size: 1.125rem;
    }
    
    h3 {
        font-size: 1rem;
    }
}
