/* 新版日历样式 - 纵轴时间，横轴技师 */

/* 日历控制栏 */
.calendar-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

/* 日历控制栏中的多门店视图按钮 */
.calendar-controls .btn-admin-management {
    background: #00C896;
    color: white;
    border: none;
    font-weight: 600;
}

.calendar-controls .btn-admin-management:hover {
    background: #00B184;
}

/* 移动端单门店控制按钮优化 - 保持原样式只缩小尺寸 */
@media (max-width: 768px) {
    .calendar-controls {
        padding: 8px;
        gap: 6px;
        margin-bottom: 15px;
    }
    
    .calendar-controls .btn {
        padding: 6px 12px !important;
        font-size: 12px !important;
        border-radius: 4px !important;
    }
    
    .calendar-controls select {
        min-width: 120px !important;
        padding: 4px 8px !important;
        font-size: 12px !important;
    }
    
    /* 小屏幕手机进一步缩小 */
    @media (max-width: 375px) {
        .calendar-controls {
            padding: 6px;
            gap: 4px;
            margin-bottom: 12px;
        }
        
        .calendar-controls .btn {
            padding: 4px 8px !important;
            font-size: 11px !important;
        }
        
        .calendar-controls select {
            min-width: 100px !important;
            padding: 3px 6px !important;
            font-size: 11px !important;
        }
    }
}

.calendar-controls select {
    min-width: 200px;
}

/* 新日历容器 */
.new-calendar-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    height: 800px; /* 保持高度，使用滚动来查看更多时间槽 */
    overflow-y: auto; /* 上下滚动 */
    overflow-x: auto; /* 左右滚动以支持多技师 */
}

/* 新日历网格 - CSS Grid布局 */
.new-calendar-grid {
    display: grid;
    grid-template-columns: 90px repeat(auto-fit, 200px) 140px; /* 增加时间轴和技师列宽度 */
    min-width: 100%;
    gap: 1px;
    background-color: #e5e7eb;
}

