:root {
    --primary: #1e293b;
    --accent: #3b82f6;
    --accent-light: #60a5fa;
    --bg: #f1f5f9;
    --white: #ffffff;
    --shadow: 0 12px 40px rgba(0,0,0,0.08);
    --radius: 18px;
    --sidebar-width: 270px;
    --topbar-height: 65px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: #1e293b;
    display: flex;
    min-height: 100vh;
}

/* ========== 登录页（保留高级毛玻璃） ========== */
.login-wrapper {
    width: 100%; min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(145deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
    position: relative; overflow: hidden;
}
.login-wrapper::before,
.login-wrapper::after {
    content: ''; position: absolute;
    border-radius: 50%; filter: blur(80px); opacity: 0.15;
}
.login-wrapper::before {
    width: 600px; height: 600px;
    background: #3b82f6; top: -200px; right: -200px;
}
.login-wrapper::after {
    width: 500px; height: 500px;
    background: #a855f7; bottom: -150px; left: -150px;
}
.login-card {
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(40px);
    border-radius: 32px;
    box-shadow: 0 40px 80px rgba(0,0,0,0.5), inset 0 1px 1px rgba(255,255,255,0.15);
    padding: 50px 45px; width: 440px; max-width: 90%;
    border: 1px solid rgba(255,255,255,0.15);
    text-align: center; color: white;
    position: relative; z-index: 1;
}
.login-card .logo-icon { font-size: 48px; margin-bottom: 15px; }
.login-card h1 { font-size: 30px; font-weight: 700; margin-bottom: 10px; }
.login-card .school-name {
    font-size: 16px; opacity: 0.8; margin-bottom: 35px;
    padding-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,0.2);
    letter-spacing: 4px;
}
.login-card .input-group { position: relative; margin-bottom: 22px; }
.login-card .input-group .input-icon {
    position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
    color: rgba(255,255,255,0.7); font-size: 18px;
}
.login-card input {
    width: 100%; padding: 15px 20px 15px 50px;
    border: 1px solid rgba(255,255,255,0.25); border-radius: 50px;
    background: rgba(255,255,255,0.1); color: white; font-size: 16px;
    outline: none; transition: 0.3s;
}
.login-card input::placeholder { color: rgba(255,255,255,0.5); }
.login-card input:focus {
    border-color: #60a5fa; background: rgba(255,255,255,0.15);
    box-shadow: 0 0 25px rgba(59,130,246,0.4);
}
.login-card button {
    width: 100%; padding: 15px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: none; border-radius: 50px;
    font-size: 18px; font-weight: 600; color: white;
    cursor: pointer; transition: 0.3s; margin-top: 20px;
    letter-spacing: 2px; box-shadow: 0 15px 30px rgba(37,99,235,0.4);
}
.login-card button:hover { transform: translateY(-3px); box-shadow: 0 20px 40px rgba(37,99,235,0.6); }
.error-msg {
    background: rgba(239,68,68,0.2); border: 1px solid rgba(239,68,68,0.4);
    color: white; padding: 12px; border-radius: 30px;
    margin-bottom: 25px; font-size: 14px;
}

