/*
 * 我的预约 · 课程表 tab（顶部统计 + 日历）
 * 日历部分由 new-mycourse.html 的 css/calendar-css/calendar093.css 摘取而来，
 * 全部规则限定在 .cal-wrap / .cal-toggle / .cal-* / .cal-stats 作用域内。
 *
 * 注意：绝对不要引入 css/calendar-css/common.css。
 * 它带有全局 reset（a/body/button/div/p/span/input/... 的 margin/padding/border 全部清零）、
 * body{font-family:微软雅黑} 和 body,html{background:#fff}，会污染整页 weui 样式。
 * 这里只补上日历自身需要的局部 reset（.cal-wrap ul）。
 *
 * rem 基准由 style20220624.css → jquery-weui-20220602.css 的 html{font-size:14px} 提供，
 * 与本页其它部分同源，日历尺寸与原来在 new-mycourse.html 上完全一致。
 */

/* ---------------- 顶部课程统计（已并入折叠条左侧，不再独占一行） ---------------- */
/* 未开课 / 已开课两项数据来自原有四个接口，不新增请求 */
.cal-stats {
	display: flex;
	align-items: center;
	flex: 1;
	min-width: 0;
}

/* 还没拉到数据时不占位，避免折叠条左侧闪一块空白 */
.cal-stats:empty {
	display: none;
}

/* 统计条目按内容宽度排列，不再两栏等分 —— 整体贴左，「收起日历」才有位置贴右 */
.cal-stats .cs-item {
	display: flex;
	align-items: center;
	flex: 0 0 auto;
}

/* 分隔线跟在前一项后面：1px 竖线 + 左右各 8px，比拉动式等分更贴近文字 */
.cal-stats .cs-item + .cs-item::before {
	content: '';
	width: 1px;
	height: 11px;
	margin: 0 8px;
	background: #e5e5e5;
}

.cal-stats .cs-label {
	font-size: 12px;
	line-height: 1.4;
	color: #999999;
	white-space: nowrap;
}

/* 以下三条对应"大数字 + 明细"的三行式统计，当前用的是单行文案（cs-label 内联数字）。
   若要恢复，需同时把 .cal-stats .cs-item 改回 block 并加 flex: 1 */
.cal-stats .cs-num {
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
	color: #333333;
}

.cal-stats .cs-unit {
	margin-left: 2px;
	font-size: 11px;
	font-weight: 400;
	color: #999999;
}

.cal-stats .cs-detail {
	font-size: 11px;
	line-height: 1.4;
	color: #bbbbbb;
}

/* ---------------- 折叠条（左：课程统计 / 右：展开·收起） ---------------- */
.cal-toggle {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	margin: 8px 12px 0 12px;
	padding: 8px 14px;
	background: #ffffff;
	border-radius: 5px;
	font-size: 14px;
	color: #576b95;
	cursor: pointer;
	user-select: none;
	-webkit-user-select: none;
}

/* 右侧文案靠右：用 margin-left:auto 而不是 space-between，
   这样统计还没加载出来（.cal-stats 被 :empty 隐藏）时文案也不会跑到左边 */
.cal-toggle-right {
	display: flex;
	align-items: center;
	flex: 0 0 auto;
	margin-left: auto;
	padding-left: 10px;
}

.cal-toggle-right #calToggleText {
	white-space: nowrap;
}

.cal-toggle-arrow {
	width: 0;
	height: 0;
	margin-left: 6px;
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
	border-top: 6px solid #576b95;
	transition: transform 0.2s ease;
}

.cal-toggle-arrow--up {
	transform: rotate(180deg);
}

/* ---------------- 日历容器 ---------------- */
.cal-wrap {
	padding: 6px 12px 0 12px;
}

/* 局部 reset：不引入 common.css，这里补上 ul/li 的默认样式清除 */
.cal-wrap ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.cal-wrap .calendar {
	width: 100%;
	box-sizing: border-box;
	background: #ffffff;
	box-shadow: 0px 3px 24px 0px rgba(0, 0, 0, 0.1);
	border-radius: 0.2rem;
	overflow: hidden;
	padding: 0 0.2rem;
}

/* 年月 + 左右切换 */
.cal-wrap .calendar .month {
	display: flex;
	align-items: center;
	justify-content: space-between;
	white-space: nowrap;
	padding: 4px 8px;
	background: #ffffff;
}

.cal-wrap .calendar .month .year-month {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.9rem;
	font-weight: bold;
	color: #2D2D2D;
}

