/* 课栈APP及其所属功能的数字版权属于 ioll.top 及其所有者 */
/* 课程表 | 课栈 为课栈APP所属功能之一 */
:root {
    /* 苹果液态玻璃色系变量 */
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.07);
    --text-main: #1d1d1f;
    --text-secondary: #86868b;
    --accent-purple: #bf5af2;
    --accent-blue: #007aff;
    --accent-green: #30d158;
    --accent-pink: #ff375f;
    --accent-yellow: #ffd60a;
    --accent-orange: #ff9500;
    --accent-red: #ff3b30;
    --accent-brown: #a2845e;
    --accent-coral: #ff6b6b;

    /* 课程颜色渐变 */
    --c-green-grad: linear-gradient(135deg, #30d158, #34c759);
    --c-purple-grad: linear-gradient(135deg, #bf5af2, #af52de);
    --c-pink-grad: linear-gradient(135deg, #ff375f, #ff2d55);
    --c-blue-grad: linear-gradient(135deg, #007aff, #5ac8fa);
    --c-yellow-grad: linear-gradient(135deg, #ffd60a, #ffcc00);
    --c-orange-grad: linear-gradient(135deg, #ff9500, #ff9f0a);
    --c-red-grad: linear-gradient(135deg, #ff3b30, #ff453a);
    --c-brown-grad: linear-gradient(135deg, #a2845e, #b3936c);
    --c-coral-grad: linear-gradient(135deg, #ff6b6b, #ff7575);

    /* 功能色 */
    --primary-purple: #bf5af2;
    --bg-light: #f5f5f7;
    --text-dark: #1d1d1f;
    --text-gray: #86868b;
    --border-color: rgba(0,0,0,0.08);
    --week-select-color: #bf5af2;
}

* {
    margin: 0; 
    padding: 0; 
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
}

body {
    /* 极光流体背景 - 苹果风格 */
    background:
        radial-gradient(at 0% 0%, hsla(253, 68%, 58%, 0.15) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 0.12) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 0.1) 0, transparent 50%),
        radial-gradient(at 80% 50%, hsla(189, 100%, 56%, 0.1) 0px, transparent 50%),
        radial-gradient(at 0% 50%, hsla(340, 100%, 76%, 0.1) 0px, transparent 50%),
        radial-gradient(at 80% 100%, hsla(323, 100%, 39%, 0.1) 0px, transparent 50%),
        radial-gradient(at 0% 100%, hsla(242, 100%, 77%, 0.1) 0px, transparent 50%);
    background-color: #f5f5f7;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    padding-top: 64px; /* 为固定状态栏留出空间 */
    padding-bottom: 100px; /* 为底部导航栏留出空间 */
    -webkit-touch-callout: none; /* iOS Safari */
    -webkit-user-select: none;   /* Safari */
    -khtml-user-select: none;    /* Konqueror HTML */
    -moz-user-select: none;      /* Firefox */
    -ms-user-select: none;       /* Internet Explorer/Edge */
    user-select: none;
}

/* 隐藏滚动条 - WebKit */
::-webkit-scrollbar {
    display: none; /* Chrome、Safari 和 Opera */
}



/* 顶部状态栏 - 液态玻璃效果 - 固定悬浮在页面上方 */
.course-status-float {
    position: fixed;
    top: 7px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    padding: 14px 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    will-change: transform;
    
    /* 高级液态玻璃效果 */
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 0px solid rgba(255, 255, 255, 0.4);
    border-radius: 30px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        inset 0 -1px 0 rgba(0, 0, 0, 0.05);
    
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 200; /* 确保在最上层 */
}

.course-status-float:hover {
    transform: translateX(-50%) scale(1.02);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(0, 0, 0, 0.08);
}

.course-status-float:active {
    transform: translateX(-50%) scale(0.98);
}

.course-status-float.week-change-notification {
    background: rgba(191, 90, 242, 0.9) !important;
    color: white !important;
    transform: translateX(-50%) scale(1.05) !important;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

/* 确保通知状态下的hover效果 */
.course-status-float.week-change-notification:hover {
    transform: translateX(-50%) scale(1.07) !important;
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1) !important;
}

.course-status-float.week-change-notification:active {
    transform: translateX(-50%) scale(1.0) !important;
}

.course-status-float.status-active {
    background: rgba(255, 255, 255, 0.9);
    color: #007aff;
}

.course-status-float.status-next {
    background: rgba(255, 255, 255, 0.8);
    color: #5856d6;
}

.course-status-float.status-free {
    background: rgba(255, 255, 255, 0.7);
    color: var(--text-main);
}

/* 确保通知样式优先 */
.course-status-float.week-change-notification {
    pointer-events: none !important; /* 通知期间禁用点击 */
}

/* 恢复后的样式 */
.course-status-float:not(.week-change-notification) {
    pointer-events: auto !important;
}

/* 可滚动内容区域 */
.scrollable-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 170px); /* 计算可用的滚动空间 */
}

/* 周数栏 - 液态玻璃效果 - 跟随滚动 */
.week-bar {
    display: grid;
    grid-template-columns: 48px repeat(7, 1fr);
    padding: 0px 0;
    margin: 0 15px 5px;
    
    /* 玻璃效果 */
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    
    flex-shrink: 0;
}

.week-number-cell {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-purple);
    cursor: pointer;
    padding: 3px 0;
    border-radius: 17px;
    transition: all 0.3s ease;
    margin: 0 1px;
    text-align: center;
}

.week-number-cell:hover {
    background: rgba(191, 90, 242, 0.1);
    transform: scale(1.05);
}

.week-number-cell span {
    font-size: 15px;
    font-weight: 500;
    margin-top: 0px;
    opacity: 0.8;
}

.week-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--text-secondary);
    padding: 8px 0;
    border-radius: 12px;
    transition: all 0.3s ease;
    text-align: center;
}

.week-day .day-name {
    font-weight: 600;
    margin-bottom: 3px;
    font-size: 13px;
}

/* 当前日高亮 - iOS日历风格 */
.week-day.active {
    color: var(--accent-blue);
}

.week-day.active .day-name {
    background: var(--accent-blue);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

/* 课表主体容器 - 跟随滚动 */
.schedule-container {
    flex: 1;
    position: relative;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 15px;
    border-radius: 20px;
    padding: 0px;
    
    /* 玻璃效果 */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    
    min-height: 400px;
    overflow: hidden;
    will-change: transform; /* 优化动画性能 */
}

.schedule-grid {
    display: grid;
    grid-template-columns: 50px repeat(7, 1fr);
    grid-template-rows: repeat(12, auto);
    position: relative;
    min-height: 100%;
    gap: 0;
}

/* 时间轴 */
.time-slot {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 11px;
    color: var(--text-secondary);
    min-height: 80px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    border-right: 1px solid rgba(0,0,0,0.05);
    padding: 10px 0;
    font-variant-numeric: tabular-nums;
    background: rgba(255, 255, 255, 0.3);
}

.time-slot .slot-num {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-main);
    margin-bottom: 2px;
}

/* 网格线 - 极细弱化 */
.grid-cell {
    border-bottom: 1px solid rgba(0,0,0,0.03);
    border-right: 1px solid rgba(0,0,0,0.03);
    position: relative;
    transition: background 0.2s;
    cursor: pointer;
    min-height: 68px;
    background: rgba(255, 255, 255, 0.2);
    -webkit-tap-highlight-color: transparent; /* 移除点击高亮 */
    touch-action: pan-x pan-y; /* 允许平移滚动 */
}

.grid-cell:hover {
    background: rgba(0,0,0,0.02);
}

/* 课程卡片 - 液态玻璃核心效果 */
.course-block {
    margin: 2px;
    padding: 8px 10px;
    border-radius: 14px;
    color: white;
    font-size: 11px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    z-index: 5;
    
    /* 液态玻璃效果 */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.15),
        inset 0 1px 1px rgba(255, 255, 255, 0.3),
        inset 0 -2px 4px rgba(0, 0, 0, 0.1);
    
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    touch-action: auto; /* 允许所有触摸操作 */
}

