/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    line-height: 1.6;
}

/* 导航栏样式 */
.navbar {
    background-color: #4a90e2 !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 0.75rem 1.5rem;
}

.navbar-brand {
    color: white !important;
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.navbar-light .navbar-nav .nav-link {
    color: rgba(255,255,255,0.9) !important;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.navbar-light .navbar-nav .nav-link:hover {
    color: white !important;
    transform: translateY(-1px);
}

.navbar-light .navbar-nav .nav-item span {
    color: white !important;
}

/* 主容器布局 */
.main-container {
    display: flex;
    gap: 24px;
    max-width: 100%;
    margin: 24px auto;
    padding: 0 24px;
}

/* 左侧导航栏 */
.sidebar {
    width: 260px;
    flex-shrink: 0;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
}

.sidebar-header {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    padding: 20px 24px;
    color: white;
}

.sidebar-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.sidebar-nav ul {
    list-style: none;
    padding: 8px 0;
}

.sidebar-nav li {
    margin: 4px 12px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    color: #555;
    text-decoration: none;
    font-size: 0.95rem;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.sidebar-nav li a:hover {
    background: #f0f5ff;
    color: #4a90e2;
}

.sidebar-nav li.active {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
}

.sidebar-nav li.active a {
    color: white;
}

.sidebar-nav li.active a:hover {
    background: transparent;
}

.sidebar-nav .icon {
    font-size: 1.2rem;
    margin-right: 10px;
}

/* 右侧主内容区 */
.main-content {
    flex: 1;
    min-width: 0;
}

/* 筛选区域 */
.filter-section {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 20px 24px;
    margin-bottom: 24px;
}

.filter-group {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-label {
    font-weight: 600;
    color: #666;
    margin-right: 12px;
    white-space: nowrap;
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-tag {
    padding: 8px 18px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    background: white;
    color: #666;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-tag:hover {
    border-color: #4a90e2;
    color: #4a90e2;
}

.filter-tag.active {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    border-color: #4a90e2;
    color: white;
}

/* 试卷卡片网格 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

/* 试卷卡片样式 */
.exam-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: visible; /* 允许下载下拉菜单向下弹出卡片外 */
    transition: all 0.3s ease;
}

.exam-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(74, 144, 226, 0.2);
}

.card-header-bg {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    padding: 24px;
    color: white;
    text-align: center;
    /* 卡片取消 overflow:hidden 后，由头部自己承担顶部圆角 */
    border-radius: 16px 16px 0 0;
}

.card-title {
    margin: 0 0 8px 0;
    font-size: 1.4rem;
    font-weight: bold;
}

.card-subtitle {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.card-body {
    padding: 20px;
}

.card-description {
    margin: 0 0 12px 0;
    color: #666;
    font-size: 0.95rem;
}

.card-tags {
    display: flex;
    gap: 8px;
}

.tag {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    background: #f0f2f5;
    color: #666;
}

.tag.primary {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: white;
}

.tag.secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
}

.tag.year {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
}

.tag.month {
    background: linear-gradient(135deg, #50c878 0%, #40b060 100%);
    color: white;
}

.tag.type {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    color: white;
}

.tag.level {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
}

.card-footer {
    /* 2×2 按钮网格：第一行 试卷浏览 | 开始考试，第二行 试卷版 | 答案解析版 */
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid #f0f0f0;
}

/* 学生只有两个按钮时，两个按钮各占一列，正好一行 */
.card-footer .btn {
    min-width: 0;
    padding: 10px 4px;
    font-size: 0.88rem;
    text-align: center;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn {
    flex: 1;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-outline {
    background: white;
    border: 2px solid #4a90e2;
    color: #4a90e2;
}

.btn-outline:hover {
    background: #f0f5ff;
}

.btn-primary {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

/* 试卷卡片下载下拉按钮（教师/管理员可见） */
.download-dropdown {
    flex: 1;
    position: relative;
}

.btn-download {
    width: 100%;
    background: white;
    border: 2px solid #27ae60;
    color: #27ae60;
}

/* 答案版下载：绿底白字，与"开始考试"蓝底白字风格呼应 */
.btn-download-solid {
    width: 100%;
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    border: none;
    color: white;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.25);
}

.btn-download-solid:hover {
    background: linear-gradient(135deg, #2fab66 0%, #1f8b4d 100%);
    box-shadow: 0 6px 16px rgba(39, 174, 96, 0.35);
}

.btn-download:hover {
    background: #eafaf1;
}

.download-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px); /* 向下弹出，不遮挡卡片内容 */
    left: 0;
    right: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    z-index: 30;
}

.download-dropdown.open .download-menu {
    display: block;
}

.download-menu a {
    display: block;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
}

.download-menu a:hover {
    background: #f0f5ff;
    color: #4a90e2;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.empty-state h3 {
    margin: 0 0 8px 0;
    color: #333;
}

.empty-state p {
    margin: 0;
    color: #999;
}

/* 分页容器 */
.pagination-container {
    margin-top: 24px;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    gap: 8px;
}

.page-item .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
}

.page-item .page-link:hover {
    border-color: #4a90e2;
    color: #4a90e2;
}

.page-item.active .page-link {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    border-color: #4a90e2;
    color: white;
}

.page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 首页样式 */
.homepage-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 24px;
}

/* Hero区域 */
.hero-section {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 50%, #2980b9 100%);
    border-radius: 24px;
    padding: 60px 40px;
    margin-bottom: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    overflow: hidden;
}

.hero-content {
    flex: 1;
    max-width: 600px;
}

.hero-content h1 {
    font-size: 2.5rem;
    margin: 0 0 16px 0;
    font-weight: bold;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.hero-subtitle {
    font-size: 1.3rem;
    margin: 0 0 12px 0;
    opacity: 0.95;
}

.hero-description {
    font-size: 1rem;
    margin: 0 0 24px 0;
    opacity: 0.9;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 16px;
}

.hero-buttons .btn {
    padding: 12px 32px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.hero-buttons .btn-primary {
    background: white;
    color: #4a90e2;
}

.hero-buttons .btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255,255,255,0.3);
}

.hero-buttons .btn-outline {
    background: transparent;
    border: 2px solid rgba(255,255,255,0.8);
    color: white;
}

.hero-buttons .btn-outline:hover {
    background: rgba(255,255,255,0.1);
    border-color: white;
}

.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
}

.hero-icons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.icon-item {
    font-size: 4rem;
    animation: float 3s ease-in-out infinite;
}

.icon-item:nth-child(1) { animation-delay: 0s; }
.icon-item:nth-child(2) { animation-delay: 0.5s; }
.icon-item:nth-child(3) { animation-delay: 1s; }
.icon-item:nth-child(4) { animation-delay: 1.5s; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

/* 统计数据区域 */
.stats-section {
    margin-bottom: 32px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(74, 144, 226, 0.15);
}

.stat-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f5ff 0%, #e6f0ff 100%);
    border-radius: 16px;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #4a90e2;
    margin: 0;
}

.stat-label {
    font-size: 0.9rem;
    color: #888;
    margin: 4px 0 0 0;
}

/* 科目导航区域 */
.subjects-section {
    margin-bottom: 32px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 0 20px 0;
    color: #333;
}

.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.subject-card {
    background: white;
    border-radius: 16px;
    padding: 28px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
}

.subject-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4a90e2, #357abd);
}

.subject-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(74, 144, 226, 0.2);
}

