* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}
.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    border-radius: 20px; /* 更大的圆角 */
    /* 更柔和、多层次的阴影 */
    box-shadow: 0 15px 35px rgba(50, 50, 93, 0.1), 0 5px 15px rgba(0, 0, 0, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.5); /* 玻璃质感边缘 */
}
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 20px;
    text-align: center;
}
.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 30px;
}
.login-form {
    background: white;
    padding: 40px;
    max-width: 400px;
    width: 100%;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05); /* 非常淡的阴影 */
}
.login-form h2 {
    color: #667eea;
    margin-bottom: 20px;
    text-align: center;
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: bold;
}
.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}
.form-group input:focus {
    outline: none;
    border-color: #667eea;
}
/* 替换 .login-btn */
.login-btn {
    width: 100%;
    padding: 14px; /* 更胖一点，手指好点 */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px; /* 圆润按钮 */
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(102, 126, 234, 0.25); /* 彩色投影 */
    transition: all 0.2s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 14px rgba(102, 126, 234, 0.3);
}

.login-btn:active {
    transform: translateY(1px); /* 点击下沉 */
}
.admin-btn {
    width: 100%;
    padding: 12px;
    background: #999;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s;
}
.admin-btn:hover {
    background: #888;
    transform: translateY(-2px);
}
.error-message {
    background: #ff6b6b;
    color: white;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
}
.content {
    padding: 30px;
    display: none;
}
.content.active {
    display: block;
}
.logout-btn {
    float: right;
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    margin-bottom: 20px;
}
.logout-btn:hover {
    background: #ff5252;
}
.schedule-grid {
    display: grid;
    grid-template-columns: 100px repeat(5, 1fr);
    gap: 1px;
    background: #e0e0e0;
    padding: 1px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.schedule-cell {
    background: white;
    padding: 15px;
    text-align: center;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
}
.time-cell {
    background: #f8f9fa;
    color: #667eea;
    font-weight: bold;
    font-size: 0.85em;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #e0e0e0; /* 加强时间列的分隔感 */
}
.day-header {
    background: #667eea; /* 用深色背景区分表头 */
    color: white;
    padding: 10px;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
}
.slot-cell {
    /* 之前的样式保持不变，确保有以下 flex 属性 */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column; /* 确保内容垂直排列 */
    text-align: center;
}
.slot-cell:hover {
    background: #f0fcf4; /* 鼠标悬停变极淡的绿色 */
    border-color: #4CAF50;
    transform: scale(1.02); /* 微微放大 */
    z-index: 1;
}
.slot-cell.booked {
    background: #eff6ff; /* 极淡的蓝色背景 */
    border-left: 4px solid #667eea; /* 左侧加深色条，像专业的日程表 */
    border-radius: 4px; /* 稍微方一点 */
    padding-left: 12px; /* 给左侧色条留位置 */
    color: #667eea;
}
.slot-cell.blocked {
    background: repeating-linear-gradient(
        45deg,
        #fafafa,
        #fafafa 10px,
        #f0f0f0 10px,
        #f0f0f0 20px
    ); /* 斜线纹理，表示禁用 */
    opacity: 0.6;
}
.slot-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
    word-break: break-all;
}
.slot-blocked-label {
    color: #ff6b6b;
    font-weight: bold;
    font-size: 0.8em;
}
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal.active {
    display: flex;
}
.modal-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    border: 3px solid #667eea;
}
.modal-title {
    font-size: 1.8em;
    color: #667eea;
    margin-bottom: 20px;
    text-align: center;
}
.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}
.modal-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}
.btn-confirm {
    background: #4CAF50;
    color: white;
}
.btn-confirm:hover {
    background: #45a049;
}
.btn-cancel {
    background: #f5f5f5;
    color: #666;
}
.btn-cancel:hover {
    background: #e0e0e0;
}
.btn-delete {
    background: #ff6b6b;
    color: white;
}
.btn-delete:hover {
    background: #ff5252;
}
.message {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    display: none;
}
.message.success {
    background: #d4edda;
    color: #155724;
    display: block;
}
.message.error {
    background: #f8d7da;
    color: #721c24;
    display: block;
}
.stats {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}
.stat-box {
    background: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border-left: 4px solid #667eea;
}
.stat-number {
    font-size: 2em;
    font-weight: bold;
    color: #667eea;
}
.stat-label {
    color: #999;
    font-size: 0.9em;
    margin-top: 5px;
}
.admin-content {
    display: none;
}
.admin-content.active {
    display: block;
}
.year-calendar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}
.month-card {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    border: 2px solid #e0e0e0;
}
.month-title {
    font-weight: bold;
    color: #667eea;
    text-align: center;
    margin-bottom: 10px;
    font-size: 0.95em;
}
.week-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}
.day-box {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 0.7em;
    background: white;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.2s;
}
.day-box:hover {
    background: #e8e8ff;
    border-color: #667eea;
}
.day-box.selected {
    background: #667eea;
    color: white;
    font-weight: bold;
}
.day-box.other-month {
    color: #ccc;
    cursor: default;
}
.day-box.today {
    border: 2px solid #4CAF50;
    font-weight: bold;
}
.meeting-time-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    margin: 15px 0;
}
.time-btn {
    padding: 10px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9em;
}
.time-btn:hover {
    border-color: #667eea;
    background: #f0f0f0;
}
.time-btn.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
}
@media (max-width: 768px) {
    .schedule-grid {
        grid-template-columns: 80px repeat(2, 1fr);
    }
    .header h1 {
        font-size: 1.8em;
    }
    .schedule-cell {
        padding: 10px;
        font-size: 0.8em;
    }
    .year-calendar {
        grid-template-columns: 1fr;
    }
}
/* 确保表格容器本身也是居中的 */
#scheduleContainer {
    width: 100%;
    max-width: 1000px; /* 稍微调窄一点，在居中模式下会更精致 */
    margin: 0 auto;
    display: inline-block; /* 或者 block，配合 text-align: center 使用 */
    text-align: left; /* 这一行很重要：让表格内部的文字（比如 "Click to book"）保持靠左或居中，看你喜好。通常表格里的字保持左对齐或居中都可以 */
}

