/* ===== 全局样式 ===== */
body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', sans-serif;
    background-color: #f5f5f5;
}

/* ===== 登录/注册页面 ===== */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 420px;
}

.auth-card h2 {
    color: #333;
    font-weight: 700;
}

/* ===== 侧边栏 ===== */
.sidebar {
    min-height: calc(100vh - 56px);
    border-right: 1px solid #e0e0e0;
    padding-top: 16px;
}

.sidebar .nav-link {
    color: #555;
    padding: 10px 16px;
    border-radius: 8px;
    margin: 2px 8px;
    transition: all 0.2s;
}

.sidebar .nav-link:hover {
    background-color: #e3f2fd;
    color: #1976d2;
}

.sidebar .nav-link.active {
    background-color: #1976d2;
    color: white;
}

.sidebar .nav-link i {
    margin-right: 8px;
    width: 20px;
    text-align: center;
}

/* ===== 统计卡片 ===== */
.stat-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    padding: 20px;
    text-align: center;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.stat-card .stat-title {
    font-size: 14px;
    color: #888;
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
}

.stat-card.income .stat-value { color: #4caf50; }
.stat-card.expense .stat-value { color: #f44336; }
.stat-card.balance .stat-value { color: #1976d2; }

/* ===== 表格 ===== */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.table-container .table {
    margin-bottom: 0;
}

.table th {
    background-color: #fafafa;
    border-bottom-width: 2px;
    font-weight: 600;
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
}

/* 收入行 */
tr.income-row {
    background-color: #f1f8e9;
}
tr.income-row:hover {
    background-color: #dcedc8;
}

/* 支出行 */
tr.expense-row {
    background-color: #fce4ec;
}
tr.expense-row:hover {
    background-color: #f8bbd0;
}

/* ===== 表单 ===== */
.form-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    padding: 24px;
}

/* ===== 图表容器 ===== */
.chart-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    padding: 20px;
    margin-bottom: 20px;
}

.chart-wrapper {
    position: relative;
    max-height: 400px;
}

/* ===== 按钮增强 ===== */
.btn-icon {
    padding: 4px 8px;
    font-size: 14px;
}

/* ===== 类别标签 ===== */
.badge-category {
    font-size: 0.85em;
    padding: 4px 10px;
    border-radius: 20px;
}

.badge-income {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.badge-expense {
    background-color: #fce4ec;
    color: #c62828;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .sidebar {
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }

    .stat-card {
        margin-bottom: 12px;
    }
}

/* ===== 操作按钮列固定宽度 ===== */
.action-btns {
    white-space: nowrap;
}

.action-btns .btn {
    padding: 2px 8px;
    font-size: 13px;
}

/* ===== 项目选择器 ===== */
#projectSelector {
    background-color: #343a40;
    border-color: #495057;
    color: #e0e0e0;
}

#projectSelector option {
    background-color: #343a40;
    color: #e0e0e0;
}

/* ===== 模态框增强 ===== */
.modal-content {
    border-radius: 12px;
}

/* ===== 打印样式 ===== */
@media print {
    .sidebar, .navbar, .btn, form {
        display: none !important;
    }
    main {
        width: 100% !important;
        margin: 0 !important;
    }
}
