/**
 * 出勤日历 - 前台美观样式（修复全宽问题）
 * 特点：卡片式设计，圆角阴影，出勤日期有明显标记，表格宽度自适应且居中
 */

.attendance-calendar-wrapper {
    max-width: 600px;
    width: 100%;
    margin: 2rem auto;
    background: white;
    border-radius: 24px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.attendance-calendar-wrapper:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 35px rgba(0, 0, 0, 0.15);
}

/* 头部：月份年份 */
.attendance-calendar-header {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: white;
    text-align: center;
    padding: 1.2rem 0;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 1px;
}

.attendance-month-year {
    display: block;
}

/* 表格样式 - 关键修复：固定布局，防止溢出 */
.attendance-calendar-table {
    width: 100%;
    table-layout: fixed;      /* 强制等宽列，防止内容撑开 */
    border-collapse: collapse;
    background: #fff;
}

.attendance-calendar-table th,
.attendance-calendar-table td {
    width: 14.285%;          /* 100% / 7 */
    text-align: center;
    vertical-align: middle;
    padding: 0.6rem 0;
    border: none;
    position: relative;
}

.attendance-calendar-table th {
    background: #f8faff;
    color: #4a627a;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    padding: 0.9rem 0;
    border-bottom: 1px solid #eef2f8;
}

/* 普通日期数字 */
.day-number {
    display: inline-block;
    width: 32px;
    height: 32px;
    line-height: 32px;
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
    border-radius: 50%;
    transition: all 0.2s;
}

/* 出勤日期标记样式：醒目的绿色渐变圆 + 对勾图标 */
.attendance-day.selected {
    background: #e6f7ec;
}

.attendance-day.selected .day-number {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.4);
    font-weight: bold;
}

/* 对勾标记 */
.attendance-mark {
    position: absolute;
    bottom: 4px;
    right: 8px;
    font-size: 11px;
    color: #2ecc71;
    font-weight: bold;
    background: white;
    border-radius: 10px;
    width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* 空单元格 */
.attendance-empty {
    background: #fefefe;
    opacity: 0.6;
}

/* 底部总结 */
.attendance-footer {
    background: #f9fbfe;
    border-top: 1px solid #eef2f8;
    padding: 0.8rem 1rem;
    text-align: center;
    font-size: 14px;
}

.attendance-summary {
    display: inline-block;
    background: #eef2fa;
    color: #2c3e50;
    padding: 0.4rem 1rem;
    border-radius: 40px;
    font-weight: 500;
}

/* 移动端适配 */
@media (max-width: 480px) {
    .attendance-calendar-wrapper {
        max-width: calc(100% - 2rem);
        margin: 1rem;
        border-radius: 16px;
    }
    .day-number {
        width: 28px;
        height: 28px;
        line-height: 28px;
        font-size: 14px;
    }
    .attendance-mark {
        bottom: 2px;
        right: 4px;
        font-size: 9px;
        width: 14px;
        height: 14px;
        line-height: 14px;
    }
    .attendance-calendar-header {
        padding: 1rem 0;
        font-size: 16px;
    }
    .attendance-calendar-table th,
    .attendance-calendar-table td {
        padding: 0.4rem 0;
    }
}

/* 脉冲动画 */
.attendance-day.selected .day-number {
    animation: softPulse 0.5s ease-out;
}

@keyframes softPulse {
    0% { transform: scale(0.9); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}