/* 全局样式 - 淡紫色主题 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f0ff 0%, #e8d9ff 100%);
    min-height: 100vh;
    color: #4a2b7a;
}

/* 导航栏 */
.nav-bar {
    background: linear-gradient(90deg, #9c27b0, #ce93d8);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(156, 39, 176, 0.3);
}

.nav-bar h1 {
    color: white;
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    transition: background 0.3s;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.2);
}

.nav-links a.active {
    background: white;
    color: #9c27b0;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(156, 39, 176, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(156, 39, 176, 0.15);
}

/* 按钮 */
.btn {
    background: linear-gradient(135deg, #9c27b0, #ce93d8);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.btn-outline {
    background: transparent;
    border: 1px solid #9c27b0;
    color: #9c27b0;
}

.btn-outline:hover {
    background: #9c27b0;
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #f44336, #ef9a9a);
}

/* 表单 */
input, select, textarea {
    width: 100%;
    padding: 10px 15px;
    margin: 8px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border 0.3s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #9c27b0;
    box-shadow: 0 0 5px rgba(156, 39, 176, 0.3);
}

/* 表单组 */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #4a2b7a;
}

/* 账单列表项 */
.bill-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.bill-item:last-child {
    border-bottom: none;
}

.bill-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.bill-category {
    font-size: 1.5rem;
}

.bill-name {
    font-weight: 500;
}

.bill-date {
    font-size: 0.8rem;
    color: #888;
}

.bill-amount-expense {
    font-weight: bold;
    color: #f44336;
}

.bill-amount-income {
    font-weight: bold;
    color: #4caf50;
}

.bill-actions {
    display: flex;
    gap: 10px;
}

.bill-actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
}

/* 统计数据卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(156, 39, 176, 0.1);
}

.stat-card h3 {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 10px;
}

.stat-card .value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #9c27b0;
}

.stat-card .income {
    color: #4caf50;
}

.stat-card .expense {
    color: #f44336;
}

/* 图表容器 */
.chart-container {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(156, 39, 176, 0.1);
}

.chart-box {
    height: 300px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-bar .form-group {
    margin-bottom: 0;
    min-width: 150px;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    color: #4a2b7a;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #888;
}

/* 消息提示 */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    z-index: 1100;
    animation: fadeInOut 2s ease;
}

@keyframes fadeInOut {
    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); }
}