﻿/* CSS Variables for Custom Theme */
.calendar-widget {
	--primary-color: #0f4caf;
	--secondary-color: #4080ff;
	--accent-color: #f59e0b;
	--bg-color: #f5f7fa;
	--card-bg: rgba(255, 255, 255, 0.95);
	--text-main: #333;
	--text-secondary: #666;
	--border-color: #d0d7e3;
	--today-bg: #e0e7ff;
	--event-dot: #4080ff;
	/* Disabled State Optimization */
	--text-disabled: #71717a;
	/* Zinc 500, Contrast 4.5:1 */
	--bg-disabled: #f4f4f5;
	/* Zinc 100 */
}

.calendar-widget, .calendar-widget * {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
}

.calendar-widget {
	color: var(--text-main);
	line-height: 1.5;
}

.calendar-widget a {
	color: inherit;
}

.calendar-widget button {
	font: inherit;
	line-height: inherit;
}


/* 隐藏 CMS 数据容器，仅供 JS 解析使用 */
.calendar-widget #cmsDataContainer, .calendar-widget #cmsDataContainer .infoList {
	display: none !important;
}

.calendar-widget {
	display: flex;
	float: none !important;
	width: 100%;
	max-width: 1200px;
	margin-left: auto !important;
	margin-right: auto !important;
	height: 700px;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
	overflow: hidden;
	position: relative;
	flex-direction: column;
}

/* Title Bar */
.calendar-widget .widget-header {
	padding: 20px 40px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-bottom: 1px solid #f0f0f0;
	flex-shrink: 0;
	background:
		linear-gradient(135deg, rgba(64, 128, 255, 0.08), rgba(255, 255, 255, 0) 45%),
		linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.92));
}

.calendar-widget .brand-title {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding-left: 18px;
	position: relative;
	cursor: default;
	transition: transform 0.35s ease;
}

.calendar-widget .brand-title:hover {
	transform: scale(1.02);
}

.calendar-widget .brand-title::before {
	content: '';
	position: absolute;
	left: -18px;
	top: -6px;
	width: 54px;
	height: 54px;
	background: radial-gradient(circle, rgba(64, 128, 255, 0.18), rgba(64, 128, 255, 0));
	pointer-events: none;
}

.calendar-widget .brand-title h1 {
	font-size: 28px;
	font-weight: 800;
	background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	position: relative;
	letter-spacing: 2px;
	line-height: 1.05;
	filter: drop-shadow(0 6px 14px rgba(64, 128, 255, 0.18));
}

.calendar-widget .brand-title h1::before {
	content: '';
	position: absolute;
	left: -18px;
	top: 50%;
	transform: translateY(-50%);
	width: 6px;
	height: 76%;
	background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
	border-radius: 10px;
	box-shadow: 0 0 16px rgba(15, 76, 175, 0.28);
}

.calendar-widget .brand-title span {
	width: fit-content;
	padding: 3px 10px;
	font-size: 11px;
	color: #6b7aa6;
	text-transform: uppercase;
	letter-spacing: 1.8px;
	font-weight: 700;
	opacity: 0.95;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.8);
	border: 1px solid rgba(64, 128, 255, 0.14);
	box-shadow: 0 4px 12px rgba(15, 76, 175, 0.08);
}

.calendar-widget .view-more-btn {
	color: var(--primary-color);
	text-decoration: none;
	font-size: 14px;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 20px;
	background-color: #fff;
	border: 1.5px solid var(--primary-color);
	border-radius: 24px;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	font-weight: 600;
	box-shadow: 0 2px 6px rgba(15, 76, 175, 0.1);
	letter-spacing: 0.5px;
}

.calendar-widget .view-more-btn span {
	transition: transform 0.3s ease;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-family: serif;
	font-weight: bold;
	font-size: 16px;
}

.calendar-widget .view-more-btn:hover {
	color: #fff;
	background-color: var(--primary-color);
	border-color: var(--primary-color);
	box-shadow: 0 4px 15px rgba(15, 76, 175, 0.3);
	transform: translateY(-1px);
}

.calendar-widget .view-more-btn:active {
	transform: translateY(1px);
	box-shadow: 0 2px 4px rgba(15, 76, 175, 0.2);
}

.calendar-widget .view-more-btn:hover span {
	transform: translateX(4px);
}

/* Main Container */
.calendar-widget .widget-body {
	display: flex;
	flex: 1;
	/* 填充剩余空间 */
	background: url('https://images.unsplash.com/photo-1507413245164-6160d8298b31?auto=format&fit=crop&q=80&w=1000') no-repeat center center;
	background-size: cover;
	position: relative;
	overflow: hidden;
}

.calendar-widget .widget-body::after {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.88);
	backdrop-filter: blur(4px);
	z-index: 1;
}

