* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1680px;
    margin: 0 auto;
    padding: 20px;
}


.header {
    background: #2c3e50;
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 24px;
    margin-bottom: 15px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.currency-toggle {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background 0.3s;
}

.currency-toggle:hover {
    background: #2980b9;
}

.currency-toggle.active {
    background: #27ae60;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    background: #34495e;
    color: white;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    transition: background 0.3s;
}

.nav-link:hover {
    background: #3498db;
}

.balance-info {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 15px;
}

.balance-item {
    text-align: center;
}

.balance-amount {
    font-size: 20px;
    font-weight: bold;
    display: block;
}

.income {
    color: #27ae60;
}

.expense {
    color: #e74c3c;
}

.total {
    color: #3498db;
}

.balance-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
}

.balance-btn {
    background: #f0f0f0;
    color: #333;
    border: none;
    padding: 12px 16px;
    border-radius: 4px;
    cursor: default;
    font-size: 14px;
    transition: none;
    flex: 1;
    max-width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.btn-label {
    font-size: 12px;
    color: #666;
}

.btn-amount {
    font-size: 16px;
    font-weight: bold;
    color: #000;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ===== 顶部控制区：币种 + 时间段 + 用户 ===== */
.header-controls-top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.currency-toggle {
    background: #2c3e50;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 6px 14px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}
.currency-toggle.active {
    background: #f39c12;
}
.period-tabs {
    display: flex;
    gap: 6px;
    background: #f0f0f0;
    padding: 3px;
    border-radius: 6px;
}
.period-btn {
    border: none;
    background: transparent;
    color: #555;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}
.period-btn.active {
    background: #3498db;
    color: #fff;
    font-weight: bold;
}
.header-top-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}
.header-top-right h1 {
    margin: 0;
    font-size: 18px;
    text-align: right;
}
.chart-buttons {
    display: flex;
    gap: 6px;
}
.chart-btn {
    background: #34495e;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 5px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s;
}
.chart-btn:hover {
    background: #3498db;
}

/* ===== 四个时间段统计卡片 ===== */
.period-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 12px;
}
.period-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 10px 12px;
}
.period-title {
    font-size: 13px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 6px;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 4px;
}
.period-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin: 3px 0;
    color: #555;
}
.period-row .balance-amount {
    font-size: 15px;
}
.period-row.total {
    border-top: 1px dashed #ddd;
    margin-top: 6px;
    padding-top: 6px;
    font-weight: bold;
}

/* ===== 移动端适配 ===== */
@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .header-controls-top {
        flex-wrap: nowrap;
        justify-content: space-between;
        gap: 8px;
    }
    .header-top-right {
        align-items: stretch;
    }
    .header-top-right h1 {
        text-align: left;
        font-size: 16px;
    }
    .chart-buttons {
        justify-content: flex-end;
    }
    /* 手机端：时间段卡片改为 tab 式，仅显示选中的一张 */
    .period-tabs {
        flex: 1;
        min-width: 0;
    }
    .period-btn {
        flex: 1;
        padding: 6px 4px;
        text-align: center;
    }
    .period-summary {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .period-card {
        display: none;
    }
    .period-card.active {
        display: block;
    }
}
@media (max-width: 480px) {
    .header-controls-top {
        flex-wrap: wrap;
    }
    .period-tabs {
        width: 100%;
    }
    .period-btn {
        padding: 6px 2px;
        font-size: 12px;
    }
}

.record-form-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.record-form-section h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.record-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

#amount {
    -moz-appearance: textfield;
}

#amount::-webkit-outer-spin-button,
#amount::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#amount::-webkit-scrollbar {
    display: none;
}

.amount-inputs {
    display: flex;
    gap: 10px;
}

.amount-inputs input {
    flex: 1;
}

.amount-inputs input:first-child {
    background: #f8f9fa; /* K输入框 */
}

.amount-inputs input:last-child {
    background: #fff3cd; /* RMB输入框 */
    border-color: #ffc107;
}

.form-group input,
.form-group select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.type-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.type-btn {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    background: #f0f0f0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.type-btn.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.type-btn.income-btn {
    border-color: #27ae60;
}

.type-btn.expense-btn {
    border-color: #e74c3c;
}

