/* ===== 教务管理系统 样式表 ===== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* 危险操作按钮（批量删除等） */
.btn-danger {
    padding: 9px 18px;
    background: #fff;
    color: #e74c3c;
    border: 1px solid #e74c3c;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

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

/* ===== 主布局 ===== */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ===== 侧边栏 ===== */
.sidebar {
    width: 240px;
    background: #26384a;
    color: #ecf0f1;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.logo {
    padding: 16px 16px 15px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.025);
}

.logo-mark {
    width: 112px;
    height: 66px;
    margin: 0 auto 7px;
}

.logo-mark img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.logo h2 {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 1px;
    color: #f7f9fc;
}

.menu {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0 18px;
}

.menu ul {
    list-style: none;
}

.menu-item {
    min-height: 46px;
    margin: 2px 8px;
    padding: 11px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background 0.2s, color 0.2s, transform 0.2s;
    border-left: 3px solid transparent;
    border-radius: 0 9px 9px 0;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.07);
    transform: translateX(2px);
}

.menu-item.active {
    background: #38536c;
    border-left-color: #78a6ff;
    color: #ffffff;
}

.menu-item .icon {
    width: 28px;
    margin-right: 10px;
    text-align: center;
    font-size: 18px;
    line-height: 1;
}

.menu-item .text {
    font-size: 14px;
    font-weight: 500;
}

.menu-group-title {
    padding: 18px 20px 7px;
    font-size: 11px;
    color: #91a1af;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.menu-group ul .menu-item {
    padding-left: 28px;
}

.menu::-webkit-scrollbar {
    width: 6px;
}

/* ===== 帮助页面 ===== */
.help-page .page-content {
    padding: 24px;
}

.help-section {
    padding: 0 0 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid #e7ebf0;
}

.help-section:last-of-type {
    margin-bottom: 0;
    border-bottom: 0;
}

.help-section h3 {
    margin-bottom: 14px;
    color: #26384a;
    font-size: 17px;
}

.help-list {
    margin: 0;
    padding-left: 24px;
    color: #52606d;
    line-height: 1.9;
}

.help-list li + li {
    margin-top: 5px;
}

.help-flow {
    display: flex;
    align-items: stretch;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 2px 10px;
}

.help-flow-step {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1 0 165px;
    min-height: 76px;
    padding: 14px;
    border: 1px solid #dce5f0;
    border-radius: 8px;
    background: #f8fbff;
    color: #334155;
    line-height: 1.5;
}

.help-flow-step strong {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    border-radius: 50%;
    background: #3157d5;
    color: #fff;
    font-size: 13px;
}

.help-flow-step small {
    color: #718096;
    font-size: 12px;
}

.help-flow-arrow {
    align-self: center;
    flex: 0 0 auto;
    color: #8da2bf;
    font-size: 22px;
}

.help-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.help-grid > div {
    padding: 16px;
    border-left: 3px solid #4f7de8;
    background: #f7f9fc;
}

.help-grid strong {
    color: #26384a;
}

.help-grid p {
    margin-top: 7px;
    color: #52606d;
    line-height: 1.7;
}

.help-highlight {
    padding: 18px;
    border: 1px solid #dce5f0;
    border-radius: 8px;
    background: #fbfdff;
}

.help-footer {
    padding: 14px 16px;
    border-radius: 6px;
    background: #fff8e6;
    color: #7a5b18;
    line-height: 1.7;
}

.help-toc {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
}
.help-toc a {
    color: #3157d5;
    font-size: 13px;
    text-decoration: none;
    padding: 3px 10px;
    border-radius: 4px;
    background: #f0f4ff;
    transition: background .15s;
}
.help-toc a:hover {
    background: #dde8ff;
}
.help-subhead {
    margin: 18px 0 8px;
    color: #3157d5;
    font-size: 14px;
    font-weight: 700;
}
.help-tip {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 6px;
    background: #f0f7ff;
    color: #3b5e7a;
    font-size: 13px;
    line-height: 1.7;
}
.help-faq details {
    margin-bottom: 10px;
    padding: 12px 16px;
    border: 1px solid #e7ebf0;
    border-radius: 8px;
    background: #fafcff;
}
.help-faq summary {
    cursor: pointer;
    font-weight: 600;
    color: #26384a;
    font-size: 14px;
    list-style: none;
}
.help-faq summary::-webkit-details-marker { display: none; }
.help-faq summary::before {
    content: 'Q ';
    color: #e25d4f;
    font-weight: 700;
}
.help-faq details[open] summary::before {
    content: 'A ';
    color: #2ba655;
}
.help-faq details[open] summary { margin-bottom: 8px; }
.help-faq details p {
    margin: 0;
    color: #52606d;
    line-height: 1.8;
    font-size: 13px;
}
.help-list code {
    padding: 1px 5px;
    border-radius: 3px;
    background: #eef2f7;
    font-size: 12px;
    color: #c5422a;
}
.help-list ul {
    margin-top: 4px;
    padding-left: 20px;
}
.help-list ol {
    margin-top: 4px;
    padding-left: 20px;
}

@media (max-width: 700px) {
    .help-page .page-content {
        padding: 16px;
    }

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

    .help-toc {
        flex-direction: column;
        gap: 4px;
    }
}

.menu::-webkit-scrollbar-track {
    background: transparent;
}

.menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.22);
    border-radius: 6px;
}

