/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 导航栏 */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

.nav-links a:hover {
    opacity: 0.8;
}

.user-info {
    margin-left: 1rem;
    font-weight: 500;
}

.logout {
    background: rgba(255,255,255,0.2);
    padding: 0.5rem 1rem;
    border-radius: 5px;
}

/* 表单样式 */
.form-wrapper {
    max-width: 500px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
}

.btn-info {
    background: linear-gradient(135deg, #17a2b8 0%, #20c997 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

/* 余额卡片 */
.balance-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.balance-card {
    padding: 1.5rem;
    border-radius: 10px;
    color: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.balance-card.income {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.balance-card.expense {
    background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
}

.balance-card.total {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.balance-card h3 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.balance-card .amount {
    font-size: 2rem;
    font-weight: 600;
}

/* 快速操作 */
.quick-actions {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

/* 图表区域 */
.chart-section {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin: 2rem 0;
}

/* 表格样式 */
table {
    width: 100%;
    background: white;
    border-collapse: collapse;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

table th, table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

table tbody tr:hover {
    background: #f8f9fa;
}

.type-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.type-badge.income {
    background: #d4edda;
    color: #155724;
}

.type-badge.expense {
    background: #f8d7da;
    color: #721c24;
}

td.income {
    color: #28a745;
    font-weight: 600;
}

td.expense {
    color: #dc3545;
    font-weight: 600;
}

/* 筛选表单 */
.filter-form {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    margin: 1rem 0 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.filter-group input,
.filter-group select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.875rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    
    .balance-cards {
        grid-template-columns: 1fr;
    }
    
    .filter-row {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        flex-direction: column;
    }
    
    table {
        display: block;
        overflow-x: auto;
    }
}

/* 提示信息 */
.alert {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
    font-weight: 500;
}

.alert.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 无数据提示 */
.no-data {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
}

/* 数据表格样式 */
.data-table {
    width: 100%;
    background: white;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin: 1rem 0;
}

.data-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.data-table .income {
    color: #28a745;
    font-weight: 600;
}

.data-table .expense {
    color: #dc3545;
    font-weight: 600;
}

.data-table .no-data {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 2rem;
}

/* 月度数据区域 */
.monthly-data {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin: 1rem 0;
}

/* 余额设置页面样式 */
.balance-form {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin: 1rem 0;
}

.current-balance-info {
    text-align: center;
    margin: 1rem 0 2rem;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    color: white;
}

.current-balance-info .amount {
    font-size: 1.5em;
    font-weight: bold;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
}

.adjustment-info {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.adjustment-info h4 {
    margin-top: 0;
    color: #333;
}

.adjustment-info ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.adjustment-info li {
    margin-bottom: 0.5rem;
    color: #666;
}

/* 按钮样式增强 */
.btn-warning {
    background: linear-gradient(135deg, #ffc107, #ff8c00);
    color: white;
    border: none;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #e0a800, #e67e00);
}