* {
	box-sizing: border-box;
}

[hidden] {
	display: none !important;
}

body {
	margin: 0;
	min-height: 100vh;
	background: #f5f7fb;
	color: #172033;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
	font-size: 16px;
	line-height: 1.6;
}

a {
	color: #0b63ce;
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

.topbar {
	border-bottom: 1px solid #e1e7f0;
	background: #ffffff;
}

.topbar-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: min(1120px, calc(100% - 40px));
	min-height: 64px;
	margin: 0 auto;
}

.brand {
	color: #16213a;
	font-size: 20px;
	font-weight: 700;
	letter-spacing: 0;
}

.brand-sub {
	color: #667085;
	font-size: 14px;
}

.top-actions {
	display: flex;
	align-items: center;
	gap: 14px;
}

.login-trigger,
.logout-trigger {
	width: auto;
	height: 32px;
	border: 1px solid #d8e0eb;
	background: #f8fafc;
	color: #596579;
	padding: 0 11px;
	font-size: 13px;
	font-weight: 600;
}

.login-trigger:hover,
.logout-trigger:hover {
	border-color: #b8c4d4;
	background: #eef2f7;
	color: #263247;
}

.user-status {
	display: flex;
	align-items: center;
	gap: 8px;
	color: #536074;
	font-size: 13px;
}

.user-name {
	color: #263247;
	font-weight: 700;
}

.user-level {
	border-left: 1px solid #d8e0eb;
	padding-left: 8px;
}

.logout-trigger {
	height: 28px;
	border: 0;
	background: transparent;
	padding: 0 4px;
	font-weight: 500;
}

.page {
	width: min(1120px, calc(100% - 40px));
	margin: 0 auto;
	padding: 42px 0 32px;
}

.tool {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: 28px;
	align-items: start;
}

.panel,
.side {
	border: 1px solid #e1e7f0;
	border-radius: 8px;
	background: #ffffff;
	box-shadow: 0 10px 30px rgba(22, 33, 58, 0.06);
}

.panel {
	padding: 28px;
}

.side {
	padding: 22px;
}

.section-title {
	margin: 0 0 8px;
	font-size: 26px;
	font-weight: 750;
	line-height: 1.25;
}

.section-desc {
	margin: 0 0 24px;
	color: #667085;
}

.search-form {
	display: grid;
	grid-template-columns: 150px minmax(0, 1fr) 110px;
	gap: 12px;
	align-items: stretch;
}

select,
input,
button {
	width: 100%;
	height: 44px;
	border-radius: 6px;
	font: inherit;
}

select,
input {
	border: 1px solid #ccd5e1;
	background: #ffffff;
	color: #172033;
	padding: 0 12px;
	outline: none;
}

select:focus,
input:focus {
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

button {
	border: 0;
	background: #145bd7;
	color: #ffffff;
	font-weight: 700;
	cursor: pointer;
}

button:hover {
	background: #0f4fc0;
}

button:disabled {
	background: #8aa7de;
	cursor: wait;
}

.top-actions .login-trigger {
	width: auto;
	min-width: 52px;
	height: 30px;
	border: 1px solid #d8e0eb;
	border-radius: 6px;
	background: #ffffff;
	color: #536074;
	padding: 0 10px;
	font-size: 13px;
	font-weight: 600;
	box-shadow: none;
}

.top-actions .login-trigger:hover {
	border-color: #b8c4d4;
	background: #f8fafc;
	color: #263247;
	text-decoration: none;
}

.top-actions .logout-trigger {
	width: auto;
	height: 28px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: #667085;
	padding: 0 4px;
	font-size: 13px;
	font-weight: 500;
}

.top-actions .logout-trigger:hover {
	background: #f1f5f9;
	color: #263247;
}

.result {
	margin-top: 22px;
}

.empty {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 220px;
	border: 1px dashed #cbd5e1;
	border-radius: 8px;
	background: #f8fafc;
	color: #667085;
	text-align: center;
}

.result-link {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: 10px;
	align-items: start;
	margin-bottom: 14px;
	border: 1px solid #d9e6ff;
	border-radius: 8px;
	background: #f8fbff;
	padding: 14px;
	font-size: 14px;
}

.result-label {
	display: inline-flex;
	align-items: center;
	height: 26px;
	border-radius: 999px;
	background: #145bd7;
	color: #ffffff;
	padding: 0 10px;
	font-size: 13px;
	font-weight: 700;
	white-space: nowrap;
}

.result-url {
	display: block;
	padding-top: 2px;
	color: #075fc4;
	line-height: 1.7;
	word-break: break-all;
}

.result-note {
	margin-top: 5px;
	color: #667085;
	font-size: 12px;
	line-height: 1.6;
}

.download-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	min-height: 68px;
	margin-bottom: 12px;
	border: 1px solid #dbe4ef;
	border-radius: 8px;
	background: #f8fafc;
	padding: 12px 14px;
}

.download-label {
	color: #263247;
	font-size: 15px;
	font-weight: 700;
}

