* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

/* 移动端底部按钮栏样式 */
@media (max-width: 991.98px) {
    body {
        padding-bottom: 80px;
    }

    .mobile-bottom-bar-icons {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        background: #fff;
        border-top: 1px solid #eee;
        display: flex !important;
        justify-content: space-around;
        align-items: center;
        height: 62px;
        z-index: 100;
        box-shadow: 0 -2px 8px rgba(0,0,0,0.04);
        padding: 0 5px;
    }

    .mobile-bar-btn {
        flex: 1;
        text-align: center;
        background: none;
        border: none;
        outline: none;
        font-size: 12px;
        color: #444;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        height: 100%;
        padding: 0 1px;
        margin: 0;
        cursor: pointer;
        text-decoration: none;
        min-width: 0;
    }

    .mobile-bar-btn-main {
        color: #fff;
        background: #e74c3c;
        border-radius: 18px;
        margin: 0 1px;
        font-weight: bold;
        height: 36px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        min-width: 70px;
        box-shadow: 0 2px 8px rgba(231,76,60,0.08);
        border: none;
        font-size: 13px;
        letter-spacing: 1px;
        padding: 0 6px;
    }

    .mobile-bar-btn div {
        font-size: 11px;
        font-weight: 500;
        margin-top: 2px;
        text-decoration: none;
        display: block !important;
        color: #444 !important;
    }

    .mobile-bar-btn.active div {
        color: #e74c3c !important;
    }

    .svg-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 2px;
    }

    .svg-icon svg {
        display: block;
        width: 18px;
        height: 18px;
    }
}

/* 移动端顶部标题 */
.mobile-page-title {
    display: none;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    padding: 12px 0;
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    color: #333;
}

@media (max-width: 991.98px) {
    .mobile-page-title {
        display: block;
    }
}

/* 学期导航标签 */
.semester-tabs {
    display: flex;
    background: #fff;
    margin: 10px 15px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    min-height: 42px;
}

.semester-tab {
    flex: 1;
    padding: 10px 12px;
    text-align: center;
    background: #fff;
    color: #666;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    font-weight: 500;
    position: relative;
}

.semester-tab.active {
    background: #fff;
    color: #FF6B35;
}

.semester-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #FF6B35;
}

/* 主要内容区域 - PC端 */
.main-content {
    display: flex;
    margin: 20px auto;
    gap: 20px;
    max-width: 1200px;
    padding: 0 15px;
    min-height: calc(100vh - 200px);
}

/* 左侧年级导航 */
.grade-sidebar {
    width: 200px;
    background: #fff;
    border-radius: 10px;
    padding: 15px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    height: fit-content;
    position: sticky;
    top: 20px;
    flex-shrink: 0;
}

.grade-item {
    display: block;
    width: 100%;
    padding: 12px 20px;
    text-align: center;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    border-left: 3px solid transparent;
    margin: 1px 0;
    border-radius: 0 6px 6px 0;
}

.grade-item:hover {
    background: #fff7e6;
    color: #FF6B35;
    transform: translateX(2px);
}

.grade-item.active {
    background: #fff7e6;
    color: #FF6B35;
    border-left-color: #FF6B35;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(255,107,53,0.15);
}

/* 右侧内容区域 */
.content-area {
    flex: 1;
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    min-width: 0;
}

/* 加载/空状态 */
.content-loading, .content-empty {
    text-align: center;
    padding: 40px 16px;
    color: #999;
    font-size: 14px;
}
.content-empty a.go-resource-btn {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 20px;
    background: #FF6B35;
    color: #fff;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
}

/* 学科分类 */
.subject-section { margin-bottom: 25px; }

.subject-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 8px;
}

.subject-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.subject-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    flex-shrink: 0;
}

.subject-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

/* 分类选项按钮 */
.category-options { display: flex; gap: 6px; }

.category-option {
    padding: 4px 10px;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    background: #fff;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.category-option.active {
    background: #FF6B35;
    color: #fff;
    border-color: #FF6B35;
}

/* 文件夹网格 - 每行4个 */
.folder-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.folder-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    min-height: 70px;
    background: none;
    border: none;
    position: relative;
    overflow: hidden;
}

.folder-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    background: #f8f9fa;
}

.folder-icon {
    font-size: 32px;
    margin-bottom: 6px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}

.folder-name {
    font-size: 14px;
    text-align: center;
    line-height: 1.2;
    font-weight: 500;
    color: #495057;
}