.course-block:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.2),
        inset 0 1px 1px rgba(255, 255, 255, 0.4),
        inset 0 -2px 4px rgba(0, 0, 0, 0.15);
}

.course-block:active {
    transform: scale(0.97);
}

.course-name {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 3px;
    line-height: 1.3;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

.course-info {
    font-size: 10px;
    opacity: 0.9;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
    line-height: 1.2;
}

/* 课程颜色变种 */
.c-green { background: var(--c-green-grad); }
.c-purple { background: var(--c-purple-grad); }
.c-pink { background: var(--c-pink-grad); }
.c-blue { background: var(--c-blue-grad); }
.c-yellow { 
    background: var(--c-yellow-grad);
    color: #1d1d1f;
}
.c-yellow .course-info {
    color: rgba(29, 29, 31, 0.9);
}
.c-orange { background: var(--c-orange-grad); }
.c-red { background: var(--c-red-grad); }
.c-brown { background: var(--c-brown-grad); }
.c-coral { background: var(--c-coral-grad); }

/* 底部导航栏 - 液态玻璃 - 固定悬浮 */
.bottom-nav {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    height: 65px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-radius: 35px;
    z-index: 200; /* 确保在最上层 */
    
    /* 高级玻璃效果 */
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    
    transition: all 0.3s ease;
}

.bottom-nav:hover {
    box-shadow: 
        0 15px 50px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-secondary);
    font-size: 10px;
    width: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    padding: 8px 0;
    border-radius: 12px;
}