.download-preview {
	display: block;
	width: min(260px, 100%);
	margin-top: 8px;
	aspect-ratio: 16 / 9;
	border: 1px solid #dbe4ef;
	border-radius: 6px;
	background: #0f172a;
	object-fit: contain;
}

.download-button {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	min-width: 82px;
	height: 38px;
	border-radius: 6px;
	background: #145bd7;
	color: #ffffff;
	padding: 0 18px;
	font-size: 14px;
	font-weight: 700;
}

.download-button:hover {
	background: #0f4fc0;
	color: #ffffff;
	text-decoration: none;
}

.preview-wrap {
	overflow: auto;
	border: 1px solid #e1e7f0;
	border-radius: 8px;
	background: #f8fafc;
	padding: 14px;
}

.preview-wrap img {
	display: block;
	width: min(100%, 720px);
	max-height: 520px;
	object-fit: contain;
	border-radius: 6px;
	background: #ffffff;
}

.error {
	margin-top: 14px;
	border: 1px solid #fecaca;
	border-radius: 8px;
	background: #fff1f2;
	color: #b42318;
	padding: 12px 14px;
}

.info,
.success {
	margin-top: 14px;
	border: 1px solid #bfdbfe;
	border-radius: 8px;
	background: #eff6ff;
	color: #1d4ed8;
	padding: 12px 14px;
}

.success {
	border-color: #bbf7d0;
	background: #f0fdf4;
	color: #15803d;
}

.auth-page {
	max-width: 520px;
}

.auth-panel {
	padding: 28px;
}

.auth-form {
	display: grid;
	gap: 14px;
}

.auth-form label {
	display: grid;
	gap: 6px;
	color: #445064;
	font-weight: 700;
}

.auth-form .checkbox-label {
	display: flex;
	align-items: center;
	gap: 8px;
}

.auth-form .checkbox-label input {
	width: auto;
	height: auto;
}

.button-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	border-radius: 6px;
	background: #145bd7;
	color: #ffffff;
	padding: 0 14px;
	font-weight: 700;
}

.button-link.secondary {
	background: #64748b;
}

.modal {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: grid;
	place-items: center;
	padding: 20px;
}

.modal.is-open {
	display: grid;
}

.modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.48);
}

.login-dialog {
	position: relative;
	z-index: 1;
	width: min(420px, 100%);
	border: 1px solid #dbe3ee;
	border-radius: 8px;
	background: #ffffff;
	box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
	padding: 26px;
}

.login-dialog h2 {
	margin: 0 0 6px;
	font-size: 21px;
}

.login-dialog > p {
	margin: 0 0 20px;
	color: #667085;
	font-size: 14px;
}

.modal-close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 34px;
	height: 34px;
	background: transparent;
	color: #667085;
	font-size: 24px;
	font-weight: 400;
	line-height: 1;
}

.modal-close:hover {
	background: #eef2f7;
	color: #263247;
}

.login-form {
	display: grid;
	gap: 9px;
}

.login-form label {
	color: #445064;
	font-size: 14px;
	font-weight: 700;
}

.login-form input {
	margin-bottom: 5px;
}

.login-form button[type="submit"] {
	margin-top: 7px;
}

.login-error {
	border: 1px solid #fecaca;
	border-radius: 6px;
	background: #fff1f2;
	color: #b42318;
	padding: 9px 11px;
	font-size: 13px;
}

.modal-open {
	overflow: hidden;
}

.side h2 {
	margin: 0 0 14px;
	font-size: 18px;
}

.platform-list {
	display: grid;
	gap: 8px;
	margin: 0 0 20px;
	padding: 0;
	list-style: none;
	color: #445064;
}

.platform-list li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-bottom: 1px solid #eef2f7;
	padding-bottom: 8px;
}

.sample {
	margin: 0;
	color: #667085;
	font-size: 14px;
	word-break: break-all;
}

.footer {
	width: min(1120px, calc(100% - 40px));
	margin: 0 auto;
	border-top: 1px solid #e1e7f0;
	padding: 18px 0 28px;
	color: #667085;
	font-size: 14px;
}

@media (max-width: 920px) {
	.tool {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 680px) {
	.topbar-inner,
	.page,
	.footer {
		width: min(100% - 24px, 1120px);
	}

	.topbar-inner {
		align-items: flex-start;
		flex-direction: column;
		gap: 2px;
		padding: 14px 0;
	}

	.top-actions {
		width: 100%;
		align-items: center;
		justify-content: space-between;
		gap: 8px;
	}

	.brand-sub {
		display: none;
	}

	.user-status {
		flex-wrap: wrap;
	}

	.page {
		padding-top: 22px;
	}

	.panel,
	.side {
		padding: 18px;
	}

	.section-title {
		font-size: 22px;
	}

	.search-form {
		grid-template-columns: 1fr;
	}

	.result-link {
		grid-template-columns: 1fr;
		gap: 8px;
	}

	.download-row {
		align-items: stretch;
		flex-direction: column;
		gap: 10px;
	}

	.download-preview {
		width: 100%;
		max-height: 240px;
	}

	.download-button {
		width: 100%;
	}
}