.calendar-widget .calendar-container {
	position: relative;
	z-index: 2;
	padding: 20px 30px;
	flex: 1.1;
	/* 稍微给日历多一点空间 */
	min-width: 420px;
	/* 随整体宽度微调 */
}

.calendar-widget .event-details {
	position: relative;
	z-index: 2;
	padding: 20px 30px;
	flex: 1;
	min-width: 350px;
	/* 随整体宽度微调 */
	border-left: 1px solid rgba(0, 0, 0, 0.05);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	height: 100%;
	/* 强制占满高度 */
}

/* Calendar Controls */
.calendar-widget .calendar-controls {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 25px;
}

.calendar-widget .current-month {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 18px;
	border-radius: 18px;
	font-size: 20px;
	font-weight: 700;
	color: var(--text-main);
	background: rgba(255, 255, 255, 0.72);
	border: 1px solid rgba(64, 128, 255, 0.12);
	box-shadow: 0 10px 24px rgba(15, 76, 175, 0.08);
	backdrop-filter: blur(8px);
}

.calendar-widget #calendarIcon {
	width: 36px;
	height: 36px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 12px;
	background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(255, 193, 7, 0.08));
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
	font-size: 18px;
}

.calendar-widget #yearMonthText {
	letter-spacing: 0.5px;
}

.calendar-widget .nav-buttons {
	display: flex;
	gap: 12px;
}

.calendar-widget .nav-btn {
	width: 40px;
	height: 40px;
	border: 1px solid rgba(64, 128, 255, 0.2);
	background: rgba(255, 255, 255, 0.78);
	border-radius: 14px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--secondary-color);
	font-size: 16px;
	font-weight: 700;
	box-shadow: 0 8px 18px rgba(15, 76, 175, 0.08);
	backdrop-filter: blur(8px);
	transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.calendar-widget #todayBtn {
	width: 44px;
	color: #fff;
	background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
	border-color: transparent;
	box-shadow: 0 10px 20px rgba(15, 76, 175, 0.22);
}

.calendar-widget .nav-btn:hover {
	border-color: rgba(64, 128, 255, 0.35);
	background: #fff;
	transform: translateY(-2px);
	box-shadow: 0 12px 22px rgba(15, 76, 175, 0.14);
}

.calendar-widget .nav-btn:active {
	transform: translateY(0);
	box-shadow: 0 6px 12px rgba(15, 76, 175, 0.1);
}

/* Calendar Grid */
.calendar-widget .calendar-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 10px;
	height: 380px;
	/* 固定日历网格高度 */
}

.calendar-widget .weekday {
	text-align: center;
	font-size: 14px;
	color: var(--text-secondary);
	padding-bottom: 15px;
}

.calendar-widget .day-cell {
	aspect-ratio: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	cursor: pointer;
	border-radius: 8px;
	position: relative;
	transition: all 0.2s;
}

.calendar-widget .day-cell:hover:not(.empty):not(.disabled) {
	background: rgba(0, 0, 0, 0.03);
}

.calendar-widget .day-cell.disabled {
	color: var(--text-disabled);
	cursor: not-allowed;
	background: var(--bg-disabled) !important;
	opacity: 0.6;
	font-weight: 400;
}

.calendar-widget .day-cell.disabled::before {
	content: '';
	position: absolute;
	width: 60%;
	height: 1px;
	background: currentColor;
	transform: rotate(-45deg);
	opacity: 0.3;
}

.calendar-widget .day-cell.disabled .holiday-label {
	color: #a1a1aa;
}

.calendar-widget .day-cell.today {
	font-weight: 700;
	color: var(--primary-color);
	border: 2px solid var(--primary-color);
}

.calendar-widget .day-cell.selected {
	background: var(--primary-color) !important;
	color: #fff !important;
}

.calendar-widget .day-cell.has-event {
	font-weight: 600;
	color: var(--primary-color);
	background: rgba(15, 76, 175, 0.05);
}

.calendar-widget .day-cell.has-event::after {
	content: '';
	position: absolute;
	bottom: 6px;
	width: 6px;
	height: 6px;
	background: var(--event-dot);
	border-radius: 50%;
	box-shadow: 0 0 4px rgba(64, 128, 255, 0.4);
}

.calendar-widget .day-cell.selected.has-event::after {
	background: #fff;
}

.calendar-widget .day-cell.other-month {
	color: #e5e7eb;
	pointer-events: none;
}

/* Event Details Area */
.calendar-widget .event-card {
	display: block;
	text-decoration: none;
	padding: 18px 20px;
	margin-bottom: 20px;
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.4);
	/* 初始半透明 */
	border: 1px solid rgba(255, 255, 255, 0.6);
	transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
	cursor: pointer;
	position: relative;
	backdrop-filter: blur(5px);
	/* 玻璃拟态效果 */
}