/* 让表格格子内的文字居中 */
.schedule-grid {
    display: grid;
    /* 强制定义 6 列：第1列固定宽度，后5列平分剩余空间 */
    grid-template-columns: 80px repeat(5, 1fr); 
    gap: 1px;
    background: #e0e0e0; /* 网格线的颜色 */
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    width: 100%; /* 确保撑满容器 */
}

/* 新增：过期时间段的样式 */
.slot-cell.past {
    background: #eeeeee;
    color: #bbbbbb;
    border-color: #e0e0e0;
}

/* 只有“没被约”且“过期”的格子才禁用鼠标 */
/* 注意：HTML里没有专门给没约的格子加类，所以我们可以反过来写 */
/* 或者更简单地，只针对 expired 状态禁用 */

/* 方案：我们在 JS 里控制 pointer-events 也许更灵活，或者用 CSS 选择器 */
/* 但最简单的 CSS 改法是：去掉 pointer-events: none，把控制权还给 JS */

.slot-cell.past:not(.booked) {
    cursor: not-allowed !important;
    pointer-events: none;
}

.slot-cell.past.booked {
    cursor: pointer; /* 已预约的过期格子，依然是小手 */
    opacity: 0.7;    /*稍微透明一点区别于未来的预约*/
}

@media (max-width: 768px) {
    /* 1. 让容器填满屏幕，去掉圆角 */
    .container {
        border-radius: 0;
        box-shadow: none;
    }
    
    /* 2. 表格允许横向滑动 */
    #scheduleContainer {
        width: 100%;
        overflow-x: auto; /* 关键：横向滚动 */
        padding-bottom: 20px;
    }
    
    /* 3. 强制表格保持最小宽度，防止挤压 */
    .schedule-grid {
        min-width: 600px; 
    }
    
    /* 4. 调整头部字体大小 */
    .header h1 {
        font-size: 1.5em;
    }
}

/* === 新增样式：状态文字标签 === */
.status-label {
    font-size: 0.75em;       /* 缩小字体，防止换行 */
    font-weight: 700;        /* 加粗 */
    letter-spacing: 0.5px;   /* 字间距稍微拉开 */
    text-transform: uppercase; /* 强制大写 */
    display: block;
    width: 100%;
    text-align: center;
}

/* EXPIRED 样式：灰色 */
.status-label.expired {
    color: #b0b0b0; 
}

/* UNAVAILABLE 样式：红色或深灰色，带一点警示感 */
.status-label.unavailable {
    color: #e57373; /* 柔和的红色 */
    opacity: 0.8;
}