/* ===== 主内容区 ===== */
.main-content {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-bar {
    height: 60px;
    background: white;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    flex-shrink: 0;
}

.breadcrumb {
    font-size: 16px;
    color: #666;
}

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

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

/* 全局校区选择器 */
.campus-switcher {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #f5f7fa;
    border-radius: 4px;
    border: 1px solid #e0e6ed;
}

.campus-switcher label {
    font-size: 13px;
    color: #606266;
    margin: 0;
}

.campus-switcher select {
    padding: 4px 8px;
    border: 1px solid #d0d7de;
    border-radius: 4px;
    font-size: 13px;
    color: #333;
    background: white;
    cursor: pointer;
    min-width: 100px;
    outline: none;
    transition: border-color 0.2s;
}

.campus-switcher select:hover:not(:disabled) {
    border-color: #667eea;
}

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

.campus-switcher select:disabled {
    background: #f0f0f0;
    color: #999;
    cursor: not-allowed;
}

.btn-logout {
    padding: 6px 16px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.btn-logout:hover {
    background: #c0392b;
}

.content-area {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
}

/* ===== 班级详情 ===== */
.class-name-link {
    color: #4f72d8;
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
}

.class-name-link:hover {
    text-decoration: underline;
}

.class-detail-page {
    min-height: calc(100vh - 112px);
}

.breadcrumb {
    color: #888;
    font-size: 12px;
    margin-bottom: 5px;
}

.class-detail-layout {
    display: grid;
    grid-template-columns: 225px minmax(0, 1fr);
    gap: 16px;
    min-height: 0;
    flex: 1;
}

.class-detail-sidebar {
    border: 1px solid #e5e8ee;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.class-detail-banner {
    padding: 14px;
    color: #fff;
    min-height: 88px;
    background: linear-gradient(135deg, #1689ed, #1889e9);
}

.class-detail-type {
    display: inline-block;
    padding: 2px 8px;
    border: 1px solid rgba(255,255,255,.75);
    border-radius: 3px;
    font-size: 11px;
}

.class-detail-banner h3 {
    margin: 10px 0 5px;
    font-size: 16px;
}

.class-detail-banner p {
    margin: 0;
    font-size: 12px;
    opacity: .9;
}

.class-detail-info {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.class-detail-info div {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 12px;
}

.class-detail-info span { color: #888; }
.class-detail-info strong { color: #444; font-weight: 400; }

.class-detail-students { padding: 12px; }
.class-students-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 10px; }
.class-detail-students h4 { margin: 0; font-size: 13px; }
.class-detail-students h4 em { color: #999; font-style: normal; font-weight: 400; }
.class-student-add { border: 0; background: transparent; color: #1689ed; cursor: pointer; font-size: 11px; padding: 0; white-space: nowrap; }
.class-student-add:hover { text-decoration: underline; }
.class-student-row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid #f1f1f1; font-size: 12px; }
.class-student-row span { color: #999; }

.class-detail-main {
    min-width: 0;
    border: 1px solid #e5e8ee;
    border-radius: 6px;
    padding: 0 12px 12px;
    overflow: auto;
}

.class-detail-tabs {
    display: flex;
    gap: 20px;
    height: 42px;
    align-items: center;
    border-bottom: 1px solid #e7eaf0;
    white-space: nowrap;
    overflow-x: auto;
}

.class-detail-tabs button {
    height: 42px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #8490a3;
    font-size: 12px;
    padding: 0;
}

.class-detail-tabs button.active { color: #1689ed; border-bottom-color: #1689ed; }
.class-detail-tabs button:disabled { cursor: default; }

.class-calendar-head { display: flex; align-items: center; gap: 14px; padding: 12px 0; }
.class-calendar-head h3 { margin: 0; font-size: 16px; }
.class-calendar-head span { color: #888; font-size: 12px; }
.class-calendar-week, .class-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(92px, 1fr)); min-width: 650px; }
.class-calendar-week strong { padding: 8px; text-align: center; font-size: 12px; color: #555; background: #fafbfc; border: 1px solid #eee; }
.class-calendar-cell { min-height: 92px; border: 1px solid #eee; margin: -1px 0 0 -1px; padding: 5px; background: #fff; }
.class-calendar-cell.muted { background: #fafafa; }
.class-calendar-day { display: flex; align-items: center; justify-content: space-between; color: #555; font-size: 11px; margin-bottom: 5px; }
.class-calendar-add { width: 22px; height: 22px; border: 0; border-radius: 50%; background: #fff; color: #1689ed; cursor: pointer; font-size: 18px; line-height: 20px; padding: 0; box-shadow: 0 1px 4px rgba(0,0,0,.18); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .15s ease; }
.class-calendar-cell:hover .class-calendar-add, .class-calendar-add:focus { opacity: 1; visibility: visible; pointer-events: auto; }
.class-calendar-add:hover { background: #1689ed; color: #fff; }
.class-lesson-defaults { color: #888; font-size: 12px; }
.class-lesson-item { padding: 5px; margin-bottom: 4px; border-left: 3px solid #1689ed; background: #f5f8fc; font-size: 10px; line-height: 1.45; cursor: pointer; transition: background .15s ease, box-shadow .15s ease; }
.class-lesson-item:hover, .class-lesson-item:focus { background: #eaf4ff; box-shadow: 0 1px 4px rgba(22,137,237,.18); outline: none; }
.class-lesson-item strong, .class-lesson-item span, .class-lesson-item small { display: block; }
.class-lesson-item span { color: #666; }
.class-lesson-item small { color: #999; }
.class-lesson-detail-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0; border-bottom: 1px solid #eee; }
.class-lesson-detail-header h2 { margin: 0 0 6px; font-size: 20px; color: #444; }
.class-lesson-detail-header p { margin: 0; color: #999; font-size: 13px; }
.class-lesson-summary { display: grid; grid-template-columns: repeat(6, minmax(120px, 1fr)); gap: 1px; margin: 16px 0; background: #eee; border: 1px solid #eee; }
.class-lesson-summary div { display: flex; flex-direction: column; gap: 6px; padding: 12px; background: #fff; }
.class-lesson-summary span { color: #999; font-size: 12px; }
.class-lesson-summary strong { color: #1689ed; font-size: 13px; font-weight: 500; }
.class-lesson-tabs { display: flex; gap: 24px; border-bottom: 1px solid #eee; }
.class-lesson-tabs button { padding: 10px 0; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #666; cursor: pointer; }
.class-lesson-tabs button.active { color: #1689ed; border-bottom-color: #1689ed; }
.class-lesson-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 0; }
.class-lesson-count { padding: 10px 0; color: #666; font-size: 13px; }
.class-lesson-student-table { overflow-x: auto; }
.class-lesson-student-table table { min-width: 900px; }
.class-lesson-note { margin-top: 16px; padding: 14px; background: #fafbfc; border: 1px solid #eee; }
.class-lesson-note h3 { margin: 0 0 10px; font-size: 14px; }
.class-lesson-note p { margin: 5px 0; color: #666; font-size: 13px; }
@media (max-width: 900px) { .class-lesson-summary { grid-template-columns: repeat(3, minmax(100px, 1fr)); } }

/* ===== 页面容器 ===== */
.page-container {
    min-width: 0;
    background: white;
    border-radius: 8px;
    padding: 20px 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 112px);
    opacity: 0;
    transform: translateY(8px);
    animation: fadeInUp 0.25s ease-out forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.page-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    /* 兜底滚动：列表页内部表格会自己滚，不会触发这一层；表单/帮助等页面则在此滚动（标题仍在上方不动） */
    overflow: auto;
    min-height: 0;
}

/* page-content 与 .table-container 之间的包装层（如 #studentList、#contractList 等）
   默认是普通 block，会掐断 flex 高度约束，导致内部表格高度失控、表头 sticky 错位。
   只匹配直接包含 .table-container 的包装层，避免影响工作台等页面 */
.page-content > div:has(> .table-container) {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* 统计页图表较多，保持页面整体滚动 */
.stats-page-container {
    flex: none;
    min-height: calc(100vh - 112px);
}

.stats-page-container .page-content {
    overflow: visible;
}

/* 课表查看页：标题/筛选固定，表格内部滚动 + 表头吸顶（与其他列表页一致） */
.calendar-page-container {
    flex: 1;
    min-height: 0;
}

.calendar-page-container .page-content {
    overflow: hidden;
}

.calendar-page-container #calendarList {
    flex: 1;
    min-height: 0;
}

.calendar-page-container #calendarList .table-container {
    overflow-x: auto;
    overflow-y: auto;
    flex: 1;
}

.page-header h2 {
    font-size: 20px;
    color: #333;
}

.page-actions {
    display: flex;
    gap: 10px;
}

/* ===== 按钮 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 16px;
    border: 1px solid #d9dce3;
    border-radius: 6px;
    background: #fff;
    color: #4b5563;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
    transition: all 0.2s ease;
}

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

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-sm {
    min-height: 30px;
    padding: 5px 11px;
    border-radius: 5px;
    font-size: 13px;
}

.btn-primary, .btn-secondary, .btn-danger, .btn-success, .btn-warning {
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

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

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

.btn-primary {
    background: #667eea;
    color: #fff;
}

.btn-primary:hover {
    background: #5568d3;
    color: #fff;
}

.btn-secondary {
    background: #f0f0f0;
    color: #444;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #e0e0e0;
    color: #222;
}

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

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

.btn-success {
    background: #27ae60;
    color: #fff;
}

.btn-success:hover {
    background: #229954;
    color: #fff;
}

.btn-sm,
.btn-primary.btn-sm,
.btn-secondary.btn-sm,
.btn-danger.btn-sm,
.btn-success.btn-sm,
.btn-warning.btn-sm {
    min-height: 30px;
    padding: 5px 11px;
    border-radius: 5px;
    font-size: 13px;
}

/* ===== 表单 ===== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: #555;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="email"],
.form-group input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input:not([type="checkbox"]):not([type="radio"]):focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* ===== 表格 ===== */
table {
    width: 100%;
    border-collapse: collapse;
}

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

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    font-size: 13px;
}

td {
    font-size: 14px;
}

tr:hover {
    background: #f8f9fa;
}

/* ===== 搜索筛选 ===== */
.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.search-bar input,
.search-bar select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-bar input {
    width: 200px;
}

.search-bar button {
    padding: 8px 20px;
}

/* ===== 表格容器 ===== */
.table-container {
    overflow-x: auto;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* ===== 标签 ===== */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    margin: 2px;
    white-space: nowrap;
}

.tag-normal {
    background: #d4edda;
    color: #155724;
}

.tag-vip {
    background: #fff3cd;
    color: #856404;
}

.tag-trial {
    background: #d1ecf1;
    color: #0c5460;
}

.tag-finish {
    background: #e2e3e5;
    color: #383d41;
}

.tag-active {
    background: #d4edda;
    color: #155724;
}

/* ===== 状态标签 ===== */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
}

.status-normal { background: #d4edda; color: #155724; }
.status-active { background: #d4edda; color: #155724; }
.status-suspended { background: #fff3cd; color: #856404; }
.status-expired { background: #e2e3e5; color: #383d41; }
.status-not-start { background: #d1ecf1; color: #0c5460; }
.status-finished { background: #d4edda; color: #155724; }
.status-cancelled { background: #f8d7da; color: #721c24; }

/* ===== 操作按钮 ===== */
.action-buttons {
    display: flex;
    gap: 8px;
}

.action-btn {
    padding: 4px 10px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
}

.action-btn-edit {
    color: #667eea;
}

.action-btn-delete {
    color: #e74c3c;
}

.action-btn-view {
    color: #27ae60;
}

/* ===== 课节工具栏 ===== */
.lesson-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 6px;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.lesson-toolbar span {
    font-size: 14px;
    color: #666;
}

.lesson-toolbar strong {
    color: #e65100;
    font-size: 16px;
}

.col-checkbox {
    width: 40px;
    text-align: center;
}

.col-checkbox input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

th.col-checkbox {
    padding: 8px;
}

/* ===== 分页 ===== */
.pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.pagination-info {
    font-size: 13px;
    color: #8a909c;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pagination-controls button {
    box-sizing: border-box;
    min-width: 34px;
    height: 34px;
    padding: 0 12px;
    border: 1px solid #dfe3eb;
    background: #fff;
    color: #4b5563;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}

.pagination-controls button.page-number,
.pagination-controls button.active {
    width: 34px;
    min-width: 34px;
    padding: 0;
}

.pagination-controls button.active {
    background: #1677ff;
    color: #fff;
    border-color: #1677ff;
    font-weight: 600;
}

.pagination-controls button:disabled {
    color: #c5c8ce;
    background: #fff;
    cursor: not-allowed;
}

.pagination-controls button:hover:not(:disabled) {
    background: #f0f5ff;
    color: #1f2937;
    border-color: #8aaeff;
}

.pagination-controls button.active:hover:not(:disabled) {
    background: #0f67df;
    color: #fff;
    border-color: #0f67df;
}

.pagination-controls button.active:disabled {
    background: #1677ff;
    color: #fff;
    border-color: #1677ff;
    cursor: default;
}

.pagination-controls > span {
    padding: 0 2px;
    font-size: 13px;
    color: #8a909c;
}

/* ===== 弹窗 ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 10px;
    box-sizing: border-box;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: fit-content;
    min-width: 420px;
    max-width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* 大模态框：允许更宽的内容显示 */
.large-modal .modal-content {
    min-width: 600px;
    max-width: 95vw;
    max-height: calc(100vh - 20px);
}

/* 超大模态框：用于复杂表格或多列内容 */
.xlarge-modal .modal-content {
    min-width: 900px;
    max-width: 95vw;
    max-height: calc(100vh - 20px);
}

/* 表单弹窗：紧凑宽度，适合简单表单 */
.form-modal .modal-content {
    width: min(480px, calc(100vw - 24px));
    min-width: 0;
    max-width: 480px;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 16px;
}

.close {
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

/* ===== 提示信息 ===== */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 4px;
    color: white;
    font-size: 14px;
    z-index: 2000;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.toast.show {
    display: block;
    animation: slideIn 0.3s ease;
}

.toast-success { background: #27ae60; }
.toast-error { background: #e74c3c; }
.toast-warning { background: #f39c12; }
.toast-info { background: #3498db; }

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

/* ===== 加载中 ===== */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 50px;
    color: #999;
}

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

/* ===== 快捷操作 ===== */
.quick-actions {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.quick-action-card {
    flex: 1;
    min-width: 140px;
    max-width: 200px;
    background: white;
    padding: 24px 16px;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid transparent;
}

.quick-action-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102,126,234,0.2);
    border-color: #667eea;
}

.quick-action-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

.quick-action-text {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

/* ===== 配置页控件 ===== */
.config-select {
    width: 200px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

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

/* ===== 学生详情模态框 ===== */

.detail-tabs {
    display: flex;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 20px;
    gap: 8px;
}

.detail-tab {
    padding: 10px 18px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    color: #666;
    font-size: 14px;
    transition: all 0.2s;
    font-weight: 500;
}

.detail-tab:hover {
    color: #667eea;
}

.detail-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.detail-tab .tab-count {
    background: #f0f0f0;
    color: #888;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    margin-left: 6px;
    font-weight: normal;
}

.detail-tab.active .tab-count {
    background: rgba(102,126,234,0.1);
    color: #667eea;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.summary-grid .grid-item {
    background: linear-gradient(135deg, #f8faff 0%, #eef2ff 100%);
    border-radius: 8px;
    padding: 16px;
    border-left: 4px solid #667eea;
}

.summary-grid .grid-item:nth-child(2) { border-left-color: #52c41a; }
.summary-grid .grid-item:nth-child(3) { border-left-color: #fa8c16; }
.summary-grid .grid-item:nth-child(4) { border-left-color: #eb2f96; }

.grid-item .gi-label {
    color: #888;
    font-size: 13px;
    margin-bottom: 6px;
}

.grid-item .gi-value {
    color: #333;
    font-size: 22px;
    font-weight: 600;
}

.grid-item .gi-sub {
    color: #999;
    font-size: 12px;
    margin-top: 4px;
}

.profile-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    padding: 22px 24px;
    color: white;
    margin-bottom: 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.profile-name {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 6px;
}

.profile-sub {
    font-size: 13px;
    opacity: 0.9;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.profile-tag {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    margin-left: 6px;
}

.profile-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.profile-stats {
    text-align: right;
    min-width: 180px;
}

.profile-stats-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin: 4px 0;
    opacity: 0.95;
}

.profile-stats-row .label { opacity: 0.8; }
.profile-stats-row .value { font-weight: 600; }

.link-btn {
    color: #667eea;
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.15s;
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
}

.link-btn:hover {
    text-decoration: underline;
    color: #5568d3;
}

.empty-tip {
    padding: 28px;
    text-align: center;
    color: #aaa;
    background: #fafafa;
    border-radius: 6px;
    font-size: 14px;
}

.stat-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-green { background: #e8f5e9; color: #388e3c; }
.badge-orange { background: #fff4e6; color: #e65100; }
.badge-red { background: #ffebee; color: #c62828; }
.badge-blue { background: #e3f2fd; color: #1565c0; }
.badge-purple { background: #f3e5f5; color: #6a1b9a; }
.badge-gray { background: #f0f0f0; color: #666; }

/* ===== 数据卡片 ===== */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stats-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.stats-card .stats-label {
    color: #999;
    font-size: 14px;
    margin-bottom: 10px;
}

.stats-card .stats-value {
    font-size: 28px;
    font-weight: bold;
    color: #333;
}

/* ===== 图表容器 ===== */
.chart-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.chart {
    width: 100%;
    height: 300px;
}

.chart-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}
.chart-half {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}
.chart-half .chart { height: 250px; }

@media (max-width: 900px) {
    .chart-row { flex-direction: column; }
    .chart-half { margin-bottom: 20px; }
}

/* ===== 低课时预警 ===== */
.low-hours-alert {
    background: #fff8e6;
    border: 1px solid #ffe0a3;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
}
.low-hours-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.low-hours-header strong { color: #a86a00; font-size: 15px; }
.low-hours-header small { color: #b8860b; font-size: 12px; }
.low-hours-header .low-hours-icon { font-size: 18px; }
.low-hours-table { display: flex; flex-direction: column; gap: 4px; }
.low-hours-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: background .15s;
}
.low-hours-row:hover { background: #fffaef; }
.low-hours-name { flex: 0 0 100px; font-weight: 600; color: #333; font-size: 13px; }
.low-hours-course { flex: 1; color: #666; font-size: 13px; }
.low-hours-remain { font-size: 13px; font-weight: 700; }
.hours-warning { color: #e6a23c; }
.hours-danger { color: #f56c6c; }
.low-hours-more { margin-top: 8px; text-align: center; color: #b8860b; font-size: 12px; }

/* ===== 星期选择按钮组 ===== */
.weekday-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.weekday-btn {
    padding: 10px 14px;
    border: 1px solid #dcdfe6;
    background: #fff;
    color: #606266;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    min-width: 58px;
    text-align: center;
    user-select: none;
}

.weekday-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.weekday-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: #fff;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

/* ===== 时间选择器 ===== */
.time-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.time-select-box {
    flex: 1;
    position: relative;
}

.time-select-label {
    font-size: 12px;
    color: #909399;
    margin-bottom: 4px;
    display: block;
}

.time-select-preset {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.time-preset-btn {
    padding: 5px 12px;
    font-size: 12px;
    border: 1px solid #e4e7ed;
    background: #f5f7fa;
    color: #606266;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.time-preset-btn:hover {
    background: #667eea;
    border-color: #667eea;
    color: #fff;
}

.time-preset-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: #fff;
}

/* ===== 开关 ===== */
.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px dashed #eee;
}

.switch-row:last-child {
    border-bottom: none;
}

.switch-row .switch-label {
    font-size: 14px;
    color: #303133;
    font-weight: 500;
}

.switch-row .switch-desc {
    font-size: 12px;
    color: #909399;
    margin-top: 2px;
}

/* ===== 详情页 ===== */
.detail-page {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
}

.detail-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.detail-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.detail-info-row:last-child {
    border-bottom: none;
}

.detail-info-label {
    color: #999;
    font-size: 14px;
}

.detail-info-value {
    color: #333;
    font-weight: 500;
}

/* ===== 退费提示 ===== */
.refund-hint {
    margin-bottom: 16px;
    padding: 12px 14px;
    background: #fff8f0;
    border: 1px solid #f5d9b8;
    border-radius: 6px;
    color: #8a5a1f;
    font-size: 13px;
    line-height: 1.6;
}

.refund-hint-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.refund-hint-row + .refund-hint-row {
    margin-top: 6px;
}

.refund-hint strong {
    color: #d9722b;
    font-size: 15px;
    font-weight: 600;
}

.refund-hint .btn-sm {
    padding: 3px 10px;
    font-size: 12px;
    white-space: nowrap;
}

/* ===== 合约详情 ===== */
.contract-detail-modal .modal-content {
    width: min(900px, calc(100vw - 24px));
    min-width: 0;
    max-width: 900px;
}

.contract-detail-modal .modal-body {
    padding: 0;
    background: #f6f8fb;
}

.contract-detail {
    color: #303133;
}

.contract-detail-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 28px;
    background: linear-gradient(135deg, #f0f7ff 0%, #ffffff 70%);
    border-bottom: 1px solid #e5eaf2;
}

.contract-detail-eyebrow {
    color: #6b7a90;
    font-size: 12px;
    letter-spacing: .04em;
}

.contract-detail-hero h4 {
    margin: 6px 0 5px;
    color: #1f2d3d;
    font-size: 22px;
    font-weight: 700;
}

.contract-detail-hero h4 small {
    margin-left: 8px;
    color: #8492a6;
    font-size: 13px;
    font-weight: 400;
}

.contract-detail-hero p {
    margin: 0;
    color: #8492a6;
    font-size: 13px;
}

.detail-status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 13px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.detail-status.is-success { color: #16845b; background: #e8f7ef; }
.detail-status.is-muted { color: #6b7280; background: #eef1f5; }

.detail-section {
    margin: 16px 20px 0;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid #e7ebf2;
    border-radius: 8px;
}

.detail-section-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    color: #303133;
    font-size: 15px;
    font-weight: 700;
}

.detail-section-title small {
    color: #9aa5b5;
    font-size: 12px;
    font-weight: 400;
}

.detail-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.detail-hours-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.detail-money-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.detail-summary-card {
    position: relative;
    min-width: 0;
    padding: 13px 14px;
    background: #f8fafc;
    border: 1px solid #edf0f5;
    border-radius: 6px;
}

.detail-summary-card span {
    display: block;
    margin-bottom: 8px;
    color: #8492a6;
    font-size: 12px;
}

.detail-summary-card strong {
    color: #303133;
    font-size: 20px;
    line-height: 1.2;
}

.detail-summary-card em {
    margin-left: 4px;
    color: #8492a6;
    font-size: 12px;
    font-style: normal;
}

.detail-summary-note {
    display: block;
    margin-top: 7px;
    color: #a0aabd;
    font-size: 11px;
    line-height: 1.3;
    font-style: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.detail-summary-card.is-positive { background: #f2fbf6; border-color: #d8f1e3; }
.detail-summary-card.is-positive strong, .text-success { color: #16845b !important; }
.detail-summary-card.is-negative { background: #fff6f6; border-color: #f6dddd; }
.detail-summary-card.is-negative strong, .text-danger { color: #d9534f !important; }
.detail-summary-card.is-refund { background: #fff7f5; border-color: #f8e1dc; }
.detail-summary-card.is-refund strong { color: #d9534f; }

.detail-section-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.detail-list .detail-section-title { margin-bottom: 4px; }
.detail-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 38px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f2f5;
}
.detail-info-row:last-child { border-bottom: 0; }
.detail-info-row strong { color: #303133; font-size: 13px; text-align: right; }
.detail-info-label { color: #8492a6; font-size: 13px; }

.detail-remark p {
    margin: 0;
    color: #606f82;
    font-size: 13px;
    line-height: 1.7;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.payment-section { margin-bottom: 20px; }
.payment-table-wrap { overflow-x: auto; }
.payment-table { width: 100%; min-width: 620px; border-collapse: collapse; }
.payment-table th, .payment-table td { padding: 11px 10px; border-bottom: 1px solid #edf0f5; text-align: left; font-size: 13px; white-space: nowrap; }
.payment-table th { color: #8492a6; background: #f8fafc; font-size: 12px; font-weight: 600; }
.payment-table td { color: #4b5563; }
.payment-table tbody tr:last-child td { border-bottom: 0; }
.empty-detail { padding: 18px 0 4px; color: #9aa5b5; text-align: center; font-size: 13px; }

/* ===== 日历视图 ===== */
.calendar-view {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-nav {
    display: flex;
    gap: 10px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e0e0e0;
}

.calendar-day {
    background: white;
    min-height: 100px;
    padding: 8px;
}

.calendar-day-header {
    font-size: 12px;
    color: #999;
    margin-bottom: 5px;
}

.calendar-day.other-month {
    background: #fafafa;
}

.calendar-day.today {
    background: #e3f2fd;
}

.calendar-lesson {
    background: #667eea;
    color: white;
    padding: 2px 4px;
    border-radius: 2px;
    font-size: 11px;
    margin-bottom: 2px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== 收支管理 ===== */
.finance-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}
.finance-card {
    background: white;
    padding: 18px 16px;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    border-left: 4px solid #667eea;
}
.finance-card[onclick]:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 18px rgba(0,0,0,0.15);
    border-left-width: 6px;
}
.finance-card.income { border-left-color: #27ae60; }
.finance-card.expense { border-left-color: #e74c3c; }
.finance-card.profit { border-left-color: #667eea; }
.finance-card.trend { border-left-color: #f39c12; }
.finance-card.income[onclick]:hover { background: #f0f9f4; }
.finance-card.expense[onclick]:hover { background: #fef0f0; }
.finance-card.profit[onclick]:hover { background: #eef2ff; }
.fc-label { color: #888; font-size: 13px; margin-bottom: 8px; }
.fc-value { font-size: 24px; font-weight: 700; color: #333; }
.finance-card.income .fc-value { color: #27ae60; }
.finance-card.expense .fc-value { color: #e74c3c; }
.fc-sub { color: #999; font-size: 12px; margin-top: 6px; }
.fc-types { font-size: 13px; color: #555; }

/* ===== P3 交互与视觉优化 ===== */
:root {
    --ui-primary: #3f6fd9;
    --ui-primary-dark: #3159b6;
    --ui-border: #dfe4ec;
    --ui-muted: #667085;
    --ui-surface: #ffffff;
    --ui-focus: rgba(63, 111, 217, 0.2);
}

button,
select,
input,
textarea {
    font: inherit;
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--ui-focus);
    outline-offset: 2px;
}

.btn-primary, .btn-secondary, .btn-danger, .btn-success,
.btn-logout,
.search-bar button {
    min-height: 36px;
    transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.btn-logout:hover,
.search-bar button:hover {
    color: #fff;
}

.btn-primary:hover, .btn-secondary:hover, .btn-danger:hover, .btn-success:hover,
.search-bar button:hover {
    transform: translateY(-1px);
}

.btn-primary:active, .btn-secondary:active, .btn-danger:active, .btn-success:active,
.search-bar button:active {
    transform: translateY(0);
}

.page-header {
    gap: 16px;
}

.page-actions,
.action-buttons,
.search-bar {
    align-items: center;
}

.page-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.search-bar input:focus,
.search-bar select:focus,
.form-group input:not([type="checkbox"]):not([type="radio"]):focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--ui-primary);
    box-shadow: 0 0 0 3px var(--ui-focus);
}

.table-container {
    border: 1px solid var(--ui-border);
    border-radius: 6px;
    background: var(--ui-surface);
}

.table-container table {
    min-width: 680px;
}

.table-container thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #f8fafc;
    box-shadow: 0 1px 0 var(--ui-border);
}

.table-container tbody tr:nth-child(even) {
    background: #fbfcfe;
}

.table-container tbody tr:hover {
    background: #eef4ff;
}

.action-buttons {
    flex-wrap: wrap;
    min-width: max-content;
}

/* ===== 学员列表：紧凑单行表格 ===== */
.table-container table.student-list-table {
    min-width: 0;
    width: 100%;
}

.student-list-table th,
.student-list-table td {
    white-space: nowrap;
    padding: 9px 10px;
}

.student-list-table .link-btn {
    white-space: nowrap;
}

.student-list-table .col-check {
    width: 38px;
    text-align: center;
}

.student-list-table .col-index {
    width: 46px;
    text-align: center;
}

.student-list-table .col-num {
    width: 56px;
    text-align: center;
}

.student-list-table .col-action {
    width: 150px;
}

.student-list-table .col-action .action-buttons {
    flex-wrap: nowrap;
    gap: 4px;
    justify-content: flex-start;
}

.student-list-table .col-action .action-btn {
    padding: 4px 6px;
    min-height: 28px;
}

.action-btn {
    min-height: 32px;
    border-radius: 4px;
}

.action-btn:hover {
    background: #f1f5ff;
}

/* ===== 行内“更多操作”菜单（三个点） ===== */
.row-actions {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.more-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #909399;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.more-btn:hover {
    background: #eef2f8;
    color: #409eff;
}

.more-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 34px;
    z-index: 60;
    min-width: 96px;
    padding: 5px 0;
    background: #fff;
    border: 1px solid #e4e7ed;
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(31, 45, 61, .14);
}

.more-menu.show {
    display: block;
}

.more-menu-item {
    display: block;
    width: 100%;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: #606266;
    font-size: 13px;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
}

.more-menu-item:hover {
    background: #f5f7fa;
}

.more-menu-item.danger {
    color: #f56c6c;
}

.more-menu-item.danger:hover {
    background: #fef0f0;
}

/* ===== 可点击表格行 ===== */
.clickable-row {
    cursor: pointer;
}

.table tbody tr.clickable-row:hover {
    background: #eef4ff;
}

/* ===== 缴费详情弹层（学员详情之上的二级弹窗） ===== */
.payment-detail-overlay {
    z-index: 1100;
}

.payment-detail-content {
    width: 520px;
    min-width: 0;
    max-width: calc(100vw - 24px);
}

.pay-detail-amount {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-bottom: 18px;
    padding: 20px 16px;
    border-radius: 8px;
}

.pay-detail-amount.is-positive {
    background: #f2fbf6;
    border: 1px solid #d8f1e3;
}

.pay-detail-amount.is-negative {
    background: #fff6f6;
    border: 1px solid #f6dddd;
}

.pay-detail-amount-label {
    color: #8492a6;
    font-size: 13px;
}

.pay-detail-amount strong {
    font-size: 28px;
    line-height: 1.2;
}

.pay-detail-amount.is-positive strong {
    color: #16845b;
}

.pay-detail-amount.is-negative strong {
    color: #d9534f;
}

.empty-state,
.loading-state {
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ui-muted);
    text-align: center;
    padding: 24px;
}

/* ===== 响应式 ===== */
@media (max-width: 1200px) {
    .detail-page {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    
    .sidebar .logo h2,
    .sidebar .logo-mark,
    .menu-item .text,
    .menu-group-title {
        display: none;
    }
    
    .menu-item {
        justify-content: center;
        padding: 12px;
    }
    
    .menu-group ul .menu-item {
        padding-left: 12px;
    }

    .top-bar {
        padding: 0 12px;
    }

    .user-info {
        gap: 8px;
    }

    .campus-switcher label,
    .user-info > span {
        display: none;
    }

    .content-area {
        padding: 10px;
    }

    .page-container {
        padding: 16px;
    }

    .summary-grid,
    .finance-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .large-modal .modal-content,
    .xlarge-modal .modal-content,
    .contract-detail-modal .modal-content {
        min-width: 0;
        width: 100%;
    }

    .contract-detail-hero {
        padding: 18px 16px;
    }

    .contract-detail-hero h4 {
        font-size: 19px;
    }

    .detail-section {
        margin: 12px 12px 0;
        padding: 15px;
    }

    .detail-summary-grid,
    .detail-hours-grid,
    .detail-money-grid,
    .detail-section-grid {
        grid-template-columns: 1fr;
    }

    .detail-summary-note {
        white-space: normal;
    }

    .detail-summary-card strong {
        font-size: 18px;
    }

    .detail-info-row {
        align-items: flex-start;
    }

    .detail-info-row strong {
        max-width: 62%;
        overflow-wrap: anywhere;
    }

    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .page-header h2 {
        font-size: 18px;
    }

    .page-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .page-actions > button,
    .page-actions > a,
    .search-bar > button,
    .search-bar > input,
    .search-bar > select {
        flex: 1 1 140px;
    }

    .search-bar input {
        width: auto;
    }

    .table-container {
        border-left: 0;
        border-right: 0;
        border-radius: 0;
        margin-left: -16px;
        margin-right: -16px;
    }

    th, td {
        padding: 10px 12px;
        white-space: nowrap;
    }

    .pagination {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .pagination-controls {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 52px;
    }

    .top-bar {
        height: auto;
        min-height: 56px;
        gap: 8px;
    }

    .breadcrumb {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .content-area {
        padding: 8px;
    }

    .page-container {
        padding: 12px;
        border-radius: 6px;
    }

    .summary-grid,
    .finance-summary {
        grid-template-columns: 1fr;
    }

    .page-actions > button,
    .page-actions > a,
    .search-bar > button,
    .search-bar > input,
    .search-bar > select {
        flex-basis: 100%;
    }
}

/* ===== 班级学员管理（picker） ===== */
.student-picker {
    display: flex;
    gap: 16px;
    min-height: 480px;
}

.student-picker-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.student-picker-col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid #eef0f5;
    margin-bottom: 12px;
}

.student-picker-col-header h4 {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.student-picker-count {
    font-size: 12px;
    color: #667eea;
    background: #eef0ff;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 600;
}

.student-picker-search {
    position: relative;
    margin-bottom: 10px;
}

.student-picker-search input {
    width: 100%;
    padding: 9px 12px 9px 34px;
    border: 1px solid #d9dce3;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    transition: border-color .2s;
    box-sizing: border-box;
    background: #fff;
}

.student-picker-search input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,.12);
}

.student-picker-search::before {
    content: "🔍";
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    opacity: .6;
}

.student-picker-list {
    flex: 1;
    overflow-y: auto;
    border: 1px solid #e8eaf0;
    border-radius: 10px;
    background: #fafbfd;
    padding: 8px;
    min-height: 0;
}

.student-picker-list-empty {
    text-align: center;
    color: #9aa0a6;
    padding: 40px 0;
    font-size: 13px;
}

/* —— 学员卡片（可添加列表） —— */
.student-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #eef0f5;
    border-radius: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all .18s ease;
    position: relative;
}

.student-card:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102,126,234,.12);
    background: #f7f8ff;
}

.student-card.selected {
    border-color: #667eea;
    background: #eef0ff;
    box-shadow: 0 2px 8px rgba(102,126,234,.18);
}

.student-card input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: #667eea;
}

.student-card-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(102,126,234,.25);
}

.student-card-info {
    flex: 1;
    min-width: 0;
}

.student-card-name {
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 6px;
}

.student-card-grade {
    font-weight: 500;
    color: #667eea;
    font-size: 12px;
    background: #eef0ff;
    padding: 1px 8px;
    border-radius: 10px;
}

.student-card-meta {
    font-size: 12px;
    color: #6b7280;
    margin-top: 3px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.student-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.student-card-hours {
    font-size: 12px;
    color: #22c55e;
    font-weight: 600;
}

.student-card-hours.debt {
    color: #ef4444;
}

/* —— 已选学员卡片 —— */
.student-cart-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #f0f7ff, #f7f8ff);
    border: 1px solid #d6e4ff;
    border-radius: 8px;
    margin-bottom: 6px;
}

.student-cart-card .student-card-avatar {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    box-shadow: 0 2px 4px rgba(239,68,68,.2);
}

.student-cart-card .student-card-info {
    flex: 1;
    min-width: 0;
}

.student-cart-card .student-card-name {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

.student-cart-card .student-card-grade {
    background: #fef3c7;
    color: #d97706;
}

.student-cart-card .student-cart-remove {
    background: none;
    border: 1px solid #fca5a5;
    color: #ef4444;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all .18s;
    flex-shrink: 0;
}

.student-cart-card .student-cart-remove:hover {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
}

/* —— 标签徽章 —— */
.student-tag {
    display: inline-block;
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 8px;
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.student-tag.course {
    background: #eef0ff;
    color: #667eea;
    border-color: #c7cbef;
}

/* —— 分隔竖线 —— */
.student-picker-divider {
    width: 1px;
    background: linear-gradient(180deg, transparent, #e5e7eb 20%, #e5e7eb 80%, transparent);
    margin: 4px 0;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .student-picker {
        flex-direction: column;
        min-height: auto;
    }
    .student-picker-divider {
        width: 100%;
        height: 1px;
        margin: 8px 0;
    }
}
