/**
 * UC考证日历 前台样式
 *
 * 作用域：.ucg（含独立域名模式）
 * 设计：卡片 + 倒计时数字 + 时间轴 + 月历 + 打卡热力图
 */

.ucg {
	--ucg-primary: #4f46e5;
	--ucg-primary-strong: #4338ca;
	--ucg-primary-soft: #eef2ff;
	--ucg-text: #1f2430;
	--ucg-text-2: #5b6474;
	--ucg-muted: #8a93a4;
	--ucg-border: #e6e8ef;
	--ucg-card: #ffffff;
	--ucg-bg: #f6f7fb;
	--ucg-danger: #dc2626;
	--ucg-success: #059669;
	--ucg-warning: #d97706;
	--ucg-radius: 16px;
	--ucg-shadow: 0 10px 30px rgba(31, 36, 48, .07);
	--ucg-shadow-sm: 0 4px 14px rgba(31, 36, 48, .06);

	box-sizing: border-box;
	max-width: 1180px;
	margin: 0 auto;
	padding: 18px 16px 48px;
	color: var(--ucg-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
	font-size: 14px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

.ucg *,
.ucg *::before,
.ucg *::after {
	box-sizing: border-box;
}

.ucg a {
	color: var(--ucg-primary);
	text-decoration: none;
}

.ucg button {
	font-family: inherit;
}

.ucg-standalone-body {
	margin: 0;
	min-height: 100vh;
	background: var(--ucg-bg, #f6f7fb);
}

.ucg--standalone {
	max-width: 1180px;
	padding-top: 28px;
}

/* ---------- 加载 / 提示 ---------- */

.ucg-loading,
.ucg-noscript {
	padding: 60px 20px;
	text-align: center;
	color: var(--ucg-muted);
}

.ucg-notice {
	max-width: 560px;
	margin: 8vh auto;
	padding: 40px 32px;
	background: #fff;
	border: 1px solid var(--ucg-border);
	border-radius: 20px;
	box-shadow: var(--ucg-shadow);
	text-align: center;
}

.ucg-notice__title {
	margin: 0 0 10px;
	font-size: 24px;
	line-height: 1.35;
}

.ucg-notice__text {
	margin: 0 0 22px;
	color: var(--ucg-text-2);
}

.ucg-notice__actions {
	display: flex;
	gap: 10px;
	justify-content: center;
	flex-wrap: wrap;
}

/* ---------- 顶栏 ---------- */

.ucg-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 18px 22px;
	background:
		radial-gradient(120% 140% at 0% 0%, #eef2ff 0%, transparent 55%),
		radial-gradient(120% 140% at 100% 0%, #fdf2f8 0%, transparent 50%),
		#fff;
	border: 1px solid var(--ucg-border);
	border-radius: 22px;
	box-shadow: var(--ucg-shadow-sm);
}

.ucg-brand {
	display: flex;
	align-items: center;
	gap: 14px;
	min-width: 0;
}

.ucg-brand__mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	flex: 0 0 46px;
	border-radius: 14px;
	background: linear-gradient(135deg, var(--ucg-primary), #7c3aed);
	color: #fff;
	font-size: 20px;
	font-weight: 700;
	box-shadow: 0 8px 18px rgba(79, 70, 229, .28);
}

.ucg-brand h1 {
	margin: 0;
	font-size: 20px;
	line-height: 1.3;
	letter-spacing: .2px;
}

.ucg-brand p {
	margin: 2px 0 0;
	font-size: 12px;
	color: var(--ucg-muted);
}

.ucg-top__actions {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 0 0 auto;
}

/* ---------- 按钮 ---------- */

.ucg-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 36px;
	padding: 7px 14px;
	border: 1px solid var(--ucg-border);
	border-radius: 10px;
	background: #fff;
	color: var(--ucg-text);
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: background .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease;
	white-space: nowrap;
}

.ucg-btn:hover {
	border-color: #c9cde0;
	background: #fafbff;
}

.ucg-btn:active {
	transform: translateY(1px);
}

.ucg-btn:focus-visible {
	outline: 3px solid rgba(79, 70, 229, .22);
	outline-offset: 2px;
}

.ucg-btn--primary {
	border-color: transparent;
	background: linear-gradient(135deg, var(--ucg-primary), #6d28d9);
	color: #fff;
	box-shadow: 0 6px 16px rgba(79, 70, 229, .24);
}

.ucg-btn--primary:hover {
	background: linear-gradient(135deg, var(--ucg-primary-strong), #5b21b6);
}

.ucg-btn--ghost {
	border-color: transparent;
	background: transparent;
	color: var(--ucg-text-2);
}

.ucg-btn--ghost:hover {
	background: #f3f4f8;
}

.ucg-btn--danger {
	border-color: #fecaca;
	background: #fff5f5;
	color: var(--ucg-danger);
}

.ucg-btn--sm {
	min-height: 30px;
	padding: 4px 10px;
	font-size: 12px;
	border-radius: 8px;
}

.ucg-btn[disabled] {
	opacity: .55;
	cursor: not-allowed;
	transform: none;
}

.ucg-iconbtn {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 36px;
	padding: 0 12px;
	border: 1px solid var(--ucg-border);
	border-radius: 10px;
	background: #fff;
	color: var(--ucg-text-2);
	font-size: 13px;
	cursor: pointer;
}

.ucg-iconbtn:hover {
	background: #fafbff;
}

.ucg-dot {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 999px;
	background: var(--ucg-danger);
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	line-height: 1;
}

/* ---------- 页签 ---------- */

.ucg-tabs {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 18px 0;
	padding: 6px;
	background: #fff;
	border: 1px solid var(--ucg-border);
	border-radius: 14px;
	overflow-x: auto;
	scrollbar-width: none;
}

.ucg-tabs::-webkit-scrollbar {
	display: none;
}

.ucg-tab {
	flex: 0 0 auto;
	padding: 8px 16px;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: var(--ucg-text-2);
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: background .15s ease, color .15s ease;
}

.ucg-tab:hover {
	background: #f5f6fa;
}

.ucg-tab.is-active {
	background: var(--ucg-primary-soft);
	color: var(--ucg-primary-strong);
	font-weight: 600;
}

.ucg-tabs__spacer {
	flex: 1 1 auto;
}

/* ---------- 页面提示条 ---------- */

.ucg-banner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	margin-bottom: 16px;
	padding: 12px 16px;
	border: 1px solid #c7d2fe;
	border-radius: 12px;
	background: #eef2ff;
	color: #3730a3;
	font-size: 13px;
}

.ucg-banner a {
	font-weight: 600;
}

/* ---------- 倒计时 Hero ---------- */

.ucg-hero {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	padding: 26px 28px;
	border-radius: 22px;
	background:
		radial-gradient(120% 160% at 100% 0%, rgba(124, 58, 237, .32) 0%, transparent 55%),
		linear-gradient(135deg, #312e81 0%, #4f46e5 55%, #7c3aed 100%);
	color: #fff;
	box-shadow: 0 16px 36px rgba(49, 46, 129, .24);
	overflow: hidden;
}

.ucg-hero__eyebrow {
	display: inline-block;
	margin-bottom: 6px;
	padding: 3px 9px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .16);
	font-size: 11px;
	letter-spacing: .6px;
}

.ucg-hero h2 {
	margin: 0 0 6px;
	font-size: 24px;
	line-height: 1.35;
	color: #fff;
}

.ucg-hero p {
	margin: 0;
	color: rgba(255, 255, 255, .78);
	font-size: 13px;
}

.ucg-hero__count {
	display: flex;
	align-items: baseline;
	gap: 6px;
	flex: 0 0 auto;
	padding: 12px 18px;
	border-radius: 18px;
	background: rgba(255, 255, 255, .12);
	backdrop-filter: blur(4px);
}

.ucg-hero__count strong {
	font-size: 52px;
	font-weight: 800;
	line-height: 1;
	letter-spacing: -2px;
}

.ucg-hero__count span {
	font-size: 14px;
	color: rgba(255, 255, 255, .8);
}

/* ---------- 网格与卡片 ---------- */

.ucg-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 16px;
	margin-top: 18px;
}

.ucg-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 20px;
	border: 1px solid var(--ucg-border);
	border-radius: var(--ucg-radius);
	background: var(--ucg-card);
	box-shadow: var(--ucg-shadow-sm);
	transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}

.ucg-card:hover {
	transform: translateY(-2px);
	box-shadow: var(--ucg-shadow);
	border-color: #d8dbea;
}

.ucg-card__head {
	display: flex;
	align-items: flex-start;
	gap: 10px;
}

.ucg-card__head h3 {
	margin: 0;
	font-size: 16px;
	line-height: 1.45;
	flex: 1 1 auto;
}

.ucg-card__head .ucg-btn {
	margin-left: auto;
}

.ucg-card__count {
	display: flex;
	align-items: baseline;
	gap: 8px;
}

.ucg-card__count b {
	font-size: 38px;
	line-height: 1;
	font-weight: 800;
	letter-spacing: -1.5px;
	color: var(--ucg-primary-strong);
}

.ucg-card__count span {
	color: var(--ucg-text-2);
	font-size: 13px;
}

.ucg-card__date {
	margin: -4px 0 0;
	color: var(--ucg-muted);
	font-size: 12px;
}

.ucg-card__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-top: auto;
	padding-top: 12px;
	border-top: 1px dashed var(--ucg-border);
	color: var(--ucg-text-2);
	font-size: 12px;
}

.ucg-badge {
	display: inline-flex;
	align-items: center;
	padding: 2px 8px;
	border-radius: 999px;
	background: #f1f3f9;
	color: var(--ucg-text-2);
	font-size: 11px;
	font-weight: 600;
	white-space: nowrap;
}

.ucg-badge--exam { background: #eef2ff; color: #4338ca; }
.ucg-badge--cert { background: #ecfdf5; color: #047857; }
.ucg-badge--contest { background: #fff7ed; color: #c2410c; }
.ucg-badge--goal { background: #f5f3ff; color: #6d28d9; }
.ucg-badge--danger { background: #fef2f2; color: #b91c1c; }

.ucg-muted {
	color: var(--ucg-muted);
	font-size: 12px;
}

.ucg-empty {
	padding: 46px 24px;
	border: 1px dashed #d9dceb;
	border-radius: 18px;
	background: #fff;
	text-align: center;
	color: var(--ucg-muted);
}

.ucg-empty h3 {
	margin: 0 0 8px;
	color: var(--ucg-text);
	font-size: 17px;
}

.ucg-empty p {
	margin: 0 0 18px;
}

/* ---------- 时间轴 ---------- */

.ucg-timeline {
	display: flex;
	flex-direction: column;
	gap: 0;
	margin-top: 4px;
}

.ucg-tl {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 0 0 14px 18px;
	border-left: 2px solid #edeff6;
	font-size: 12px;
}

.ucg-tl:last-child {
	padding-bottom: 0;
	border-left-color: transparent;
}

.ucg-tl::before {
	content: "";
	position: absolute;
	left: -6px;
	top: 3px;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #d5d9e6;
	border: 2px solid #fff;
	box-shadow: 0 0 0 1px #dfe2ee;
}

.ucg-tl.is-done::before {
	background: #c7cbd8;
}

.ucg-tl.is-next::before {
	background: var(--ucg-primary);
	box-shadow: 0 0 0 3px rgba(79, 70, 229, .18);
}

.ucg-tl__main {
	flex: 1 1 auto;
	min-width: 0;
}

.ucg-tl__title {
	display: flex;
	align-items: center;
	gap: 6px;
	color: var(--ucg-text);
	font-weight: 600;
}

.ucg-tl__meta {
	color: var(--ucg-muted);
	font-size: 11px;
}

.ucg-tl__type {
	font-weight: 500;
}

.ucg-node--signup_start { color: #0f766e; }
.ucg-node--signup_end { color: #b91c1c; }
.ucg-node--admit_print { color: #b45309; }
.ucg-node--exam { color: #4338ca; }
.ucg-node--result { color: #047857; }
.ucg-node--custom { color: #6b7280; }

/* ---------- 工具栏 / 分段控件 ---------- */

.ucg-toolbar {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	margin-bottom: 14px;
}

.ucg-toolbar h2 {
	margin: 0;
	font-size: 20px;
	min-width: 140px;
	text-align: center;
}

.ucg-toolbar__spacer {
	flex: 1 1 auto;
}

.ucg-seg {
	display: inline-flex;
	padding: 3px;
	background: #eef0f6;
	border-radius: 10px;
}

.ucg-seg button {
	padding: 6px 12px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--ucg-text-2);
	font-size: 12px;
	cursor: pointer;
}

.ucg-seg button.is-active {
	background: #fff;
	color: var(--ucg-primary-strong);
	font-weight: 600;
	box-shadow: 0 1px 4px rgba(31, 36, 48, .1);
}

/* ---------- 月历 ---------- */

.ucg-calendar {
	border: 1px solid var(--ucg-border);
	border-radius: 18px;
	background: #fff;
	overflow: hidden;
	box-shadow: var(--ucg-shadow-sm);
}

.ucg-calendar__week {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	background: #f8f9fd;
	border-bottom: 1px solid var(--ucg-border);
}

.ucg-calendar__week span {
	padding: 10px 4px;
	text-align: center;
	color: var(--ucg-muted);
	font-size: 12px;
	font-weight: 600;
}

.ucg-calendar__grid {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
}

.ucg-day {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-height: 92px;
	padding: 8px;
	border: 0;
	border-right: 1px solid #f1f2f7;
	border-bottom: 1px solid #f1f2f7;
	background: #fff;
	text-align: left;
	cursor: pointer;
	transition: background .12s ease;
}

.ucg-day:nth-child(7n) {
	border-right: 0;
}

.ucg-day:hover {
	background: #fafbff;
}

.ucg-day.is-out {
	background: #fbfbfd;
	color: #c3c7d4;
}

.ucg-day.is-today {
	background: #eef2ff;
}

.ucg-day.is-selected {
	box-shadow: inset 0 0 0 2px var(--ucg-primary);
}

.ucg-day__num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	font-size: 12px;
	font-weight: 600;
	color: var(--ucg-text-2);
}

.ucg-day.is-today .ucg-day__num {
	background: var(--ucg-primary);
	color: #fff;
}

.ucg-day__node {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	padding: 1px 5px;
	border-radius: 5px;
	background: #f1f3f9;
	color: var(--ucg-text-2);
	font-size: 10px;
	line-height: 1.5;
}

.ucg-day__node.is-signup_start { background: #ecfdf5; color: #047857; }
.ucg-day__node.is-signup_end { background: #fef2f2; color: #b91c1c; }
.ucg-day__node.is-admit_print { background: #fffbeb; color: #b45309; }
.ucg-day__node.is-exam { background: #eef2ff; color: #4338ca; }
.ucg-day__node.is-result { background: #ecfdf5; color: #047857; }
.ucg-day__node.is-custom { background: #f3f4f6; color: #4b5563; }

.ucg-calendar__legend {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	padding: 12px 16px;
	border-top: 1px solid var(--ucg-border);
	background: #fcfcfe;
	color: var(--ucg-muted);
	font-size: 11px;
}

.ucg-calendar__legend i {
	display: inline-block;
	width: 8px;
	height: 8px;
	margin-right: 5px;
	border-radius: 50%;
	background: currentColor;
	vertical-align: 1px;
}

.ucg-daypanel {
	margin-top: 14px;
	padding: 16px 18px;
	border: 1px solid var(--ucg-border);
	border-radius: 16px;
	background: #fff;
}

.ucg-daypanel__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 10px;
}

.ucg-daypanel__head h3 {
	margin: 0;
	font-size: 15px;
}

.ucg-daypanel__list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ucg-daypanel__item {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 10px 12px;
	border-radius: 10px;
	background: #f8f9fd;
}

.ucg-daypanel__item strong {
	font-size: 13px;
}

.ucg-daypanel__item p {
	margin: 2px 0 0;
	color: var(--ucg-muted);
	font-size: 12px;
}

/* ---------- 打卡 ---------- */

.ucg-checkin__stats {
	display: flex;
	gap: 22px;
}

.ucg-checkin__stats div {
	display: flex;
	flex-direction: column;
}

.ucg-checkin__stats b {
	font-size: 24px;
	line-height: 1.2;
	color: var(--ucg-primary-strong);
}

.ucg-checkin__stats span {
	color: var(--ucg-muted);
	font-size: 11px;
}

.ucg-heat {
	display: grid;
	grid-template-columns: repeat(15, minmax(0, 1fr));
	gap: 4px;
}

.ucg-heat span {
	aspect-ratio: 1 / 1;
	border-radius: 4px;
	background: #eef0f6;
}

.ucg-heat span.is-on {
	background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.ucg-heat span.is-today {
	box-shadow: 0 0 0 2px rgba(79, 70, 229, .35);
}

.ucg-heat__legend {
	display: flex;
	justify-content: space-between;
	color: var(--ucg-muted);
	font-size: 10px;
}

/* ---------- 搭子 ---------- */

.ucg-buddybar {
	display: flex;
	align-items: flex-end;
	gap: 10px;
	flex-wrap: wrap;
	padding: 14px;
	border: 1px solid var(--ucg-border);
	border-radius: 14px;
	background: #fff;
	margin-bottom: 16px;
}

.ucg-field {
	display: flex;
	flex-direction: column;
	gap: 5px;
	min-width: 140px;
	flex: 1 1 160px;
}

.ucg-field > span {
	color: var(--ucg-muted);
	font-size: 11px;
	font-weight: 600;
}

.ucg-field--grow {
	flex: 2 1 220px;
}

.ucg-input {
	width: 100%;
	height: 36px;
	padding: 0 10px;
	border: 1px solid var(--ucg-border);
	border-radius: 9px;
	background: #fff;
	color: var(--ucg-text);
	font-size: 13px;
	font-family: inherit;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.ucg-input:focus {
	outline: 0;
	border-color: var(--ucg-primary);
	box-shadow: 0 0 0 3px rgba(79, 70, 229, .14);
}

.ucg-input--area {
	height: auto;
	min-height: 74px;
	padding: 8px 10px;
	resize: vertical;
	line-height: 1.6;
}

.ucg-buddycard {
	display: grid;
	grid-template-columns: 46px minmax(0, 1fr);
	gap: 12px;
}

.ucg-avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	border-radius: 14px;
	background: linear-gradient(135deg, #eef2ff, #f5f3ff);
	color: var(--ucg-primary-strong);
	font-size: 17px;
	font-weight: 700;
}

.ucg-buddycard__main {
	min-width: 0;
}

.ucg-buddycard__title {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	margin: 0;
	font-size: 15px;
}

.ucg-score {
	display: inline-flex;
	align-items: center;
	padding: 1px 7px;
	border-radius: 999px;
	background: #ecfdf5;
	color: #047857;
	font-size: 11px;
	font-weight: 700;
}

.ucg-buddycard__meta {
	margin: 3px 0 0;
	color: var(--ucg-muted);
	font-size: 12px;
}

.ucg-buddycard__intro {
	margin: 8px 0;
	color: var(--ucg-text-2);
	font-size: 13px;
}

.ucg-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
}

.ucg-tags span {
	padding: 1px 7px;
	border-radius: 6px;
	background: #f1f3f9;
	color: var(--ucg-text-2);
	font-size: 11px;
}

.ucg-buddycard__actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	margin-top: 10px;
}

.ucg-linkbtn {
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--ucg-muted);
	font-size: 12px;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.ucg-linkbtn:hover {
	color: var(--ucg-danger);
}

/* ---------- 收件箱 / 我的 ---------- */

.ucg-panel {
	margin-top: 16px;
	padding: 18px 20px;
	border: 1px solid var(--ucg-border);
	border-radius: 16px;
	background: #fff;
	box-shadow: var(--ucg-shadow-sm);
}

.ucg-panel__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
}

.ucg-panel__head h3 {
	margin: 0;
	font-size: 16px;
}

.ucg-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ucg-listitem {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 14px;
	padding: 12px 14px;
	border: 1px solid #eff0f6;
	border-radius: 12px;
	background: #fcfcfe;
}

.ucg-listitem__main {
	min-width: 0;
}

.ucg-listitem__main strong {
	display: block;
	font-size: 13px;
}

.ucg-listitem__main p {
	margin: 3px 0 0;
	color: var(--ucg-muted);
	font-size: 12px;
}

.ucg-listitem__actions {
	display: flex;
	gap: 8px;
	flex: 0 0 auto;
	flex-wrap: wrap;
}

.ucg-formgrid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 12px;
}

.ucg-formrow {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.ucg-check {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--ucg-text-2);
	font-size: 13px;
	cursor: pointer;
}

.ucg-check input {
	width: 16px;
	height: 16px;
	accent-color: var(--ucg-primary);
}

.ucg-tip {
	margin: 10px 0 0;
	padding: 10px 12px;
	border-radius: 10px;
	background: #fffbeb;
	color: #92400e;
	font-size: 12px;
	line-height: 1.6;
}

.ucg-note {
	margin: 0;
	padding-left: 20px;
	color: var(--ucg-text-2);
	font-size: 12px;
	line-height: 1.9;
}

/* ---------- 通知 ---------- */

.ucg-noticelist {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ucg-noticeitem {
	padding: 11px 13px;
	border-radius: 10px;
	background: #f8f9fd;
	border-left: 3px solid #dfe2ee;
}

.ucg-noticeitem.is-unread {
	background: #eef2ff;
	border-left-color: var(--ucg-primary);
}

.ucg-noticeitem strong {
	display: block;
	font-size: 13px;
}

.ucg-noticeitem p {
	margin: 3px 0 0;
	color: var(--ucg-text-2);
	font-size: 12px;
}

.ucg-noticeitem time {
	display: block;
	margin-top: 4px;
	color: var(--ucg-muted);
	font-size: 11px;
}

/* ---------- 弹层 ---------- */

.ucg-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 5vh 16px 40px;
	overflow-y: auto;
}

.ucg-modal[hidden] {
	display: none;
}

.ucg-modal__mask {
	position: fixed;
	inset: 0;
	background: rgba(17, 20, 30, .46);
	backdrop-filter: blur(2px);
}

.ucg-modal__panel {
	position: relative;
	width: 100%;
	max-width: 640px;
	border-radius: 18px;
	background: #fff;
	box-shadow: 0 24px 70px rgba(17, 20, 30, .26);
	overflow: hidden;
	animation: ucg-pop .18s ease;
}

.ucg-modal--wide .ucg-modal__panel {
	max-width: 820px;
}

@keyframes ucg-pop {
	from { opacity: 0; transform: translateY(10px) scale(.99); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

.ucg-modal__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 20px;
	border-bottom: 1px solid var(--ucg-border);
}

.ucg-modal__head h3 {
	margin: 0;
	font-size: 16px;
}

.ucg-modal__close {
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--ucg-muted);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}

.ucg-modal__close:hover {
	background: #f3f4f8;
	color: var(--ucg-text);
}

.ucg-modal__body {
	padding: 18px 20px;
	max-height: 66vh;
	overflow-y: auto;
}

.ucg-modal__foot {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 10px;
	padding: 14px 20px;
	border-top: 1px solid var(--ucg-border);
	background: #fcfcfe;
}

.ucg-modal__foot .ucg-muted {
	margin-right: auto;
}

/* ---------- 考试库 / 目标编辑 ---------- */

.ucg-lib {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ucg-libitem {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 14px;
	padding: 13px 14px;
	border: 1px solid #eff0f6;
	border-radius: 12px;
	background: #fcfcfe;
}

.ucg-libitem__main {
	min-width: 0;
}

.ucg-libitem__main h4 {
	margin: 0 0 3px;
	font-size: 14px;
	line-height: 1.45;
}

.ucg-libitem__main p {
	margin: 0;
	color: var(--ucg-muted);
	font-size: 12px;
}

.ucg-libitem__actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
}

.ucg-noderow {
	display: grid;
	grid-template-columns: 110px minmax(0, 1fr) 150px 36px;
	gap: 8px;
	align-items: center;
	margin-bottom: 8px;
}

.ucg-noderow .ucg-input {
	height: 34px;
}

.ucg-noderow__del {
	width: 34px;
	height: 34px;
	border: 1px solid #fecaca;
	border-radius: 8px;
	background: #fff5f5;
	color: var(--ucg-danger);
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
}

.ucg-subnote {
	margin: 8px 0 0;
	color: var(--ucg-muted);
	font-size: 12px;
}

/* ---------- Toast ---------- */

.ucg-toast {
	position: fixed;
	left: 50%;
	bottom: 34px;
	z-index: 100001;
	transform: translateX(-50%) translateY(10px);
	padding: 10px 18px;
	border-radius: 999px;
	background: rgba(25, 28, 38, .92);
	color: #fff;
	font-size: 13px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, .24);
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s ease, transform .2s ease;
	max-width: 86vw;
	text-align: center;
}

.ucg-toast.is-show {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

.ucg-toast.is-error {
	background: rgba(153, 27, 27, .95);
}

/* ---------- 响应式 ---------- */

@media (max-width: 768px) {
	.ucg {
		padding: 12px 10px 40px;
	}

	.ucg-top {
		padding: 14px;
		border-radius: 16px;
	}

	.ucg-brand__mark {
		width: 40px;
		height: 40px;
		flex-basis: 40px;
		font-size: 17px;
	}

	.ucg-brand h1 {
		font-size: 17px;
	}

	.ucg-brand p {
		display: none;
	}

	.ucg-hero {
		flex-direction: column;
		align-items: flex-start;
		padding: 20px;
		border-radius: 18px;
	}

	.ucg-hero h2 {
		font-size: 19px;
	}

	.ucg-hero__count {
		align-self: stretch;
		justify-content: center;
	}

	.ucg-hero__count strong {
		font-size: 44px;
	}

	.ucg-grid {
		grid-template-columns: 1fr;
	}

	.ucg-day {
		min-height: 66px;
		padding: 4px;
	}

	.ucg-day__node {
		font-size: 9px;
		padding: 0 3px;
	}

	.ucg-calendar__week span {
		font-size: 11px;
		padding: 8px 2px;
	}

	.ucg-heat {
		grid-template-columns: repeat(10, minmax(0, 1fr));
	}

	.ucg-noderow {
		grid-template-columns: 1fr 1fr;
	}

	.ucg-noderow__del {
		width: 100%;
	}

	.ucg-modal {
		padding: 2vh 8px 20px;
	}

	.ucg-modal__body {
		padding: 14px;
	}

	.ucg-modal__head,
	.ucg-modal__foot {
		padding-left: 14px;
		padding-right: 14px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ucg *,
	.ucg *::before,
	.ucg *::after {
		animation-duration: .01ms !important;
		transition-duration: .01ms !important;
	}
}

/* ============================================================
   深色模式（v3 · 2026-11-19 全量重映射）
   由站点页头右上角开关统一驱动 html.dark。
   覆盖全部浅色硬编码：白底卡片、渐变浅底、语义徽章/节点、白字保留。
   作用域限定 .ucg，浅色路径零改动。
   ============================================================ */
html.dark .ucg {
	--ucg-primary: #7C87FF;
	--ucg-primary-strong: #9BA4FF;
	--ucg-primary-soft: #232A4A;
	--ucg-text: #E8EFF8;
	--ucg-text-2: #A9B8CC;
	--ucg-muted: #7E8DA3;
	--ucg-border: #2A3448;
	--ucg-card: #151F32;
	--ucg-bg: #0C1424;
	--ucg-danger: #FF8080;
	--ucg-success: #4ADE9A;
	--ucg-warning: #FFC46B;
	--ucg-shadow: 0 10px 30px rgba(0, 0, 0, .32);
	--ucg-shadow-sm: 0 4px 14px rgba(0, 0, 0, .28);
	background: var(--ucg-bg);
	color: var(--ucg-text);
}
html.dark .ucg-standalone-body { background: var(--ucg-bg) }

/* --- 白底 / 浅灰底卡片 → 深卡片 --- */
html.dark .ucg .ucg-notice,
html.dark .ucg .ucg-btn,
html.dark .ucg .ucg-iconbtn,
html.dark .ucg .ucg-tabs,
html.dark .ucg .ucg-tab,
html.dark .ucg .ucg-empty,
html.dark .ucg .ucg-seg,
html.dark .ucg .ucg-seg button.is-active,
html.dark .ucg .ucg-calendar,
html.dark .ucg .ucg-calendar__week,
html.dark .ucg .ucg-day,
html.dark .ucg .ucg-day.is-out,
html.dark .ucg .ucg-daypanel,
html.dark .ucg .ucg-daypanel__item,
html.dark .ucg .ucg-buddybar,
html.dark .ucg .ucg-input,
html.dark .ucg .ucg-panel,
html.dark .ucg .ucg-listitem,
html.dark .ucg .ucg-modal__panel,
html.dark .ucg .ucg-modal__close,
html.dark .ucg .ucg-modal__foot,
html.dark .ucg .ucg-toast,
html.dark .ucg .ucg-libitem {
	background: #151F32;
	color: #E8EFF8;
	border-color: #2A3448;
}
html.dark .ucg .ucg-tl { background: #111B2E }
html.dark .ucg .ucg-calendar__legend { background: #1A2639 }
html.dark .ucg .ucg-btn--ghost:hover,
html.dark .ucg .ucg-tab:hover { background: #1A2639 }
html.dark .ucg .ucg-day__node { background: #243149; color: #D6E2F0 }
html.dark .ucg .ucg-tags span,
html.dark .ucg .ucg-heat span { background: #1A2639 }

/* --- 顶部白底渐变卡（截图里最刺眼的浅色块）→ 深墨蓝渐变 --- */
html.dark .ucg .ucg-top {
	background:
		radial-gradient(120% 140% at 0% 0%, rgba(91, 180, 240, .12) 0%, transparent 55%),
		radial-gradient(120% 140% at 100% 0%, rgba(124, 135, 255, .10) 0%, transparent 50%),
		#151F32;
	border-color: #2A3448;
}
/* --- 页面提示条（游客模式那条白底紫字）→ 深底亮字 --- */
html.dark .ucg .ucg-banner {
	background: #1A2639;
	border-color: #384962;
	color: #B9C7DC;
}
html.dark .ucg .ucg-banner a { color: #9BA4FF }
html.dark .ucg .ucg-tip {
	background: #332C1A;
	color: #FFD591;
}
html.dark .ucg .ucg-noticeitem { background: #151F32 }
html.dark .ucg .ucg-noticeitem.is-unread { background: #1A2639 }

/* --- Hero 紫色渐变压深，白字保留 --- */
html.dark .ucg .ucg-hero {
	background:
		radial-gradient(120% 160% at 100% 0%, rgba(124, 135, 255, .22) 0%, transparent 55%),
		linear-gradient(135deg, #1B2145 0%, #2A2E63 55%, #3A2E6B 100%);
	box-shadow: 0 16px 36px rgba(0, 0, 0, .3);
	color: #F0F4FC;
}
html.dark .ucg .ucg-brand__mark,
html.dark .ucg .ucg-avatar { background: linear-gradient(135deg, #3A4278, #4A3C7A); color: #E8EFF8 }

/* --- 语义徽章 / 日历节点：深底 + 亮字，保留色相 --- */
html.dark .ucg .ucg-badge { background: #232A4A; color: #B9C7FF }
html.dark .ucg .ucg-badge--exam,
html.dark .ucg .ucg-day__node.is-exam { background: #232A4A; color: #A9B4FF }
html.dark .ucg .ucg-badge--cert,
html.dark .ucg .ucg-day__node.is-signup_start,
html.dark .ucg .ucg-day__node.is-result,
html.dark .ucg .ucg-score { background: #11362C; color: #6EE7B7 }
html.dark .ucg .ucg-badge--contest,
html.dark .ucg .ucg-day__node.is-admit_print { background: #3A2B1A; color: #FFC46B }
html.dark .ucg .ucg-badge--goal { background: #2E2145; color: #C4B5FD }
html.dark .ucg .ucg-badge--danger,
html.dark .ucg .ucg-day__node.is-signup_end { background: #3A1F26; color: #FFABAB }
html.dark .ucg .ucg-day__node.is-custom { background: #2A3448; color: #B9C7DC }
html.dark .ucg .ucg-btn--danger,
html.dark .ucg .ucg-noderow__del { background: #3A1F26; border-color: #5A2B33; color: #FFABAB }

/* --- 细线/分隔线在深底上提亮 --- */
html.dark .ucg .ucg-tl { border-color: #2A3448 }

/* ============================================================
   品牌图标：把 JS 输出的「考」字换成日历图标（2026-11-19）
   ------------------------------------------------------------
   纯 CSS 方案：零改 JS/DOM，font-size:0 隐藏文字节点，
   ::before 用 SVG mask 画日历图标，currentColor 自动适配深浅色。
   JS 生成节点：<span class="ucg-brand__mark">考</span>（ucgoal.js:425）
   ============================================================ */
.ucg-brand__mark {
	font-size: 0;               /* 隐藏 JS 输出的「考」字文本节点 */
	line-height: 0;
}
.ucg-brand__mark::before {
	content: "";
	display: block;
	width: 24px;
	height: 24px;
	background-color: currentColor;                       /* 继承白色/深色文字色 */
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4.5' width='18' height='16.5' rx='2.5'/%3E%3Cpath d='M3 9.5h18M8 2.5v4M16 2.5v4'/%3E%3Cpath d='M8 14h2M14 14h2M8 17.5h2'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4.5' width='18' height='16.5' rx='2.5'/%3E%3Cpath d='M3 9.5h18M8 2.5v4M16 2.5v4'/%3E%3Cpath d='M8 14h2M14 14h2M8 17.5h2'/%3E%3C/svg%3E") center / contain no-repeat;
}