.subject-card.scratch::before {
    background: linear-gradient(90deg, #ff6b6b, #ee5a5a);
}

.subject-card.python::before {
    background: linear-gradient(90deg, #50c878, #40b060);
}

.subject-card.robot::before {
    background: linear-gradient(90deg, #9b59b6, #8e44ad);
}

.subject-card.c_language::before {
    background: linear-gradient(90deg, #3498db, #2980b9);
}

.subject-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.subject-card h3 {
    font-size: 1.1rem;
    margin: 0 0 8px 0;
    font-weight: 600;
}

.subject-card p {
    font-size: 0.9rem;
    color: #888;
    margin: 0 0 12px 0;
    line-height: 1.5;
}

.subject-count {
    display: inline-block;
    padding: 6px 14px;
    background: #f0f2f5;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #666;
}

/* 最新试卷区域 */
.latest-section {
    margin-bottom: 32px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.view-all {
    color: #4a90e2;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.view-all:hover {
    color: #357abd;
}

.latest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.exam-card-small {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.exam-card-small:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(74, 144, 226, 0.15);
}

.card-header {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.type-badge {
    padding: 4px 12px;
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-primary {
    padding: 4px 12px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: white;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-secondary {
    padding: 4px 12px;
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.exam-card-small h4 {
    font-size: 1rem;
    margin: 0 0 8px 0;
    color: #333;
}

.exam-meta {
    font-size: 0.85rem;
    color: #888;
    margin: 0 0 16px 0;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 8px;
}

/* 用户学习统计区域 */
.user-stats-section {
    margin-bottom: 32px;
}

.user-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.user-stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 20px;
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.user-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.3);
}

.user-stat-icon {
    font-size: 2rem;
}

.user-stat-info {
    flex: 1;
}

.user-stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0;
}

.user-stat-label {
    font-size: 0.85rem;
    opacity: 0.9;
    margin: 4px 0 0 0;
}

/* 登录页面样式（少儿编程风格） */
.login-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(160deg, #38bdf8 0%, #818cf8 45%, #c084fc 100%);
    position: relative;
    overflow: hidden;
    padding: 20px;
}

/* 背景装饰层 */
.bg-decoration {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

/* 漂浮的编程元素 emoji */
.bg-emoji {
    position: absolute;
    font-size: 2.2rem;
    opacity: 0.85;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.12));
    animation: emojiFloat 8s ease-in-out infinite;
}

.bg-emoji-1 { top: 12%; left: 8%; animation-delay: 0s; font-size: 3rem; }
.bg-emoji-2 { top: 65%; left: 6%; animation-delay: 1.2s; font-size: 2.6rem; }
.bg-emoji-3 { top: 18%; right: 10%; animation-delay: 2.1s; font-size: 2rem; }
.bg-emoji-4 { bottom: 12%; right: 8%; animation-delay: 0.6s; font-size: 2.8rem; }
.bg-emoji-5 { top: 45%; left: 16%; animation-delay: 3s; font-size: 1.8rem; }
.bg-emoji-6 { top: 75%; right: 18%; animation-delay: 1.8s; font-size: 2.2rem; }
.bg-emoji-7 { top: 8%; left: 42%; animation-delay: 2.6s; font-size: 1.9rem; }
.bg-emoji-8 { bottom: 20%; left: 38%; animation-delay: 0.9s; font-size: 1.7rem; }

@keyframes emojiFloat {
    0%, 100% {
        transform: translateY(0) rotate(-4deg);
    }
    50% {
        transform: translateY(-18px) rotate(6deg);
    }
}

/* 云朵装饰 */
.bg-cloud {
    position: absolute;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    animation: cloudDrift 22s linear infinite;
}

.bg-cloud-1 {
    width: 220px;
    height: 60px;
    top: 14%;
    left: -240px;
}

.bg-cloud-2 {
    width: 160px;
    height: 44px;
    bottom: 18%;
    left: -180px;
    animation-delay: 9s;
}

@keyframes cloudDrift {
    from { transform: translateX(0); }
    to { transform: translateX(calc(100vw + 300px)); }
}

/* 登录卡片 */
.login-card {
    background: white;
    border-radius: 28px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 60px rgba(56, 98, 189, 0.28);
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s ease-out;
    overflow: hidden;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 卡片顶部彩虹装饰条 */
.card-rainbow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(90deg,
        #ff6b6b 0%, #ffa94d 20%, #ffd43b 40%,
        #51cf66 60%, #22b8cf 80%, #845ef7 100%);
}

/* 登录头部 */
.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.logo-container {
    margin-bottom: 18px;
}

.logo-icon {
    width: 88px;
    height: 88px;
    margin: 0 auto;
    background: linear-gradient(135deg, #4facfe 0%, #a78bfa 100%);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    border: 4px solid #fff;
    box-shadow: 0 10px 28px rgba(122, 92, 250, 0.35);
    animation: logoBounce 3s ease-in-out infinite;
}

@keyframes logoBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

.logo-emoji {
    font-size: 2.8rem;
    line-height: 1;
}

.logo-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    font-size: 1.3rem;
    animation: emojiFloat 2.4s ease-in-out infinite;
}

.login-title {
    font-size: 1.65rem;
    font-weight: 800;
    color: #2b3a67;
    margin: 0 0 10px 0;
    letter-spacing: 0.5px;
}

.login-subtitle {
    font-size: 0.98rem;
    color: #8a94b8;
    margin: 0;
    font-weight: 500;
}

/* 登录消息提示 */
.login-alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 16px;
    border: none;
}

.login-alert.alert-danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
}

.login-alert.alert-success {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #16a34a;
}

.login-alert.alert-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #2563eb;
}

/* 自定义表单样式 */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group-custom {
    width: 100%;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    color: #999;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.form-control-custom {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 2.5px solid #e8ecf7;
    border-radius: 16px;
    font-size: 1rem;
    background: #f8faff;
    transition: all 0.3s ease;
    outline: none;
    color: #2b3a67;
}

.form-control-custom:focus {
    border-color: #4facfe;
    background: white;
    box-shadow: 0 0 0 4px rgba(79, 172, 254, 0.15);
}

.form-control-custom:focus + .input-icon {
    color: #4facfe;
}

.form-control-custom::placeholder {
    color: #b3bcd6;
}

.form-control-custom.is-invalid {
    border-color: #e74c3c;
}

.toggle-password {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    color: #9aa5c4;
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: #4facfe;
}

.error-message {
    margin-top: 8px;
    color: #e74c3c;
    font-size: 0.875rem;
}

/* 记住我区域 */
.remember-me {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.remember-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #51cf66;
    cursor: pointer;
}

.remember-label {
    color: #6b7597;
    font-size: 0.92rem;
    cursor: pointer;
    margin-left: 8px;
    font-weight: 500}

/* 登录按钮 */
.login-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #ffa94d 0%, #ff922b 60%, #fd7e14 100%);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 1.12rem;
    font-weight: 700;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 18px rgba(255, 146, 43, 0.45);
}

.login-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 26px rgba(255, 146, 43, 0.55);
}

.login-btn:active {
    transform: translateY(0) scale(0.99);
}

/* 底部装饰代码 */
.login-code {
    margin-top: 26px;
    background: #2b3a67;
    border-radius: 12px;
    padding: 12px 16px;
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 0.85rem;
    text-align: center;
    color: #dbe4ff;
}

.login-code .code-keyword {
    color: #ff922b;
    font-weight: 700;
}

.login-code .code-string {
    color: #8ce99a;
}

/* 底部提示 */
.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #f0f0f0;
    color: #888;
    font-size: 0.9rem;
}

