:root {
	--bg: #f4f7fb;
	--surface: #ffffff;
	--surface-soft: #eef4fa;
	--text: #203040;
	--muted: #5f6c7b;
	--border: #d8e1ea;
	--accent: #245b86;
	--accent-hover: #1c476b;
	--important-bg: #fff7ea;
	--important-border: #f0b15d;
	--important-text: #8b4a00;
	--shadow: 0 8px 24px rgba(32, 48, 64, 0.08);
}

* {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	font-family: Arial, sans-serif;
	background: linear-gradient(180deg, #f7f9fc 0%, var(--bg) 100%);
	color: var(--text);
	line-height: 1.6;
}

body,
button,
input,
textarea {
	font: inherit;
	font-family: Arial, sans-serif;
}

a {
	color: var(--accent);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

img {
	display: block;
	max-width: 72%;
	height: auto;
	margin: 20px auto;
	border-radius: 14px;
}

img {
	box-shadow: var(--shadow);
}

video {
	display: block;
	max-width: 100%;
	height: auto;
	margin: 20px auto;
	border-radius: 14px;
}

.container {
	width: min(1120px, calc(100% - 32px));
	margin: 32px auto 48px;
}

.card,
.important-card,
.qa-card,
.project-card,
.group-folder,
.record {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 16px;
	box-shadow: var(--shadow);
}

.card,
.important-card {
	padding: 28px 32px;
	margin: 24px auto;
}

h1,
h2,
h3 {
	margin: 0 0 16px;
	text-align: center;
	line-height: 1.2;
	font-weight: 700;
}

h1 {
	font-size: 32px;
}

h2 {
	font-size: 32px;
}

h3 {
	font-size: 32px;
}

p,
li {
	font-size: 22px;
}

p {
	margin: 0.75rem 0;
}

ol,
ul {
	margin: 0.75rem 0;
	padding-left: 1.25rem;
}

ol.nested-list {
	list-style: none;
	counter-reset: item;
	padding-left: 0;
}

ol.nested-list > li {
	counter-increment: item;
	position: relative;
	margin-bottom: 12px;
	padding-left: 36px;
}

ol.nested-list > li::before {
	content: counters(item, ".") ". ";
	position: absolute;
	left: 0;
	color: var(--accent);
	font-weight: 700;
}

ol.nested-list li input[type="checkbox"] {
	margin-right: 10px;
	transform: scale(1.2);
	accent-color: var(--accent);
}

ol.nested-list li ol.subitem {
	padding-left: 40px;
	counter-reset: subitem;
}

ol.nested-list li ol.subitem li {
	counter-increment: subitem;
}

ol.nested-list li ol.subitem li::before {
	content: counters(item, ".") "." counters(subitem, ".") " ";
	position: absolute;
	left: 0;
	color: var(--accent);
	font-weight: 700;
}

input[type="text"],
input[type="number"],
input[type="color"],
select,
textarea,
.search,
#message,
input[type="file"] {
	width: 100%;
	padding: 12px 14px;
	margin: 10px 0;
	border-radius: 10px;
	border: 1px solid var(--border);
	background: var(--surface);
	color: var(--text);
	font-size: 18px;
}

textarea {
	min-height: 110px;
	resize: vertical;
}

button,
.button,
.project-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 18px;
	border: 1px solid var(--accent);
	border-radius: 10px;
	background: var(--accent);
	color: #fff;
	cursor: pointer;
	text-align: center;
	font-size: 1rem;
	font-weight: 700;
	font-size: 18px;
}

button:hover,
.button:hover,
.project-link:hover {
	background: var(--accent-hover);
	border-color: var(--accent-hover);
	color: #fff;
	text-decoration: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible {
	outline: 3px solid rgba(36, 91, 134, 0.25);
	outline-offset: 2px;
}

.backBtn {
	position: fixed;
	top: 20px;
	left: 20px;
	z-index: 100;
}

.important-card {
	background: var(--important-bg);
	border-left: 6px solid var(--important-border);
}

.important-card h2 {
	color: var(--important-text);
}

.record {
	padding: 18px 20px;
	margin-top: 16px;
	background: var(--surface-soft);
}

.progress-container {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 120;
	width: 100%;
	height: 18px;
	background: #dbe5ee;
}

#progress-bar {
	width: 0%;
	height: 18px;
	background: var(--accent);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 18px;
	text-align: center;
}

.project-grid {
	display: flex;
	flex-direction: column;
	gap: 12px;
	width: 100%;
	margin-top: 20px;
}

.project-card {
	padding: 22px;
	background: var(--surface-soft);
}

.project-title {
	margin-bottom: 8px;
	font-size: 1.25rem;
	font-weight: 700;
}

.project-meta {
	margin-bottom: 10px;
	color: var(--muted);
	font-size: 1rem;
}

.project-desc {
	margin-bottom: 14px;
	font-size: 1rem;
}

.group-folder {
	margin-top: 20px;
	padding: 12px 18px;
	background: #fafcff;
}

.group-folder summary {
	cursor: pointer;
	padding: 8px 0;
	list-style: none;
	font-size: 1.2rem;
	font-weight: 700;
}

.group-content {
	margin-top: 12px;
}

#chat {
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-height: 320px;
	max-height: 420px;
	padding: 18px;
	overflow-y: auto;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 14px;
}

