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

body {
    font-family: 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
    font-size: 14px;
    color: #333;
    background-color: #f5f5f5;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: #1890ff;
}

a:hover {
    color: #40a9ff;
}

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

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.login-box h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: 600;
}

.login-info {
    margin-top: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #1890ff;
}

.login-info h3 {
    color: #1890ff;
    margin-bottom: 10px;
    font-size: 16px;
}

.login-info ul {
    list-style: none;
    padding-left: 0;
}

.login-info li {
    padding: 5px 0;
    color: #666;
}

/* 侧边栏 */
.sidebar {
    width: 220px;
    background: #001529;
    color: white;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    overflow-y: auto;
}

.logo {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.logo h2 {
    font-size: 20px;
    margin-bottom: 10px;
    color: white;
}

.logo p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin: 5px 0;
}

.role-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin-top: 5px;
}

.role-admin {
    background: #ff4d4f;
    color: white;
}

.role-teacher {
    background: #52c41a;
    color: white;
}

.role-finance {
    background: #1890ff;
    color: white;
}

.nav {
    padding: 20px 0;
}

.nav a {
    display: block;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.nav a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border-left-color: #1890ff;
}

.nav a.active {
    color: white;
    background: rgba(24, 144, 255, 0.1);
    border-left-color: #1890ff;
}

.nav a.logout {
    color: #ff7875;
    margin-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
}

/* 主内容区 */
.main-content {
    margin-left: 220px;
    min-height: 100vh;
}

.header {
    background: white;
    padding: 20px 30px;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.user-info {
    color: #666;
    font-size: 14px;
}

.content {
    padding: 30px;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 24px;
    margin-bottom: 24px;
}

.card h2 {
    font-size: 18px;
    color: #333;
    margin-bottom: 20px;
    font-weight: 600;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 10px;
}

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

/* 表单样式 */
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #666;
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
    font-family: 'Microsoft YaHei', sans-serif;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #40a9ff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    font-family: 'Microsoft YaHei', sans-serif;
}

.btn-primary {
    background: #1890ff;
    color: white;
}

.btn-primary:hover {
    background: #40a9ff;
    color: white;
}

.btn-secondary {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #d9d9d9;
}

.btn-secondary:hover {
    background: #e8e8e8;
    color: #333;
}

.btn-success {
    background: #52c41a;
    color: white;
}

.btn-success:hover {
    background: #73d13d;
}

.btn-warning {
    background: #faad14;
    color: white;
}

.btn-warning:hover {
    background: #ffc53d;
}

.btn-danger {
    background: #ff4d4f;
    color: white;
}

.btn-danger:hover {
    background: #ff7875;
}

.btn-info {
    background: #13c2c2;
    color: white;
}

.btn-info:hover {
    background: #36cfc9;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-small {
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 3px;
}

/* 表格样式 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.data-table th {
    background: #fafafa;
    color: #333;
    font-weight: 600;
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    color: #666;
    font-size: 14px;
}

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

/* 金额样式 */
.money {
    font-family: 'Arial', sans-serif;
    font-weight: 500;
}

.positive {
    color: #52c41a;
}

.negative {
    color: #ff4d4f;
}

/* 分数样式 */
.score-high {
    color: #52c41a;
    font-weight: 600;
}

.score-medium {
    color: #faad14;
    font-weight: 600;
}

.score-low {
    color: #ff4d4f;
    font-weight: 600;
}

/* 消息提示 */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #52c41a;
}

.alert-error {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: #ff4d4f;
}

.alert-info {
    background: #e6f7ff;
    border: 1px solid #91d5ff;
    color: #1890ff;
}

/* 空数据提示 */
.no-data {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 16px;
}

/* 学习进程 */
.study-schedule {
    max-width: 300px;
    white-space: pre-line;
    line-height: 1.5;
}

/* 搜索表单 */
.search-form {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.search-form .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* 仪表板卡片 */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.dashboard-cards .card {
    text-align: center;
    padding: 30px 20px;
}

.card-number {
    font-size: 36px;
    font-weight: 700;
    color: #1890ff;
    margin: 15px 0;
}

.card-status {
    font-size: 24px;
    font-weight: 600;
    color: #52c41a;
    margin: 15px 0;
}

/* 快速操作 */
.quick-actions {
    margin-top: 30px;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
}

/* 系统信息 */
.system-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.info-item {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
}

.info-label {
    color: #666;
    font-weight: 500;
}

.status-active {
    color: #52c41a;
    font-weight: 500;
}

/* 备份操作 */
.backup-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.backup-actions .icon {
    margin-right: 8px;
}

.text-muted {
    color: #999;
    font-size: 13px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav a {
        flex: 1;
        min-width: 120px;
        text-align: center;
        border-left: none;
        border-bottom: 3px solid transparent;
    }
    
    .nav a.active {
        border-left: none;
        border-bottom-color: #1890ff;
    }
}
/* 在static/css/style.css文件末尾添加以下内容 */

/* 开支管理样式 */
.tabs {
    display: flex;
    border-bottom: 1px solid #e8e8e8;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: #1890ff;
}

.tab-btn.active {
    color: #1890ff;
    border-bottom-color: #1890ff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 开支统计卡片 */
.expense-summary {
    margin-bottom: 25px;
    padding: 20px;
    background: #fafafa;
    border-radius: 8px;
}

.expense-summary h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 16px;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.summary-card {
    background: white;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.summary-label {
    color: #666;
    font-size: 13px;
    margin-bottom: 8px;
}

.summary-amount {
    font-size: 22px;
    font-weight: 700;
    font-family: 'Arial', sans-serif;
}

.summary-amount.negative {
    color: #ff4d4f;
}

/* 开支类型标签 */
.expense-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.type-salary {
    background: #fff7e6;
    color: #fa8c16;
    border: 1px solid #ffd591;
}

.type-daily {
    background: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

.type-other {
    background: #f0f5ff;
    color: #2f54eb;
    border: 1px solid #adc6ff;
}

/* 筛选表单 */
.filter-form {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.filter-form .form-row {
    margin-bottom: 10px;
}

/* 开支记录表格调整 */
.expenses-table .money.negative {
    color: #ff4d4f;
    font-weight: 600;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .tabs {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1;
        min-width: 100px;
        text-align: center;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
    }
}