/* 响应式设计 - 移动端 */
@media (max-width: 991.98px) {
    .main-content {
        display: block;
        margin: 10px;
        padding: 0;
    }

    .grade-sidebar {
        width: 100%;
        margin-bottom: 10px;
        display: flex;
        overflow-x: auto;
        padding: 10px;
        gap: 8px;
        border-radius: 8px;
    }

    .grade-item {
        width: auto;
        padding: 8px 16px;
        border-left: none;
        border-radius: 20px;
        flex-shrink: 0;
        font-size: 14px;
        border: 1px solid #dee2e6;
        margin: 0;
    }

    .grade-item.active {
        background: #FF6B35;
        color: #fff;
        border-color: #FF6B35;
    }

    .grade-item:hover {
        transform: none;
        background: #FF6B35;
        color: #fff;
    }

    .content-area {
        padding: 12px;
        border-radius: 8px;
    }

    .semester-tabs {
        margin: 10px;
    }

    .folder-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .folder-item {
        padding: 8px 4px;
        min-height: 60px;
    }

    .folder-icon {
        font-size: 24px;
        margin-bottom: 4px;
    }

    .folder-name {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .folder-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;
    }

    .folder-item {
        padding: 4px 2px;
        min-height: 50px;
    }

    .folder-name {
        font-size: 11px;
    }

    .folder-icon {
        font-size: 20px;
    }
}

/* 登录/注册弹窗样式 */
.login-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); display: flex; align-items: center;
    justify-content: center; z-index: 10000;
}
.login-modal-content {
    background: #fff; border-radius: 12px; width: 90%; max-width: 360px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3); overflow: hidden;
}
.login-modal-header {
    background: linear-gradient(135deg,#FF6B35,#F7931E); color: #fff;
    padding: 16px 20px; display: flex; justify-content: space-between; align-items: center;
}
.login-modal-header h3 { margin: 0; font-size: 16px; font-weight: 600; }
.login-modal-close { font-size: 24px; cursor: pointer; line-height: 1; opacity: .8; transition: opacity .3s; }
.login-modal-close:hover { opacity: 1; }
.login-tabs { display: flex; background: #f8f9fa; border-bottom: 1px solid #e9ecef; }
.login-tab {
    flex: 1; padding: 12px 16px; background: none; border: none; color: #666;
    font-size: 14px; font-weight: 500; cursor: pointer; transition: all .3s ease;
}
.login-tab.active { background: #fff; color: #FF6B35; border-bottom: 2px solid #FF6B35; }
.login-form { display: none; padding: 20px; }
.login-form.active { display: block; }
.form-group { margin-bottom: 16px; }
.form-input {
    width: 100%; padding: 12px 16px; border: 1px solid #ddd; border-radius: 8px;
    font-size: 14px; transition: border-color .3s ease; box-sizing: border-box;
}
.form-input:focus { outline: none; border-color: #FF6B35; box-shadow: 0 0 0 2px rgba(255,107,53,.1); }
.captcha-group { display: flex; gap: 8px; }
.captcha-input { flex: 1; }
.captcha-img { width: 80px; height: 44px; border-radius: 6px; cursor: pointer; border: 1px solid #ddd; }
.submit-btn {
    width: 100%; background: linear-gradient(135deg,#FF6B35,#F7931E); color: #fff; border: none;
    border-radius: 8px; padding: 12px; font-size: 14px; font-weight: 600; cursor: pointer;
    transition: all .3s ease; margin-top: 8px;
}
.submit-btn:hover { background: linear-gradient(135deg,#E55A2B,#E68A1A); transform: translateY(-1px); }
.submit-btn:disabled { background: #ccc; cursor: not-allowed; transform: none; }

/* 错误弹窗样式 */
.error-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); display: flex; align-items: center;
    justify-content: center; z-index: 10001;
}
.error-modal-content {
    background: #fff; border-radius: 12px; width: 85%; max-width: 320px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3); overflow: hidden;
    animation: errorModalSlideIn .3s ease-out;
}
@keyframes errorModalSlideIn {
    from { opacity: 0; transform: scale(.8) translateY(-20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.error-modal-header {
    background: linear-gradient(135deg,#ff6b6b,#ee5a52); color: #fff;
    padding: 16px 20px; display: flex; align-items: center; gap: 12px;
}
.error-icon { font-size: 20px; }
.error-modal-header h3 { margin: 0; font-size: 16px; font-weight: 600; flex: 1; }
.error-modal-close { font-size: 24px; cursor: pointer; line-height: 1; opacity: .8; transition: opacity .3s; }
.error-modal-close:hover { opacity: 1; }
.error-modal-body { padding: 24px 20px; text-align: center; }
 { margin: .error-modal-body p0; color: #333; font-size: 14px; line-height: 1.5; }
.error-modal-footer { padding: 0 20px 20px; text-align: center; }
.error-btn {
    background: linear-gradient(135deg,#ff6b6b,#ee5a52); color: #fff; border: none;
    border-radius: 20px; padding: 12px 32px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.error-btn:hover { background: linear-gradient(135deg,#ee5a52,#d63031); transform: translateY(-1px); }

@media (max-width: 480px) {
    .login-modal-content { width: 95%; margin: 0 10px; max-width: 320px; }
    .form-input { padding: 10px 12px; font-size: 16px; }
    .captcha-img { width: 70px; height: 40px; }
}

/* PC端隐藏移动端元素 */
@media (min-width: 992px) {
    .mobile-bottom-bar-icons {
        display: none !important;
    }
}

/* 页脚 */
footer.bg-light {
    background: #f8f9fa;
}