/* 底部提示：账号由管理员创建 / 忘记密码联系管理员重置 */
.login-tip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #6b7597;
    font-size: 0.9rem;
    line-height: 1.6;
}

.login-tip i {
    color: #ff922b;
}

/* ========== 答题记录页面样式 ========== */
.records-page {
    width: 100%;
    padding-top: 16px;
}

/* 页面头部 */
.records-header {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    border-radius: 16px;
    padding: 24px 32px;
    margin-top: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(74, 144, 226, 0.25);
}

.records-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.records-header-text h1 {
    color: white;
    font-size: 1.5rem;
    margin: 0 0 4px 0;
    font-weight: 700;
}

.records-header-text p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    margin: 0;
}

.records-back-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.records-back-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    color: white;
    text-decoration: none;
}

/* 表格容器 */
.records-table-wrap {
    background: white;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    overflow-x: auto;
}

.records-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.records-table thead {
    background: linear-gradient(135deg, #f8fafc 0%, #f0f4ff 100%);
    border-bottom: 2px solid #e8e8e8;
}

.records-table thead th {
    padding: 14px 12px;
    font-weight: 600;
    color: #555;
    text-align: left;
    white-space: nowrap;
    font-size: 0.88rem;
}

.records-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease;
}

.records-table tbody tr:hover {
    background: #fafbff;
}