.nav-icon {
    width: 22px;
    height: 22px;
    margin-bottom: 3px;
    background-color: currentColor;
    mask-size: contain;
    -webkit-mask-size: contain;
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-position: center;
}

/* 简单的图标掩模 */
.icon-schedule {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 3h-1V1h-2v2H8V1H6v2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V9h14v10zM5 7V5h14v2H5z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 3h-1V1h-2v2H8V1H6v2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V9h14v10zM5 7V5h14v2H5z'/%3E%3C/svg%3E");
}

.icon-time {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2zm0 18c-4.4 0-8-3.6-8-8s3.6-8 8-8 8 3.6 8 8-3.6 8-8 8zm.5-13H11v6l5.2 3.2.8-1.3-4.5-2.7V7z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2zm0 18c-4.4 0-8-3.6-8-8s3.6-8 8-8 8 3.6 8 8-3.6 8-8 8zm.5-13H11v6l5.2 3.2.8-1.3-4.5-2.7V7z'/%3E%3C/svg%3E");
}

.nav-item:hover {
    color: var(--accent-purple);
    background: rgba(191, 90, 242, 0.1);
}

.nav-item.active {
    color: var(--accent-purple);
    transform: translateY(-3px);
}

.nav-item.active .nav-icon {
    transform: scale(1.1);
}

/* ========== 弹窗样式 - iOS Action Sheet 风格 ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 999;
    display: none;
    justify-content: center;
    align-items: flex-end;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    width: 100%;
    max-width: 500px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-radius: 24px 24px 0 0;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 -20px 80px rgba(0, 0, 0, 0.2);
    
    /* 使用阻尼感缓动函数，从快到慢 */
    animation: modalSlideUp 0.3s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
    
    max-height: 90vh;
    overflow-y: auto;
    margin-bottom: 0;
}

@keyframes modalSlideUp {
    0% { 
        transform: translateY(100%);
        opacity: 0;
    }
    100% { 
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes modalSlideDown {
    0% { 
        transform: translateY(0);
        opacity: 1;
    }
    100% { 
        transform: translateY(120%);
        opacity: 0;
    }
}

.modal-header {
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-main);
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    margin-left: 4px;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.8);
    font-size: 15px;
    color: var(--text-main);
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-purple);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 3px rgba(191, 90, 242, 0.1);
}

/* 按钮样式 */
.btn-function {
    width: 100%;
    padding: 12px 15px;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    margin-bottom: 8px;
}

