/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #f5f7fa;
    padding: 10px;
    font-family: "Helvetica Neue",sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

/* 主卡片样式 */
.main-card {
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
    padding: 15px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    body {
        padding: 5px;
        font-size: 13px;
    }
    
    .main-card {
        padding: 10px;
    }
}

/* 电脑端样式 - 大于800px时隐藏星期按钮，显示所有课程 */
@media (min-width: 800px) {
    /* 隐藏星期选择按钮 */
    .week-buttons {
        display: none !important;
    }
    
    /* 电脑端直接显示所有课程 */
    #day-course-content {
        display: block;
    }
}

/* 移动端样式 - 小于800px时显示星期按钮 */
@media (max-width: 799px) {
    /* 星期选择按钮横向排列，一排显示五个，无间距 */
    .week-buttons {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 0 !important;
        margin: 15px 0 !important;
        padding: 0 !important;
    }
    
    /* 按钮样式调整，去除间距 */
    .week-buttons .btn {
        margin-right: 0 !important;
        margin-bottom: 0 !important;
        flex: 1 !important;
        text-align: center;
        border-radius: 0 !important;
    }
    
    /* 第一个按钮添加左圆角 */
    .week-buttons .btn:first-child {
        border-radius: 4px 0 0 4px !important;
    }
    
    /* 最后一个按钮添加右圆角 */
    .week-buttons .btn:last-child {
        border-radius: 0 4px 4px 0 !important;
    }
}

/* 确保成绩课程名过长时显示省略号 */
.grade-course {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* 卡片头部 */
.card-header {
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ebeef5;
}

/* 标签页样式 */
.tabs {
    display: flex;
    border-bottom: 1px solid #ebeef5;
    margin-bottom: 20px;
}

.tab-item {
    padding: 10px 20px;
    cursor: pointer;
    color: #606266;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.tab-item.active {
    color: #409eff;
    border-bottom-color: #409eff;
    font-weight: 500;
}

/* 二维码容器 */
.qr-wrapper {
    position: relative;
    width: 200px;
    height: 200px;
    border: 1px solid #dcdfe6;
    padding: 10px;
    background: #fff;
    margin: 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 二维码图片 */
.qr-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

/* 二维码遮罩层 */
.qr-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* 加载状态 */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #409eff;
}

.loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #409eff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 成功图标 */
.success-icon {
    color: #67C23A;
    font-size: 40px;
    margin-bottom: 10px;
}

/* 表单样式 */
.form {
    max-width: 300px;
    margin: 30px auto;
}

.form-item {
    margin-bottom: 15px;
}

.form-label {
    display: inline-block;
    width: 60px;
    font-size: 14px;
    color: #606266;
    margin-bottom: 5px;
}

.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: #409eff;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    margin-right: 10px;
    margin-bottom: 10px;
}

.btn-primary {
    background-color: #409eff;
    color: #fff;
}

.btn-primary:hover {
    background-color: #66b1ff;
}

.btn-success {
    background-color: #67c23a;
    color: #fff;
    padding: 12px 24px;
    font-size: 16px;
}

.btn-success:hover {
    background-color: #85ce61;
}

.btn-danger {
    background-color: transparent;
    color: #f56c6c;
    border-color: #f56c6c;
}

.btn-danger:hover {
    background-color: #fef0f0;
}

.btn-secondary {
    background-color: #606266;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #86888c;
}

/* 小按钮样式 */
.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
    line-height: 1.5;
    border-radius: 3px;
}

.btn-link {
    background-color: transparent;
    color: #409eff;
    border: none;
    padding: 0;
    margin: 0;
}

.btn-link:hover {
    color: #66b1ff;
}