/* 时间轴样式 */
.time-axis {
    background: linear-gradient(to right, #f8fafc, #f1f5f9);
    color: #374151;
    position: sticky;
    left: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    border-right: 2px solid #d1d5db;
}

.time-axis-header {
    background: linear-gradient(135deg, #1f2937, #374151);
    color: white !important;
    padding: 15px 12px;
    text-align: center;
    font-weight: bold;
    font-size: 14px;
    border-bottom: 2px solid #4f46e5;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    height: 71px; /* 固定高度以匹配技师列头部 */
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 0;
    left: 0;
    z-index: 25; /* 最高层级，确保始终在最上层 */
}

.time-axis-label {
    height: 25px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    font-weight: 500;
    font-size: 11px;
    border-bottom: 1px solid #e5e7eb;
    color: var(--text-primary);
}

/* 整点时间的特殊样式 */
.time-axis-label.hour-mark {
    background: linear-gradient(to right, #f1f5f9, #f8fafc);
    font-weight: 600;
    border-bottom: 2px solid #94a3b8;
}

.time-axis-label::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 1px;
    background-color: #9ca3af;
    box-shadow: 0 0 2px rgba(156, 163, 175, 0.3);
}

.time-axis-label::after {
    content: '';
    position: absolute;
    top: 0;
    right: -2px;
    width: 8px;
    height: 1px;
    background-color: #6b7280;
}

/* 技师列样式 */
.therapist-column {
    display: flex;
    flex-direction: column;
    /* 移除硬编码的 min-width，让 grid-template-columns 决定宽度 */
}

.therapist-column-header {
    background: linear-gradient(135deg, #1f2937, #374151); /* 添加渐变效果 */
    color: white;
    padding: 10px 8px; /* 减小内边距为文字留出更多空间 */
    text-align: center;
    font-weight: bold;
    font-size: 14px;
    position: sticky;
    top: 0;
    z-index: 20; /* 提高z-index确保在预约块之上 */
    border-bottom: 2px solid #4f46e5;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* 添加阴影 */
    height: 71px; /* 固定高度以匹配时间轴头部 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.2; /* 紧凑行高 */
}

/* 使用更高优先级的选择器确保覆盖 style.css */
.new-calendar-grid .therapist-column-header .therapist-name {
    display: block !important;
    font-size: 14px !important; /* 减小字体避免遮挡 */
    margin-bottom: 2px !important; /* 减小间距 */
    line-height: 1.1 !important; /* 紧凑行高 */
    white-space: nowrap !important;      /* 禁止换行 */
    overflow: hidden !important;         /* 隐藏溢出 */
    text-overflow: ellipsis !important;  /* 显示省略号 */
    /* 强制重置所有可能的样式覆盖 */
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: white !important;
    background-clip: unset !important;
    color: white !important;
    /* 确保文字在深色背景上可见 */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

.therapist-column-header .therapist-position {
    display: block !important;
    font-size: 11px !important; /* 稍微减小职位字体 */
    line-height: 1.1 !important; /* 紧凑行高 */
    color: #d1d5db !important;
    white-space: nowrap !important;      /* 禁止换行 */
    overflow: hidden !important;         /* 隐藏溢出 */
    text-overflow: ellipsis !important;  /* 显示省略号 */
    /* 强制重置背景样式 */
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: #d1d5db !important;
    background-clip: unset !important;
    /* 确保文字在深色背景上可见 */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

/* 时间格子单元格 */
.time-slot-cell {
    height: 25px; /* 减小高度以适应15分钟精度 */
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border-bottom: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: visible; /* 改为visible以允许预约块跨越 */
}

/* 整点时间格子的特殊样式 */
.time-slot-cell[data-time$=":00"] {
    border-bottom: 2px solid #94a3b8;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
}

/* 预约开始的时间槽 */
.time-slot-cell.appointment-start {
    overflow: visible;
    z-index: 5;
}

/* 预约延续的时间槽 */
.time-slot-cell.appointment-continuation {
    pointer-events: none;
    background: transparent;
}

/* 时间轴标签点击样式 */
.time-axis-label {
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.time-axis-label:hover {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    color: #3b82f6;
    transform: translateX(2px);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
}

.time-axis-label.clickable {
    border-left: 3px solid transparent;
}

.time-axis-label.clickable:hover {
    border-left-color: #3b82f6;
}

/* 时间轴高亮样式 */
.time-axis-label.time-slot-highlighted {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    color: white !important;
    border-left-color: #1d4ed8 !important;
    border-left-width: 4px !important;
    font-weight: bold;
    cursor: grab !important;
    animation: timeSlotPulse 2s infinite;
}

.time-axis-label.time-slot-highlighted:active {
    cursor: grabbing !important;
}

@keyframes timeSlotPulse {
    0%, 100% { 
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
        transform: translateX(2px);
    }
    50% { 
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
        transform: translateX(4px);
    }
}

/* 拖拽目标高亮样式 */
.time-slot-cell.drop-target-highlight {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe) !important;
    border: 2px dashed #3b82f6 !important;
    box-shadow: inset 0 0 0 2px #3b82f6, 0 4px 12px rgba(59, 130, 246, 0.3) !important;
    animation: dropTargetPulse 1s infinite;
}

@keyframes dropTargetPulse {
    0%, 100% { 
        background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    }
    50% { 
        background: linear-gradient(135deg, #bfdbfe, #93c5fd);
    }
}

/* 拖拽辅助元素动画 */
@keyframes dragHelperPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 6px 16px rgba(59, 130, 246, 0.6);
    }
}

.time-slot-cell:hover {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    box-shadow: inset 0 0 0 2px #3b82f6, 0 4px 12px rgba(59, 130, 246, 0.15);
    transform: translateY(-1px);
}

.time-slot-cell.occupied {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    cursor: default;
}

.time-slot-cell.occupied:hover {
    background: linear-gradient(135deg, #fde68a, #fcd34d);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
    transform: none;
}



/* 预约块样式 */
.appointment-block {
    position: absolute;
    left: 2px;
    right: 2px;
    top: 1px;
    bottom: 1px;
    padding: 2px;
    border-radius: 4px;
    font-size: 9px;
    overflow: hidden;
    cursor: move; /* 改为移动光标表示可拖拽 */
    transition: all 0.2s ease;
    user-select: none; /* 防止文本选择 */
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 预约状态样式 */
.appointment-block.pending {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #78350f;
    border: 1px solid #f59e0b;
}

.appointment-block.confirmed {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: 1px solid #2563eb;
}

.appointment-block.completed {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: 1px solid #059669;
}

.appointment-block.cancelled {
    background: linear-gradient(135deg, #9ca3af, #6b7280);
    color: white;
    border: 1px solid #6b7280;
}

.appointment-block .customer-name {
    font-weight: bold;
    font-size: 9px;
    margin-bottom: 1px;
    line-height: 1.2;
}

.appointment-block .appointment-time {
    font-size: 8px;
    opacity: 0.9;
    line-height: 1.1;
}

.appointment-block .appointment-source {
    font-size: 7px;
    opacity: 0.8;
    margin-top: 1px;
    line-height: 1;
}

/* 外部API来源预约特殊标识 */
.appointment-block[data-source="external_api"] {
    border-left: 4px solid #f97316;
}

.appointment-block[data-source="external_api"]:before {
    content: "🔗";
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 10px;
}

/* 模态框样式 */
.new-calendar-appointment-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s ease;
}

.new-calendar-appointment-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease;
}

.new-calendar-appointment-content h3 {
    margin-bottom: 20px;
    color: #1f2937;
    font-size: 20px;
    font-weight: 600;
}

.new-calendar-appointment-content .close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #6b7280;
    transition: color 0.2s ease;
}

.new-calendar-appointment-content .close:hover {
    color: #ef4444;
}

/* 表单样式 */
.new-calendar-form-group {
    margin-bottom: 18px;
}

.new-calendar-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.new-calendar-form-group input,
.new-calendar-form-group select,
.new-calendar-form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.new-calendar-form-group input:focus,
.new-calendar-form-group select:focus,
.new-calendar-form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.new-calendar-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* 并排布局样式 */
.new-calendar-form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 18px;
}

.new-calendar-form-row .new-calendar-form-group.half-width {
    flex: 1;
    margin-bottom: 0;
}

/* 移动端适配 - 小屏幕时改为垂直布局 */
@media (max-width: 480px) {
    .new-calendar-form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .new-calendar-form-row .new-calendar-form-group.half-width {
        margin-bottom: 18px;
    }
}

/* 按钮样式 */
.new-calendar-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 10px;
}

.new-calendar-btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.new-calendar-btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.new-calendar-btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.new-calendar-btn-secondary:hover {
    background-color: #e5e7eb;
}



/* 响应式设计 */
@media (max-width: 768px) {
    .new-calendar-container {
        height: 500px;
    }
    
    .new-calendar-grid {
        grid-template-columns: 50px repeat(auto-fit, 65px) 80px; /* 进一步缩小技师列宽度 */
    }
    
    .therapist-column {
        min-width: 65px;
    }
    
    /* 移动端技师名称样式强化 */
    .new-calendar-grid .therapist-column-header .therapist-name {
        font-size: 14px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        /* 重置可能的样式冲突 */
        background: none;
        -webkit-background-clip: unset;
        -webkit-text-fill-color: unset;
        color: inherit;
    }
    
    .time-slot-cell {
        height: 20px; /* 移动端更紧凑 */
    }
    
    .time-axis-label {
        height: 20px;
        font-size: 10px;
    }
    
    /* 预约卡片文字优化 */
    .appointment-info-compact .info-text {
        max-width: 100px; /* 移动端减小文字宽度 */
        font-size: 10px !important; /* 缩小字体 */
    }
    
    .appointment-info-compact .info-item {
        font-size: 10px !important;
        padding: 2px 4px !important;
    }
    
    /* 时间轴标题 */
    .time-axis-header {
        font-size: 12px !important;
        padding: 8px 6px !important;
    }
    
    /* 技师名称 */
    .therapist-header h3 {
        font-size: 12px !important;
    }
    
    .therapist-header .therapist-status {
        font-size: 10px !important;
    }
    
    /* 预约块内文字 */
    .calendar-appointment .appointment-header {
        font-size: 10px !important;
    }
    
    .calendar-appointment .appointment-service {
        font-size: 9px !important;
    }
    
    .calendar-appointment .appointment-time {
        font-size: 8px !important;
    }
    
    /* 小屏幕手机进一步缩小 */
    @media (max-width: 375px) {
        .new-calendar-grid {
            grid-template-columns: 45px repeat(auto-fit, 55px) 70px; /* 超小屏幕进一步缩小 */
        }
        
        .therapist-column {
            min-width: 55px;
        }
        
        .appointment-info-compact .info-text {
            max-width: 80px;
            font-size: 9px !important;
        }
        
        .appointment-info-compact .info-item {
            font-size: 9px !important;
            padding: 1px 3px !important;
        }
        
        .time-axis-header {
            font-size: 10px !important;
            padding: 6px 4px !important;
        }
        
        .therapist-header h3 {
            font-size: 11px !important;
        }
        
        .therapist-header .therapist-status {
            font-size: 9px !important;
        }
        
        .calendar-appointment .appointment-header {
            font-size: 9px !important;
        }
        
        .calendar-appointment .appointment-service {
            font-size: 8px !important;
        }
        
        .calendar-appointment .appointment-time {
            font-size: 7px !important;
        }
        
        .time-axis-label {
            font-size: 9px !important;
        }
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 加载状态 */
.calendar-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    font-size: 16px;
    color: #6b7280;
}

.calendar-loading:before {
    content: "⏳";
    margin-right: 8px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* =============================================================
   拖拽功能样式
   ============================================================= */

/* 正在拖拽的预约块 */
.appointment-block.dragging {
    opacity: 0.8;
    z-index: 1000;
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border: 2px solid #3b82f6;
}

/* 拖拽目标时间槽的高亮效果 */
.time-slot-cell.drag-over {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe) !important;
    border: 2px dashed #3b82f6 !important;
    animation: pulse-drag 0.8s ease-in-out infinite alternate;
}

@keyframes pulse-drag {
    from {
        background: linear-gradient(135deg, #dbeafe, #bfdbfe);
        box-shadow: inset 0 0 0 2px #3b82f6;
    }
    to {
        background: linear-gradient(135deg, #eff6ff, #dbeafe);
        box-shadow: inset 0 0 0 3px #2563eb;
    }
}

/* 拖拽目标技师列的高亮效果 */
.therapist-column.drag-over-therapist {
    background-color: rgba(59, 130, 246, 0.1);
}

.therapist-column.drag-over-therapist .therapist-column-header {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    animation: therapist-highlight 0.6s ease-in-out infinite alternate;
}

@keyframes therapist-highlight {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.02);
    }
}

/* 不可拖拽的目标样式 */
.time-slot-cell.drag-invalid {
    background: linear-gradient(135deg, #fef2f2, #fee2e2) !important;
    border: 2px dashed #ef4444 !important;
    cursor: not-allowed;
}

/* 拖拽预览指示器 */
.drag-preview {
    position: fixed;
    pointer-events: none;
    z-index: 1001;
    opacity: 0.9;
    transform: rotate(5deg);
}

/* 垂直拖拽指示器（时间变更） */
.vertical-drag-indicator {
    position: absolute;
    left: -5px;
    right: -5px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #3b82f6, transparent);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.time-slot-cell.drag-over .vertical-drag-indicator {
    opacity: 1;
    animation: move-up-down 1s ease-in-out infinite alternate;
}

@keyframes move-up-down {
    from { top: 20%; }
    to { top: 80%; }
}

/* 水平拖拽指示器（技师变更） */
.horizontal-drag-indicator {
    position: absolute;
    top: -5px;
    bottom: -5px;
    width: 3px;
    background: linear-gradient(180deg, transparent, #10b981, transparent);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.therapist-column.drag-over-therapist .horizontal-drag-indicator {
    opacity: 1;
    animation: move-left-right 1s ease-in-out infinite alternate;
}

@keyframes move-left-right {
    from { left: 20%; }
    to { left: 80%; }
}

/* 拖拽反馈提示 */
.drag-feedback {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    background: rgba(59, 130, 246, 0.95);
    color: white;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1002;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateX(100%);
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
    display: none;
}

.drag-feedback.show {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
    display: block;
}

.drag-feedback.error {
    background: rgba(239, 68, 68, 0.95);
}

.drag-feedback.success {
    background: rgba(16, 185, 129, 0.95);
}

/* 实时同步指示器 */
.sync-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #10b981;
    animation: pulse 2s infinite;
}

.sync-indicator.syncing {
    background-color: #f59e0b;
}

.sync-indicator.error {
    background-color: #ef4444;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 新版预约块包装器 */
.appointment-block-wrapper {
    position: absolute;
    left: 2px;
    right: 2px;
    top: 2px;
    bottom: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    overflow: hidden;
}

.appointment-block-wrapper:hover {
    transform: translateY(-1px) scale(1.01);
    z-index: 18; /* 保持在技师列头部下方 */
}

/* 日历中的预约容器样式 */
.calendar-appointment {
    margin: 0;
    padding: 4px;
    height: 100%;
    overflow: hidden;
}

.calendar-appointment .appointment-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(210, 105, 30, 0.3);
    border-radius: 10px;
    padding: 8px 10px;
    margin: 0;
    height: calc(100% - 8px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 3px 10px rgba(210, 105, 30, 0.15);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
}

.calendar-appointment .appointment-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(210, 105, 30, 0.25);
    border-color: rgba(210, 105, 30, 0.5);
    background: rgba(255, 255, 255, 0.98);
}

/* 紧凑的预约信息显示 */
.appointment-info-compact {
    margin: 10px 0;
}

.appointment-info-compact .info-row {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.appointment-info-compact .info-item {
    display: inline-flex; /* 改为inline-flex避免渲染问题 */
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(210, 105, 30, 0.2);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    white-space: nowrap;
    backdrop-filter: blur(5px); /* 毛玻璃效果 */
    transition: all 0.2s ease;
}

.appointment-info-compact .info-item:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(210, 105, 30, 0.4);
    transform: translateY(-1px);
}

.appointment-info-compact .info-item.notes {
    flex: 1 1 100%;
    font-size: 11px;
    color: #666;
    white-space: normal; /* 允许换行 */
}

.appointment-info-compact .info-icon {
    font-size: 14px;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 2px;
}

.appointment-info-compact .info-text {
    font-weight: 500;
    color: #2c3e50;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px; /* 增加最大宽度 */
}

/* 紧凑的预约操作按钮 */
.appointment-actions-compact {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    justify-content: flex-end;
}

.btn-mini {
    padding: 4px 8px;
    font-size: 12px;
    min-width: 32px;
    height: 28px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-mini:hover {
    transform: translateY(-1px);
}

.btn-mini.btn-primary {
    background: #007bff;
    color: white;
}

.btn-mini.btn-primary:hover {
    background: #0056b3;
}

.btn-mini.btn-success {
    background: #28a745;
    color: white;
}

.btn-mini.btn-success:hover {
    background: #1e7e34;
}

.btn-mini.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-mini.btn-info:hover {
    background: #117a8b;
}

/* 外部来源徽章 */
.external-source-badge {
    background: #e74c3c;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
}

/* 非标准时间徽章 */
.non-standard-time-badge {
    display: inline-block;
    background: #ff9800;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
    cursor: help;
}

/* 状态特定样式 */
.appointment-block-wrapper.pending .appointment-card {
    border-left: 4px solid #ffc107;
}

.appointment-block-wrapper.confirmed .appointment-card {
    border-left: 4px solid #007bff;
}

.appointment-block-wrapper.completed .appointment-card {
    border-left: 4px solid #28a745;
}

.appointment-block-wrapper.cancelled .appointment-card {
    border-left: 4px solid #6c757d;
    opacity: 0.7;
}

/* 外部API预约特殊样式 */
.appointment-block-wrapper[data-source="external_api"] .appointment-card {
    border: 2px solid #e74c3c;
    background: rgba(231, 76, 60, 0.05);
    position: relative;
}

.appointment-block-wrapper[data-source="external_api"] .appointment-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #e74c3c 0%, #c0392b 100%);
    border-radius: 12px 12px 0 0;
}

.appointment-block-wrapper[data-source="external_api"] .appointment-card::after {
    content: "外部API";
    position: absolute;
    top: 8px;
    right: 8px;
    background: #e74c3c;
    color: white;
    font-size: 9px;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: bold;
}

/* 预约详情模态框样式 */
.appointment-details-modal {
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

.appointment-details-modal .appointment-container {
    margin: 0;
    background: transparent;
    box-shadow: none;
    border: none;
}

/* 日历预约响应式设计 */
@media (max-width: 768px) {
    .calendar-appointment .appointment-card {
        padding: 8px;
        border-radius: 8px;
    }
    
    .appointment-info-compact .info-item {
        font-size: 11px;
        padding: 3px 6px;
    }
    
    .appointment-info-compact .info-text {
        max-width: 80px;
    }
    
    .btn-mini {
        padding: 3px 6px;
        font-size: 11px;
        min-width: 28px;
        height: 24px;
    }
    
    .external-source-badge {
        font-size: 9px;
        padding: 1px 3px;
    }
}
/* 修复模态框显示时的页面跳动 */
.new-calendar-appointment-modal {
    position: fixed !important;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10000;
    display: none;
}

.new-calendar-appointment-modal.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* 防止body滚动 */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* 多门店日历视图样式 */
.multi-store-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

/* 移动端多门店控制按钮优化 - 保持原样式只缩小尺寸 */
@media (max-width: 768px) {
    .multi-store-controls {
        padding: 8px;
        gap: 6px;
        margin-bottom: 15px;
    }
    
    .multi-store-controls .btn {
        padding: 6px 12px !important;
        font-size: 12px !important;
        border-radius: 4px !important;
    }
    
    /* 小屏幕手机进一步缩小 */
    @media (max-width: 375px) {
        .multi-store-controls {
            padding: 6px;
            gap: 4px;
            margin-bottom: 12px;
        }
        
        .multi-store-controls .btn {
            padding: 4px 8px !important;
            font-size: 11px !important;
        }
    }
}

.multi-store-grid-container {
    width: 100%;
    height: calc(100vh - 200px);
    background: #f5f5f5;
    padding: 10px;
    box-sizing: border-box;
}

.multi-store-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 400px; /* 固定每行高度，自动生成新行 */
    gap: 10px;
    height: auto; /* 改为自动高度，允许滚动 */
    overflow-y: auto; /* 添加垂直滚动 */
    max-height: calc(100vh - 200px); /* 限制最大高度 */
    padding-bottom: 20px; /* 底部间距 */
}

.multi-store-calendar-wrapper {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.multi-store-calendar-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 15px;
    font-weight: bold;
    text-align: center;
    font-size: 16px;
}

.multi-store-calendar-content {
    flex: 1;
    overflow: auto;
    position: relative;
}

.multi-store-calendar-content .new-calendar-grid {
    min-height: 100%;
}

/* 空位提示 */
.multi-store-empty-slot {
    background: #f8f9fa;
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #718096;
    cursor: pointer;
    transition: all 0.3s ease;
}

.multi-store-empty-slot:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
    color: #475569;
}

.multi-store-empty-slot .empty-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.multi-store-empty-slot .empty-text {
    font-size: 16px;
    font-weight: 500;
}

/* 门店选择模态框 */
.store-selection-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px 0;
}

.store-selection-item {
    padding: 10px 15px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
}

.store-selection-item:hover {
    background: #f5f5f5;
}

.store-selection-item:last-child {
    border-bottom: none;
}

.store-selection-item input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.store-selection-item label {
    cursor: pointer;
    flex: 1;
    font-size: 16px;
}

.store-selection-item.selected {
    background: #e8f4f8;
}

/* 多门店日历网格特殊样式 */
.multi-store-calendar-grid {
    min-height: 100%;
    gap: 1px;
    background-color: #e5e7eb;
    /* 明确设置行数 - 1行标题 + 13行小时槽(9时-21时) */
    grid-template-rows: auto repeat(13, 1fr);
}

/* 调整多门店视图中的时间轴 - 压缩一半 */
.multi-store-calendar-content .time-axis {
    width: 40px;
}

.multi-store-calendar-content .time-axis-header {
    height: 20px;
    font-size: 8px;
    padding: 2px;
    color: white;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.multi-store-calendar-content .time-axis-label {
    font-size: 8px;
    height: 20px;
    line-height: 20px;
    color: var(--text-primary);
}

.multi-store-calendar-content .time-slot-cell {
    height: 20px;
    min-height: 20px;
}

.multi-store-calendar-content .therapist-header {
    font-size: 9px;
    padding: 2px 1px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 多门店视图中的预约块样式 - 压缩一半 */
.multi-store-calendar-content .appointment-card {
    font-size: 7px;
    padding: 1px 2px;
    border-radius: 2px;
}

.multi-store-calendar-content .info-item {
    font-size: 6px;
    margin: 0.5px 0;
}

.multi-store-calendar-content .info-icon {
    font-size: 6px;
    margin-right: 1px;
}

.multi-store-calendar-content .info-text {
    max-width: 30px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 移动端多门店视图字体优化 */
@media (max-width: 768px) {
    /* 多门店日历头部 */
    .multi-store-calendar-header {
        font-size: 12px !important;
        padding: 6px 10px !important;
    }
    
    /* 多门店视图中的时间轴 */
    .multi-store-calendar-content .time-axis-label {
        font-size: 7px !important;
    }
    
    /* 多门店视图中的技师头部 */
    .multi-store-calendar-content .therapist-header {
        font-size: 8px !important;
    }
    
    /* 多门店视图中的预约卡片 */
    .multi-store-calendar-content .appointment-card {
        font-size: 6px !important;
    }
    
    .multi-store-calendar-content .info-item {
        font-size: 6px !important;
    }
    
    /* 小屏幕手机进一步优化 */
    @media (max-width: 375px) {
        .multi-store-calendar-header {
            font-size: 11px !important;
            padding: 4px 8px !important;
        }
        
        .multi-store-calendar-content .time-axis-label {
            font-size: 6px !important;
        }
        
        .multi-store-calendar-content .therapist-header {
            font-size: 7px !important;
        }
        
        .multi-store-calendar-content .appointment-card {
            font-size: 5px !important;
        }
        
        .multi-store-calendar-content .info-item {
            font-size: 5px !important;
        }
        
        .multi-store-calendar-content .info-text {
            max-width: 25px !important;
        }
    }
}

/* 小时槽特殊样式 - 压缩一半 */
.multi-store-calendar-content .hour-slot {
    min-height: 20px;
}

.multi-store-calendar-content .status-multiple {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #5a67d8;
}

.multi-store-calendar-content .status-multiple .appointment-card {
    background: rgba(102, 126, 234, 0.1);
    border-color: #5a67d8;
}

/* 只读模式样式 */
.multi-store-calendar-content .time-slot-cell {
    cursor: default;
}

.multi-store-calendar-content .time-slot-cell.available:hover {
    background-color: transparent;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .multi-store-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 300px; /* 移动端也使用自动行高 */
    }
}

/* 手机端日历预约块简化显示 */
@media (max-width: 768px) {
    /* 隐藏详细信息和操作按钮 */
    .calendar-appointment .appointment-info-compact,
    .calendar-appointment .appointment-actions-compact {
        display: none !important;
        pointer-events: none !important; /* 确保不阻挡点击 */
    }
    
    /* 确保整个预约块可点击 */
    .appointment-block-wrapper {
        cursor: pointer;
    }
    
    /* 调整预约卡片内边距 */
    .calendar-appointment .appointment-card {
        padding: 4px !important;
    }
    
    /* 调整头部布局为垂直居中 */
    .calendar-appointment .appointment-header {
        flex-direction: column;
        align-items: center;
        gap: 2px;
        padding: 0;
    }
    
    /* 缩小时间显示 */
    .calendar-appointment .appointment-time {
        font-size: 10px !important;
        line-height: 1.2;
    }
    
    /* 隐藏时间图标和外部来源徽章 */
    .calendar-appointment .appointment-time-slot {
        font-size: 10px !important;
    }
    
    .calendar-appointment .external-source-badge {
        display: none !important;
    }
    
    /* 突出状态徽章 */
    .calendar-appointment .appointment-status-badge {
        font-size: 9px !important;
        padding: 2px 6px !important;
        margin: 0 auto;
        border-radius: 10px;
    }
    
    /* 确保预约块内容不溢出，但允许跨越多个时间槽 */
    .appointment-block-wrapper {
        /* 移除max-height限制，让预约块可以跨越多个时间槽 */
        overflow: hidden;
    }
}

/* =============================================================
   15分钟预约的紧凑样式
   ============================================================= */

/* 15分钟预约特殊处理 - 缩小字体和间距以适应21px高度 */
.appointment-block-wrapper[data-duration="15"] .appointment-info-compact .info-item {
    font-size: 10px !important;
    padding: 2px 4px !important;
    margin: 1px !important;
}

.appointment-block-wrapper[data-duration="15"] .appointment-info-compact .info-icon {
    font-size: 10px !important;
    width: 12px !important;
    height: 12px !important;
}

.appointment-block-wrapper[data-duration="15"] .appointment-info-compact .info-text {
    font-size: 9px !important;
}

.appointment-block-wrapper[data-duration="15"] .btn-mini {
    padding: 2px 4px !important;
    font-size: 10px !important;
    min-width: 24px !important;
    height: 20px !important;
}

.appointment-block-wrapper[data-duration="15"] .appointment-time {
    font-size: 10px !important;
}

.appointment-block-wrapper[data-duration="15"] .appointment-status-badge {
    font-size: 9px !important;
    padding: 1px 4px !important;
}

/* 减少内部间距 */
.appointment-block-wrapper[data-duration="15"] .appointment-card {
    padding: 4px 6px !important;
}

.appointment-block-wrapper[data-duration="15"] .appointment-info-compact {
    margin: 4px 0 !important;
}

.appointment-block-wrapper[data-duration="15"] .info-row {
    margin-bottom: 2px !important;
    gap: 3px !important;
}

.appointment-block-wrapper[data-duration="15"] .appointment-actions-compact {
    margin-top: 4px !important;
    gap: 2px !important;
}

/* 调整头部布局 */
.appointment-block-wrapper[data-duration="15"] .appointment-header {
    margin-bottom: 4px !important;
    gap: 4px !important;
}

/* 小屏幕手机进一步优化 */
@media (max-width: 375px) {
    .calendar-appointment .appointment-time {
        font-size: 9px !important;
    }
    
    .calendar-appointment .appointment-status-badge {
        font-size: 8px !important;
        padding: 1px 4px !important;
    }
}
