/* ================= 全局基础样式 ================= */
* {
    box-sizing: border-box; /* 关键：防止padding撑大元素 */
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #eef2f5;
    color: #333;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: block; 
}

/* ================= 核心容器 ================= */
.container {
    background-color: #ffffff;
    padding: 30px;
    
    width: 92%;         /* 手机端占92% */
    max-width: 450px;   /* 电脑端限制最大宽度 */
    margin: 85px auto 100px auto; /* 上85(避开公告), 左右自动, 下100(避开结算栏) */
    
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 1;
    transition: margin-top 0.3s ease; /* 增加过渡动画，关闭公告时更顺滑 */
}

h2 {
    color: #1a73e8;
    text-align: center;
    margin-bottom: 30px;
    font-weight: 700;
    border-bottom: 2px solid #f0f4f7;
    padding-bottom: 15px;
}

/* ================= 表单元素 ================= */
input[type="text"],
input[type="password"],
select {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid #dcdfe6;
    border-radius: 10px;
    font-size: 16px;
    background-color: #f7f9fb;
    transition: all 0.3s;
}

input:focus,
select:focus {
    border-color: #1a73e8;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
    outline: none;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 0.95em;
}

/* ================= 按钮样式 ================= */
.btn-primary {
    background-color: #1a73e8;
    color: white;
    padding: 15px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    width: 100%;
    font-size: 18px;
    font-weight: 600;
    transition: background-color 0.3s, transform 0.1s;
    margin-top: 10px;
    display: block;
}

.btn-primary:hover {
    background-color: #1558b3;
}
.btn-primary:active {
    transform: translateY(1px);
}

/* ================= 课程列表与多选框 ================= */
#courseList {
    margin-top: 20px;
}

.course-item {
    cursor: pointer;
    position: relative;
    padding: 15px;
    margin-bottom: 12px;
    border-left: 5px solid #4285f4;
    border-radius: 8px;
    background-color: #ffffff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.course-item:hover {
    background-color: #f6f8fa;
    transform: translateY(-2px);
}

.checkbox-wrapper {
    margin-right: 15px;
    display: flex;
    align-items: center;
}

.checkbox-wrapper input[type="checkbox"] {
    transform: scale(1.3);
    cursor: pointer;
}

.course-name {
    font-weight: 600;
    color: #333;
    flex-grow: 1;
}

.select-all-bar {
    padding: 10px 5px;
    display: none;
    align-items: center;
    font-size: 14px;
    color: #666;
    margin-top: 10px;
    border-bottom: 1px solid #eee;
}

/* ================= 平台提示与消息 (已修复上下居中) ================= */
.platform-tip {
    margin-top: 8px;
    padding: 10px 12px; /* 调整内边距 */
    background-color: #e8f0fe;
    border-left: 4px solid #1a73e8;
    color: #174ea6;
    font-size: 13px;
    line-height: 1.5;
    border-radius: 4px;
    font-weight: 500;
    
    /* --- 修复点：使用Flexbox垂直居中 --- */
    display: flex;
    align-items: center;
    min-height: 44px; /* 保证最小高度，视觉更平衡 */
}

#message {
    text-align: center;
    margin-top: 20px;
    padding: 12px;
    border-radius: 8px;
    font-weight: 500;
}
.error { background-color: #fde2e6; color: #a7223b; border: 1px solid #f5c6cb; }
.success { background-color: #e6f4ea; color: #1e8e3e; border: 1px solid #c3e6cb; }

/* ================= 顶部通知栏 ================= */
.notification-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #e8f0fe;
    color: #1967d2;
    padding: 12px 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 9999;
    font-size: 14px;
    line-height: 1.5;
}

.notification-content {
    display: flex;
    align-items: flex-start;
    flex: 1;
    margin-right: 10px;
}
.notification-icon { margin-right: 8px; }
.close-notification {
    background: transparent;
    border: none;
    color: #1967d2;
    font-size: 22px;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
    opacity: 0.6;
}

/* ================= 底部结算悬浮栏 ================= */
.footer-bar {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100%;
    z-index: 9999;
    
    background: #ffffff;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.1);
    padding: 12px 20px;
    
    display: none;
    justify-content: space-between;
    align-items: center;
}

.footer-info {
    font-size: 16px;
    color: #333;
}
.footer-info span {
    color: #1a73e8;
    font-weight: 800;
    font-size: 20px;
}

.btn-checkout {
    background-color: #1a73e8;
    color: white;
    padding: 10px 30px;
    border: none;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin: 0;
}
.btn-checkout:hover { background-color: #1558b3; }

/* ================= 移动端适配 ================= */
@media (max-width: 480px) {
    .container {
        padding: 25px 20px; /* 小屏幕内边距减小 */
    }

    /* --- 修复点：移动端首页顶部间距增加 --- */
    /* 仅当容器有这个类时生效，防止影响order页面 */
    .container.index-page-margin {
        margin-top: 165px; /* 增加到165px，防止4-5行公告遮挡 */
    }
}