.btn-function:hover {
    background-color: rgba(191, 90, 242, 0.05);
    border-color: var(--accent-purple);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.btn-function:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.btn {
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-save {
    background: var(--accent-purple);
    color: white;
}

.btn-save:hover {
    background: #a352d6;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(191, 90, 242, 0.3);
}

.btn-cancel {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
}

.btn-cancel:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.btn-delete {
    background: var(--accent-pink);
    color: white;
}

.btn-delete:hover {
    background: #e5334a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 55, 95, 0.3);
}

.modal-btns {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.modal-btns .btn {
    flex: 1;
    text-align: center;
}

/* 周数选择器 */
.week-selector-wrapper {
    margin: 10px 0;
}

.week-selector-btn-group {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.week-selector-btn {
    padding: 8px 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    flex: 1;
    min-width: 70px;
}

.week-selector-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--accent-purple);
    color: var(--accent-purple);
}

.week-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.week-item {
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.7);
}

.week-item:hover {
    border-color: var(--week-select-color);
    color: var(--week-select-color);
    transform: scale(1.05);
}

.week-item.selected {
    background: rgba(191, 90, 242, 0.1);
    color: var(--accent-purple);
    border-color: var(--accent-purple);
    box-shadow: 0 2px 8px rgba(191, 90, 242, 0.3);
}

/* 节次选择器 */
.section-picker {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 5px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.section-picker::-webkit-scrollbar {
    display: none;
}

.section-item {
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    cursor: pointer;
    margin: 0 auto;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.section-item:hover {
    border-color: var(--primary-purple);
    color: var(--primary-purple);
    transform: scale(1.05);
}

.section-item.selected {
    background: var(--primary-purple);
    color: white;
    border-color: var(--primary-purple);
    box-shadow: 0 2px 8px rgba(191, 90, 242, 0.3);
}

/* 颜色选择器 */
.color-picker {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.color-option {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* 颜色选项样式 */
.color-option[data-color="green"] { background: var(--c-green-grad); }
.color-option[data-color="purple"] { background: var(--c-purple-grad); }
.color-option[data-color="pink"] { background: var(--c-pink-grad); }
.color-option[data-color="blue"] { background: var(--c-blue-grad); }
.color-option[data-color="yellow"] { background: var(--c-yellow-grad); }
.color-option[data-color="orange"] { background: var(--c-orange-grad); }
.color-option[data-color="red"] { background: var(--c-red-grad); }
.color-option[data-color="brown"] { background: var(--c-brown-grad); }
.color-option[data-color="coral"] { background: var(--c-coral-grad); }

/* 周数设置模态框 */
.week-setting-form {
    padding: 10px 0;
}

.checkbox-group {
    display: flex;
    align-items: center;
    margin: 15px 0;
    cursor: pointer;
}

.custom-checkbox {
    width: 20px;
    height: 20px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
}

.custom-checkbox.checked {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
}

.custom-checkbox.checked::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* 提示弹窗 */
.alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.alert-overlay.active {
    display: flex;
    opacity: 1;
}

.alert {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    width: 80%;
    max-width: 300px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    animation: alertPop 0.3s ease-out;
}

@keyframes alertPop {
    from { 
        transform: scale(0.8); 
        opacity: 0; 
    }
    to { 
        transform: scale(1); 
        opacity: 1; 
    }
}

.alert-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-main);
}

.alert-message {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

.alert-btns {
    display: flex;
    gap: 12px;
}

.alert-btns .btn {
    flex: 1;
}

/* 双击视觉反馈 */
.grid-cell.double-tap {
    background: rgba(0, 122, 255, 0.15) !important;
    transition: all 0.15s ease;
}

.course-block.double-tap {
    transform: scale(1.02) !important;
    box-shadow: 0 0 15px rgba(0, 122, 255, 0.4) !important;
    transition: all 0.15s ease;
    z-index: 10 !important;
}

/* 长按视觉反馈 */
.grid-cell.long-press {
    transition: all 0.2s ease;
}

.course-block.long-press {
    transform: scale(0.95) !important;
    box-shadow: 0 0 20px rgba(191, 90, 242, 0.6), 
                inset 0 1px 1px rgba(255, 255, 255, 0.4) !important;
    transition: all 0.2s ease;
    z-index: 10 !important;
}

#weekselector-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: bottom;
}

#weekselector-modal.active {
    display: flex;
}

.week-selector-content {
    margin: 15px 0;
}

/* ========== 动画效果 ========== */

@keyframes slideInLeft {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutLeft {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(-100%); opacity: 0; }
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

.week-slide-left {
    animation: slideOutLeft 0.3s ease forwards;
}

.week-slide-right {
    animation: slideOutRight 0.3s ease forwards;
}

.week-slide-in-left {
    animation: slideInRight 0.3s ease forwards;
}

.week-slide-in-right {
    animation: slideInLeft 0.3s ease forwards;
}

/* 确保动画类不影响最终位置 */
.week-slide-in-left,
.week-slide-in-right {
    animation-fill-mode: forwards; /* 动画结束后保持最终状态 */
}

.swipe-hint {
    position: absolute;
    bottom: 15px;
    left: 0;
    width: 100%;
    text-align: center;
    z-index: 5;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.swipe-hint-content {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-size: 12px;
    color: var(--text-secondary);
}

.swipe-hint-dots {
    display: flex;
    gap: 4px;
    margin-left: 6px;
}

.swipe-hint-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--text-secondary);
    animation: dotPulse 1.4s infinite ease-in-out;
}

.swipe-hint-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.swipe-hint-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotPulse {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    30% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========== 响应式设计 - 移动端适配 ========== */

/* 主界面的移动端适配 */
@media (max-width: 320px) {
    body {
        padding-top: 50px;
        padding-bottom: 80px;
    }
    
    .course-status-float {
        top: 8.5px;
        padding: 8px 14px;
        font-size: 11px;
        max-width: 300px;
    }
    
    .scrollable-content {
        height: calc(100vh - 130px);
    }
    
    .week-bar {
        grid-template-columns: 48px repeat(7, 1fr);
    }
    
    .week-number-cell {
        font-size: 10px;
    }
    
    .week-day {
        font-size: 9px;
        padding: 4px 0;
    }
    
    .week-day .day-name {
        font-size: 10px;
        padding: 2px 6px;
    }
    
    .schedule-grid {
        grid-template-columns: 38px repeat(7, 1fr);
    }
    
    .time-slot {
        min-height: 65px;
        font-size: 8px;
    }
    
    .time-slot .slot-num {
        font-size: 10px;
    }
    
    .grid-cell {
        min-height: 52px;
    }
}

@media (max-width: 390px) {
    body {
        padding-top: 55px;
        padding-bottom: 85px;
    }
    
    .course-status-float {
        top: 7px;
        padding: 12px 18px;
        font-size: 12px;
        width: 95%;
        max-width: 320px;
    }
    
    .scrollable-content {
        height: calc(100vh - 140px);
    }
    
    .week-bar {
        grid-template-columns: 48px repeat(7, 1fr);
    }
    
    .week-number-cell {
        font-size: 12px;
    }
    
    .week-day {
        font-size: 10px;
    }
    
    .week-day .day-name {
        font-size: 11px;
        padding: 3px 8px;
    }
    
    .schedule-grid {
        grid-template-columns: 40px repeat(7, 1fr);
    }
    
    .time-slot {
        min-height: 70px;
        font-size: 9px;
    }
    
    .time-slot .slot-num {
        font-size: 11px;
    }
    
    .grid-cell {
        min-height: 55px;
    }
    
    .course-block {
        padding: 5px 6px;
        font-size: 9px;
    }
    
    .course-name {
        font-size: 12px;
    }
    
    .course-info {
        font-size: 9px;
        margin-bottom:1px;
    }
    
    .bottom-nav {
        height: 55px;
        bottom: 14px;
        border-radius: 30px;
    }
    
    .swipe-hint {
        bottom: 12px;
    }
    
    .swipe-hint-content {
        padding: 4px 8px;
        font-size: 10px;
    }
}

@media (min-width: 391px) and (max-width: 417px) {
    body {
        padding-top: 60px;
        padding-bottom: 90px;
    }
    
    .course-status-float {
        top: 9px;
        padding: 12px 20px;
        font-size: 13px;
        width: 95%;
        max-width: 350px;
    }
    
    .scrollable-content {
        height: calc(100vh - 150px); /* 调整移动端高度 */
    }
    
    .week-bar {
        margin: 0 10px 5px;
        padding: 6px 0;
        grid-template-columns: 48px repeat(7, 1fr);
    }
    
    .schedule-container {
        margin: 0 10px;
        padding: 0px;
    }
    
    .week-number-cell {
        font-size: 14px;
    }
    
    .week-number-cell span {
        font-size: 14px;
    }
    
    .week-day {
        font-size: 11px;
        padding: 6px 0;
    }
    
    .week-day .day-name {
        font-size: 12px;
        margin-bottom: 2px;
    }
    
    .schedule-grid {
        grid-template-columns: 45px repeat(7, 1fr);
    }
    
    .time-slot {
        min-height: 75px;
        font-size: 10px;
        padding: 8px 0;
    }
    
    .time-slot .slot-num {
        font-size: 12px;
    }
    
    .grid-cell {
        min-height: 60px;
    }
    
    .course-block {
        padding: 6px 7.2px;
        font-size: 11px;
        margin: 1px;
    }
    
    .course-name {
        font-size: 14px;
        margin-bottom: 3px;
        justify-content: center;
    }
    
    .course-info {
        font-size: 10px;
        margin-bottom:2px;
        justify-content: center;
    }
    
    .bottom-nav {
        width: 95%;
        height: 60px;
        bottom: 15px;
        max-width: 360px;
    }
    
    .nav-item {
        font-size: 9px;
        width: 45px;
    }
    
    .nav-icon {
        width: 20px;
        height: 20px;
    }
    
    .swipe-hint-content {
        padding: 5px 10px;
        font-size: 11px;
    }
    
    .swipe-hint-dot {
        width: 3px;
        height: 3px;
    }
}

@media (min-width: 417px) and (max-width: 431px) {
    body {
        padding-top: 60px;
        padding-bottom: 90px;
    }
    
    .course-status-float {
        top: 9px;
        padding: 12px 20px;
        font-size: 13px;
        width: 95%;
        max-width: 350px;
    }
    
    .scrollable-content {
        height: calc(100vh - 150px); /* 调整移动端高度 */
    }
    
    .week-bar {
        margin: 0 10px 5px;
        padding: 6px 0;
        grid-template-columns: 48px repeat(7, 1fr);
    }
    
    .schedule-container {
        margin: 0 10px;
        padding: 0px;
    }
    
    .week-number-cell {
        font-size: 14px;
    }
    
    .week-number-cell span {
        font-size: 14px;
    }
    
    .week-day {
        font-size: 11px;
        padding: 6px 0;
    }
    
    .week-day .day-name {
        font-size: 12px;
        margin-bottom: 2px;
    }
    
    .schedule-grid {
        grid-template-columns: 45px repeat(7, 1fr);
    }
    
    .time-slot {
        min-height: 75px;
        font-size: 10px;
        padding: 8px 0;
    }
    
    .time-slot .slot-num {
        font-size: 12px;
    }
    
    .grid-cell {
        min-height: 60px;
    }
    .course-block {
        padding: 6px 8px;
        font-size: 11px;
        margin: 1px;
    }

    .course-name {
        font-size: 14px;
        margin-bottom: 3px;
        justify-content: center;
    }
    
    .course-info {
        font-size: 10px;
        margin-bottom:2px;
        justify-content: center;
    }

    .bottom-nav {
        width: 95%;
        height: 60px;
        bottom: 15px;
        max-width: 360px;
    }
    
    .nav-item {
        font-size: 9px;
        width: 45px;
    }
    
    .nav-icon {
        width: 20px;
        height: 20px;
    }
    
    .swipe-hint-content {
        padding: 5px 10px;
        font-size: 11px;
    }
    
    .swipe-hint-dot {
        width: 3px;
        height: 3px;
    }
}

@media (min-width: 431px) and (max-width: 459px) {
    body {
        padding-top: 60px;
        padding-bottom: 90px;
    }
    
    .course-status-float {
        top: 9px;
        padding: 12px 20px;
        font-size: 13px;
        width: 95%;
        max-width: 350px;
    }
    
    .scrollable-content {
        height: calc(100vh - 150px); /* 调整移动端高度 */
    }
    
    .week-bar {
        margin: 0 10px 5px;
        padding: 6px 0;
        grid-template-columns: 48px repeat(7, 1fr);
    }
    
    .schedule-container {
        margin: 0 10px;
        padding: 0px;
    }
    
    .week-number-cell {
        font-size: 14px;
    }
    
    .week-number-cell span {
        font-size: 14px;
    }
    
    .week-day {
        font-size: 11px;
        padding: 6px 0;
    }
    
    .week-day .day-name {
        font-size: 12px;
        margin-bottom: 2px;
    }
    
    .schedule-grid {
        grid-template-columns: 45px repeat(7, 1fr);
    }
    
    .time-slot {
        min-height: 75px;
        font-size: 10px;
        padding: 8px 0;
    }
    
    .time-slot .slot-num {
        font-size: 12px;
    }
    
    .grid-cell {
        min-height: 60px;
    }
    .course-block {
        padding: 6px 9px;
        font-size: 11px;
        margin: 1px;
    }
    
    .course-name {
        font-size: 14px;
        margin-bottom: 3px;
    }
    
    .course-info {
        font-size: 10px;
        margin-bottom:2px;
    }
    .bottom-nav {
        width: 95%;
        height: 60px;
        bottom: 15px;
        max-width: 360px;
    }
    
    .nav-item {
        font-size: 9px;
        width: 45px;
    }
    
    .nav-icon {
        width: 20px;
        height: 20px;
    }
    
    .swipe-hint-content {
        padding: 5px 10px;
        font-size: 11px;
    }
    
    .swipe-hint-dot {
        width: 3px;
        height: 3px;
    }
}

/* ========== 模态框的移动端适配 ========== */

/* 课程编辑模态框 - 移动端适配 */
@media (max-width: 480px) {
    /* 课程编辑模态框 */
    #course-modal .modal-content {
        padding: 18px;
        border-radius: 18px 18px 0 0;
        max-height: 85vh;
        width: 100%;
    }
    
    #course-modal .modal-header {
        font-size: 18px;
        margin-bottom: 16px;
    }
    
    #course-modal .form-group {
        margin-bottom: 14px;
    }
    
    #course-modal .form-label {
        font-size: 12px;
        margin-bottom: 6px;
    }
    
    #course-modal .form-input {
        padding: 10px 14px;
        font-size: 14px;
        border-radius: 10px;
    }
    
    /* 星期和节次选择器的容器布局调整 */
    #course-modal .form-group[style*="display: flex; gap: 15px;"] {
        flex-direction: column;
        gap: 12px;
    }
    
    #course-modal .form-group[style*="display: flex; gap: 15px;"] > div {
        width: 100%;
    }
    
    /* 周数选择器按钮组 */
    #course-modal .week-selector-btn-group {
        gap: 6px;
        margin-bottom: 10px;
    }
    
    #course-modal .week-selector-btn {
        padding: 7px 12px;
        font-size: 11px;
        min-width: 60px;
    }
    
    /* 周数选择器 */
    #course-modal .week-selector {
        gap: 5px;
        margin-bottom: 10px;
    }
    
    #course-modal .week-item {
        width: 28px;
        height: 28px;
        line-height: 28px;
        font-size: 12px;
    }
    
    /* 节次选择按钮样式 */
    #section-select-btn {
        padding: 10px 14px;
        font-size: 14px;
        text-align: left;
    }
    
    /* 颜色选择器 */
    #course-modal .color-picker {
        gap: 10px;
        justify-content: center;
    }
    
    #course-modal .color-option {
        width: 28px;
        height: 28px;
    }
    
    /* 模态框按钮 */
    #course-modal .modal-btns {
        margin-top: 20px;
        gap: 10px;
    }
    
    #course-modal .btn {
        padding: 10px 16px;
        font-size: 14px;
        border-radius: 10px;
    }
    
    /* 节次选择模态框 - 移动端适配 */
    #section-select-modal .modal-content {
        padding: 18px;
        border-radius: 18px 18px 0 0;
        width: 95%;
        max-width: 360px;
    }
    
    #section-select-modal .modal-header {
        font-size: 18px;
        margin-bottom: 16px;
    }
    
    #section-select-modal div[style*="grid-template-columns: 1fr 1fr;"] {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    #section-select-modal .section-picker {
        max-height: 180px;
    }
    
    #section-select-modal .section-item {
        width: 36px;
        height: 36px;
        line-height: 36px;
    }
    
    /* 周数设置模态框 - 移动端适配 */
    #week-setting-modal .modal-content {
        padding: 18px;
        border-radius: 18px 18px 0 0;
        width: 100%;
    }
    
    #week-setting-modal .modal-header {
        font-size: 18px;
        margin-bottom: 16px;
    }
    
    #week-setting-modal .form-input {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    #week-setting-modal .hint-text {
        font-size: 10px;
    }
    
    /* 提示文字样式 */
    .hint-text {
        font-size: 10px;
        color: var(--text-secondary);
    }
    
    /* 计算周数显示区域 */
    #week-setting-modal #calculated-week {
        padding: 10px;
        font-size: 13px;
        margin: 10px 0;
    }
    
    /* 手动设置周数组 */
    #week-setting-modal #manual-week-group .form-input {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    /* 防止输入框在移动端被放大 */
    input[type="text"],
    input[type="number"],
    select {
        font-size: 16px; /* 防止iOS Safari自动放大 */
    }
}

