/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial Unicode MS', Arial, sans-serif;
    background-color: white;
    padding: 20px;
}

/* 容器样式，确保内容居中且不占满整个页面 */
.container {
    max-width: 1106px;
    margin: 0 auto;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    border: 1px solid #e3f2fd;
}

/* 标题样式 */
.title {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
    font-size: 24px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    line-height: 1.2;
    max-width: 100%;
}

/* 顶部区域样式 */
.top-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

/* 左侧日期显示样式 */
.date-display {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 月份导航样式 */
.month-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

/* 移动端样式 - current-year-month在两个切换按钮中间并居中显示 */
@media (max-width: 768px) {
    .month-nav {
        justify-content: center;
        width: 100%;
    }
    
    #current-year-month {
        order: 2;
        margin: 0 15px;
    }
    
    #prev-month {
        order: 1;
    }
    
    #next-month {
        order: 3;
    }
    
    .top-section {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    
    .date-display {
        width: 100%;
    }
    
    .view-buttons {
        margin-top: 10px;
    }
    
    /* 移动端事件样式 - 去除框框，只在日期顶部显示一条线 */
    .day {
        position: relative;
    }
    
    /* 为有事件的日期添加顶部线条 */
    .day:has(.event)::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 80%;
        height: 2px;
        background-color: #e3f2fd;
    }
    
    /* 去除事件的框框样式 */
    .event {
        background-color: transparent;
        padding: 2px 0;
        border-radius: 0;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }
    
    /* 移除事件的hover效果 */
    .event:hover {
        background-color: transparent;
    }
}

.month-nav button {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    background-color: #f9f9f9;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.3s ease;
}

.month-nav button:hover {
    background-color: #e9e9e9;
}

/* 当前日期显示样式 */
#current-date {
    font-size: 16px;
    color: #666;
}

/* 右侧按钮组样式 */
.view-buttons {
    display: flex;
    gap: 10px;
}

/* 按钮样式 */
.view-buttons button {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background-color: #f9f9f9;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.view-buttons button:hover {
    background-color: #e9e9e9;
}

.view-buttons button:active {
    background-color: #d9d9d9;
}

/* 底部区域样式 */
.bottom-section {
    min-height: 400px;
    background-color: white;
    border-radius: 4px;
}

/* 日历内容样式 */
#calendar-content {
    width: 100%;
    font-size: 18px;
    color: #666;
}

/* 月视图样式 */
.calendar-grid {
    width: 100%;
    margin-top: 20px;
}

.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0px;
    margin-bottom: 10px;
}

.weekdays div {
    text-align: center;
    font-weight: bold;
    padding: 10px;
    background-color: white;
    border-radius: 4px;
}

.days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0px;
}

.day {
    min-height: 120px;
    background-color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.day.other-month {
    background-color: white;
}

.day.other-month .day-number {
    color: #999;
}

.day:hover {
    background-color: #f5f5f5;
}

.day.today {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
}

.day.today .day-number {
    font-weight: bold;
    color: #856404;
}

.day-number {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 5px;
    border-top: 1px solid;
}

.day-events {
    flex: 1;
    overflow-y: hidden;
    font-size: 10px;
    line-height: 1.2;
    cursor: pointer;
}

.event {
    /* margin-bottom: 3px; */
    color: #333;
    background-color: #e3f2fd;
    padding: 2px 4px;
    border-radius: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.day.other-month .event {
    color: #ccc;
}

/* 周视图样式 */
.week-view-container {
    position: relative;
    width: 100%;
}

.week-view-content {
    width: 100%;
    border-collapse: collapse;
}

.week-view-events {
    position: absolute;
    top: 88px;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.weekday-headers {
    border-bottom: 1px solid #e3f2fd;
    margin-bottom: 0;
}

.weekday-row,
.date-row {
    display: grid;
    grid-template-columns: 150px repeat(7, 1fr);
    border-bottom: 1px solid #e3f2fd;
}

.weekday-row {
    border-bottom: none;
}

.day-title {
    padding: 10px;
    text-align: center;
    font-weight: bold;
    border-right: 1px solid #e3f2fd;
}

.weekday-short,
.date-short {
    padding: 5px 10px;
    text-align: center;
    border-right: 1px solid #e3f2fd;
}

.weekday-short:last-child,
.date-short:last-child {
    border-right: none;
}

.weekday-short {
    font-weight: bold;
}

.date-short {
    font-size: 12px;
    color: #666;
}

.time-slot {
    display: grid;
    grid-template-columns: 150px repeat(7, 1fr);
    height: 44px;
    border-bottom: 1px solid #e3f2fd;
}

.time-slot-header {
    padding: 10px;
    text-align: left;
    border-right: 1px solid #e3f2fd;
    height: 100%;
}

.time-slot-content {
    padding: 0;
    border-right: 1px solid #e3f2fd;
    height: 100%;
}

.time-slot-content:last-child {
    border-right: none;
}

/* 日视图样式 */
.day-view-title {
    margin-bottom: 20px;
    text-align: left;
}

.day-view-container {
    position: relative;
    width: 100%;
}

.day-view-content {
    width: 100%;
    border-collapse: collapse;
}

.day-view-events {
    position: absolute;
    top: 44px;
    left: 150px;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.day-title-row {
    display: grid;
    grid-template-columns: 150px 1fr;
    border-bottom: 1px solid #e3f2fd;
    margin-bottom: 0;
}

.day-title {
    padding: 10px;
    text-align: center;
    font-weight: bold;
    border-right: 1px solid #e3f2fd;
}

.day-title-content {
    padding: 10px;
    border-right: 1px solid #e3f2fd;
}

.day-time-slot {
    display: grid;
    grid-template-columns: 150px 1fr;
    height: 44px;
    border-bottom: 1px solid #e3f2fd;
}

.day-time-slot-header {
    padding: 10px;
    text-align: left;
    border-right: 1px solid #e3f2fd;
    height: 100%;
}

.day-time-slot-content {
    padding: 0;
    border-right: 1px solid #e3f2fd;
    height: 100%;
}

.event-item {
    position: absolute;
    background-color: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 4px;
    padding: 5px;
    pointer-events: auto;
    overflow: hidden;
}

.day-view-events .event-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.event-title {
    font-weight: bold;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-details {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-time {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.day-view-events .event-title {
    flex: 1;
    margin-bottom: 0;
}

.day-view-events .event-details {
    flex: 1;
}

.day-view-events .event-time {
    flex: 1;
}