/* ========== 后台布局（学校/教师） ========== */
/* 侧边栏 */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    color: white; height: 100vh;
    position: fixed; left: 0; top: 0;
    display: flex; flex-direction: column;
    box-shadow: 4px 0 30px rgba(0,0,0,0.25);
    z-index: 1000; transition: transform 0.3s ease;
}
.sidebar-header {
    padding: 35px 25px 25px; text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-header h2 { font-size: 22px; font-weight: 600; color: #f8fafc; }
.sidebar-header p { font-size: 13px; color: #94a3b8; margin-top: 6px; }

.sidebar-menu {
    flex: 1; overflow-y: auto; list-style: none; padding: 20px 0;
}
.sidebar-menu li a {
    display: flex; align-items: center;
    color: #cbd5e1; text-decoration: none;
    padding: 13px 25px; transition: 0.2s;
    font-size: 15px; border-left: 3px solid transparent;
}
.sidebar-menu li a:hover {
    background: rgba(255,255,255,0.06); color: white;
    border-left-color: var(--accent);
}
.sidebar-menu .menu-parent > a { justify-content: space-between; }
.sidebar-menu .menu-parent > a::after {
    content: '▾'; font-size: 12px; transition: transform 0.3s;
}
.menu-parent.open > a::after { transform: rotate(-180deg); }
.submenu { display: none; background: rgba(0,0,0,0.2); }
.menu-parent.open .submenu { display: block; }
.submenu li a { padding-left: 55px; font-size: 14px; }
.sidebar-menu li.active > a,
.submenu li.active > a {
    background: rgba(59,130,246,0.25); color: white;
    border-left-color: var(--accent);
}

/* 退出登录（美化） */
.sidebar-footer {
    padding: 20px; border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: auto;
}
.sidebar-footer a {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    color: #94a3b8; text-decoration: none;
    padding: 12px; border-radius: 14px;
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
    transition: 0.3s; font-weight: 500;
}
.sidebar-footer a:hover {
    background: rgba(239,68,68,0.15); color: #fca5a5;
    box-shadow: 0 8px 20px rgba(239,68,68,0.2);
}

/* 主内容区域 */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1; width: calc(100% - var(--sidebar-width));
    padding: 30px; background: var(--bg); min-height: 100vh;
}

/* 顶部 Header（全新设计） */
.top-bar {
    background: white; border-radius: 16px;
    padding: 0 30px; height: var(--topbar-height);
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    margin-bottom: 30px;
}
.top-bar .brand {
    display: flex; align-items: center; gap: 12px;
}
.top-bar .brand .school-logo {
    font-size: 24px; width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent); color: white; border-radius: 10px;
}
.top-bar .brand .school-name {
    font-weight: 600; font-size: 17px; color: var(--primary);
}
.top-bar .tools {
    display: flex; align-items: center; gap: 25px;
    color: #64748b; font-size: 14px;
}
.top-bar .tools .user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: #e2e8f0; display: flex;
    align-items: center; justify-content: center;
    font-weight: 600; color: var(--primary);
}

/* 汉堡按钮（仅移动端显示） */
.menu-toggle {
    display: none;
    background: none; border: none;
    font-size: 26px; cursor: pointer; color: var(--primary);
    margin-right: 15px;
}

/* 页面标题卡片 */
.page-header {
    background: white; padding: 25px 30px;
    border-radius: 16px; box-shadow: var(--shadow);
    margin-bottom: 25px;
}
.page-header h1 { font-size: 22px; color: var(--primary); }

/* 占位卡片 */
.placeholder-card {
    background: white; padding: 80px 30px;
    border-radius: 16px; box-shadow: var(--shadow);
    text-align: center; color: #94a3b8; font-size: 18px;
    letter-spacing: 1px;
}

/* ========== 学生端成绩查询页 ========== */
.student-page {
    width: 100%; min-height: 100vh;
    background: #f8fafc; display: flex; flex-direction: column;
}
.student-top {
    background: white; padding: 0 25px; height: 60px;
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}
.student-top .school-title { font-weight: 600; color: var(--primary); }
.student-container {
    flex: 1; display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.student-card {
    background: white; border-radius: 24px;
    box-shadow: var(--shadow); padding: 50px 40px;
    width: 100%; max-width: 650px; text-align: center;
}

/* ========== 移动端样式（完全隔离） ========== */
@media (max-width: 768px) {
    /* 侧边栏默认隐藏 */
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    /* 主内容全宽 */
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    /* 显示汉堡按钮 */
    .menu-toggle {
        display: flex;
    }
    /* 头部调整 */
    .top-bar {
        padding: 0 20px;
    }
    .top-bar .brand .school-name {
        display: none; /* 移动端隐藏文字，只显示logo */
    }
    .top-bar .tools span {
        display: none; /* 隐藏“欢迎”文字，仅显示头像 */
    }

    /* 学生页移动端 */
    .student-card {
        padding: 30px 20px;
    }
    .student-top .school-title {
        font-size: 14px;
    }
}