:root {
	font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
	color: #17201d;
	background: #f3f5f4;
	font-synthesis: none;
	letter-spacing: 0;
	--green: #173e34;
	--green-2: #2f6656;
	--mint: #e2eee9;
	--blue: #275d86;
	--amber: #a36313;
	--red: #a23a3a;
	--ink: #17201d;
	--muted: #68736f;
	--line: #d9dfdc;
	--surface: #ffffff;
	--shadow: 0 8px 24px rgba(23, 62, 52, 0.08);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
a { color: inherit; }

.login-page {
	min-height: 100vh;
	display: grid;
	grid-template-columns: minmax(320px, 0.9fr) minmax(460px, 1.1fr);
	background: #eef2f0;
}
.login-brand {
	background: var(--green);
	color: white;
	padding: clamp(40px, 8vw, 110px);
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}
.brand-mark { font-size: 22px; font-weight: 800; }
.login-brand h1 { font-size: clamp(38px, 5vw, 66px); line-height: 1.15; margin: 40px 0 20px; max-width: 660px; }
.login-brand p { color: #cfe0da; max-width: 560px; line-height: 1.8; }
.login-note { font-size: 13px; color: #a9c1b8; }
.login-panel { display: grid; place-items: center; padding: 30px; }
.login-form { width: min(420px, 100%); background: white; padding: 36px; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.login-form h2 { margin: 0 0 8px; font-size: 25px; }
.login-form .hint { margin-bottom: 28px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 232px 1fr; }
.sidebar { background: #132d27; color: #edf5f2; padding: 22px 14px 18px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.sidebar-brand { flex: 0 0 auto; padding: 8px 12px 20px; font-size: 20px; font-weight: 800; }
.sidebar-brand small { display: block; color: #9fbbb1; font-size: 11px; margin-top: 5px; font-weight: 500; }
.nav { display: grid; gap: 3px; align-content: start; flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-right: 2px; scrollbar-width: thin; scrollbar-color: #45685e transparent; }
.nav button { border: 0; background: transparent; color: #bfd1cb; padding: 11px 12px; border-radius: 6px; text-align: left; }
.nav button:hover, .nav button.active { background: #23483e; color: white; }
.sidebar-footer { flex: 0 0 auto; border-top: 1px solid #315148; padding: 14px 0 0; margin-top: 10px; }
.user-name { font-weight: 700; font-size: 14px; }
.user-enterprise { font-size: 12px; color: #9fbbb1; margin: 4px 0 12px; }

.main { min-width: 0; }
.topbar { height: 68px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 30px; position: sticky; top: 0; z-index: 5; }
.topbar-title { font-weight: 800; }
.content { padding: 28px 30px 60px; max-width: 1320px; margin: 0 auto; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-header h1 { font-size: 27px; margin: 0 0 6px; }
.hint { color: var(--muted); font-size: 14px; line-height: 1.7; margin: 0; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat { background: white; border: 1px solid var(--line); border-radius: 6px; padding: 18px; }
.stat-label { color: var(--muted); font-size: 13px; }
.stat-value { font-size: 30px; font-weight: 800; margin-top: 10px; }
.stat.ready .stat-value { color: var(--green-2); }
.stat.processing .stat-value { color: var(--blue); }
.stat.attention .stat-value { color: var(--amber); }

.panel { background: white; border: 1px solid var(--line); border-radius: 7px; padding: 22px; margin-bottom: 18px; }
.panel-header { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 18px; }
.panel h2, .panel h3 { margin: 0; font-size: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.action-tile { border: 1px solid var(--line); padding: 20px; border-radius: 6px; background: #fbfcfb; min-height: 148px; display: flex; flex-direction: column; align-items: flex-start; }
.action-tile h3 { margin: 0 0 8px; }
.action-tile p { color: var(--muted); line-height: 1.65; flex: 1; }
.quick-submit { min-height: 330px; display: flex; flex-direction: column; }
.quick-submit h2 { margin-bottom: 6px; }
.quick-submit .field { margin-top: 18px; flex: 1; }
.quick-submit .form-actions { margin-top: auto; }
.quick-submit textarea { min-height: 190px; }

.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field label { font-weight: 700; font-size: 13px; }
.field input, .field textarea, .field select, .search {
	width: 100%; border: 1px solid #cfd7d3; border-radius: 5px; padding: 11px 12px; color: var(--ink); background: white;
}
.field textarea { min-height: 128px; resize: vertical; line-height: 1.7; }
.field input:focus, .field textarea:focus, .field select:focus, .search:focus { outline: 2px solid #a8c8bd; border-color: var(--green-2); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.button { border: 1px solid var(--green); background: var(--green); color: white; padding: 10px 16px; border-radius: 5px; font-weight: 700; }
.button:hover { background: #0f3028; }
.button.secondary { background: white; color: var(--green); }
.button.danger { background: white; color: var(--red); border-color: #d8a7a7; }
.button.ghost { background: transparent; color: inherit; border-color: currentColor; }
.button:disabled { opacity: .55; cursor: not-allowed; }
.button.small { padding: 7px 11px; font-size: 12px; }

.table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; min-width: 760px; border-collapse: collapse; }
th, td { padding: 12px 10px; border-bottom: 1px solid #e4e8e6; text-align: left; vertical-align: top; font-size: 13px; }
th { color: var(--muted); font-weight: 700; background: #f7f9f8; }
tr[data-id] { cursor: pointer; }
tr[data-id]:hover { background: #f5f8f6; }
.status { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border-radius: 4px; font-size: 12px; background: #edf0ef; color: #56615d; }
.status.ready, .status.published { background: #e2f0e9; color: #226448; }
.status.processing, .status.uploading, .status.impact_pending { background: #e5eff7; color: #285f88; }
.status.needs_input, .status.pending { background: #fff0d8; color: #8b580e; }
.status.failed, .status.rejected { background: #f8e2e2; color: #933535; }

.report-head { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.score { width: 72px; height: 72px; border-radius: 50%; border: 7px solid var(--mint); display: flex; align-items: baseline; justify-content: center; gap: 2px; color: var(--green); font-weight: 800; flex: 0 0 auto; }
.score b { font-size: 20px; }
.score small { font-size: 12px; }
.client-picker { display: grid; grid-template-columns: auto minmax(220px, 360px) 1fr; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 18px; border: 1px solid var(--line); background: #fff; }
.client-picker label { font-weight: 700; }
.client-picker select { width: 100%; }
.client-picker span { color: var(--muted); font-size: 13px; }
@media (max-width: 1100px) { .client-picker { grid-template-columns: 1fr; } }
.report-section { padding: 20px 0; border-top: 1px solid var(--line); }
.report-section h3 { margin: 0 0 12px; }
.report-section p { line-height: 1.8; }
.issue { border-left: 3px solid #dca353; padding: 4px 0 4px 14px; margin: 16px 0; }
.issue strong { display: block; margin-bottom: 6px; }
.script-box { white-space: pre-wrap; background: #f6f8f7; border: 1px solid var(--line); padding: 18px; border-radius: 5px; line-height: 1.9; }
.dimension-list { display: grid; grid-template-columns: repeat(5, minmax(110px, 1fr)); gap: 8px; }
.dimension { background: #f5f8f6; padding: 12px; border-radius: 5px; }
.dimension b { display: block; font-size: 20px; color: var(--green); margin-bottom: 5px; }

.resource-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.resource { border: 1px solid var(--line); background: white; border-radius: 6px; padding: 18px; min-height: 190px; display: flex; flex-direction: column; }
.lesson-no { color: var(--green-2); font-weight: 800; font-size: 12px; }
.resource h3 { margin: 10px 0; font-size: 16px; }
.resource p { color: var(--muted); line-height: 1.65; flex: 1; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { background: #eef2f0; padding: 3px 7px; border-radius: 3px; font-size: 11px; color: #59635f; }
.resource-actions { display: flex; gap: 8px; margin-top: 16px; }

.impact { border: 1px solid var(--line); border-radius: 6px; padding: 18px; margin-bottom: 12px; }
.impact-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.impact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.impact-block { background: #f7f9f8; padding: 12px; border-radius: 5px; }
.impact-block h4 { margin: 0 0 8px; font-size: 13px; }
.impact-block ul { margin: 0; padding-left: 18px; line-height: 1.7; }

.progress { height: 8px; background: #e5e9e7; border-radius: 4px; overflow: hidden; margin-top: 8px; }
.progress span { display: block; height: 100%; background: var(--green-2); width: 0; transition: width .2s; }
.thinking { padding: 34px 6px 20px; max-width: 720px; margin: 0 auto; }
.thinking-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.thinking-head strong { font-size: 17px; }
.thinking-head p, .thinking-note { color: var(--muted); font-size: 13px; line-height: 1.7; margin: 7px 0 0; }
.thinking-dot { display: inline-block; width: 10px; height: 10px; margin-right: 10px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 0 rgba(39,93,134,.35); animation: thinking-pulse 1.4s infinite; }
.thinking-time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.thinking-track { height: 9px; margin-top: 22px; background: #e5e9e7; border-radius: 5px; overflow: hidden; }
.thinking-track span { display: block; height: 100%; min-width: 8%; border-radius: 5px; background: linear-gradient(90deg, var(--green-2), var(--blue), var(--green-2)); background-size: 200% 100%; animation: thinking-flow 1.8s linear infinite; transition: width .5s ease; }
@keyframes thinking-pulse { 70% { box-shadow: 0 0 0 9px rgba(39,93,134,0); } 100% { box-shadow: 0 0 0 0 rgba(39,93,134,0); } }
@keyframes thinking-flow { to { background-position: -200% 0; } }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.loading { padding: 80px; text-align: center; color: var(--muted); }
.toast { position: fixed; right: 24px; bottom: 24px; background: #182a24; color: white; padding: 12px 16px; border-radius: 5px; box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s; z-index: 50; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #843939; }
.mobile-menu { display: none; }

@media (max-width: 980px) {
	.stats { grid-template-columns: repeat(2, 1fr); }
	.resource-grid, .grid-3 { grid-template-columns: repeat(2, 1fr); }
	.dimension-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
	.login-page { grid-template-columns: 1fr; }
	.login-brand { padding: 34px 24px; min-height: 280px; }
	.login-brand h1 { font-size: 36px; margin-top: 30px; }
	.login-panel { padding: 20px; }
	.login-form { padding: 26px 20px; }
	.app-shell { display: block; }
	.sidebar { position: fixed; z-index: 20; left: -250px; width: 232px; transition: left .2s; }
	.sidebar.open { left: 0; }
	.mobile-menu { display: inline-flex; }
	.topbar { padding: 0 16px; }
	.content { padding: 22px 16px 50px; }
	.page-header { align-items: flex-start; flex-direction: column; }
	.grid-2, .grid-3, .resource-grid, .impact-grid { grid-template-columns: 1fr; }
	.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.stat { padding: 14px; }
	.stat-value { font-size: 25px; }
	.panel { padding: 17px; }
	.dimension-list { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
	.assignment-table-wrap { overflow: visible; }
	.assignment-table { min-width: 0; }
	.assignment-table thead { display: none; }
	.assignment-table, .assignment-table tbody, .assignment-table tr, .assignment-table td { display: block; width: 100%; }
	.assignment-table tr { padding: 14px 0; border-bottom: 1px solid #e4e8e6; }
	.assignment-table tr:last-child { border-bottom: 0; }
	.assignment-table td { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 10px; padding: 5px 0; border: 0; overflow-wrap: anywhere; }
	.assignment-table td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 700; }
}