.calendar-widget .event-card:hover {
	background: #fff;
	transform: translateY(-4px);
	/* 向上浮动 */
	box-shadow: 0 12px 30px rgba(15, 76, 175, 0.12);
	/* 柔和的品牌色阴影 */
	border-color: rgba(15, 76, 175, 0.1);
}

.calendar-widget .event-card:active {
	transform: translateY(-2px);
	box-shadow: 0 6px 15px rgba(15, 76, 175, 0.1);
}

.calendar-widget .event-card-header {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-bottom: 10px;
}

.calendar-widget .event-card-title {
	font-size: 18px;
	font-weight: 700;
	color: #333;
	line-height: 1.4;
	margin-top: -2px;
	/* 对齐 info-bar */
	transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.calendar-widget .event-card:hover .event-card-title {
	transform: translateX(10px);
	color: var(--primary-color);
}

.calendar-widget .deadline-tag {
	color: #333;
}

.calendar-widget .event-card-body {
	padding-left: 15px;
	margin-top: 10px;
}

.calendar-widget .event-description {
	font-size: 16px;
	color: #666;
	margin-bottom: 8px;
	padding-top: 12px;
	border-top: 1px solid #eee;
}

.calendar-widget .event-date {
	font-size: 14px;
	color: #999;
	margin-top: 5px;
}

.calendar-widget .info-bar {
	flex-shrink: 0;
	width: 6px;
	height: 22px;
	background: #004596;
	border-radius: 10px;
	margin-top: 3px;
}

.calendar-widget .no-events {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 100%;
	color: #a0aec0;
	padding: 40px 20px;
	text-align: center;
	animation: calendarWidgetFadeIn 0.5s ease;
}

.calendar-widget .no-events::before {
	content: '☕';
	font-size: 50px;
	margin-bottom: 15px;
	filter: grayscale(0.2);
	opacity: 0.7;
}

.calendar-widget .no-events .empty-title {
	font-size: 18px;
	font-weight: 600;
	color: #718096;
	margin-bottom: 8px;
}

.calendar-widget .no-events .empty-subtitle {
	font-size: 14px;
	color: #a0aec0;
}

@keyframes calendarWidgetFadeIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.calendar-widget .event-content {
	height: 380px;
	/* 固定内容区高度，与左侧日历对齐 */
	transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
	width: 100%;
}

.calendar-widget .event-content.slide-left {
	transform: translateX(-30px);
	opacity: 0;
}

.calendar-widget .event-content.slide-right {
	transform: translateX(30px);
	opacity: 0;
}

.calendar-widget .event-content.slide-in {
	transform: translateX(0);
	opacity: 1;
}

.calendar-widget .pagination {
	height: 50px;
	/* 固定分页控件高度 */
	margin-top: auto;
	display: flex;
	align-items: center;
	gap: 15px;
	padding-top: 10px;
	transition: opacity 0.3s ease;
	flex-shrink: 0;
	/* 禁止被压缩 */
}

.calendar-widget .pagination.hidden {
	opacity: 0;
	pointer-events: none;
}

.calendar-widget .page-info {
	font-weight: 500;
	font-family: "Courier New", Courier, monospace;
	/* 使用等宽字体防止跳动 */
	min-width: 60px;
	/* 增加宽度以适应放大的数字 */
	display: flex;
	align-items: baseline;
	gap: 2px;
}

.calendar-widget #currentPage {
	font-size: 28px;
	/* 放大当前页码数字 */
	color: #333;
}

.calendar-widget .page-info .total {
	font-size: 18px;
	/* 保持总页数较小 */
	color: #999;
}

.calendar-widget .page-controls {
	display: flex;
	gap: 8px;
}

.calendar-widget .page-btn {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: 1px solid #e2e8f0;
	background: #fff;
	color: #4a5568;
	display: flex;
	justify-content: center;
	align-items: center;
	cursor: pointer;
	transition: all 0.2s;
	font-size: 14px;
}

.calendar-widget .page-btn:hover:not(:disabled) {
	background: #f7fafc;
	border-color: var(--primary-color);
	color: var(--primary-color);
}

.calendar-widget .page-btn:disabled {
	opacity: 0.3;
	cursor: not-allowed;
}

.calendar-widget .holiday-label {
	position: absolute;
	top: 4px;
	right: 4px;
	font-size: 10px;
	color: var(--accent-color);
}

/* Responsive */
@media (max-width: 768px) {
	.calendar-widget .widget-header {
		padding: 15px 20px;
	}

	.calendar-widget .calendar-container,
	.calendar-widget .event-details {
		flex: 1 1 100%;
		border-left: none;
		padding: 20px;
	}

	.calendar-widget .event-details {
		border-top: 1px solid rgba(0, 0, 0, 0.05);
	}
}