.cal-wrap .calendar .month .arrow {
	width: 2rem;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

.cal-wrap .cal-arrow {
	width: 0.4rem;
	height: 0.4rem;
	border-top: 2px solid #666666;
	border-right: 2px solid #666666;
}

.cal-wrap .cal-arrow-right {
	transform: rotate(45deg);
}

.cal-wrap .cal-arrow-left {
	transform: rotate(-135deg);
}

/* 星期表头 */
.cal-wrap .calendar .weekdays {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-around;
	padding: 0.03rem 0;
	margin-bottom: 0.03rem;
	background-color: #f5f6f7;
	border-radius: 0.4rem;
}

.cal-wrap .calendar .weekdays li {
	display: inline-block;
	text-align: center;
	font-size: 0.75rem;
	color: #666666;
}

/* 日期格子 */
.cal-wrap .calendar .days {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-start;
	background: #ffffff;
	padding-bottom: 0.1rem;
}

.cal-wrap .calendar .days li {
	position: relative;
	width: 14.2%;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	color: #000000;
	cursor: pointer;
}

.cal-wrap .calendar .days li .day-li {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 1.6rem;
	height: 1.6rem;
	border-radius: 0.3rem;
}

/* 本月内已过去（早于今天）：数字用中灰，与"未来黑色""补位浅灰"区分开。
   刻意不用灰底 —— 相邻格子的灰底色块会连成一片，反而糊在一起，只用文字色区分更清爽。
   必须写在文件末尾的 .day-checked 文字色规则之前：两者同权重，靠书写顺序决定胜负，选中态白色要赢 */
.cal-wrap .calendar .days li .day-li.day-past .day-span {
	color: #999999;
}

/* 选中：整块黑灰底色 + 白字 */
.cal-wrap .calendar .days li .day-li.day-checked {
	background: #4a4a4a;
}

.cal-wrap .calendar .days li .day-li .day-span {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 1.3rem;
	height: 1.3rem;
	font-size: 0.75rem;
	border-radius: 50%;
}

/* 今天：数字黑色加粗，格子底部挂"今天"小字。
   刻意不用 var(--haoclass_color1)：系统有 8 套主题色，部分主题色（如美团黄）做文字色对比度很差。 */
.cal-wrap .calendar .days li .day-li.day-today .day-span {
	color: #000000;
	font-weight: bold;
}

.cal-wrap .day-today-text {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	font-style: normal;
	font-size: 0.38rem;
	font-weight: bold;
	line-height: 1;
	text-align: center;
	color: #999999;
}

/* 选中态统一放最后：避免与"今天"的规则权重打平后被书写顺序翻盘 */
.cal-wrap .calendar .days li .day-li.day-checked .day-span,
.cal-wrap .calendar .days li .day-li.day-checked.day-today .day-span {
	color: #ffffff;
}

.cal-wrap .calendar .days li .day-li.day-checked .day-today-text {
	color: #ffffff;
}

/* 非本月日期 */
.cal-wrap .other {
	color: #cccccc;
}

/* 每日课数角标：柔和红底 + 白字，挂在格子右上角偏内一点。
   圆圈刻意做小（0.58rem），文字字号保持 0.45rem 不变，靠缩小 padding 而非字号来瘦身 */
.cal-wrap .class_num {
	position: absolute;
	top: -0.12rem;
	right: -0.12rem;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-width: 0.58rem;
	height: 0.58rem;
	padding: 0 0.07rem;
	border-radius: 0.29rem;
	/* 原为 #FA5151（饱和度过高、过于刺眼），改为降饱和的柔和红，白字对比度反而更好 */
	background: #d96a6a;
	color: #ffffff;
	font-size: 0.45rem;
	font-weight: bold;
	line-height: 1;
}

/* 日历下方提示 */
.cal-wrap .cal-hint {
	padding: 6px 0 0 0;
	color: #999999;
	font-size: 12px;
	text-align: center;
}

/* 当天视图：日期标题条 + 返回入口 + 状态标记 */
.cal-day-bar {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
}

.cal-back-all {
	margin-left: auto;
	color: #576b95;
	font-size: 13px;
	cursor: pointer;
}

.cal-status-done {
	display: inline-block;
	vertical-align: middle;
	margin-left: 6px;
	padding: 0 5px;
	border-radius: 3px;
	font-size: 11px;
	line-height: 16px;
	color: #ffffff;
	background: #999999;
}

.cal-loading {
	margin-top: 20px;
	color: #999999;
	font-size: 14px;
	text-align: center;
}
