/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.2);
    backdrop-filter: blur(8px);
    padding: 30px;
    margin-top: 50px;
}

/* 导航栏样式 */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.navbar h1 {
    color: #4a5568;
    font-size: 24px;
    font-weight: 600;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-btn {
    text-decoration: none;
    color: #667eea;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: #667eea;
    color: white;
}

.nav-btn.active {
    background: #667eea;
    color: white;
}

/* 表单样式 */
.form-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.form-container:has(.form-card:only-child) {
    justify-content: center;
}

.form-card {
    flex: 1;
    max-width: 420px;
    min-width: 300px;
    padding: 25px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.form-title {
    font-size: 20px;
    margin-bottom: 20px;
    color: #2d3748;
    font-weight: 600;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #4a5568;
}

input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
    width: 100%;
}

.btn:hover {
    background: #5a67d8;
}

.btn-register {
    background: #48bb78;
    margin-top: 10px;
}

.btn-register:hover {
    background: #38a169;
}

/* 消息提示样式 */
.flash-messages {
    margin-bottom: 20px;
}

.alert {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-weight: 500;
}

.alert-success {
    background: #c6f6d5;
    color: #22543d;
}

.alert-danger {
    background: #fed7d7;
    color: #742a2a;
}

.alert-info {
    background: #e0f7fa;
    color: #087f93;
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

th {
    background: #f7fafc;
    font-weight: 600;
    color: #2d3748;
}

tr:hover {
    background: #f7fafc;
}

/* 统计卡片样式 */
.stats-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    flex: 1;
    min-width: 180px;
    padding: 25px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #667eea;
    margin: 10px 0;
}

.stat-label {
    color: #718096;
    font-weight: 500;
}

/* 时间选择器样式 */
.time-picker {
    display: flex;
    align-items: center;
    gap: 5px;
}

.time-select {
    padding: 12px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
    min-width: 70px;
}

.time-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.time-separator {
    font-size: 18px;
    font-weight: bold;
    color: #a0aec0;
    padding: 0 5px;
}

/* 宽表单卡片样式 */
.form-card-wide {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

/* 宽表单组（独占一行） */
.form-group-wide {
    margin-bottom: 25px;
    width: 50%;
    margin-left: auto;
    margin-right: auto;
}

/* 2x2 网格布局 */
.form-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    grid-auto-flow: row !important;
    gap: 25px;
    width: 100%;
}

/* 大表单控件样式 */
.form-control-large {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 18px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control-large:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* 大时间选择器样式 */
.time-picker-large {
    display: flex;
    align-items: center;
    gap: 10px;
}

.time-select-large {
    padding: 16px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 18px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    min-width: 100px;
}

.time-select-large:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.time-separator-large {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
    padding: 0 5px;
}

/* 提交按钮区域 */
.form-submit {
    margin-top: 30px;
    text-align: center;
}

.btn-large {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px 48px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: inline-block;
    text-decoration: none;
}

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

.btn-cancel {
    background: #a0aec0;
    color: white;
    text-decoration: none;
}

.btn-cancel:hover {
    box-shadow: 0 8px 20px rgba(160, 174, 192, 0.3);
}

/* ========== 新增：操作按钮 ========== */
.btn-action {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
    margin-right: 5px;
}

.btn-edit {
    background: #ebf4ff;
    color: #3182ce;
}

.btn-edit:hover {
    background: #3182ce;
    color: white;
}

.btn-delete {
    background: #fff5f5;
    color: #e53e3e;
}

.btn-delete:hover {
    background: #e53e3e;
    color: white;
}

/* ========== 新增：导出按钮 ========== */
.btn-export {
    display: inline-block;
    padding: 8px 18px;
    background: #48bb78;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-export:hover {
    background: #38a169;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

/* ========== 新增：分页导航 ========== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.page-btn {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #667eea;
    background: white;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.page-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.page-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.page-btn.disabled {
    color: #cbd5e0;
    cursor: not-allowed;
    pointer-events: none;
}

/* ========== 新增：错误页面 ========== */
.error-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

.error-card {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.error-code {
    font-size: 48px;
    color: #667eea;
    margin-bottom: 15px;
}

.error-message {
    font-size: 18px;
    color: #718096;
    margin-bottom: 25px;
}

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

.chart-container canvas {
    max-height: 350px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin-top: 20px;
    }

    .navbar {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    /* 小屏幕下单列布局 */
    .form-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .form-card-wide {
        padding: 20px;
        margin: 10px;
    }

    /* 统计卡片在小屏下全宽 */
    .stat-card {
        min-width: 140px;
    }

    /* 图表容器自适应 */
    .chart-container {
        padding: 15px;
    }

    /* 表格操作按钮 */
    .btn-action {
        padding: 4px 8px;
        font-size: 12px;
    }
}

/* 按钮行（登录/注册并排） */
.btn-row {
    display: flex;
    gap: 10px;
}

.btn-row .btn {
    width: auto;
    flex: 1;
}

.btn-back {
    background: #a0aec0;
}

.btn-back:hover {
    background: #718096;
}

.btn-submit-register {
    background: #48bb78;
}

.btn-submit-register:hover {
    background: #38a169;
}
