:root {
--bg-gradient: linear-gradient(135deg, #1a5276 0%, #2e86c1 50%, #48c9b0 100%);
--primary: #1a5276;
--accent: #667eea;
--accent-hover: #5567d5;
--header-bg: rgba(255,255,255,.95);
--header-text: #1a5276;
--footer-text: #1a5276;
--footer-link: #667eea;
--sidebar-bg: linear-gradient(180deg, rgba(108,92,231,.95) 0%, rgba(162,155,254,.95) 100%);
--sidebar-width: 30%;
--sidebar-min-width: 180px;
--sidebar-max-width: 280px;
--sidebar-text: rgba(255,255,255,.9);
--card-bg: rgba(255,255,255,.95);
--card-title: #1a5276;
--text-secondary: #666;
--text-muted: #999;
--border-light: #eee;
--btn-primary-bg: #667eea;
--btn-primary-text: #fff;
--btn-primary-hover: #5567d5;
--success: #28a745;
--danger: #dc3545;
--shadow-sm: 0 2px 10px rgba(0,0,0,.1);
--radius-sm: 8px;
--radius-md: 12px;
}
.global-header {
    background: var(--header-bg, rgba(255,255,255,.95));
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 15px;
    left: 15px;
    right: 15px;
    z-index: 200;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
    backdrop-filter: blur(10px);
}
.global-header .logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--header-text, #1a5276);
    text-decoration: none;
}
.global-header .logo:hover { opacity: 0.8; }
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.user-section {
    display: flex;
    align-items: center;
    gap: 8px;
}
.user-avatar {
    font-size: 20px;
    line-height: 1;
    opacity: .7;
}
.user-info {
    display: flex;
    flex-direction: column;
    line-height: 1;
    gap: 2px;
}
.user-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--header-text, #333);
    line-height: 1;
}
.user-role {
    font-size: 10px;
    color: var(--text-muted, #999);
    line-height: 1;
}
.btn-login, .btn-logout {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
}
.btn-login {
    background: var(--accent, #667eea);
    color: #fff;
    border: none;
}
.btn-logout {
    background: #dc3545;
    color: #fff;
    border: none;
    padding: 4px 10px;
    font-size: 12px;
}
.btn-logout:hover {
    background: #c82333;
}

body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
background: var(--bg-gradient);
min-height: 100vh;
padding: 15px;
}
.container { max-width: 1000px; margin: 0 auto; }

.global-header .theme-btn:hover {
opacity: 1;
background: rgba(0,0,0,0.05);
transform: scale(1.1);
}
@keyframes slideUp {
from { opacity: 0; transform: translateY(40px) scale(.95); }
to { opacity: 1; transform: translateY(0) scale(1); }
}
.theme-picker-close:hover {
background: #fee2e2;
color: #ef4444;
transform: rotate(90deg);
}
.theme-card {
position: relative;
border-radius: 16px;
overflow: hidden;
cursor: pointer;
transition: all .25s cubic-bezier(.4,0,.2,1);
border: 3px solid transparent;
aspect-ratio: 1;
}
.theme-card:hover {
transform: translateY(-6px) scale(1.02);
box-shadow: 0 12px 32px rgba(0,0,0,.2);
}
.theme-card.active {
border-color: var(--accent, #667eea);
box-shadow: 0 0 0 4px rgba(102,126,234,.3);
}
.global-header .quick-nav a {
padding: 8px 14px;
border-radius: var(--radius-sm);
text-decoration: none;
color: var(--text-secondary);
font-size: 13px;
font-weight: 500;
transition: all .2s;
}
.global-header .quick-nav a:hover {
background: #f0f7ff;
color: var(--primary);
}
.global-header .quick-nav a.active {
background: var(--primary);
color: #fff;
font-weight: 600;
}
.global-header .btn-logout {
background: #dc3545;
color: #fff;
}
.global-header .btn-logout:hover {
background: #c82333;
}

.global-header .btn-login:hover {
background: var(--accent-hover);
}
.global-footer,
.global-footer .brand,
#cc-footer .brand {
margin-bottom: 12px;
}
.global-footer .brand h3,
#cc-footer .brand h3 {
font-size: 18px;
color: var(--footer-text);
margin-bottom: 4px;
}
.global-footer .brand p,
#cc-footer .brand p {
font-size: 13px;
color: var(--text-secondary);
}
.global-footer .links,
.global-footer .links a,
#cc-footer .links a {
color: var(--footer-link);
text-decoration: none;
font-size: 13px;
transition: color .2s;
}
.global-footer .links a:hover,
#cc-footer .links a:hover {
color: var(--primary);
}
.global-footer .copyright,
.card {
background: var(--card-bg);
border-radius: var(--radius-md);
padding: 16px;
box-shadow: var(--shadow-sm);
margin-bottom: 12px;
}
.card h2 {
font-size: 16px;
color: var(--card-title);
margin-bottom: 12px;
display: flex;
align-items: center;
gap: 6px;
}
.btn {
padding: 8px 16px;
border-radius: var(--radius-sm);
font-size: 13px;
font-weight: 500;
cursor: pointer;
transition: all .2s;
border: none;
}
.btn-primary {
background: var(--btn-primary-bg);
color: var(--btn-primary-text);
}
.btn-primary:hover {
background: var(--btn-primary-hover);
}
.btn-success {
background: var(--success);
color: #fff;
}
.btn-danger {
background: var(--danger);
color: #fff;
}
.page-body {
display: flex;
flex: 1;
min-height: 0;
}
.main {
margin-left: calc(var(--sidebar-max-width) + 5px); /* JS 会动态覆盖为实际宽度 */
height: calc(100vh - 95px); /* 80px top + 15px bottom */
margin-top: 65px; /* 15px body + 65px = 80px = sidebar top */
min-width: 0;
display: flex;
flex-direction: column;
overflow-y: auto;
    scrollbar-width: none;
}