/* 用户信息样式 */
.user-info {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #fff;
    border: 1px solid #ebeef5;
    border-radius: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: bold;
    margin-bottom: 2px;
    font-size: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-status {
    font-size: 12px;
    color: #909399;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 进度条 */
.progress {
    width: 100%;
    height: 10px;
    background-color: #ecf5ff;
    border-radius: 5px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-bar {
    height: 100%;
    background-color: #409eff;
    transition: width 0.3s;
}

/* 表格样式 */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.table th,
.table td {
    padding: 8px 12px;
    border: 1px solid #ebeef5;
    text-align: left;
}

.table th {
    background-color: #f5f7fa;
    font-weight: 500;
    color: #606266;
}

/* 标签样式 */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 2px;
    font-size: 12px;
}

.tag-success {
    background-color: #f0f9eb;
    color: #67c23a;
}

.tag-danger {
    background-color: #fef0f0;
    color: #f56c6c;
}

/* API日志样式 */
.api-log {
    font-size: 11px;
    background: #272822;
    color: #f8f8f2;
    padding: 8px;
    border-radius: 4px;
    max-height: 60px;
    overflow: auto;
    margin: 0;
}

/* 状态文本 */
.status-text {
    color: #909399;
    font-size: 13px;
    margin: 10px 0;
}

/* 头像和昵称 */
.user-avatar-section {
    margin-bottom: 10px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-bottom: 5px;
}

.user-nickname {
    margin: 5px 0;
    font-size: 14px;
}

/* 消息提示 */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    z-index: 1000;
    animation: fadeInOut 3s ease-in-out;
}

.message-success {
    background-color: #67c23a;
}

.message-error {
    background-color: #f56c6c;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(-20px); }
    10% { opacity: 1; transform: translateY(0); }
    90% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-20px); }
}

/* 内容区域 */
.content-section {
    margin-top: 20px;
    min-height: 200px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #ebeef5;
}

.content-section.hidden {
    display: none;
}

/* 按钮组 */
.btn-group {
    margin-bottom: 15px;
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    justify-content: flex-start;
    align-items: center;
}

/* 课表容器样式 */
.kebiao-container {
    margin: 15px 0;
}

/* 周末课程样式 */
.kebiao-weekend {
    margin-bottom: 20px;
    padding: 15px;
    background: #f0f9eb;
    border-radius: 8px;
    border: 1px solid #e1f3d8;
}

.weekend-content {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

/* 工作日课程样式 */
.kebiao-weekdays {
    padding: 0;
    background: transparent;
    border-radius: 0;
    border: none;
    margin: 0;
}

.weekdays-content {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    flex-wrap: wrap;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    /* 大屏幕 */
    .weekdays-content {
        gap: 10px;
    }
    
    .kebiao_week_1,
    .kebiao_week_2,
    .kebiao_week_3,
    .kebiao_week_4,
    .kebiao_week_5 {
        min-height: 250px;
    }
}

@media (max-width: 992px) {
    /* 中等屏幕 */
    .weekdays-content {
        gap: 8px;
    }
    
    .kebiao_week_1,
    .kebiao_week_2,
    .kebiao_week_3,
    .kebiao_week_4,
    .kebiao_week_5 {
        min-height: 200px;
        padding: 8px;
    }
    
    .kebiao-item {
        min-height: 70px;
        height: auto;
        padding: 10px;
    }
}

@media (max-width: 768px) {
    /* 小屏幕 */
    .weekdays-content {
        flex-direction: column;
    }
    
    .kebiao_week_1,
    .kebiao_week_2,
    .kebiao_week_3,
    .kebiao_week_4,
    .kebiao_week_5 {
        min-height: auto;
        width: 100%;
    }
    
    /* 顶部选择和网课区域在小屏幕上垂直排列 */
    #content3 > div:first-of-type {
        flex-direction: column;
    }
    
    /* 课表项适应小屏幕 */
    .kebiao-item {
        min-height: 60px;
        height: auto;
        padding: 8px;
    }
}

@media (max-width: 576px) {
    /* 超小屏幕 */
    .kebiao-item {
        min-height: 50px;
        padding: 6px;
        font-size: 13px;
    }
    
    /* 统一顶部选择和网课区域的内边距 */
    #content3 > div:first-of-type {
        padding: 0;
    }
}

/* 单日课程样式 - 改为Flex容器，确保内部课表项高度统一 */
.kebiao_week_1,
.kebiao_week_2,
.kebiao_week_3,
.kebiao_week_4,
.kebiao_week_5,
.kebiao_week_6,
.kebiao_week_7 {
    flex: 1;
    background: #fff;
    padding: 10px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    min-height: 300px;
    max-width: 100%;
    display: flex;
    flex-direction: column;
}

/* 统一的课表项样式，使用Flexbox实现高度统一 */
.kebiao-item {
    margin: 10px 0;
    padding: 12px;
    border-radius: 6px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    text-overflow: ellipsis;
    background: #f5f7fa;
}