@media (max-width: 375px) {
    /* 更小屏幕适配 - 模态框 */
    #course-modal .modal-content,
    #section-select-modal .modal-content,
    #week-setting-modal .modal-content {
        padding: 16px;
    }
    
    #course-modal .modal-header,
    #section-select-modal .modal-header,
    #week-setting-modal .modal-header {
        font-size: 16px;
        margin-bottom: 14px;
    }
    
    #course-modal .form-input,
    #week-setting-modal .form-input {
        padding: 9px 12px;
        font-size: 13px;
    }
    
    #course-modal .week-selector-btn {
        padding: 6px 10px;
        font-size: 10px;
        min-width: 55px;
    }
    
    #course-modal .week-item {
        width: 26px;
        height: 26px;
        line-height: 26px;
        font-size: 11px;
    }
    
    #section-select-modal .section-item {
        width: 32px;
        height: 32px;
        line-height: 32px;
    }
    
    #course-modal .btn,
    #section-select-modal .btn,
    #week-setting-modal .btn {
        padding: 9px 14px;
        font-size: 13px;
    }
    
    /* 周数选择器在小屏幕上显示为两行 */
    #course-modal .week-selector-btn-group {
        gap: 4px;
    }
    
    #course-modal .week-selector-btn {
        flex: 0 0 calc(50% - 4px);
        margin-bottom: 4px;
    }
}

