* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 系统标题样式 */
.system-title-container {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #3498db 0%, #2ecc71 100%);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    color: white;
}

.system-main-title {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.system-subtitle {
    margin: 10px 0 0 0;
    font-size: 20px;
    font-weight: 500;
    opacity: 0.9;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* 原有h1样式作为备用 */
h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

/* 日历控制区 */
.calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* 周标题样式 */
#weekTitle {
    font-size: 18px;
    color: #2c3e50;
    margin: 0;
    text-align: center;
    font-weight: bold;
}

/* 年份和日期范围样式 */
#weekTitle .year,
#weekTitle .date-range {
    display: inline;
}

/* 移动端日期显示优化 */
@media (max-width: 768px) {
    #weekTitle {
        white-space: normal;
        line-height: 1.4;
    }
    
    /* 移动端显示为两行：第一行年份，第二行起止月日 */
    #weekTitle .year {
        display: block;
        font-size: 16px;
        margin-bottom: 5px;
    }
    
    #weekTitle .date-range {
        display: block;
        font-size: 14px;
    }
    
    .calendar-controls {
        padding: 10px;
    }
}

.calendar-controls:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.calendar-controls button {
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.calendar-controls button:hover {
    background-color: #2980b9;
    transform: scale(1.05);
}

.calendar-controls button:active {
    transform: scale(0.98);
}

/* 日历表格 */
.calendar-container {
    overflow-x: auto;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 20px;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.calendar-container.fade {
    opacity: 0;
}

#calendarTable {
    width: 100%;
    border-collapse: collapse;
}

#calendarTable th, #calendarTable td {
    padding: 12px;
    text-align: center;
    border: 1px solid #ddd;
    transition: transform 0.2s ease;
}

/* 过去时间段样式 */
#calendarTable td.unavailable {
    background-color: #b4b4b4;
    color: #fff;
    cursor: not-allowed;
}

#calendarTable td.unavailable:hover {
    background-color: #a0a0a0;
    transform: none;
}

#calendarTable th {
    background-color: #34495e;
    color: white;
    font-weight: bold;
    position: relative;
    overflow: hidden;
}

#calendarTable th::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

#calendarTable th:hover::after {
    left: 100%;
}

#calendarTable th .holiday-name {
    font-size: 14px; /* 增大节假日名称字号 */
    color: #ffd700; /* 金色 */
    font-weight: normal;
    margin-top: 4px;
    display: block;
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#calendarTable td.time-slot {
    background-color: #ecf0f1;
    font-weight: bold;
}

#calendarTable td.available {
    background-color: #01c260;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

#calendarTable td.available:hover {
    background-color: #01a850;
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

#calendarTable td.available::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(255,255,255,0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

#calendarTable td.available:hover::before {
    opacity: 1;
}

#calendarTable td.special-available {
    background-color: #fbff7c; /* 用户指定的黄色 */
    color: #333;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

#calendarTable td.special-available:hover {
    background-color: #f1f542; /* 鼠标悬停时稍深的黄色 */
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

#calendarTable td.special-available::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(0,0,0,0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

#calendarTable td.special-available:hover::before {
    opacity: 1;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 30px;
    border: 1px solid #888;
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transform: translateY(-50px);
    transition: transform 0.3s ease;
    position: relative;
    overflow: hidden;
}

.modal.show .modal-content {
    transform: translateY(0);
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #2ecc71, #f39c12, #e74c3c);
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
    position: relative;
    z-index: 1;
}

.close:hover,
.close:focus {
    color: black;
    transform: rotate(90deg);
    text-decoration: none;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
    animation: fadeInUp 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
    text-align: left;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
    line-height: 1.4;
    text-align: left;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 24px;
    text-align: center;
}

.modal-content form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 表单按钮容器 */
.form-buttons {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 20px;
    width: 100%;
}

/* 基础按钮样式 */
.btn {
    padding: 10px 0;
    border: none;
    border-radius: 0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

/* 主按钮样式 */
.btn-primary {
    background-color: #2196f3;
    color: white;
    box-shadow: 0 2px 5px rgba(33, 150, 243, 0.3);
}

.btn-primary:hover {
    background-color: #1976d2;
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.4);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(33, 150, 243, 0.3);
}

/* 危险按钮样式 */
.btn-danger {
    background-color: #f44336;
    color: white;
    box-shadow: 0 2px 5px rgba(244, 67, 54, 0.3);
}

.btn-danger:hover {
    background-color: #d32f2f;
    box-shadow: 0 4px 8px rgba(244, 67, 54, 0.4);
    transform: translateY(-2px);
}

.btn-danger:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(244, 67, 54, 0.3);
}

/* 按钮禁用状态 */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }
.form-group:nth-child(3) { animation-delay: 0.3s; }
.form-group:nth-child(4) { animation-delay: 0.4s; }

.modal-content button {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    animation: fadeInUp 0.3s ease-out 0.5s both;
}

.modal-content button:hover {
    background-color: #2980b9;
    transform: scale(1.02);
}

.modal-content button:active {
    transform: scale(0.98);
}

