/* index.css - 首页专用样式(无登录按钮,登录入口仅 footer) */

/* ───── 顶部横屏滚动公告(只在首页出现) ───── */
.notice-marquee {
    /* 固定在视口最顶部,即使上下滑动页面也始终在最上面 */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    /* 与"课堂任务"标题同字号(18px),红色文字;
       背景与边框全部透明,只让字本身显眼。 */
    height: 36px;
    line-height: 36px;
    background: transparent;
    border: 0;
    overflow: hidden;
}
.notice-track {
    display: inline-block;
    white-space: nowrap;
    /* padding-left:100% 让 track 的"起点"位于视口最右侧:
       文字一开始坐在屏幕右边之外,接着随着动画从右向左滑入。
       单份文字即可,因为 track 整体 = (100vw 空白) + (1 份文字)。
       动画 translateX(-100%) 走完整个 track 宽度,loop 边界
       两个端点都恰好落在"屏幕外",所以肉眼看不到跳变 ——
       同时因为 track 里只有 1 份文字,任何瞬间视口里最多只
       会出现一行,不会看到"重复两条"。 */
    padding-left: 100%;
    animation: notice-scroll 28s linear infinite;
    will-change: transform;
}
.notice-marquee:hover .notice-track {
    /* 鼠标悬停时**就地暂停**,用户能看到完整文字;
       离开时无缝继续(浏览器 CSS 引擎会保留当前相位)。 */
    animation-play-state: paused;
}
.notice-text {
    display: inline-block;
    padding: 0 60px;
    font-size: 18px;       /* 与 .classroom-rules h2 同号 */
    font-weight: 600;
    color: #e74c3c;         /* 红色文字 */
}
@keyframes notice-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}
/* 当公告出现时,把首页内容整体下移 36px,避免被固定条遮住 */
body:has(.notice-marquee) {
    padding-top: 36px;
}

.index-container {
    display: flex;
    gap: 30px;
}

.index-content {
    flex: 1;
    min-width: 0;
}

.index-header {
    text-align: center;
    padding: 50px 20px 20px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.index-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(to right, #7b61ff, #5a43d0);
}

.index-header h1 {
    margin: 0;
    font-size: 28px;
    letter-spacing: 1px;
    color: #2c3e50;
    font-weight: 600;
}

.index-header p {
    margin: 12px 0 0;
    color: #666;
    font-size: 15px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    background: #f8f9fa;
    padding: 10px 16px;
    border-radius: 8px;
    border-left: 3px solid #7b61ff;
}

.index-main {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

/* 试卷卡片网格(桌面 2 列,移动 1 列) */
.exam-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.index-link {
    display: block;
    background: white;
    border-radius: 12px;
    padding: 18px 20px;
    text-decoration: none;
    color: #333;
    border: 1px solid #eaeaea;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.index-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #7b61ff;
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.index-link:hover {
    border-color: #7b61ff;
    box-shadow: 0 6px 16px rgba(123, 97, 255, 0.15);
    transform: translateY(-3px);
}

.index-link:hover::before {
    transform: scaleY(1);
}

.index-link .title {
    display: block;
    font-weight: 600;
    font-size: 17px;
    margin-bottom: 6px;
    color: #2c3e50;
}

.index-link .url {
    display: block;
    font-size: 14px;
    color: #7f8c8d;
}

.current-badge {
    color: #ff4444;
    font-weight: 600;
    margin-left: 8px;
    font-size: 14px;
}

/* 当前考试高亮卡 */
.current-exam-box {
    border: 2px solid #1fa6ff;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #eaf6ff 0%, #f5fbff 100%);
}
.current-exam-box h3 {
    margin-top: 0;
    color: #ff4444;
    font-size: 16px;
    font-weight: 700;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}
.page-link {
    padding: 8px 16px;
    background: white;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #7b61ff;
    border-radius: 8px;
    transition: all 0.2s;
}
.page-link:hover {
    background: #7b61ff;
    color: white;
}
.page-link.active {
    background: #7b61ff;
    color: white;
    border-color: #7b61ff;
}
.page-link.disabled {
    color: #ccc;
    pointer-events: none;
    background: #f9f9f9;
}

/* 侧边栏 */
.classroom-rules {
    width: 300px;
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 20px;
    height: fit-content;
    flex-shrink: 0;
}

.classroom-rules h2 {
    margin: 0 0 16px 0;
    font-size: 18px;
    color: #2c3e50;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f3f4;
    position: relative;
}

.classroom-rules h2::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: #7b61ff;
}

.classroom-rules ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.classroom-rules li {
    margin-bottom: 14px;
    line-height: 1.5;
    padding-left: 24px;
    position: relative;
}

.classroom-rules li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #7b61ff;
    font-size: 18px;
}

/* 其他入口 */
.other-entries {
    list-style: none;
    padding: 0;
    margin: 0;
}
.other-entries li {
    margin-bottom: 10px;
}
.other-entries li::before {
    content: none;
}
.other-entries a {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    background: linear-gradient(135deg, #f6f8fa, #eef2f6);
    color: #5a43d0;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    border: 1px solid transparent;
}
.other-entries a:hover {
    transform: translateX(2px);
    background: linear-gradient(135deg, #eef2f6, #dde6f0);
    border-color: #7b61ff;
}
.other-entries a .oe-title {
    display: block;
    font-size: 14px;
}
.other-entries a .oe-desc {
    display: block;
    font-size: 12px;
    color: #888;
    font-weight: 400;
    margin-top: 2px;
}

/* 响应式 */
@media (max-width: 768px) {
    .index-container {
        flex-direction: column;
    }

    .classroom-rules {
        width: 100%;
        position: static;
        order: -1; /* 移动端放最上面 */
    }

    .index-header {
        padding: 30px 20px 20px;
    }

    .index-header h1 {
        font-size: 24px;
    }

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