/* ===== 全局重置 & 主题 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #f5f7fb;
    color: #1e293b;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.app-container {
    max-width: 1200px;
    width: 100%;
    background: #ffffff;
    border-radius: 32px;
    box-shadow: 0 20px 60px rgba(0, 20, 40, 0.10);
    overflow: hidden;
    transition: all 0.2s;
}

/* ===== 顶部导航栏 ===== */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: linear-gradient(135deg, #c8102e 0%, #1a5c9e 100%);
    color: #fff;
    flex-wrap: wrap;
    gap: 12px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.logo-text {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #fff;
}

.logo-text span {
    color: #ffd966;
}

.navbar-tabs {
    display: flex;
    gap: 6px;
    background: rgba(255, 255, 255, 0.15);
    padding: 4px;
    border-radius: 40px;
    flex-wrap: wrap;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 10px 22px;
    border-radius: 40px;
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn i {
    font-size: 16px;
}

.tab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

.tab-btn.active {
    background: #ffffff;
    color: #1a5c9e;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.tab-btn .badge {
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    padding: 0 8px;
    border-radius: 20px;
    font-weight: 700;
    line-height: 20px;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14px;
    flex-wrap: wrap;
}

.navbar-user .role-tag {
    background: rgba(255, 255, 255, 0.20);
    padding: 4px 14px;
    border-radius: 40px;
    font-weight: 500;
    font-size: 13px;
    backdrop-filter: blur(4px);
}

.navbar-user .role-tag i {
    margin-right: 6px;
}

.navbar-user .role-switch {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    padding: 6px 14px;
    border-radius: 40px;
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s;
    min-width: 120px;
    appearance: auto;
}

.navbar-user .role-switch:hover {
    background: rgba(255, 255, 255, 0.25);
}

.navbar-user .role-switch option {
    color: #1e293b;
    background: #fff;
}

/* ===== 内容区域 ===== */
.main-content {
    padding: 28px 32px 32px;
    background: #fafcff;
    min-height: 520px;
}

.page-panel {
    display: none;
    animation: fadeUp 0.3s ease;
}

.page-panel.active {
    display: block;
}

@keyframes fadeUp {
    0% {
        opacity: 0;
        transform: translateY(12px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 通用卡片 & 标题 ===== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 22px;
}

.section-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #0b1e33;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header h2 i {
    color: #c8102e;
}

.section-header .sub-info {
    font-size: 14px;
    color: #64748b;
    background: #f1f5f9;
    padding: 4px 16px;
    border-radius: 40px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

.card-item {
    background: #ffffff;
    border-radius: 20px;
    padding: 20px 22px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #e9edf4;
    transition: all 0.2s;
    position: relative;
}

.card-item:hover {
    box-shadow: 0 8px 28px rgba(0, 20, 40, 0.08);
    border-color: #d0dbe8;
}

/* 学生卡片右上角状态标签 */
.student-status-badge {
    position: absolute;
    top: 12px;
    right: 12px;
}

.class-card .class-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
    padding-right: 80px;
}

.class-card .class-meta {
    font-size: 14px;
    color: #475569;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    margin: 8px 0;
}

.class-card .class-meta i {
    margin-right: 4px;
    color: #64748b;
}

.class-card .class-stats {
    font-size: 13px;
    color: #64748b;
    border-top: 1px solid #e9edf4;
    padding-top: 12px;
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.class-card .class-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
    max-width: 70%;
}

.class-card .class-badge .badge-tag {
    font-size: 10px;
    padding: 2px 10px;
    border-radius: 40px;
    font-weight: 600;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.badge-tag.checkin-pending {
    background: #dbeafe;
    color: #1e4a7a;
}

.badge-tag.makeup-pending {
    background: #fef3c7;
    color: #92400e;
}

/* ===== 班次卡片专用微调（新增） ===== */
.session-card .session-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #0b1e33;
}

.session-card .session-meta {
    font-size: 14px;
    color: #475569;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    margin: 8px 0;
}

.session-card .session-meta i {
    margin-right: 4px;
    color: #64748b;
}

.session-card .session-status-row {
    border-top: 1px solid #e9edf4;
    padding-top: 12px;
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #64748b;
}

/* 状态标签 */
.status-tag {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 12px;
    border-radius: 40px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.status-tag.pending {
    background: #dbeafe;
    color: #1e4a7a;
}

.status-tag.done {
    background: #d1fae5;
    color: #0b6e4f;
}

.status-tag.approved {
    background: #d1fae5;
    color: #0b6e4f;
}

.status-tag.rejected {
    background: #fee2e2;
    color: #b91c1c;
}

.status-tag.waiting {
    background: #fef3c7;
    color: #92400e;
}

.status-tag.neutral {
    background: #e9edf4;
    color: #475569;
}

/* 按钮 */
.btn {
    border: none;
    padding: 8px 20px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: #1a5c9e;
    color: #fff;
}

.btn-primary:hover {
    background: #134a7a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 92, 158, 0.30);
}

.btn-success {
    background: #0b8a5e;
    color: #fff;
}

.btn-success:hover {
    background: #0a724d;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(11, 138, 94, 0.30);
}

.btn-danger {
    background: #b91c1c;
    color: #fff;
}

.btn-danger:hover {
    background: #991515;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(185, 28, 28, 0.30);
}

.btn-outline {
    background: transparent;
    color: #475569;
    border: 1.5px solid #d0dbe8;
}

.btn-outline:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.btn-sm {
    padding: 5px 14px;
    font-size: 12px;
}

.btn-xs {
    padding: 3px 12px;
    font-size: 11px;
}

.btn-back {
    background: transparent;
    color: #1a5c9e;
    border: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    padding: 6px 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-back:hover {
    color: #134a7a;
}

.btn-warning {
    background: #d97706;
    color: #fff;
}

.btn-warning:hover {
    background: #b45309;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.30);
}

.btn-secondary {
    background: #64748b;
    color: #fff;
}

.btn-secondary:hover {
    background: #475569;
    transform: translateY(-1px);
}

.btn-info {
    background: #0e7490;
    color: #fff;
}

.btn-info:hover {
    background: #0a5a70;
}

/* 审核列表 */
.audit-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.audit-item {
    background: #fff;
    border-radius: 16px;
    padding: 16px 22px;
    border: 1px solid #e9edf4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    transition: 0.15s;
}

.audit-item:hover {
    border-color: #cbd5e1;
    background: #fafdff;
}

.audit-item .info {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.audit-item .info .name {
    font-weight: 700;
    font-size: 16px;
}

.audit-item .info .detail {
    color: #475569;
    font-size: 14px;
}

.audit-item .info .detail i {
    margin: 0 4px 0 12px;
    color: #94a3b8;
}

.audit-item .actions {
    display: flex;
    gap: 8px;
}

.audit-item .actions .btn {
    min-width: 70px;
    justify-content: center;
}

/* ===== 家长端 ===== */
.parent-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 860px) {
    .parent-grid {
        grid-template-columns: 1fr;
    }

    .card-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 540px) {
    .card-grid {
        grid-template-columns: 1fr;
    }

    .navbar {
        flex-direction: column;
        align-items: stretch;
    }

    .navbar-tabs {
        justify-content: center;
    }

    .navbar-user {
        justify-content: center;
    }

    .main-content {
        padding: 18px 16px;
    }

    .audit-item {
        flex-direction: column;
        align-items: stretch;
    }

    .audit-item .actions {
        justify-content: flex-end;
    }

    .class-card .class-name {
        padding-right: 60px;
    }

    .class-card .class-badge {
        top: 8px;
        right: 8px;
        gap: 3px;
    }

    .class-card .class-badge .badge-tag {
        font-size: 9px;
        padding: 1px 8px;
    }

    .logo-img {
        width: 36px;
        height: 36px;
    }

    .student-status-badge {
        top: 8px;
        right: 8px;
    }

    .student-status-badge .status-tag {
        font-size: 10px;
        padding: 2px 8px;
    }
}

.parent-card {
    background: #fff;
    border-radius: 24px;
    padding: 24px 28px;
    border: 1px solid #e9edf4;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.parent-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.parent-card h3 i {
    color: #c8102e;
}

.balance-number {
    font-size: 36px;
    font-weight: 700;
    color: #0b1e33;
}

.balance-number small {
    font-size: 18px;
    font-weight: 400;
    color: #64748b;
    margin-left: 4px;
}

.remaining-hours {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.remaining-hours .big-number {
    font-size: 48px;
    font-weight: 800;
    color: #1a5c9e;
    line-height: 1;
}

.remaining-hours .total {
    color: #94a3b8;
    font-size: 15px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9edf4;
    border-radius: 10px;
    margin-top: 10px;
    overflow: hidden;
}

.progress-bar .fill {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, #c8102e, #4a90d9);
    transition: width 0.6s;
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-list .row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
}

.info-list .row .label {
    color: #64748b;
}

.info-list .row .value {
    font-weight: 500;
}

.empty-state {
    text-align: center;
    padding: 28px 0;
    color: #94a3b8;
    font-size: 14px;
}

.class-detail-header {
    background: #f8fafc;
    border-radius: 16px;
    padding: 18px 24px;
    margin-bottom: 24px;
    border: 1px solid #e9edf4;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

.class-detail-header .class-info {
    display: flex;
    flex-wrap: wrap;
    gap: 18px 30px;
}

.class-detail-header .class-info .item {
    font-size: 14px;
    color: #334155;
}

.class-detail-header .class-info .item i {
    margin-right: 6px;
    color: #64748b;
}

.class-detail-header .class-info .item strong {
    color: #0b1e33;
}

.batch-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

/* 模态框 */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 998;
}

.modal-overlay.show {
    display: flex;
}

#confirmModal {
    z-index: 999;
}

.modal-box {
    background: #fff;
    border-radius: 28px;
    padding: 32px 40px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
    animation: modalPop 0.25s ease;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modalPop {
    0% {
        transform: scale(0.92);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-box h3 {
    font-size: 20px;
    margin-bottom: 16px;
}

.modal-box .form-group {
    margin-bottom: 16px;
}

.modal-box .form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 4px;
}

.modal-box .form-group input,
.modal-box .form-group select,
.modal-box .form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d0dbe8;
    border-radius: 12px;
    font-size: 14px;
    transition: 0.2s;
    font-family: inherit;
}

.modal-box .form-group input:focus,
.modal-box .form-group select:focus,
.modal-box .form-group textarea:focus {
    outline: none;
    border-color: #1a5c9e;
    box-shadow: 0 0 0 3px rgba(26, 92, 158, 0.15);
}

.modal-box .form-group textarea {
    resize: vertical;
    min-height: 70px;
}

.modal-box .modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

.modal-box .modal-actions .btn {
    min-width: 80px;
    justify-content: center;
}

.detail-item {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

.detail-item .label {
    width: 100px;
    font-weight: 600;
    color: #475569;
    flex-shrink: 0;
}

.detail-item .value {
    color: #0b1e33;
}

.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 26px;
    border-radius: 16px;
    background: #0b1e33;
    color: #fff;
    font-weight: 500;
    font-size: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.success {
    background: #0b8a5e;
}

.toast.error {
    background: #b91c1c;
}

.toast.info {
    background: #1a5c9e;
}

@keyframes slideIn {
    0% {
        opacity: 0;
        transform: translateX(30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.hidden {
    display: none !important;
}

/* 学生卡片内按钮组 - 两行 */
.student-button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.student-button-row .btn {
    flex: 1 0 auto;
    min-width: 60px;
    justify-content: center;
    font-size: 11px;
    padding: 4px 8px;
}

.record-type-badge {
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 40px;
    font-weight: 600;
    background: #e9edf4;
    color: #475569;
}

.record-type-badge.checkin {
    background: #dbeafe;
    color: #1e4a7a;
}

.record-type-badge.makeup {
    background: #fef3c7;
    color: #92400e;
}

/* 家长端子导航 */
.parent-subnav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.parent-subnav .btn {
    background: #f1f5f9;
    color: #334155;
}

.parent-subnav .btn.active-sub {
    background: #1a5c9e;
    color: #fff;
}

.child-card .child-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #0b1e33;
}

.child-card .child-class {
    font-size: 14px;
    color: #475569;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.child-card .child-class i {
    color: #64748b;
}

.child-card .child-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
    margin: 12px 0;
}

.child-card .child-stats-grid .stat-item {
    font-size: 14px;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 6px;
}

.child-card .child-stats-grid .stat-item i {
    width: 18px;
    color: #64748b;
}

.child-card .child-stats-grid .stat-item .num {
    font-weight: 700;
    color: #0b1e33;
}

.child-card .child-footer {
    border-top: 1px solid #e9edf4;
    padding-top: 12px;
    margin-top: 4px;
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #64748b;
}

/* 请假记录列表样式 */
.leave-record-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
    flex-wrap: wrap;
    gap: 8px;
}

.leave-record-item .leave-info {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    align-items: center;
}

.leave-record-item .leave-info .leave-date {
    font-weight: 500;
}

.leave-record-item .leave-info .leave-reason {
    color: #475569;
}

.leave-record-item .leave-actions {
    display: flex;
    gap: 6px;
}

.leave-record-item .leave-actions .btn {
    font-size: 11px;
    padding: 2px 10px;
}