/* 出勤表外层 - 增强兼容性 */
.schedule-container {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    margin: 40px auto;
    max-width: 1100px;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    padding: 0 15px;
}

/* 左边标题 */
.schedule-title {
    min-width: 160px;
    text-align: center;
    font-family: "Oswald", "Noto Sans JP", Arial, sans-serif;
    font-weight: 700;
    color: #f08080;
    letter-spacing: 2px;
    line-height: 1.4;
    font-size: 16px;
    position: relative;
    margin: 0;
    padding: 10px 0;
}

/* 方括号效果 - 增强兼容性 */
.schedule-title::before,
.schedule-title::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 12px;
    border: 2px solid #f08080;
    box-sizing: border-box;
}

.schedule-title::before {
    left: -20px;
    border-right: none;
}

.schedule-title::after {
    right: -20px;
    border-left: none;
}

/* 网格布局 - 增强兼容性 */
.schedule-grid {
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    display: -ms-grid;
    display: grid;
    -ms-grid-columns: 1fr 8px 1fr 8px 1fr 8px 1fr;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-left: 40px;
    width: 100%;
}

/* 单日卡片 - 增强兼容性 */
.schedule-day {
    background: #fff;
    border: 1px solid #fae5da;
    border-radius: 4px;
    padding: 14px 10px;
    text-align: center;
    min-height: 100px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    font-family: "Oswald", "Noto Sans JP", Arial, sans-serif;
    font-weight: 600;
    position: relative;
    box-sizing: border-box;
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
}

/* 悬停效果 */
.schedule-day:hover {
    -webkit-transform: translateY(-3px);
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 星期字母 */
.day-header {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 6px;
    line-height: 1;
}

/* 日期 */
.day-date {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1;
}

/* 出勤时间 */
.day-time {
    font-size: 16px;
    color: #333;
    border-top: 1px dotted #ccc;
    padding-top: 6px;
    font-weight: 500;
    line-height: 1.2;
}

/* 休息日 → 灰色 */
.schedule-day.rest .day-header,
.schedule-day.rest .day-date,
.schedule-day.rest .day-time {
    color: #aaa;
}

/* 工作日颜色方案 - 增强兼容性 */
/* 第1天工作日 - 粉红色 */
.schedule-day[data-index="0"].working .day-header,
.schedule-day[data-index="0"].working .day-date {
    color: #ff1493;
}

.schedule-day[data-index="0"].working .day-time {
    color: #ff69b4;
}

/* 第2天工作日 - 橙色 */
.schedule-day[data-index="1"].working .day-header,
.schedule-day[data-index="1"].working .day-date {
    color: #ff6347;
}

.schedule-day[data-index="1"].working .day-time {
    color: #ff8c00;
}

/* 第3天工作日 - 金黄色 */
.schedule-day[data-index="2"].working .day-header,
.schedule-day[data-index="2"].working .day-date {
    color: #ffa500;
}

.schedule-day[data-index="2"].working .day-time {
    color: #ffb347;
}

/* 第4天工作日 - 绿色 */
.schedule-day[data-index="3"].working .day-header,
.schedule-day[data-index="3"].working .day-date {
    color: #228b22;
}

.schedule-day[data-index="3"].working .day-time {
    color: #32cd32;
}

/* 第5天工作日 - 青色 */
.schedule-day[data-index="4"].working .day-header,
.schedule-day[data-index="4"].working .day-date {
    color: #008b8b;
}

.schedule-day[data-index="4"].working .day-time {
    color: #00ced1;
}

/* 第6天工作日 - 蓝色 */
.schedule-day[data-index="5"].working .day-header,
.schedule-day[data-index="5"].working .day-date {
    color: #191970;
}

.schedule-day[data-index="5"].working .day-time {
    color: #4169e1;
}

/* 第7天工作日 - 紫色 */
.schedule-day[data-index="6"].working .day-header,
.schedule-day[data-index="6"].working .day-date {
    color: #663399;
}

.schedule-day[data-index="6"].working .day-time {
    color: #9370db;
}

/* 第8天工作日 - 深紫色 */
.schedule-day[data-index="7"].working .day-header,
.schedule-day[data-index="7"].working .day-date {
    color: #4b0082;
}

.schedule-day[data-index="7"].working .day-time {
    color: #8a2be2;
}

/* 周六紫色 - 只对休息日生效 */
.schedule-day.rest.saturday .day-header,
.schedule-day.rest.saturday .day-date {
    color: #6f42c1;
}

/* 周日红色 - 只对休息日生效 */
.schedule-day.rest.sunday .day-header,
.schedule-day.rest.sunday .day-date {
    color: #dc3545;
}

/* 今天标记 - 增强兼容性 */
.schedule-day.today::before {
    content: 'TODAY';
    position: absolute;
    top: -8px;
    left: 50%;
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%);
    background: #28a745;
    color: white;
    font-size: 8px;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: bold;
    white-space: nowrap;
    z-index: 10;
}

.schedule-day.today {
    position: relative;
    border: 2px solid #28a745;
}

/* 响应式设计 - 手机端优化 */
/* 平板设备 */
@media (max-width: 1024px) {
    .schedule-container {
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -ms-flex-direction: column;
        flex-direction: column;
        margin: 30px auto;
    }

    .schedule-title {
        margin-bottom: 20px;
        min-width: auto;
        width: 100%;
    }

    .schedule-grid {
        margin-left: 0;
        -ms-grid-columns: 1fr 8px 1fr 8px 1fr 8px 1fr;
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 手机设备 - 标题在上，8个日期排列 */
@media (max-width: 768px) {
    .schedule-container {
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -ms-flex-direction: column;
        flex-direction: column;
        margin: 20px auto;
        padding: 0 10px;
    }

    .schedule-title {
        margin-bottom: 15px;
        min-width: auto;
        width: 100%;
        font-size: 18px;
        padding: 12px 0;
    }

    .schedule-grid {
        margin-left: 0;
        -ms-grid-columns: 1fr 8px 1fr;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        width: 100%;
    }

    .schedule-day {
        min-height: 90px;
        padding: 12px 8px;
    }

    .day-header {
        font-size: 20px;
    }

    .day-date {
        font-size: 16px;
    }

    .day-time {
        font-size: 14px;
    }
}

/* 小屏手机设备 - 单列布局 */
@media (max-width: 480px) {
    .schedule-grid {
        -ms-grid-columns: 1fr;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .schedule-day {
        min-height: 85px;
        padding: 10px 8px;
    }

    .schedule-title {
        font-size: 16px;
        padding: 10px 0;
    }

    .schedule-title::before {
        left: -10px;
    }

    .schedule-title::after {
        right: -10px;
    }

    .day-header {
        font-size: 18px;
    }

    .day-date {
        font-size: 15px;
    }

    .day-time {
        font-size: 13px;
    }
}

/* 针对旧版IE的兼容性处理 */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
    .schedule-grid {
        display: -ms-flexbox;
        display: flex;
        -ms-flex-wrap: wrap;
        flex-wrap: wrap;
    }

    .schedule-day {
        width: calc(25% - 8px);
        margin: 4px;
    }

    @media (max-width: 768px) {
        .schedule-container {
            display: block;
        }

        .schedule-day {
            width: calc(50% - 10px);
        }
    }

    @media (max-width: 480px) {
        .schedule-day {
            width: 100%;
        }
    }
}

/* 针对Safari的特定优化 */
@supports (-webkit-touch-callout: none) {
    .schedule-day {
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
}