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

* {
    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;
}

/* ===== 主布局 ===== */
.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;
}

.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;
}

/* 统计页和课表页内容较长，允许页面整体滚动 */
.stats-page-container,
.calendar-page-container {
    flex: none;
    min-height: calc(100vh - 112px);
}

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

.calendar-page-container #calendarList {
    flex: none;
}

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

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

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

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

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

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

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

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

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

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

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

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

/* ===== 表单 ===== */
.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;
}

.table-container table {
    flex: 1;
}

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

.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: 16px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}

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

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

.pagination-controls button {
    box-sizing: border-box;
    width: 88px;
    height: 44px;
    padding: 0 10px;
    border: 1px solid #d9dce3;
    background: #fff;
    color: #333;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
}

.pagination-controls button.active,
.pagination-controls button.page-number {
    width: 44px;
}

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

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

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

/* ===== 弹窗 ===== */
.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);
}

.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;
}

/* ===== 星期选择按钮组 ===== */
.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;
}

/* ===== 日历视图 ===== */
.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-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: 1;
    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;
}

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

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

.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 {
        min-width: 0;
        width: 100%;
    }

    .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%;
    }
}
