/* 自定义样式 */
:root {
    --primary-color: #4285F4;
    --income-color: #0F9D58;
    --expense-color: #DB4437;
    --accent-color: #F4B400;
    --text-dark: #333;
    --text-light: #666;
    --border-color: #e0e0e0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* 侧边栏样式 */
.sidebar {
    position: fixed;
    top: 56px;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
    overflow-y: auto;
}

.sidebar .nav-link {
    color: var(--text-dark);
    padding: 12px 20px;
    border-radius: 0;
    transition: all 0.3s ease;
}

.sidebar .nav-link:hover {
    background-color: #e9ecef;
    color: var(--primary-color);
}

.sidebar .nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

.sidebar .nav-link i {
    width: 20px;
    text-align: center;
}

/* 主内容区 */
main {
    margin-top: 56px;
    padding-top: 20px;
}

/* 卡片样式 */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* 统计卡片 */
.stat-card {
    background: linear-gradient(135deg, var(--primary-color), #5a95f5);
    color: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.stat-card.income {
    background: linear-gradient(135deg, var(--income-color), #2e7d32);
}

.stat-card.expense {
    background: linear-gradient(135deg, var(--expense-color), #d32f2f);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-card .stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* 按钮样式 */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #3367d6;
    border-color: #3367d6;
}

.btn-success {
    background-color: var(--income-color);
    border-color: var(--income-color);
}

.btn-danger {
    background-color: var(--expense-color);
    border-color: var(--expense-color);
}

/* 表格样式 */
.table {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.table thead th {
    background-color: var(--primary-color);
    color: white;
    border: none;
    font-weight: 500;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

/* 表单样式 */
.form-control {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 10px 15px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(66, 133, 244, 0.25);
}

.form-label {
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 8px;
}

/* 登录页面样式 */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), #5a95f5);
}

.login-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.login-title {
    text-align: center;
    color: var(--primary-color);
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 30px;
}

.login-form .form-control {
    margin-bottom: 20px;
    padding: 12px 15px;
}

.login-btn {
    width: 100%;
    padding: 12px;
    font-size: 1.1rem;
    border-radius: 8px;
    margin-bottom: 20px;
}

.login-footer {
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* 图表容器 */
.chart-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        position: static;
        height: auto;
    }
    
    main {
        margin-top: 0;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 徽章样式 */
.badge {
    font-size: 0.8rem;
    padding: 5px 10px;
    border-radius: 15px;
}

.badge-income {
    background-color: var(--income-color);
}

.badge-expense {
    background-color: var(--expense-color);
}

/* 分页样式 */
.pagination .page-link {
    color: var(--primary-color);
    border-color: var(--border-color);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.pagination .page-link:hover {
    color: var(--primary-color);
    background-color: #f8f9fa;
}

/* 侧边栏标题样式 */
.sidebar-heading {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* 渐变背景样式 */
.bg-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.bg-gradient-success {
    background: linear-gradient(135deg, #0F9D58 0%, #2e7d32 100%);
}

.bg-gradient-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* 风险偏好卡片样式 */
.risk-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.risk-card:hover .card {
    transform: translateY(-5px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.risk-card.active .card {
    border-width: 2px;
}

.cursor-pointer {
    cursor: pointer;
}

/* AI分析内容样式 */
.analysis-content {
    line-height: 1.8;
    color: var(--text-dark);
}

.analysis-content h3,
.analysis-content h4,
.analysis-content h5,
.analysis-content h6 {
    color: var(--primary-color);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.analysis-content p {
    margin-bottom: 1rem;
}

.analysis-content li {
    margin-bottom: 0.5rem;
}

.analysis-content strong {
    color: #000;
    font-weight: 600;
}

/* 进度条样式 */
.progress {
    height: 25px;
    border-radius: 10px;
    background-color: #e9ecef;
}

.progress-bar {
    background: linear-gradient(135deg, var(--primary-color), #5a95f5);
    border-radius: 10px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 资产卡片特殊样式 */
.asset-card {
    border-left: 4px solid var(--primary-color);
}

.liability-card {
    border-left: 4px solid var(--expense-color);
}

/* 加载动画增强 */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* 卡片头部渐变 */
.card-header.bg-primary {
    background: linear-gradient(135deg, var(--primary-color), #5a95f5) !important;
}

.card-header.bg-success {
    background: linear-gradient(135deg, var(--income-color), #2e7d32) !important;
}

.card-header.bg-danger {
    background: linear-gradient(135deg, var(--expense-color), #d32f2f) !important;
}

.card-header.bg-info {
    background: linear-gradient(135deg, #4facfe, #00f2fe) !important;
}

.card-header.bg-warning {
    background: linear-gradient(135deg, #fa709a, #fee140) !important;
}

/* 列表组样式优化 */
.list-group-item {
    border-left: none;
    border-right: none;
    padding: 1rem 0;
}

.list-group-item:first-child {
    border-top: none;
}

.list-group-item:last-child {
    border-bottom: none;
}

/* 按钮增强效果 */
.btn {
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-lg {
    padding: 15px 30px;
    font-size: 1.1rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
}

/* 表格优化 */
.table-responsive {
    border-radius: 10px;
    overflow: hidden;
}

.table td {
    vertical-align: middle;
}

/* 工具提示样式 */
.tooltip {
    font-size: 0.875rem;
}

/* 导航栏优化 */
.navbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.3rem;
}

/* 文本颜色辅助类 */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), #5a95f5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 全局字体设置 */
body {
    font-family: "宋体", "SimSun", serif !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
}

/* 标题字体调整 */
h1, h2, h3, h4, h5, h6 {
    font-family: "宋体", "SimSun", serif !important;
    font-weight: normal !important;
}

/* 按钮字体调整 */
.btn {
    font-family: "宋体", "SimSun", serif !important;
    font-weight: normal !important;
}

/* 页面标题样式调整 */
h1.h2, 
h2 {
    font-size: 1rem !important;
    font-weight: normal !important;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

/* 健康管理页面标题 */
.health-page h2 {
    font-size: 1.2rem !important;
    font-weight: normal !important;
}

/* 任务状态列标题字体调整 */
.card-header h5 {
    font-size: 1rem !important;
    font-weight: normal !important;
    font-family: "宋体", "SimSun", serif !important;
}

/* 响应式优化 */
@media (max-width: 992px) {
    .sidebar {
        position: static;
        height: auto;
        overflow-y: visible;
    }
    
    main {
        margin-left: 0 !important;
    }
}

@media (max-width: 576px) {
    .stat-card .stat-value {
        font-size: 1.3rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .table {
        font-size: 0.875rem;
    }
}