body {
    margin: 0;
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #f5f5f5;
    font-size: 16px;
}

.top-nav {
    background-color: #306692;
    color: white;
    text-align: center;
    padding: 15px 0;
    font-size: 18px;
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 100;
}

.content {
    flex: 1;
    padding: 15px;
    background-color: #f5f5f5;
    padding-bottom: 70px; /* 给底部导航留出空间 */
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    background-color: #f5f5f5;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px 0;
    border-top: 1px solid var(--border-color);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color:var(--border-color);
    text-decoration: none;
    font-size: 16px;
    padding: 8px 15px;
    border-radius: 20px;
    transition: all 0.3s ease;
    flex: 60px;
    text-align: center;
}

.nav-item.active {
    background-color: #306692;
    color: white;
}

.nav-item i {
    font-size: 22px;
    margin-bottom: 4px;
}
.report-btn-container {
    margin: 20px 15px;
    text-align: center;
}

.report-btn {
    background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 184, 148, 0.3);
    transition: all 0.3s ease;
}

.report-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 184, 148, 0.4);
}

.report-btn:active {
    transform: translateY(0);
}

.report-btn i {
    margin-right: 8px;
    font-size: 18px;
}
/* 统计页面样式 */
.filter-bar {
    background-color: #306692;
    color: white;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-radius: 8px;
}

.type-selector, .time-selector {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 8px 12px;
    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn.active {
    background-color: white;
    color: #306692;
    font-weight: bold;
}

.chart-container {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.chart-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
}

.ranking-container {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.ranking-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.ranking-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.category-icon {
    width: 40px;
    height: 40px;
    background-color: #e0e0e0;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 12px;
    color: #306692;
    font-size: 18px;
}

.category-info {
    flex: 1;
}

.category-name {
    font-weight: bold;
    margin-bottom: 4px;
}

.progress-bar {
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
    margin-top: 5px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background-color: #306692;
    border-radius: 4px;
}

.category-amount {
    font-size: 16px;
    color: #333;
    text-align: right;
}

@media (min-width: 768px) {
    body {
        max-width: 500px;
        margin: 0 auto;
        height: 100vh;
        position: relative;
        box-shadow: 0 0 20px rgba(0,0,0,0.1);
    }
    
    /* 关键修复：导航栏宽度限制 */
    .bottom-nav {
        width: 500px; /* 固定宽度 */
        left: 50%;
        transform: translateX(-50%);
        margin: 0 auto;
    }
    
    /* 确保内容不超出 */
    .content {
        overflow-y: auto;
        max-height: calc(100vh - 60px); /* 减去导航栏高度 */
    }
}
/* 添加在文件末尾 */
/* AI建议模块样式 */
.ai-advice-container {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    border-radius: 12px;
    padding: 16px;
    margin: 20px 15px;
    box-shadow: 0 4px 20px rgba(106, 17, 203, 0.2);
    color: white;
    display: block; /* 修改为block */
    position: relative;
    overflow: hidden;
    transform: translateY(10px);
    opacity: 0;
    transition: all 0.3s ease-out;
}

.ai-advice-container.show {
    transform: translateY(0);
    opacity: 1;
}

/* 其他原有样式保持不变 */

.ai-advice-container::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
    transform: rotate(30deg);
}

.ai-advice-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    font-size: 18px;
    font-weight: 600;
    position: relative;
    z-index: 2;
}

.ai-advice-header i {
    margin-right: 10px;
    font-size: 20px;
    color: #fff;
}

.ai-advice-content {
    display: flex;
    align-items: center;
    position: relative;
    z-index: 2;
}

.ai-advice-icon {
    margin-right: 15px;
    font-size: 28px;
    color: rgba(255, 255, 255, 0.8);
}

.ai-advice-text {
    flex: 1;
    line-height: 1.6;
}

.ai-advice-text p {
    margin: 0;
    font-size: 15px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
/* 收支提醒浮窗容器 */
.financial-alert-container {
    position: fixed;
    bottom: 80px; /* 在底部导航栏上方 */
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    pointer-events: none; /* 避免阻挡下方元素 */
    z-index: 999;
}

/* 收支提醒浮窗样式 */
.financial-alert {
    background: linear-gradient(135deg, #ff7675 0%, #fdcb6e 100%);
    color: #fff;
    border-radius: 10px;
    padding: 12px 16px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    display: none;
    animation: slideIn 0.3s forwards;
    max-width: 450px; /* 限制在小程序宽度内 */
    width: calc(100% - 40px); /* 左右留20px边距 */
    margin: 0 20px;
    pointer-events: auto; /* 恢复按钮点击 */
}

.financial-alert.show {
    display: flex;
}

.alert-content {
    display: flex;
    align-items: center;
    width: 100%;
}

.financial-alert i {
    font-size: 20px;
    margin-right: 10px;
    flex-shrink: 0;
}

.alert-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
}

.close-alert {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    margin-left: 10px;
    padding: 0 0 0 10px;
    flex-shrink: 0;
}

/* 动画效果 */
@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (min-width: 768px) {
    .financial-alert {
        max-width: 460px; /* 在桌面模式下稍宽 */
    }
}



/* 响应式调整 */
@media (max-width: 480px) {
    .ai-advice-container {
        padding: 14px;
    }
    
    .ai-advice-header {
        font-size: 16px;
    }
    
    .ai-advice-icon {
        font-size: 24px;
    }
    
    .ai-advice-text p {
        font-size: 14px;
    }
}
/* 通勤提示样式 */
.commute-toast {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #4CAF50 0%, #8BC34A 100%);
    color: white;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 14px;
    z-index: 1002;
    display: none;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    animation: slideInOut 5s forwards;
}

@keyframes slideInOut {
    0% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    15% { opacity: 1; transform: translateX(-50%) translateY(0); }
    85% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

.commute-toast i {
    font-size: 18px;
}