.submit-btn {
    grid-column: 1 / -1;
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.submit-btn:hover {
    background: #2980b9;
}

.statistics-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.statistics-section h2 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.stats-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 8px 15px;
    border: none;
    background: #f0f0f0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn.active {
    background: #3498db;
    color: white;
}

.tab-btn:hover {
    background: #2980b9;
}

.stats-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.stat-item {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
}

.stat-value {
    font-size: 18px;
    font-weight: bold;
    display: block;
    margin-top: 5px;
}

.records-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.records-section h2 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.records-list {
    max-height: 600px;
    overflow-y: auto;
}

/* Toast 消息组件样式 */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: white;
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 300px;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease-in-out;
    position: relative;
    overflow: hidden;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.hide {
    transform: translateX(100%);
    opacity: 0;
}

.toast.success {
    border-left: 4px solid #27ae60;
}

.toast.error {
    border-left: 4px solid #e74c3c;
}

.toast.warning {
    border-left: 4px solid #f39c12;
}

.toast.info {
    border-left: 4px solid #3498db;
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast.success .toast-icon {
    color: #27ae60;
}

.toast.error .toast-icon {
    color: #e74c3c;
}

.toast.warning .toast-icon {
    color: #f39c12;
}

.toast.info .toast-icon {
    color: #3498db;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    flex-shrink: 0;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #666;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    transition: width linear;
}

.toast.success .toast-progress {
    background: #27ae60;
}

.toast.error .toast-progress {
    background: #e74c3c;
}

.toast.warning .toast-progress {
    background: #f39c12;
}

.toast.info .toast-progress {
    background: #3498db;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .toast {
        min-width: auto;
        max-width: none;
        width: 100%;
    }
}

/* 删除确认对话框样式 */
.confirmation-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.confirmation-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.confirmation-modal {
    background: white;
    padding: 20px;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
}

.confirmation-modal h3 {
    margin-top: 0;
    color: #2c3e50;
}

.confirmation-buttons {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 20px;
}

.confirm-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    flex: 1;
    transition: background 0.3s;
}

.confirm-btn:hover {
    background: #c0392b;
}

.cancel-btn {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    flex: 1;
    transition: background 0.3s;
}

.cancel-btn:hover {
    background: #7f8c8d;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

.prev-btn,
.next-btn {
    padding: 8px 15px;
    border: 1px solid #ddd;
    background: #f0f0f0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.prev-btn:hover,
.next-btn:hover {
    background: #e0e0e0;
}

.prev-btn:disabled,
.next-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    padding: 8px 15px;
    font-size: 14px;
    color: #666;
}

.record-item {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    transition: none;
}

.record-item.income {
    background: #d4edda;
    border-left: 4px solid #27ae60;
}

.record-item.expense {
    background: #f8d7da;
    border-left: 4px solid #e74c3c;
}

.record-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.record-amount {
    font-weight: bold;
    font-size: 18px;
}

.record-amount.income {
    color: #27ae60;
}

.record-amount.expense {
    color: #e74c3c;
}

.rmb-equivalent {
    color: #999;
    font-size: 14px;
    font-weight: normal;
    margin-left: 4px;
}

.k-equivalent {
    color: #999;
    font-size: 14px;
    font-weight: normal;
    margin-left: 4px;
}

.record-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 0;
    font-size: 14px;
    color: #666;
}

.record-meta.no-description {
    gap: 0;
}

.record-description {
    color: #555;
    font-size: 13px;
}

.record-actions {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin-top: 5px;
}

.record-actions button {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    width: 80px;
    text-align: center;
}

.edit-btn {
    background: #3498db;
    color: white;
}

.delete-btn {
    background: #e74c3c;
    color: white;
}