.records-table tbody tr:last-child {
    border-bottom: none;
}

.records-table tbody td {
    padding: 12px;
    color: #444;
    vertical-align: middle;
}

/* 试卷编号 */
.exam-id {
    display: inline-block;
    background: #f0f4ff;
    color: #4a90e2;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
}

/* 试卷名 */
.exam-title-cell {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

/* 得分徽章 */
.score-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 600;
}

.score-badge.score-pass {
    background: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

.score-badge.score-fail {
    background: #fff2f0;
    color: #ff4d4f;
    border: 1px solid #ffccc7;
}

.score-badge.score-none {
    background: #fafafa;
    color: #999;
    border: 1px solid #e8e8e8;
}

/* 类型标签 */
.type-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 600;
    color: white;
}

.tag-scratch { background: #ff6b6b; }
.tag-python { background: #52c41a; }
.tag-robot { background: #9b59b6; }
.tag-c_language { background: #3498db; }
/* 专项练习（大类）标签 */
.tag-practice { background: #fa8c16; }
/* 比赛语言标签 */
.tag-c_plus_plus { background: #3498db; }

/* 时间列 */
.time-cell {
    white-space: nowrap;
    color: #666;
    font-size: 0.85rem;
}

/* 操作列 */
.action-cell {
    white-space: nowrap;
}

.action-btn {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    margin-right: 4px;
}

.view-btn {
    background: #e6f7ff;
    color: #1890ff;
}

.view-btn:hover {
    background: #bae7ff;
    color: #096dd9;
    text-decoration: none;
}

.delete-btn {
    background: #fff1f0;
    color: #ff4d4f;
}

.delete-btn:hover {
    background: #ffccc7;
    color: #cf1322;
}

.delete-form {
    display: inline;
}

/* 错题订正按钮 */
.correction-btn {
    background: #fff7e6;
    color: #fa8c16;
}

.correction-btn:hover {
    background: #ffe7ba;
    color: #d46b08;
    text-decoration: none;
}

/* 订正标识 */
.correction-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    background: #fff7e6;
    color: #fa8c16;
    border: 1px solid #ffd591;
    margin-left: 6px;
    vertical-align: middle;
}

/* 分页 */
.records-pagination {
    margin-top: 24px;
    text-align: center;
}

.pagination-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pagination-btn {
    display: inline-block;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 0.88rem;
    color: #555;
    background: white;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid #e8e8e8;
}

.pagination-btn:hover:not(.disabled):not(.active) {
    background: #f0f4ff;
    border-color: #4a90e2;
    color: #4a90e2;
    text-decoration: none;
}

.pagination-btn.active {
    background: #4a90e2;
    color: white;
    border-color: #4a90e2;
    font-weight: 600;
}

.pagination-btn.disabled {
    color: #ccc;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-dots {
    color: #999;
    padding: 0 4px;
    font-weight: 600;
}

.pagination-info {
    margin-top: 10px;
    font-size: 0.82rem;
    color: #999;
}

/* 空状态 */
.records-empty {
    background: white;
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.empty-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
}

.records-empty h3 {
    font-size: 1.3rem;
    color: #333;
    margin: 0 0 8px 0;
}

.records-empty p {
    font-size: 0.95rem;
    color: #888;
    margin: 0 0 24px 0;
}

.records-empty-btn {
    display: inline-block;
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    padding: 10px 32px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(74, 144, 226, 0.3);
}

.records-empty-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
    color: white;
    text-decoration: none;
}

/* ========== 我的学生页面样式（与答题记录页面同风格） ========== */

/* 搜索卡片：与 records-table-wrap 同款白卡 */
.students-search-card {
    background: white;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    padding: 20px 24px;
    margin-bottom: 20px;
}

.students-search-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.students-search-input {
    flex: 1;
    min-width: 220px;
    padding: 9px 14px;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.students-search-input:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.15);
}

/* 搜索区按钮：与 records 风格配色一致 */
.students-search-btn {
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.students-search-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.students-search-btn.btn-blue {
    background: #4a90e2;
    color: white;
}

.students-search-btn.btn-blue:hover:not(:disabled) {
    background: #357abd;
}

.students-search-btn.btn-plain {
    background: #f0f4ff;
    color: #4a90e2;
}

.students-search-btn.btn-plain:hover {
    background: #e0eaff;
}

.students-search-btn.btn-green {
    background: #52c41a;
    color: white;
}

.students-search-btn.btn-green:hover:not(:disabled) {
    background: #49b018;
}

/* 搜索结果提示行 */
.ms-search-msg {
    margin-top: 14px;
    font-size: 0.88rem;
    color: #888;
}

.ms-search-msg.ms-search-err {
    color: #ff4d4f;
}

.students-search-tip {
    margin-top: 12px;
    font-size: 0.8rem;
    color: #999;
}

/* 「只看未分配」勾选项：与搜索框同一行，保持垂直居中 */
.ms-only-unassigned {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    color: #555;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    margin: 0;
}

.ms-only-unassigned input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0;
    cursor: pointer;
}

/* 搜索结果表格里的勾选框（含表头全选） */
.ms-pick-cell {
    width: 68px;
    white-space: nowrap;
}

.ms-pick-cell input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0 6px 0 0;
    vertical-align: middle;
    cursor: pointer;
}

.ms-pick-cell label {
    margin: 0;
    font-size: 0.85rem;
    color: #555;
    cursor: pointer;
    user-select: none;
    vertical-align: middle;
}

/* 搜索结果条数提示 */
.ms-search-msg .ms-search-count {
    color: #1e50a2;
    font-weight: 600;
}

/* 名下学生列表：用户名搜索卡片（普通输入框，非下拉） */
.ms-list-filter {
    margin-bottom: 16px;
}

.ms-list-filter-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

/* 「重置」用 <a> 实现，需补齐按钮的盒模型 */
.ms-list-filter .students-search-btn.ms-list-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    line-height: 1.2;
}

.ms-list-filter .students-search-btn.ms-list-reset:hover {
    text-decoration: none;
}

/* 开通/关闭解析按钮（表格内，绿色系，与 view-btn/delete-btn 同规格） */
.action-btn.explain-btn {
    background: #f6ffed;
    color: #52c41a;
}

.action-btn.explain-btn:hover {
    background: #d9f7d0;
    color: #49b018;
}

/* 我的学生表格：固定布局，列宽按百分比平均分配，避免用户名列过宽 */
.students-table {
    table-layout: fixed;
}

.students-table td {
    overflow-wrap: anywhere;
}

.students-table .action-cell {
    white-space: normal;
}

/* 我的学生：操作按钮固定两行两列，四个按钮等宽对齐 */
.students-ops {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    align-items: stretch;
}

.students-ops .action-btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-right: 0;
    padding: 5px 4px;
    text-align: center;
    white-space: nowrap;
}

.students-name-cell {
    font-weight: 600;
    overflow-wrap: anywhere;
}

/* ========== 全站统一品牌 / 页脚备案信息 ========== */

/* 导航栏 logo + 站点名 */
.site-logo {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    object-fit: cover;
}

.site-name {
    font-weight: 700;
    color: #2b6cff;
    font-size: 1.05rem;
    letter-spacing: 0.5px;
}

/* 页脚：备案信息 */
.site-footer {
    margin-top: 48px;
    padding: 24px 12px;
    background: #f8f9fb;
    border-top: 1px solid #e8ecf3;
}

.site-footer-inner p {
    margin: 4px 0;
    font-size: 0.82rem;
    color: #8a94a6;
}

.site-footer-name {
    font-weight: 600;
}

.beian-link {
    color: #8a94a6 !important;
    text-decoration: none;
}

/* 两个备案号同一行：左公安备案、右工信部备案 */
.beian-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

/* 公安联网备案图标（置于备案编号之前） */
.beian-icon {
    height: 14px;
    width: auto;
    margin-right: 4px;
    vertical-align: -2px;
}

.beian-link:hover {
    color: #2b6cff !important;
    text-decoration: underline;
}