@media (max-width: 320px) {
    /* 最小屏幕适配 - 模态框 */
    #course-modal .week-selector-btn-group {
        justify-content: center;
    }
    
    #course-modal .week-selector-btn {
        flex: 0 0 calc(50% - 6px);
        margin-bottom: 4px;
        font-size: 9px;
        padding: 5px 8px;
    }
    
    #course-modal .week-selector {
        justify-content: center;
    }
    
    #course-modal .week-item {
        width: 24px;
        height: 24px;
        line-height: 24px;
        font-size: 10px;
    }
    
    #course-modal .color-picker {
        justify-content: center;
    }
    
    #course-modal .color-option {
        width: 26px;
        height: 26px;
    }
    
    #section-select-modal .section-item {
        width: 30px;
        height: 30px;
        line-height: 30px;
    }
}

/* 横屏模式适配 */
@media (max-height: 600px) and (orientation: landscape) {
    body {
        padding-top: 55px;
        padding-bottom: 85px;
    }
    
    .course-status-float {
        top: 8px;
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .scrollable-content {
        height: calc(100vh - 140px);
    }
    
    #course-modal .modal-content,
    #section-select-modal .modal-content,
    #week-setting-modal .modal-content {
        max-height: 80vh;
        padding: 16px;
    }
    
    #course-modal .week-selector-wrapper {
        max-height: 120px;
        overflow-y: auto;
    }
    
    #section-select-modal .section-picker {
        max-height: 150px;
    }
}