.no-records {
    text-align: center;
    padding: 20px;
    color: #666;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 20px;
        text-align: center;
        margin-bottom: 10px;
    }
    
    .balance-info {
        flex-direction: column;
        gap: 8px;
    }
    
    .balance-buttons {
        flex-direction: row;
        gap: 8px;
        margin-top: 10px;
        justify-content: center;
    }
    
    .balance-btn {
        max-width: none;
        width: 48%;
        padding: 10px 8px;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        cursor: default; /* 移除点击效果 */
        transition: none; /* 移除过渡效果 */
    }
    
    .btn-label {
        font-size: 11px;
    }
    
    .btn-amount {
        font-size: 14px;
    }
    
    .balance-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding: 6px 0;
    }
    
    .balance-amount {
        font-size: 16px;
    }
    
    .record-form-section,
    .statistics-section,
    .records-section {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .record-form-section h2,
    .statistics-section h2,
    .records-section h2 {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .record-form {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .form-group label {
        font-size: 14px;
        margin-bottom: 3px;
    }
    
    .form-group input,
    .type-btn,
    .tab-btn,
    .submit-btn,
    .cancel-btn-form {
        font-size: 16px; /* 防止iOS自动缩放 */
        padding: 12px;
    }
    
    .type-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .type-btn {
        width: 100%;
    }
    
    .type-btn.income-btn.active {
        background: #27ae60;
        border-color: #27ae60;
    }
    
    .type-btn.expense-btn.active {
        background: #e74c3c;
        border-color: #e74c3c;
    }
    
    .stats-tabs {
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 15px;
    }
    
    .tab-btn {
        flex: 1;
        min-width: 70px;
        padding: 10px 8px;
        font-size: 13px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .stat-item {
        padding: 12px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .records-list {
        max-height: 500px;
    }
    
    .record-item {
        flex-direction: row;
        align-items: center;
        gap: 15px;
        padding: 12px;
        margin-bottom: 8px;
    }
    
    .record-item:hover {
        transform: none; /* 移动端禁用悬停效果 */
    }
    
    .record-info {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 5px;
    }
    
    .record-amount {
        font-size: 16px;
        min-width: 80px;
    }
    
    .rmb-equivalent {
        font-size: 12px;
        margin-left: 2px;
    }
    
    .record-meta {
        flex: 1;
        flex-direction: column;
        gap: 2px;
        font-size: 13px;
    }
    
    .record-actions {
        display: flex;
        gap: 8px;
        width: auto;
    }
    
    .record-actions button {
        width: 70px; /* 移动端进一步缩小按钮宽度 */
        padding: 8px 4px;
        font-size: 12px;
    }
    
    .pagination {
        flex-wrap: wrap;
        gap: 10px;
        margin-top: 15px;
    }
    
    .prev-btn,
    .next-btn {
        padding: 12px 15px;
        flex: 1;
    }
    
    .page-info {
        order: -1;
        width: 100%;
        text-align: center;
        padding: 8px 0;
    }
    
    /* 弹窗移动端优化 */
    .confirmation-modal {
        width: 95%;
        padding: 20px 15px;
        margin: 10px;
        max-height: 80vh;
        overflow-y: auto;
    }
    
    .confirmation-modal h3 {
        font-size: 18px;
        text-align: center;
    }
    
    .confirmation-modal p {
        font-size: 14px;
        margin: 15px 0;
        text-align: center;
        line-height: 1.4;
    }
    
    .confirmation-buttons {
        flex-direction: row; /* 移动端也保持水平排列 */
        gap: 10px;
    }
    
    .confirm-btn,
    .cancel-btn {
        width: 100%;
        padding: 14px;
        font-size: 16px;
        border: none;
    }
    
    /* 通知移动端优化 */
    .notification {
        left: 10px;
        right: 10px;
        top: 10px;
        width: auto;
        font-size: 14px;
        padding: 12px 15px;
    }
    
    /* 取消按钮优化 */
    .cancel-btn-form {
        margin-top: 8px;
        width: 100%;
    }
    
    /* 隐藏空的选择器 */
    .records-controls {
        display: none;
    }
}

/* 小屏手机优化 (最大宽度480px) */
@media (max-width: 480px) {
    .container {
        padding: 5px;
    }
    
    .header {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .header h1 {
        font-size: 18px;
    }
    
    .header-top {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .header-controls {
        justify-content: center;
        margin-left: 0;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .user-info {
        font-size: 12px;
        gap: 8px;
    }
    
    .logout-btn {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .currency-toggle {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .balance-info {
        flex-direction: column;
        gap: 5px;
    }
    
    .balance-item {
        padding: 8px;
    }
    
    .balance-amount {
        font-size: 15px;
    }
    
    .balance-buttons {
        flex-direction: row;
        gap: 8px;
        margin-top: 8px;
        justify-content: center;
    }
    
    .balance-btn {
        width: 48%;
        padding: 8px;
        flex: 1;
    }
    
    .record-form-section,
    .statistics-section,
    .records-section {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .record-form-section h2,
    .statistics-section h2,
    .records-section h2 {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .record-form {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .form-group label {
        font-size: 13px;
        margin-bottom: 2px;
    }
    
    .form-group input,
    .type-btn,
    .tab-btn,
    .submit-btn,
    .cancel-btn-form {
        font-size: 16px; /* 防止iOS自动缩放 */
        padding: 10px;
    }
    
    .amount-inputs {
        flex-direction: column;
        gap: 8px;
    }
    
    .amount-inputs input {
        width: 100%;
        flex: none;
    }
    
    .type-buttons {
        flex-direction: row;
        gap: 8px;
    }
    
    .type-btn {
        flex: 1;
        width: auto;
    }
    
    .stats-tabs {
        flex-wrap: wrap;
        gap: 4px;
        margin-bottom: 12px;
    }
    
    .tab-btn {
        flex: 1;
        min-width: 0;
        font-size: 12px;
        padding: 8px 4px;
    }
    
    .stat-value {
        font-size: 15px;
    }
    
    .record-amount {
        font-size: 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .stat-item {
        padding: 8px;
    }
    
    .record-item {
        padding: 10px;
    }
    
    .record-actions {
        flex-direction: column;
        gap: 5px;
    }
    
    .edit-btn,
    .delete-btn {
        padding: 6px 8px;
        font-size: 12px;
    }
    
    .pagination {
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }
    
    .prev-btn,
    .next-btn {
        width: 100%;
        max-width: 200px;
    }
}

/* 统计模态框样式 */
.stats-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.stats-modal.show {
    opacity: 1;
    visibility: visible;
}

.stats-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.stats-modal-content {
    position: relative;
    background: white;
    border-radius: 0;
    box-shadow: none;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(1);
    transition: transform 0.3s ease;
}

.stats-modal.show .stats-modal-content {
    transform: scale(1);
}

.stats-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: #2c3e50;
    color: white;
    border-bottom: 1px solid #e1e8ed;
}

.stats-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.stats-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.stats-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.stats-modal-body {
    padding: 24px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* 统计表格样式 */
.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stats-table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #e1e8ed;
}

.stats-table th {
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 1px solid #e1e8ed;
    white-space: nowrap;
}

.stats-table td {
    padding: 12px 8px;
    border-bottom: 1px solid #e1e8ed;
    vertical-align: middle;
}

.stats-table tbody tr {
    transition: background-color 0.2s ease;
}

.stats-table tbody tr:hover {
    background: #f8f9fa;
}

.stats-table tbody tr:last-child td {
    border-bottom: none;
}

.stats-table .income {
    color: #27ae60;
    font-weight: 600;
}

.stats-table .expense {
    color: #e74c3c;
    font-weight: 600;
}

/* 统计区域头部样式 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

.section-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.section-header h2 {
    margin: 0;
    font-size: 18px;
    color: #2c3e50;
}

.currency-label {
    font-size: 12px;
    color: #7f8c8d;
    font-weight: normal;
}

.chart-buttons {
    display: flex;
    gap: 8px;
}

.chart-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.3);
}

.chart-btn:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.4);
}

    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.3);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .stats-modal-content {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
    }
    
    .stats-modal-header {
        padding: 16px 20px;
    }
    
    .stats-modal-body {
        padding: 16px;
    }
    
    .stats-table {
        font-size: 12px;
    }
    
    .stats-table th,
    .stats-table td {
        padding: 8px 6px;
    }
    
    /* 移动端按钮样式优化 */
    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .chart-buttons {
        justify-content: center;
        gap: 6px;
    }
    
    .chart-btn {
        padding: 6px 12px;
        font-size: 13px;
        flex: 1;
        max-width: 120px;
    }
}

@media (max-width: 480px) {
    .stats-modal-header {
        padding: 12px 16px;
    }
    
    .stats-modal-header h3 {
        font-size: 16px;
    }
    
    .stats-modal-body {
        padding: 12px;
    }
    
    .stats-table th,
    .stats-table td {
        padding: 6px 4px;
    }
    
    /* 超小屏幕按钮优化 */
    .chart-btn {
        padding: 5px 10px;
        font-size: 12px;
        max-width: 100px;
    }
}