/**
 * 记账系统样式
 */

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
}

[v-cloak] {
    display: none;
}

/* 登录页面 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    margin: 20px;
}

.login-card h2 {
    text-align: center;
    margin: 0;
    color: #333;
}

/* 主容器 */
.main-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 顶部导航栏 */
.header {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 0;
    height: 60px;
    line-height: 60px;
}

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

.header h1 {
    font-size: 24px;
    color: #333;
    margin: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    color: #666;
}

/* 内容区 */
.content-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
}

/* 工具栏 */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

/* 统计卡片 */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.summary-card h3 {
    font-size: 16px;
    color: #666;
    margin-bottom: 15px;
    text-align: center;
}

.summary-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-radius: 4px;
}

.summary-item.income {
    background: #f0f9ff;
}

.summary-item.expense {
    background: #fff1f0;
}

.summary-item .label {
    color: #666;
    font-size: 14px;
}

.summary-item .value {
    font-size: 18px;
    font-weight: bold;
}

.summary-item.income .value {
    color: #67C23A;
}

.summary-item.expense .value {
    color: #F56C6C;
}

/* 表格 */
.records-table {
    margin-top: 20px;
    background: #fff;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 日期+时段单元格 */
.date-time-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.date-text {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.time-period-text {
    font-size: 12px;
    color: #999;
}

/* 金额单元格 */
.amount-cell {
    font-size: 16px;
    font-weight: 600;
}

.amount-cell.income {
    color: #67C23A;
}

.amount-cell.expense {
    color: #F56C6C;
}

/* 分类图标单元格 */
.category-icon-cell {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.category-icon {
    font-size: 24px;
    display: inline-block;
    line-height: 1;
}

/* 操作按钮 */
.action-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

.action-buttons .el-button {
    padding: 4px 8px;
    min-width: auto;
}

.icon-edit,
.icon-delete {
    font-size: 16px;
    display: inline-block;
    line-height: 1;
}

.action-buttons .el-button.is-circle {
    width: 32px;
    height: 32px;
    padding: 0;
}

/* 分析页面 */
.analysis-container {
    padding: 20px 0;
}

.date-range-selector {
    margin-bottom: 20px;
}

.analysis-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.analysis-summary h3 {
    font-size: 16px;
    color: #666;
    margin-bottom: 10px;
}

.analysis-summary .amount {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 5px;
}

.analysis-summary .amount.income {
    color: #67C23A;
}

.analysis-summary .amount.expense {
    color: #F56C6C;
}

.analysis-summary .count {
    color: #999;
    font-size: 14px;
}

.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* 响应式设计 */

/* 平板端 */
@media (max-width: 1024px) {
    .header-content {
        padding: 0 15px;
    }
    
    .content-container {
        padding: 15px;
    }
    
    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 移动端 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 18px;
    }
    
    .user-info span {
        display: none;
    }
    
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-buttons {
        width: 100%;
    }
    
    .filter-buttons .el-radio-group {
        width: 100%;
        display: flex;
    }
    
    .filter-buttons .el-radio-button {
        flex: 1;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .charts-container {
        grid-template-columns: 1fr;
    }
    
    .analysis-summary {
        grid-template-columns: 1fr;
    }
    
    /* 表格在移动端改为卡片展示 */
    .records-table .el-table__header {
        display: none;
    }
    
    .login-card {
        margin: 10px;
    }
    
    /* 弹窗在移动端调整宽度 */
    .el-dialog {
        width: 90% !important;
        max-width: 90% !important;
        margin: 5vh auto !important;
    }
    
    /* 表格列宽优化 */
    .records-table .el-table__body-wrapper {
        overflow-x: auto;
    }
    
    .records-table .el-table__cell {
        padding: 8px 4px !important;
    }
    
    /* 日期单元格 */
    .date-text {
        font-size: 13px;
    }
    
    .time-period-text {
        font-size: 11px;
    }
    
    /* 金额单元格 */
    .amount-cell {
        font-size: 15px;
    }
    
    /* 分类图标单元格 */
    .category-icon {
        font-size: 22px;
    }
    
    /* 操作列按钮优化 */
    .records-table .el-table__cell:last-child {
        min-width: 90px !important;
        width: 90px !important;
    }
    
    .action-buttons {
        gap: 4px;
    }
    
    .action-buttons .el-button.is-circle {
        width: 28px;
        height: 28px;
    }
    
    .icon-edit,
    .icon-delete {
        font-size: 14px;
    }
    
    /* 卡片头部在移动端 */
    .card-header {
        flex-wrap: wrap;
        gap: 10px;
    }
}

/* 小屏幕 */
@media (max-width: 480px) {
    .content-container {
        padding: 10px;
    }
    
    .summary-item {
        flex-direction: column;
        text-align: center;
    }
    
    /* 弹窗在小屏幕进一步优化 */
    .el-dialog {
        width: 95% !important;
        max-width: 95% !important;
        margin: 2vh auto !important;
    }
    
    .el-dialog__body {
        padding: 15px !important;
    }
    
    /* 备注框在小屏幕更小 */
    .el-textarea__inner {
        min-height: 60px !important;
    }
    
    /* 表格列宽进一步压缩 */
    .records-table .el-table__cell {
        padding: 6px 3px !important;
        font-size: 12px !important;
    }
    
    .date-text {
        font-size: 12px;
    }
    
    .time-period-text {
        font-size: 10px;
    }
    
    .amount-cell {
        font-size: 14px;
    }
    
    /* 分类图标单元格 */
    .category-icon {
        font-size: 20px;
    }
    
    .records-table .el-table__cell:last-child {
        min-width: 80px !important;
        width: 80px !important;
    }
    
    .action-buttons {
        gap: 3px;
    }
    
    .action-buttons .el-button.is-circle {
        width: 26px;
        height: 26px;
    }
    
    .icon-edit,
    .icon-delete {
        font-size: 13px;
    }
    
    /* 日期列在小屏幕更紧凑 */
    .date-time-cell {
        gap: 2px;
    }
    
    /* 卡片头部在小屏幕 */
    .card-header {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    /* 日期列在小屏幕更紧凑 */
    .date-time-cell {
        gap: 2px;
    }
}

/* Element Plus 主题定制 */
:root {
    --el-color-primary: #409EFF;
    --el-color-success: #67C23A;
    --el-color-danger: #F56C6C;
}

/* 动画效果 */
.el-card {
    transition: transform 0.3s, box-shadow 0.3s;
}

.el-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}


