/* 基础日历容器样式 */
.jsai-calendar {
    max-width: 100%;
    height: 100%; /* 继承父级高度 */
    background: #fff; 
    position: relative; /* 用于弹出框定位 */
    overflow: hidden;
    display: flex; /* 启用flex布局 */
    flex-direction: column; /* 垂直排列子元素 */
}

/* 头部控制区 */
.calendar-header {
    display: flex;
    gap: 1.25rem;
    align-items: center;
    padding: .625rem 0;
    font-size: 1rem;
    color: gray;
}
.today-btn{margin-left: auto;}
.jsai-btn {
    padding: 6px 12px;
    cursor: pointer;
    border: 1px solid #e0e0e0;
    background: #f8f9fa;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 14px;
}

.jsai-btn:hover {
    background: #e9ecef;
    border-color: #d0d0d0;
}
.jsai-btn i{font-size:1.5rem;}
.current-month {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    min-width: 100px;
}

/* 星期标题 */
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 8px;
}

.weekday {
    text-align: center;
    padding: 8px 4px;
    font-weight: 600;
    font-size: 14px;
    color: #666;
    background: #f8f9fa;
    border-radius: 4px 4px 0 0;
}

/* 日期网格（响应式核心） */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(6, 1fr); /* 6行平均分配高度 */
    gap: 6px;
    flex: 1; /* 占据容器剩余高度 */
}

/* 日期单元格 - 自适应填充网格空间 */
.calendar-cell {
    padding: 8px;
    border: 1px solid #e6e6e6;
    border-radius: 1rem;
    position: relative;
    transition: all 0.2s;
    /* 使用flex实现内容垂直水平居中 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* 空单元格（上月/下月） */
.cell-empty {
    background: #fafafa;
    border-color: #f0f0f0;
    opacity: 0.5;
}

/* 有文章的日期 */
.has-post {
    background: #EB713E90;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px #EB713E;
	
}

.has-post:hover {
    background: #EB713E;
	border-color: #EB713E;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px #EB713E80;
}

/* 日期数字 - 确保居中显示 */
.cell-date {
    font-weight: 600;
    font-size: 1.125rem;
    color: #333;
    /* 移除底部外边距，通过flex布局控制间距 */
    margin-bottom: 0;
}

/* 文章数量标记 - 隐藏数字，改为小点 */
.post-badge {
    /* 隐藏原数量标记 */
    display: none;
}

/* 用伪元素添加小点标记（在日期下方） */
.has-post::after {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color:white; /* 与主题色保持一致 */
}
.has-post .cell-date{ color:white;}
.has-post.is-today{background-color: #00AFEC;}
.has-post.is-today:hover{box-shadow: 0 2px 8px #00AFEC80; border:0;}
/* 今天标记 */
.is-today {
    border-color: #00AFEC;
    box-shadow: inset 0 0 0 1px #00AFEC;
	background:#00AFEC20;
}

/* 弹出框容器（限制在日历内显示） */
.calendar-modal-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none; /* 允许点击穿透 */
    z-index: 10;
}

/* 弹出框样式 */
.calendar-modal {
    position: absolute; /* 相对于日历容器定位 */
    display: none;
    align-items: center;
    justify-content: center;
    padding: 10px;
    pointer-events: auto;
	width:90%;
}

.modal-content {
    background: #fff;
    padding: 1rem;
    border-radius: 1rem;
    width: 100%;  
    max-height: 80%; 
    overflow-y: auto; 
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    position: relative;
}
.modal-content h3{
	font-size:18px;
}

.close-modal {
    position: absolute;
    right: 10px;
    top: 6px;
    border: none;
    background: transparent;
    font-size: 22px;
    cursor: pointer;
    color: #666;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.close-modal:hover {
    background: #f5f5f5;
}

.modal-posts {
    display:flex;
	flex-direction: column;
	gap:10px;
}

.modal-posts li {	
	position:relative;
	font-size:16px;
	
}
.modal-posts a:after {
    content:'';
	width:4px;
	height:4px;
	background:#00AFEC;
	position:absolute;
	left:10px;
	top:50%;
	transform:translateY(-50%);
}


.modal-posts a {
	position:relative;
	border-radius:8px;
	padding:10px;
    padding-left:24px;
	display:block;
    text-decoration: none;
	background:#F5F5F5;
    transition: color 0.2s;
	overflow:hidden;
	text-overflow:ellipsis;
	white-space:nowrap;
}

.modal-posts a:hover {
    color: #00AFEC;
	background: #00AFEC0a;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .calendar-grid {
        gap: 4px;
    }
    .calendar-cell {
        padding: 6px;
    }
    .cell-date {
        font-size: 14px;
    }
	.calendar-modal{
		width:100%;
	}
    .modal-content {
        max-width: none;
		padding: 12px;
		border-radius: 12px;
    }
	.modal-content h3{
		font-size:14px;
	}
	.modal-posts li {
		font-size:14px;
	}
}

@media (max-width: 480px) {
    .calendar-header {
        flex-wrap: wrap;
        gap: 8px;
    }
    .jsai-btn {
        padding: 4px 8px;
        font-size: 13px;
    }
    .has-post::after {
        width: 3px;
        height: 3px;
        margin-top: 4px;
    }
}