/* 横屏模式适配 - 课表界面 */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        padding-top: 55px;
        padding-bottom: 75px;
    }
    
    .scrollable-content {
        height: calc(100vh - 130px);
    }
    
    .week-bar {
        padding: 4px 0;
        margin: 0 10px 3px;
    }
    
    .schedule-container {
        padding: 10px;
        margin: 0 0px;
    }
    
    .time-slot {
        min-height: 45px;
        font-size: 9px;
        padding: 5px 0;
    }
    
    .grid-cell {
        min-height: 45px;
    }
    
    .bottom-nav {
        height: 50px;
        bottom: 15px;
    }
}

/* 无玻璃效果支持的降级方案 */
@supports not (backdrop-filter: blur(10px)) {
    .course-status-float,
    .week-bar,
    .schedule-container,
    .modal-content,
    .bottom-nav,
    .alert {
        background: rgba(255, 255, 255, 0.95);
    }
    
    .course-block {
        background: linear-gradient(135deg, 
            rgba(255, 255, 255, 0.9),
            rgba(255, 255, 255, 0.8));
        border: 1px solid rgba(255, 255, 255, 0.3);
    }
    
    .c-green { background: #30d158; }
    .c-purple { background: #bf5af2; }
    .c-pink { background: #ff375f; }
    .c-blue { background: #007aff; }
    .c-yellow { background: #ffd60a; }
}