.main::-webkit-scrollbar {
    display: none;
}

.main-content {
flex: 1;
padding: 0;
min-height: 0;
}
body.page-with-sidebar {
height: 100vh;
padding: 15px;
overflow: hidden;
}
.sidebar {
width: var(--sidebar-width);
min-width: var(--sidebar-min-width);
max-width: var(--sidebar-max-width);
background: var(--sidebar-bg);
backdrop-filter: blur(10px);
border-radius: 16px;
position: fixed;
top: 80px;
left: 15px;
bottom: 15px;
z-index: 100;
border-right: 1px solid rgba(255,255,255,.2);
display: flex;
flex-direction: column;
overflow-y: auto;
}
.sidebar nav {
margin-top: 12px;
flex: 1;
padding: 8px 0;
}
.sidebar-group {
font-size: 12px;
color: rgba(255,255,255,.6);
letter-spacing: 0.5px;
padding: 16px 12px 6px 20px;
font-weight: 700;
}
.sidebar nav a {
display: flex;
align-items: center;
gap: 8px;
padding: 6px 12px 6px 20px;
color: rgba(255,255,255,.85);
text-decoration: none;
font-size: 13px;
transition: all .2s ease;
border-left: 3px solid transparent;
margin: 0;
border-radius: 0 6px 6px 0;
}
.nav-group-title {
font-size: 12px;
font-weight: 700;
color: rgba(255,255,255,.6);
letter-spacing: 0.5px;
padding: 16px 12px 6px 20px;
}
.nav-icon {
font-size: 14px;
width: 20px;
text-align: center;
flex-shrink: 0;
}
.nav-text {
font-size: 13px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.sidebar nav a:hover {
background: rgba(255,255,255,.12);
color: #fff;
}
.sidebar nav a.active {
background: rgba(255,255,255,.18);
color: #fff;
border-left-color: #FFD700;
font-weight: 600;
}
.sidebar nav a.active {
background: rgba(255,255,255,.2);
color: #fff;
border-left-color: var(--game-warning, #FFD700);
font-weight: 600;
}
.sidebar nav a .icon {
font-size: 18px;
width: 24px;
text-align: center;
}
.sidebar-footer {
padding: 20px;
border-top: 1px solid rgba(255,255,255,.15);
text-align: center;
background: rgba(0,0,0,.1);
}
.sidebar-footer .copyright {
font-size: 10px;
color: rgba(255,255,255,.5);
margin-top: 8px;
}
.sidebar-toggle {
display: none;
position: fixed;
top: 12px;
left: 12px;
z-index: 100;
width: 40px;
height: 40px;
border-radius: 10px;
border: none;
background: var(--card-bg);
box-shadow: var(--shadow-sm);
font-size: 20px;
cursor: pointer;
align-items: center;
justify-content: center;
}
.sidebar-overlay {
display: none;
position: fixed;
inset: 0;
background: rgba(0,0,0,.3);
z-index: 49;
}
.class-picker-overlay.active {
display: flex;
}
.class-picker h3 {
margin: 0 0 8px;
color: var(--primary);
font-size: 20px;
}
.class-picker p {
margin: 0 0 20px;
color: var(--text-muted);
font-size: 13px;
}
.class-door:hover {
border-color: var(--accent);
background: linear-gradient(135deg, #e8eef8, #d4daf4);
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(102,126,234,.2);
}
.class-door
.class-door
.class-door
#content {
flex: 1;
min-height: 0;
}
#content::-webkit-scrollbar {
display: none; /* Chrome/Safari */
}

/* ========== Section 统一对齐规则 ========== */
/* 顶部对齐 sidebar top: body(15) + main(55) + main-content(10) = 80px */
/* 右边缘对齐导航栏: body padding 15px = header right:15px */
#content > * {
    padding-top: 0 !important;
}
#content > * {
    margin: 0 !important;
}
@media (max-width: 768px) {
body {
padding: 10px;
}

.global-header
.sidebar-quick-nav {
display: block;
border-bottom: 1px solid var(--border-light);
margin-bottom: 8px;
padding-bottom: 8px;
}
.sidebar-quick-nav a {
display: block;
padding: 8px 12px;
color: var(--sidebar-text);
text-decoration: none;
font-size: 13px;
border-radius: 8px;
}
.sidebar-quick-nav a:hover {
background: var(--sidebar-hover);
}

.global-footer .links,
.sidebar {
position: fixed;
transform: translateX(-100%);
transition: transform .3s ease;
width: 75%;
max-width: 300px;
height: 100vh;
min-height: 100vh;
}
.sidebar.open {
transform: translateX(0);
}
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.class-picker-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.class-picker {
    background: var(--card-bg, #fff);
    border-radius: 16px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
}
.class-picker h3 {
    margin: 0 0 16px;
    text-align: center;
}
.class-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}
.class-door {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
}
.class-door:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
}
.door-icon { font-size: 32px; margin-bottom: 8px; }
.door-name { font-size: 13px; font-weight: 600; }
.quick-nav {
    display: flex;
    gap: 8px;
    align-items: center;
}
.quick-nav a {
    padding: 6px 12px;
    color: var(--header-text, #333);
    text-decoration: none;
    font-size: 13px;
    border-radius: 6px;
    transition: background 0.2s;
}
.quick-nav a:hover {
    background: rgba(0,0,0,0.05);
}

/* ========== Header 内元素 ========== */

/* ========== 班级选择器 ========== */

.class-picker-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--border-light, #e0e0e0);
    border-radius: 8px;
    background: var(--card-bg, #fff);
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary, #333);
    transition: all .2s;
    white-space: nowrap;
}
.class-picker-btn:hover {
    border-color: var(--primary, #1a5276);
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.class-picker-icon {
    font-size: 16px;
}
.class-picker-name {
    font-weight: 600;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.class-picker-arrow {
    font-size: 10px;
    color: #999;
}
/* 浮动班级选择窗口 */
.cpm-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.4);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: cpm-fade-in .2s ease;
}
@keyframes cpm-fade-in { from{opacity:0} to{opacity:1} }
@keyframes cpm-slide-up { from{transform:translateY(20px);opacity:0} to{transform:translateY(0);opacity:1} }
.cpm-card {
    background: #fff;
    border-radius: 20px;
    width: 320px;
    max-height: 70vh;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    overflow: hidden;
    animation: cpm-slide-up .25s ease;
}
.cpm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
}
.cpm-title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
}
.cpm-close {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 14px;
    color: #999;
    transition: all .15s;
}
.cpm-close:hover { background: #e0e0e0; color: #333; }
.cpm-list {
    padding: 8px;
    overflow-y: auto;
    max-height: calc(70vh - 60px);
}
.cpm-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: all .15s;
}
.cpm-item:hover { background: #f5f5ff; }
.cpm-item.active {
    background: linear-gradient(135deg, #667eea11, #764ba211);
    border: 1px solid #667eea33;
}
.cpm-item-icon {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px;
    background: #f0f0ff;
    font-size: 18px;
}
.cpm-item.active .cpm-item-icon { background: #667eea22; }
.cpm-item-info { flex: 1; }
.cpm-item-name { font-size: 14px; font-weight: 600; color: #333; }
.cpm-item-count { font-size: 12px; color: #999; margin-top: 2px; }
.cpm-item.active .cpm-item-name { color: #667eea; }
/* 旧 class-picker-item 样式已移除，统一使用 cpm-* 弹窗 */

/* ========== Header 导航紧靠用户区 ========== */
.header-divider {
    width: 1px;
    height: 20px;
    background: var(--border-light, #e0e0e0);
    margin: 0 4px;
}
.quick-nav {
    display: flex;
    gap: 2px;
    align-items: center;
}

/* ========== 导航栏班级下拉 ========== */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== 导航栏Hover下拉 ========== */
.nav-dropdown-wrap {
    position: relative;
    display: inline-block;
}
.nav-dropdown-wrap > a {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    transition: all .2s;
    cursor: pointer;
}
.nav-dropdown-wrap > a:hover,
.nav-dropdown-wrap:hover > a {
    background: #f0f7ff;
    color: var(--primary);
}
.nav-dropdown-wrap > a.active {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,.15);
    padding: 6px 0;
    min-width: 160px;
    z-index: 9999;
    animation: fadeInDown .15s ease;
}
.nav-dropdown-wrap:hover .nav-dropdown-menu {
    display: block;
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.nav-dropdown-item {
    display: block;
    padding: 8px 16px;
    font-size: 13px;
    color: #333;
    text-decoration: none;
    transition: background .15s;
    white-space: nowrap;
}
.nav-dropdown-item:hover {
    background: #f0f7ff;
    color: #667eea;
}
.nav-dropdown-item.active {
    color: #667eea;
    font-weight: 600;
}
/* ===== Section 共享组件 ===== */

/* Toast 通知 */
.toast {
    position: fixed; top: 20px; right: 20px;
    padding: 12px 20px; border-radius: 8px;
    color: #fff; font-size: 13px; z-index: 9999;
    animation: slideIn .3s ease;
}
.toast.success { background: #28a745; }
.toast.error { background: #dc3545; }
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* 空状态 */
.empty-state { text-align: center; padding: 40px; color: #999; }
.empty-icon { font-size: 48px; margin-bottom: 15px; }

/* 审批卡片 */
.request-item { background: #f8f9fa; border-radius: 12px; padding: 15px; margin-bottom: 15px; }
.request-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.request-student { font-weight: 600; color: #333; }
.request-time { font-size: 12px; color: #999; }
.request-detail { display: flex; align-items: center; gap: 15px; margin: 10px 0; }
.request-icon { font-size: 32px; }
.request-info { flex: 1; }
.request-name { font-weight: 600; }
.request-convert { color: #667eea; font-size: 14px; margin-top: 4px; }
.request-actions { display: flex; gap: 10px; margin-top: 15px; }

/* 审批按钮 */
.btn-approve { padding: 8px 20px; background: linear-gradient(135deg, #28a745, #20c997); color: #fff; border: none; border-radius: 8px; cursor: pointer; font-weight: 600; }
.btn-reject { padding: 8px 20px; background: #dc3545; color: #fff; border: none; border-radius: 8px; cursor: pointer; }

/* 五育标签 */
.wuyu-tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.wuyu-德 { background: #fff3cd; color: #856404; }
.wuyu-智 { background: #d1ecf1; color: #0c5460; }
.wuyu-体 { background: #d4edda; color: #155724; }
.wuyu-美 { background: #f8d7da; color: #721c24; }
.wuyu-劳 { background: #e2e3e5; color: #383d41; }

/* 标签栏 */
.tab-bar { display: flex; gap: 10px; margin-bottom: 20px; }
.tab-btn { padding: 8px 16px; border: 2px solid #667eea; border-radius: 20px; background: #fff; cursor: pointer; transition: all .3s; }
.tab-btn.active { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; border-color: transparent; }

/* 流程步骤 */
.flow-steps { display: flex; align-items: center; margin: 15px 0; font-size: 12px; }
.flow-step { display: flex; align-items: center; }
.flow-step-circle { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.flow-step-done { background: #28a745; color: #fff; }
.flow-step-active { background: #667eea; color: #fff; }
.flow-step-pending { background: #e9ecef; color: #999; }
.flow-arrow { width: 30px; height: 2px; margin: 0 3px; }
.flow-arrow-done { background: #28a745; }
.flow-arrow-active { background: #667eea; }
.flow-arrow-pending { background: #e9ecef; }

/* === 性别背景色（全站统一） === */
.male, .cr-male { background: linear-gradient(135deg, #e3f2fd, #bbdefb); border: 1.5px solid #90caf9; }
.female, .cr-female { background: linear-gradient(135deg, #fce4ec, #f8bbd0); border: 1.5px solid #f48fb1; }
.male-flat, .cr-male-flat { background: #e3f2fd; border: 1.5px solid #90caf9; }
.female-flat, .cr-female-flat { background: #fce4ec; border: 1.5px solid #f48fb1; }
