﻿:root {
			--bg: #2b2d31;
			--surface: #34373d;
			--surface-2: #3f434c;
			--text: #f2f4f8;
			--muted: #c3c8d3;
			--line: #525965;
			--brand: #8fb3ff;
			--brand-strong: #6f99f5;
			--ok: #63d297;
			--warn: #9aa7ba;
			--theme-transition: 620ms cubic-bezier(0.22, 1, 0.36, 1);
			--theme-transition-fast: 420ms cubic-bezier(0.22, 1, 0.36, 1);
		}

		:root.light {
			--bg: #aec3da;
			--surface: #e1eeff;
			--surface-2: #97adc4;
			--text: #15233e;
			--muted: #486282;
			--line: #899eb5;
			--brand: #3b79d8;
			--brand-strong: #2e66bc;
			--ok: #208c57;
			--warn: #6b7f98;
		}

		* {
			box-sizing: border-box;
		}

		body {
			margin: 0;
			min-height: 100vh;
			font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
			background: radial-gradient(circle at top right, #4b4f56 0%, var(--bg) 48%);
			color: var(--text);
			padding-bottom: 58px;
			transition: background var(--theme-transition), color var(--theme-transition);
		}

		:root.light body {
			background: linear-gradient(180deg, #a2b8ca 0%, #93aec9 34%, #87a4c4 100%);
		}

		.container {
			width: min(1160px, 94vw);
			margin: 0 auto;
			padding: 24px 0 34px;
		}

		.page-head {
			display: flex;
			justify-content: space-between;
			align-items: center;
			gap: 12px;
			margin-bottom: 16px;
			animation: fadeSlideDown 680ms cubic-bezier(0.22, 1, 0.36, 1) both;
		}

		h1 {
			margin: 0;
			font-size: clamp(1.5rem, 2.6vw, 2rem);
			letter-spacing: 0.03em;
		}

		.theme-toggle {
			display: inline-flex;
			align-items: center;
			gap: 8px;
			border: 1px solid var(--line);
			background: linear-gradient(145deg, var(--surface), color-mix(in srgb, var(--surface-2) 72%, var(--surface)));
			color: var(--text);
			border-radius: 999px;
			padding: 7px 12px;
			font-weight: 600;
			font-size: 0.9rem;
			cursor: pointer;
			transition: transform 0.2s ease, box-shadow var(--theme-transition-fast), border-color var(--theme-transition-fast), background var(--theme-transition-fast), color var(--theme-transition-fast);
		}

		.theme-toggle:hover {
			transform: translateY(-1px);
			border-color: color-mix(in srgb, var(--brand) 48%, var(--line));
			box-shadow: 0 8px 22px color-mix(in srgb, var(--brand) 20%, transparent);
		}

		.theme-icon {
			width: 20px;
			height: 20px;
			display: inline-flex;
			align-items: center;
			justify-content: center;
			border-radius: 50%;
			background: color-mix(in srgb, var(--brand) 22%, transparent);
		}

		.panel {
			background: color-mix(in srgb, var(--surface) 90%, transparent);
			border: 1px solid var(--line);
			border-radius: 18px;
			padding: 16px;
			transition: background var(--theme-transition), border-color var(--theme-transition);
			animation: fadeSlideUp 720ms cubic-bezier(0.22, 1, 0.36, 1) both;
		}

		.empty-state {
			min-height: 62vh;
			display: flex;
			align-items: center;
			justify-content: center;
		}

		.empty-card {
			width: min(640px, 92vw);
			text-align: center;
			padding: 28px;
			border-radius: 20px;
			border: 1px dashed color-mix(in srgb, var(--brand) 40%, var(--line));
			background:
				radial-gradient(circle at 10% 15%, color-mix(in srgb, var(--brand) 28%, transparent), transparent 30%),
				radial-gradient(circle at 85% 85%, color-mix(in srgb, var(--warn) 26%, transparent), transparent 34%),
				color-mix(in srgb, var(--surface) 92%, transparent);
		}

		.empty-card h2 {
			margin: 0;
			font-size: clamp(1.25rem, 2vw, 1.5rem);
		}

		.empty-card p {
			margin: 8px 0 18px;
			color: var(--muted);
		}

		.upload-controls {
			display: grid;
			gap: 10px;
			padding: 10px;
			border-radius: 14px;
			border: 1px solid color-mix(in srgb, var(--brand) 26%, var(--line));
			background: linear-gradient(160deg, color-mix(in srgb, var(--surface-2) 56%, transparent), color-mix(in srgb, var(--surface) 88%, transparent));
		}

		.upload-controls.inline {
			grid-template-columns: 1fr auto;
			align-items: center;
		}

		input[type="file"] {
			width: 100%;
			border: 1px dashed color-mix(in srgb, var(--brand) 70%, var(--line));
			background: color-mix(in srgb, var(--surface-2) 82%, var(--surface));
			border-radius: 12px;
			padding: 10px;
			color: var(--text);
		}

		input[type="file"]::file-selector-button {
			border: 0;
			margin-right: 10px;
			padding: 8px 12px;
			border-radius: 8px;
			font-weight: 600;
			color: #edf4ff;
			background: linear-gradient(135deg, var(--brand), var(--brand-strong));
			cursor: pointer;
		}

		input[type="file"]:hover {
			border-color: color-mix(in srgb, var(--brand) 85%, var(--line));
			background: color-mix(in srgb, var(--surface-2) 92%, var(--surface));
		}

		.btn-primary {
			border: 0;
			border-radius: 12px;
			padding: 10px 16px;
			font-size: 14px;
			font-weight: 600;
			cursor: pointer;
			color: #f4f7ff;
			background: linear-gradient(135deg, var(--brand), var(--brand-strong));
			transition: transform 0.2s ease, filter 0.2s ease;
		}

		.btn-primary:hover {
			transform: translateY(-1px);
			filter: brightness(1.04);
		}

		.schedule-section {
			display: none;
			gap: 12px;
		}

		.schedule-head {
			display: flex;
			align-items: center;
			justify-content: space-between;
			gap: 12px;
		}

		.schedule-title {
			margin: 0;
			font-size: 1.12rem;
		}

		.current-date {
			font-size: 14px;
			font-weight: 700;
			color: var(--brand);
		}

		.table-wrap {
			overflow: auto;
			border-radius: 14px;
			border: 1px solid var(--line);
			background: color-mix(in srgb, var(--surface) 95%, transparent);
		}

		table {
			width: 100%;
			border-collapse: collapse;
			table-layout: fixed;
			min-width: 940px;
		}

		thead th {
			padding: 11px 8px;
			border-bottom: 1px solid var(--line);
			border-right: 1px solid var(--line);
			text-align: center;
			font-weight: 700;
			background: color-mix(in srgb, var(--surface-2) 76%, var(--surface));
		}

		thead th.today-col {
			background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 32%, transparent), color-mix(in srgb, var(--surface-2) 80%, transparent));
		}

		thead th:first-child,
		tbody th {
			width: 112px;
		}

		tbody th,
		tbody td {
			height: 136px;
			padding: 8px;
			border-right: 1px solid var(--line);
			border-bottom: 1px solid var(--line);
			vertical-align: top;
		}

		tbody th {
			background: color-mix(in srgb, var(--surface-2) 66%, var(--surface));
			font-size: 13px;
			font-weight: 600;
			text-align: center;
			vertical-align: middle;
		}

		tbody td {
			background: color-mix(in srgb, var(--surface) 94%, transparent);
		}

		tbody td.today-col {
			background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 16%, transparent), color-mix(in srgb, var(--surface) 94%, transparent));
		}

		thead th:last-child,
		tbody td:last-child {
			border-right: 0;
		}

		.slot-index {
			display: block;
			font-size: 12px;
			color: var(--muted);
			margin-bottom: 4px;
		}

		.cell-stack {
			height: 100%;
			display: grid;
			gap: 6px;
			grid-auto-rows: 1fr;
		}

		.course-card {
			height: 100%;
			display: flex;
			flex-direction: column;
			justify-content: space-between;
			border: 1px solid color-mix(in srgb, var(--brand) 40%, var(--line));
			border-radius: 12px;
			padding: 8px;
			background: linear-gradient(165deg, color-mix(in srgb, var(--brand) 19%, transparent), color-mix(in srgb, var(--warn) 16%, transparent));
			overflow: hidden;
		}

		.course-name {
			font-weight: 800;
			font-size: 14px;
			line-height: 1.35;
			margin-bottom: 4px;
		}

		.course-meta {
			display: grid;
			gap: 2px;
			font-size: 12px;
			line-height: 1.35;
		}

		.course-teacher {
			font-weight: 700;
			color: color-mix(in srgb, var(--brand) 84%, var(--text));
		}

		.course-location {
			font-weight: 700;
			color: color-mix(in srgb, var(--warn) 72%, var(--text));
		}

		.empty-cell {
			height: 100%;
			display: grid;
			place-items: center;
			font-size: 12px;
			font-weight: 600;
			color: var(--muted);
			border-radius: 12px;
			border: 1px dashed color-mix(in srgb, var(--line) 70%, transparent);
		}

		.bottom-actions {
			margin-top: 6px;
		}

		.bottom-actions .upload-controls {
			box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 14%, transparent);
		}

		.schedule-section.day-refreshing .table-wrap {
			animation: daySwitchFlash 780ms ease;
		}

		.schedule-section.day-refreshing .course-card,
		.schedule-section.day-refreshing .empty-cell {
			animation: daySwitchCardIn 620ms cubic-bezier(0.22, 1, 0.36, 1);
		}

		.tools-copyright-badge {
			position: fixed;
			left: 50%;
			bottom: 12px;
			transform: translateX(-50%);
			z-index: 9999;
			pointer-events: none;
			padding: 6px 12px;
			border-radius: 999px;
			border: 1px solid color-mix(in srgb, var(--brand) 28%, var(--line));
			background: color-mix(in srgb, var(--surface) 88%, rgba(0, 0, 0, 0.4));
			backdrop-filter: blur(8px);
			font-size: 12px;
			font-weight: 700;
			line-height: 1;
			color: var(--text);
			box-shadow: 0 8px 20px color-mix(in srgb, #000000 28%, transparent);
			white-space: nowrap;
		}

		@keyframes fadeSlideDown {
			from {
				opacity: 0;
				transform: translateY(-10px);
			}
			to {
				opacity: 1;
				transform: translateY(0);
			}
		}

		@keyframes fadeSlideUp {
			from {
				opacity: 0;
				transform: translateY(12px);
			}
			to {
				opacity: 1;
				transform: translateY(0);
			}
		}

		@keyframes daySwitchFlash {
			0% {
				filter: brightness(1);
				transform: scale(1);
			}
			30% {
				filter: brightness(1.1);
				transform: scale(1.003);
			}
			100% {
				filter: brightness(1);
				transform: scale(1);
			}
		}

		@keyframes daySwitchCardIn {
			from {
				opacity: 0;
				transform: translateY(8px);
			}
			to {
				opacity: 1;
				transform: translateY(0);
			}
		}

		@media (max-width: 900px) {
			.container {
				padding: 12px 0 24px;
			}

			.empty-state {
				min-height: 56vh;
			}

			.upload-controls.inline {
				grid-template-columns: 1fr;
			}

			.upload-controls {
				padding: 8px;
			}

			.tools-copyright-badge {
				font-size: 11px;
				bottom: 10px;
				padding: 6px 10px;
			}

			table {
				min-width: 760px;
			}

			thead th:first-child,
			tbody th {
				width: 96px;
			}

			tbody th,
			tbody td {
				height: 120px;
			}

			.slot-index {
				font-size: 11px;
			}

			.course-name {
				font-size: 13px;
			}

			.course-meta {
				font-size: 11px;
			}
		}

		@media (max-width: 640px) {
			.page-head {
				align-items: flex-start;
				gap: 8px;
			}

			h1 {
				font-size: 1.28rem;
			}

			.schedule-head {
				align-items: flex-start;
				flex-direction: column;
				gap: 4px;
			}

			table {
				min-width: 640px;
			}

			thead th:first-child,
			tbody th {
				width: 86px;
				font-size: 12px;
			}

			tbody th,
			tbody td {
				height: 108px;
				padding: 6px;
			}

			.course-card {
				padding: 6px;
				border-radius: 10px;
			}

			.theme-toggle {
				padding: 6px 10px;
				font-size: 0.82rem;
			}

			.tools-copyright-badge {
				max-width: calc(100vw - 20px);
				overflow: hidden;
				text-overflow: ellipsis;
			}
		}

		@media (hover: none) and (pointer: coarse) {
			body {
				padding-bottom: 0;
			}

			.tools-copyright-badge {
				display: none;
			}
		}