/* 无课的课表项样式 */
.kebiao-item.empty {
    background: #f9f9f9;
    color: #909399;
    font-size: 12px;
}

/* 网课区域样式 - 只显示白色内容部分 */
.kebiao-netclass {
    flex: 1;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    min-height: auto;
}

.kebiao-netclass h3 {
    margin: 5px 0;
    font-size: 16px;
    color: #303133;
    font-weight: 500;
}

.kebiao-netclass #netclass-content {
    margin-top: 5px;
    flex: 1;
    display: flex;
    align-items: center;
}

/* 课表顶部区域样式 */
.kebiao-top-section {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* 课表选择区域样式 */
.kebiao-select-area {
    flex: 1;
    min-width: 300px;
}

/* 网课内容项样式 */
.kebiao-netclass .netclass-item {
    margin: 0;
    padding: 8px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    height: 40px;
    display: flex;
    align-items: center;
    width: 100%;
    overflow: hidden;
}

/* 选择框容器样式 */
.kebiao-select-area > div:first-child {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

/* 推送按钮和网课容器样式 - 强制一行显示 */
.kebiao-select-area > div:last-child {
    display: flex !important;
    gap: 10px;
    align-items: center;
    flex-wrap: nowrap !important;
}

/* 下拉框样式 */
.kebiao-select-area select {
    min-width: 150px;
    margin-bottom: 0;
}

/* 推送按钮样式 - 固定宽度 */
.kebiao-select-area .btn {
    white-space: nowrap;
    margin-bottom: 0;
    padding: 6px 12px;
    font-size: 14px;
    width: 80px; /* 固定宽度 */
    text-align: center;
}

/* 网课区域样式 - 占满剩余空间 */
.kebiao-netclass {
    flex: 1 !important;
    min-width: 0;
    display: block;
}

/* 网课内容样式 */
.kebiao-netclass #netclass-content {
    width: 100%;
}

/* 确保推送按钮和网课内容在所有情况下都在一行 */
@media (max-width: 768px) {
    /* 覆盖移动端样式，确保推送按钮和网课内容在一行 */
    .kebiao-select-area > div:last-child {
        display: flex !important;
        flex-wrap: nowrap !important;
    }
    
    /* 推送按钮和网课内容区域在一行显示 */
    .kebiao-select-area .btn,
    .kebiao-netclass {
        margin-bottom: 0 !important;
    }
    
    /* 网课区域占满剩余空间 */
    .kebiao-netclass {
        flex: 1 !important;
    }
}

.kebiao-netclass .netclass-item .netclass-text {
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.kebiao-netclass .netclass-item .netclass-empty {
    color: #909399;
    white-space: nowrap;
    margin: 0 auto;
}

/* 响应式调整顶部区域 */
@media (max-width: 768px) {
    .kebiao-top-section {
        flex-direction: column;
    }
    
    .kebiao-select-area {
        min-width: auto;
    }
    
    .kebiao-netclass {
        min-height: auto;
    }
}

/* 成绩统计样式 */
.grade-stats {
    display: flex;
    gap: 20px;
    margin: 15px 0;
    padding: 15px;
    background-color: #ecf5ff;
    border: 1px solid #c6e2ff;
    border-radius: 6px;
    font-size: 16px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-label {
    color: #606266;
}

.stat-value {
    font-weight: bold;
    color: #409eff;
    font-size: 18px;
}

/* 成绩列表样式 */
.cehngji_ul {
    list-style-type: none;
    padding: 0;
    margin: 10px 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    transition: grid-template-columns 0.3s ease;
}

/* 网格布局类 */
.cehngji_ul.grid-1 {
    grid-template-columns: 1fr;
}

.cehngji_ul.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.cehngji_ul.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.cehngji_ul.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.grade-item {
    background-color: #fff;
    border: 1px solid #ebeef5;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.grade-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-color: #dcdfe6;
}

.grade-course {
    font-weight: 500;
    font-size: 15px;
    margin-bottom: 10px;
    color: #303133;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    display: block;
}

.grade-info {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 14px;
    color: #606266;
    flex: 1;
    align-items: flex-end;
}

.grade-info span {
    display: inline-block;
    padding: 4px 8px;
    background-color: #f5f7fa;
    border-radius: 4px;
    white-space: nowrap;
}

.grade-score {
    color: #409eff;
    font-weight: 500;
}

.grade-point {
    color: #67c23a;
    font-weight: 500;
}

.grade-credit {
    color: #e6a23c;
    font-weight: 500;
}

/* 选择框样式 */
select {
    padding: 8px 12px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
    margin-right: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color 0.3s;
    min-width: 150px;
}

select:hover {
    border-color: #c6e2ff;
}

select:focus {
    outline: none;
    border-color: #409eff;
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
}

/* 响应式设计 - 针对移动端优化 */
/* 成绩列表响应式布局 - 全局媒体查询 */
/* 宽度小于900px时，最多显示3个 */
@media (max-width: 899px) {
    .cehngji_ul.grid-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 宽度小于650px时，最多显示2个 */
@media (max-width: 649px) {
    .cehngji_ul.grid-3,
    .cehngji_ul.grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* 确保grid-2类在650px以下也显示2个 */
    .cehngji_ul.grid-2 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* 宽度小于400px时，显示1个 */
@media (max-width: 399px) {
    .cehngji_ul.grid-2,
    .cehngji_ul.grid-3,
    .cehngji_ul.grid-4 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    /* 普通按钮在移动端占满宽度，但成绩查询按钮除外 */
    .btn:not(#chaxun):not([onclick="pushChengji()"]) {
        margin-right: 0;
        margin-bottom: 8px;
    }
    
    /* 成绩查询和推送按钮保持在同一行 */
    #chaxun, [onclick="pushChengji()"] {
        width: auto;
        display: inline-block;
        margin-right: 10px;
        margin-bottom: 10px;
    }
    
    /* 第二个下拉框取消右边距 */
    #content2 select:last-child {
        margin-right: 0;
    }
    
    /* 成绩查询页面的按钮样式 */
    #content2 #chaxun {
        background-color: #409eff;
        color: white;
        border: none;
        padding: 8px 16px;
        border-radius: 4px;
        cursor: pointer;
        font-size: 14px;
    }
    
    #content2 [onclick="pushChengji()"] {
        background-color: #606266;
        color: white;
        border: none;
        padding: 8px 16px;
        border-radius: 4px;
        cursor: pointer;
        font-size: 14px;
    }
    
    /* 标题字体大小响应式调整 */
    h3 {
        font-size: 18px;
        margin: 10px 0;
    }
    
    h4 {
        font-size: 16px;
        margin: 8px 0;
    }
    
    /* 卡片头部字体大小调整 */
    .card-header {
        font-size: 16px;
        padding-bottom: 8px;
    }
    
    /* 课表顶部区域在移动端垂直排列 */
    .kebiao-top-section {
        flex-direction: column;
        gap: 10px;
    }
    
    /* 课表选择区域在移动端占满宽度 */
    .kebiao-select-area {
        width: 100%;
        min-width: auto;
    }
    
    /* 两个下拉框在一行显示 */
    .kebiao-select-area > div {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        align-items: center;
    }
    
    /* 下拉框样式调整，占满剩余空间 */
    .kebiao-select-area select {
        flex: 1;
        min-width: 120px;
        margin-right: 0;
        margin-bottom: 0;
        width: auto;
    }
    
    /* 推送按钮变小，节省空间 */
    .kebiao-select-area .btn {
        padding: 4px 8px !important;
        font-size: 12px !important;
        margin-right: 0 !important;
        white-space: nowrap;
        width: auto;
        margin-bottom: 0 !important;
    }
    
    /* 推送当周课表按钮和网课内容区域在一行显示 */
    .kebiao-select-area {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    /* 网课区域占满宽度 */
    .kebiao-netclass {
        width: 100%;
        display: flex;
        align-items: center;
    }
}

@media (max-width: 576px) {
    /* 超小屏幕字体大小调整 */
    body {
        font-size: 12px;
    }
    
    h3 {
        font-size: 16px;
    }
    
    h4 {
        font-size: 14px;
    }
    
    /* 按钮字体大小调整 */
    .btn {
        font-size: 13px;
        padding: 6px 12px;
    }
    
    /* 选择框字体大小调整 */
    select {
        font-size: 13px;
        padding: 6px 10px;
    }
}
