/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    background: linear-gradient(135deg, #f8f4ff 0%, #e8e4ff 100%);
    color: #4a4a4a;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 1s ease-out;
}

.header-content {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 40px 20px;
    box-shadow: 0 10px 30px rgba(147, 112, 219, 0.1);
    backdrop-filter: blur(10px);
}

.avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #9370db, #8a2be2);
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
    animation: pulse 2s infinite;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #6a5acd;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(147, 112, 219, 0.2);
}

.subtitle {
    font-size: 1.2rem;
    color: #9370db;
    margin-bottom: 15px;
    font-weight: 500;
}

.description {
    font-size: 1rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

/* 统计卡片样式 */
.stats-section {
    margin-bottom: 40px;
    animation: fadeInUp 1s ease-out 0.3s both;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(147, 112, 219, 0.1);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(147, 112, 219, 0.2);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.stat-card.income .stat-icon {
    background: linear-gradient(135deg, #9370db, #8a2be2);
}

.stat-card.expense .stat-icon {
    background: linear-gradient(135deg, #ff6b9d, #c44569);
}

.stat-card.balance .stat-icon {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
}

.stat-content h3 {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 5px;
    font-weight: 500;
}

.stat-amount {
    font-size: 1.8rem;
    font-weight: 700;
    color: #4a4a4a;
}

/* 图表区域样式 */
.charts-section {
    margin-bottom: 40px;
    animation: fadeInUp 1s ease-out 0.6s both;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.chart-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(147, 112, 219, 0.1);
    backdrop-filter: blur(10px);
    height: 400px;
    position: relative;
}

.chart-card canvas {
    max-height: 320px !important;
}

.chart-card h3 {
    text-align: center;
    color: #6a5acd;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

/* 交易记录样式 */
.transactions-section {
    margin-bottom: 40px;
    animation: fadeInUp 1s ease-out 0.9s both;
}

.transactions-section h2 {
    text-align: center;
    color: #6a5acd;
    margin-bottom: 30px;
    font-size: 2rem;
}

.filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid #9370db;
    color: #9370db;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.filter-btn:hover,
.filter-btn.active {
    background: #9370db;
    color: white;
    transform: translateY(-2px);
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #9370db, #8a2be2);
    transform: translateX(-50%);
}

.transaction-item {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 5px 20px rgba(147, 112, 219, 0.1);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
    position: relative;
    animation: slideInRight 0.6s ease-out;
}

.transaction-item:hover {
    transform: translateX(5px);
}

.transaction-item.income {
    border-left: 4px solid #9370db;
}

.transaction-item.expense {
    border-left: 4px solid #ff6b9d;
}

.transaction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.transaction-date {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.transaction-amount {
    font-size: 1.2rem;
    font-weight: 700;
}

.transaction-item.income .transaction-amount {
    color: #9370db;
}

.transaction-item.expense .transaction-amount {
    color: #ff6b9d;
}

.transaction-type {
    font-size: 1rem;
    color: #4a4a4a;
    font-weight: 500;
}

.transaction-description {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
}

/* 说明部分样式 */
.explanation-section {
    animation: fadeInUp 1s ease-out 1.2s both;
}

.explanation-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(147, 112, 219, 0.1);
    backdrop-filter: blur(10px);
    text-align: center;
}

.explanation-card h3 {
    color: #6a5acd;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.explanation-card p {
    margin-bottom: 15px;
    color: #4a4a4a;
}

.explanation-card ul {
    list-style: none;
    margin: 20px 0;
    text-align: left;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.explanation-card li {
    padding: 8px 0;
    color: #4a4a4a;
    position: relative;
    padding-left: 25px;
}

.explanation-card li::before {
    content: '💜';
    position: absolute;
    left: 0;
    top: 8px;
}

.highlight {
    background: linear-gradient(135deg, #9370db, #8a2be2);
    color: white;
    padding: 15px 25px;
    border-radius: 15px;
    font-weight: 500;
    margin-top: 20px;
    display: inline-block;
}

/* 动画效果 */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .timeline::before {
        left: 20px;
    }
    
    .transaction-item {
        margin-left: 40px;
    }
    
    .filters {
        flex-direction: column;
        align-items: center;
    }
    
    .filter-btn {
        width: 200px;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 30px 15px;
    }
    
    .title {
        font-size: 1.8rem;
    }
    
    .stat-card {
        padding: 20px;
        flex-direction: column;
        text-align: center;
    }
    
    .chart-card {
        padding: 20px;
    }
    
    .explanation-card {
        padding: 30px 20px;
    }
}