.message {
	max-width: 78%;
	padding: 12px 14px;
	border-radius: 14px;
	word-break: break-word;
	box-shadow: none;
}

.message.self {
	margin-left: auto;
	background: var(--accent);
	color: #fff;
}

.message.other {
	margin-right: auto;
	background: var(--surface-soft);
	color: var(--text);
}

.qa-card {
	max-width: 900px;
	margin: 24px auto;
	padding: 18px 28px;
	background: var(--surface-soft);
}

.qa-card p {
	text-indent: 0;
}

.site-note {
	padding: 16px 18px;
	margin: 18px 0;
	background: var(--surface-soft);
	border: 1px solid var(--border);
	border-radius: 12px;
	color: var(--muted);
}

.actions-row,
.exchange-links {
	display: flex;
	gap: 20px;
	flex-wrap: wrap;
	margin-top: 20px;
}

.actions-row > *,
.exchange-links > * {
	flex: 1 1 180px;
	margin: 0;
}

.compact-title {
	margin: 0;
}

.stack-center {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.lab-block {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.lab-block p {
	text-align: center;
}

.lab-block button {
	width: auto;
	margin: 12px auto 0;
}

.center-button {
	display: block;
	width: fit-content;
	margin: 24px auto 0;
}

.labs-list {
	display: flex;
	flex-direction: column;
	gap: 24px;
	margin-top: 20px;
}

.labs-list > .card {
	margin: 0;
}

.teacher-shell {
	display: grid;
	gap: 20px;
}

.teacher-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
}

.teacher-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
}

.teacher-panel {
	padding: 24px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 16px;
	box-shadow: var(--shadow);
}

.teacher-panel h2,
.teacher-panel h3 {
	text-align: left;
}

.teacher-form {
	display: grid;
	gap: 12px;
}

.teacher-form .row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.teacher-form .row-3 {
	display: grid;
	grid-template-columns: 2fr 1fr auto;
	gap: 12px;
	align-items: end;
}

.teacher-list {
	display: grid;
	gap: 12px;
	margin-top: 16px;
}

.teacher-item {
	padding: 16px;
	background: var(--surface-soft);
	border: 1px solid var(--border);
	border-radius: 12px;
}

.teacher-item h4 {
	margin: 0 0 10px;
	font-size: 20px;
}

.teacher-muted {
	color: var(--muted);
	font-size: 16px;
}

.student-note {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 10px;
	align-items: center;
	margin-top: 10px;
}

.student-note input {
	margin: 0;
}

.matrix-toolbar {
	display: grid;
	grid-template-columns: 1fr auto auto;
	gap: 12px;
	align-items: end;
}

.matrix-wrap {
	overflow-x: auto;
	border: 1px solid var(--border);
	border-radius: 12px;
	background: var(--surface);
}

.matrix-table {
	width: 100%;
	border-collapse: collapse;
	min-width: 820px;
}

.matrix-table th,
.matrix-table td {
	border: 1px solid var(--border);
	padding: 10px;
	text-align: center;
	vertical-align: middle;
}

.matrix-table th {
	background: var(--surface-soft);
	font-size: 16px;
}

.matrix-table td:first-child,
.matrix-table th:first-child {
	text-align: left;
	min-width: 240px;
}

.matrix-cell {
	width: 100%;
	padding: 10px;
	border-radius: 8px;
	border: none;
	font-size: 14px;
	font-weight: 700;
}

.matrix-cell.ok {
	background: #c6efce;
	color: #1b5e20;
}

.matrix-cell.bad {
	background: #f4cccc;
	color: #8a1f11;
}

.mini-button {
	width: auto;
	padding: 10px 14px;
	font-size: 14px;
}

.auth-wrap {
	min-height: 70vh;
	display: grid;
	align-items: center;
}

.auth-card {
	max-width: 520px;
	margin: 0 auto;
}

.auth-card h1,
.auth-card h2 {
	text-align: center;
}

.hidden {
	display: none !important;
}

@media (max-width: 768px) {
	.container {
		width: min(100% - 20px, 1120px);
		margin-top: 18px;
	}

	.card,
	.important-card,
	.qa-card {
		padding: 20px;
	}

	.backBtn {
		top: 12px;
		left: 12px;
	}

	button,
	.button,
	.project-link {
		width: 100%;
	}

	.mini-button {
		width: 100%;
	}

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

	.teacher-form .row,
	.teacher-form .row-3,
	.matrix-toolbar {
		grid-template-columns: 1fr;
	}

	.message {
		max-width: 100%;
	}

	img,
	video {
		max-width: 100%;
	}
}