#weekTitle {
    font-size: 20px;
    color: #2c3e50;
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    /* 容器样式 */
    .container {
        padding: 10px;
    }
    
    /* 系统标题优化 */
    .system-title-container {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .system-main-title {
        font-size: 22px;
    }
    
    .system-subtitle {
        font-size: 16px;
    }
    
    /* 日历控制区优化 */
    .calendar-controls {
        padding: 10px;
    }
    
    .calendar-controls button {
        padding: 8px 15px;
        font-size: 14px;
    }
    
    /* 周标题优化 - 确保日期完整显示 */
    #weekTitle {
        font-size: 14px;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        flex: 1;
        text-align: center;
        padding: 0 5px;
    }
    
    /* 日历容器优化 */
    .calendar-container {
        padding: 10px;
        overflow-x: auto;
    }
    
    /* 表格优化 - 确保可以横向滚动 */
    #calendarTable {
        min-width: 600px;
    }
    
    #calendarTable th, #calendarTable td {
        padding: 8px 4px;
        font-size: 12px;
        min-width: 80px;
    }
    
    /* 预约信息样式优化 */
    .booking-info {
        font-size: 11px;
    }
    
    /* 模态框优化 */
    .modal-content {
        margin: 25% auto;
        width: 95%;
        padding: 20px;
        max-height: 80vh;
        overflow-y: auto;
    }
    
    /* 表单元素优化 */
    .form-group input {
        padding: 10px;
        font-size: 14px;
    }
    
    .modal-content button {
        padding: 10px;
        font-size: 16px;
    }
    
    /* 已选择时段样式优化 */
    .selected-slot-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    /* 响应式布局调整 */
    .form-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    /* 触摸友好的按钮大小 */
    .btn {
        padding: 12px 0;
        font-size: 16px;
    }
    
    /* 隐藏加载指示器的文字，只保留动画 */
    .loading p {
        display: none;
    }
}

/* 加载动画样式 */
.loading-spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #3498db;
    font-weight: bold;
}

/* 预约信息样式 */
.booking-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 5px;
    font-size: 12px;
    text-align: center;
    line-height: 1.4;
}

.company-name {
    font-weight: bold;
    color: #fff;
    margin-bottom: 2px;
}

.contact-person {
    color: #f0f0f0;
    font-size: 11px;
}

#calendarTable td.booked {
    background-color: #e74c3c;
    color: white;
    cursor: not-allowed;
    transition: background-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

#calendarTable td.booked::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(255,255,255,0.2) 0%, transparent 70%);
}

/* 特殊时段提示样式 */
#special-time-notice {
    display: block;
    color: #e74c3c;
    font-weight: bold;
    font-size: 14px;
    margin-top: 5px;
    padding: 5px;
    background-color: #fff5f5;
    border-radius: 3px;
    animation: bounce 1s infinite;
}

/* 跳动动画 */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* 选中时段的样式 */
.selected {
    background-color: #4CAF50 !important;
    color: white;
    cursor: pointer;
}

/* 已选择时段列表容器 */
#selectedTimeSlots {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f0f8ff;
    border: 1px solid #b3e5fc;
    border-radius: 8px;
}

#selectedTimeSlots strong {
    display: block;
    margin-bottom: 10px;
    color: #2196f3;
    font-size: 14px;
}

/* 已选择时段列表容器 */
#selectedSlotsList {
    margin-bottom: 0;
    border-radius: 6px;
    overflow: hidden;
}

/* 单个已选择时段样式 */
.selected-slot-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 5px;
    background-color: #ffffff;
    border: 1px solid #e1f5fe;
    border-radius: 4px;
    color: #333333;
    font-size: 13px;
    transition: all 0.2s ease;
}

/* 最后一个时段项不显示边框 */
.selected-slot-item:last-child {
    border-bottom: 1px solid #e1f5fe;
    margin-bottom: 0;
}

/* 时段信息样式 */
.slot-info {
    font-weight: 500;
    color: #2c3e50;
    flex-grow: 1;
}

/* 日期样式 */
.slot-date {
    font-size: 12px;
    color: #666;
    margin-bottom: 2px;
}

/* 星期和时间样式 */
.slot-day-time {
    font-size: 13px;
    color: #333;
    font-weight: 500;
}

/* 取消选择按钮样式 */
#cancelSelection.btn-danger {
    background-color: #f44336 !important;
    color: white !important;
}

/* 移除时段按钮样式 */
.remove-slot-btn {
    background-color: #ff0000 !important;
    color: white !important;
    border: none !important;
    border-radius: 3px !important;
    padding: 4px 6px !important;
    cursor: pointer !important;
    font-size: 11px !important;
    font-weight: bold !important;
    transition: all 0.2s ease !important;
    margin-left: 10px !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
    min-width: 60px !important; /* 大约四个汉字的宽度 */
    max-width: 60px !important;
    text-align: center !important;
}

/* 移除按钮悬停效果 */
.remove-slot-btn:hover {
    background-color: #cc0000 !important; /* 悬停时使用更深的红色 */
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 3px rgba(255, 0, 0, 0.3) !important;
}

/* 移除按钮点击效果 */
.remove-slot-btn:active {
    transform: translateY(0);
}

/* 已选择时段标题 */
.booking-form h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}