:root {
	--bg: #f4f5f8;
	--panel: #ffffff;
	--panel-2: #f0f1f5;
	--text: #1a1b2e;
	--muted: #6b7280;
	--accent: #fa9d00;
	--accent-glow: rgba(250, 157, 0, 0.15);
	--accent-hover: #e08f00;
	--blue: #0033ff;
	--blue-hover: #002acc;
	--blue-tint: rgba(0, 51, 255, 0.08);
	--danger: #e21d38;
	--danger-tint: rgba(226, 29, 56, 0.08);
	--border: #e0e2e8;
	--radius: 12px;
	--radius-sm: 8px;
	--shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
	--shadow-md: 0 4px 12px rgba(0, 0, 0, 0.07);
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	font-family:
		system-ui,
		-apple-system,
		Segoe UI,
		Roboto,
		sans-serif;
	background: var(--bg);
	color: var(--text);
	min-height: 100vh;
}

.app {
	max-width: 960px;
	margin: 0 auto;
	padding: 24px 16px 64px;
}

.spinner {
	text-align: center;
	color: var(--muted);
	margin-top: 80px;
}

/* ---- Login ---- */
.login-wrap {
	max-width: 400px;
	margin: 10vh auto 0;
}

.login {
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 0;
	text-align: center;
	overflow: hidden;
	box-shadow: var(--shadow-md);
}

.login-top {
	background: linear-gradient(135deg, rgba(250, 157, 0, 0.1), rgba(0, 51, 255, 0.04));
	padding: 32px 28px 20px;
	border-bottom: 1px solid var(--border);
}

.login-logo {
	width: 48px;
	height: 48px;
	border-radius: 14px;
	background: linear-gradient(135deg, var(--accent), var(--accent-hover));
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 14px;
	font-size: 22px;
	font-weight: 800;
	color: #fff;
	box-shadow: 0 4px 16px var(--accent-glow);
}

.login-top h1 {
	margin: 0 0 4px;
	font-size: 22px;
	color: var(--accent);
}

.login-top p {
	color: var(--muted);
	margin: 0;
	font-size: 14px;
}

.login-body {
	padding: 20px 28px 32px;
}

.login input {
	width: 100%;
	padding: 12px 14px;
	font-size: 16px;
	border-radius: 10px;
	border: 1px solid var(--border);
	background: var(--panel-2);
	color: var(--text);
	margin-bottom: 14px;
	transition:
		border-color 0.2s,
		box-shadow 0.2s;
}

.login input:focus {
	outline: none;
	border-color: var(--blue);
	box-shadow: 0 0 0 3px var(--blue-tint);
}

button {
	cursor: pointer;
	border: none;
	border-radius: 10px;
	font-size: 15px;
	font-weight: 600;
	padding: 11px 20px;
	background: var(--accent);
	color: #fff;
	transition:
		background 0.15s,
		box-shadow 0.2s,
		transform 0.1s;
}

button:active {
	transform: scale(0.97);
}
button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	transform: none;
}
button.full {
	width: 100%;
}

button:hover:not(:disabled) {
	background: var(--accent-hover);
	box-shadow: 0 0 20px var(--accent-glow);
}

button.ghost {
	background: transparent;
	border: 1px solid var(--border);
	color: var(--muted);
}

button.ghost:hover:not(:disabled) {
	background: var(--panel-2);
	color: var(--text);
	box-shadow: none;
}

button.download-btn {
	background: transparent;
	border: 1px solid rgba(250, 157, 0, 0.3);
	color: var(--accent);
	padding: 8px 16px;
	font-size: 13px;
}

button.download-btn:hover:not(:disabled) {
	background: rgba(250, 157, 0, 0.08);
	border-color: var(--accent);
	box-shadow: 0 0 16px var(--accent-glow);
}

button.danger {
	background: transparent;
	color: var(--danger);
	border: 1px solid rgba(226, 29, 56, 0.25);
	padding: 8px 14px;
	font-size: 13px;
}

button.danger:hover:not(:disabled) {
	background: var(--danger-tint);
	border-color: var(--danger);
	box-shadow: 0 0 16px rgba(226, 29, 56, 0.15);
}

.error {
	color: var(--danger);
	font-size: 13px;
	min-height: 18px;
	margin-bottom: 8px;
	font-weight: 500;
}

/* ---- Header ---- */
.topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 24px;
	padding-bottom: 16px;
	border-bottom: 2px solid rgba(250, 157, 0, 0.15);
}

.topbar h1 {
	font-size: 22px;
	margin: 0;
	color: var(--accent);
	letter-spacing: -0.3px;
}

.topbar .right {
	display: flex;
	gap: 10px;
	align-items: center;
}

.badge {
	background: var(--blue-tint);
	color: var(--blue);
	border: 1px solid rgba(0, 51, 255, 0.2);
	border-radius: 999px;
	padding: 4px 12px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.3px;
	text-transform: uppercase;
}

/* ---- Info Section ---- */
.info-card {
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	margin-bottom: 24px;
	overflow: hidden;
	box-shadow: var(--shadow-sm);
}

.info-card-header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 18px;
	background: linear-gradient(135deg, rgba(250, 157, 0, 0.06), rgba(0, 51, 255, 0.03));
	border-bottom: 1px solid var(--border);
	cursor: pointer;
	user-select: none;
}

.info-card-header:hover {
	background: linear-gradient(135deg, rgba(250, 157, 0, 0.1), rgba(0, 51, 255, 0.05));
}

.info-card-header .chevron {
	font-size: 12px;
	color: var(--muted);
	transition: transform 0.2s;
}

.info-card-header .chevron.open {
	transform: rotate(90deg);
}

.info-card-header h2 {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	color: var(--text);
	flex: 1;
}

.info-card-header .pill {
	font-size: 11px;
	background: var(--blue-tint);
	color: var(--blue);
	padding: 2px 8px;
	border-radius: 999px;
	font-weight: 600;
}

.info-card-body {
	padding: 16px 18px;
}

.info-card-body p {
	margin: 0 0 14px;
	font-size: 13px;
	color: var(--muted);
	line-height: 1.5;
}

.setting-row {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 10px 0;
	border-bottom: 1px solid var(--border);
}

.setting-row:last-child {
	border-bottom: none;
	padding-bottom: 0;
}

.setting-label {
	font-size: 12px;
	font-weight: 600;
	color: var(--muted);
	white-space: nowrap;
	min-width: 160px;
	padding-top: 6px;
	flex-shrink: 0;
}

.setting-value-wrap {
	flex: 1;
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 8px;
}

.setting-value {
	font-family: "SF Mono", "Cascadia Code", "Fira Code", monospace;
	font-size: 13px;
	color: var(--text);
	background: var(--panel-2);
	padding: 6px 10px;
	border-radius: 6px;
	border: 1px solid var(--border);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	flex: 1;
	min-width: 0;
}

.copy-btn {
	flex-shrink: 0;
	width: 32px;
	height: 32px;
	padding: 0;
	display: grid;
	place-items: center;
	background: transparent;
	border: 1px solid var(--border);
	border-radius: 8px;
	color: var(--muted);
	font-size: 14px;
	transition:
		background 0.15s,
		border-color 0.15s,
		color 0.15s;
}

.copy-btn:hover {
	background: var(--panel-2);
	border-color: var(--accent);
	color: var(--accent);
	box-shadow: none;
}

.copy-btn.copied {
	border-color: #22c55e;
	color: #22c55e;
	background: rgba(34, 197, 94, 0.08);
}

.setting-url {
	display: block;
	color: var(--blue);
	text-decoration: none;
	font-size: 13px;
	font-weight: 500;
	padding: 6px 0;
}

.setting-url:hover {
	text-decoration: underline;
}

/* ---- File list ---- */
.files {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.file {
	display: flex;
	align-items: center;
	gap: 14px;
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 14px 16px;
	transition:
		border-color 0.2s,
		box-shadow 0.2s;
	position: relative;
	box-shadow: var(--shadow-sm);
}

.file::before {
	content: "";
	position: absolute;
	left: -1px;
	top: 10px;
	bottom: 10px;
	width: 3px;
	border-radius: 2px;
	background: var(--accent);
	opacity: 0.4;
	transition: opacity 0.2s;
}

.file:hover {
	border-color: rgba(250, 157, 0, 0.25);
	box-shadow: 0 0 24px var(--accent-glow);
}

.file:hover::before {
	opacity: 1;
}

.file .icon {
	width: 42px;
	height: 42px;
	flex: 0 0 42px;
	border-radius: 10px;
	background: var(--blue-tint);
	display: grid;
	place-items: center;
	font-size: 13px;
	font-weight: 700;
	color: var(--blue);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	border: 1px solid rgba(0, 51, 255, 0.1);
}

.file .meta {
	flex: 1;
	min-width: 0;
}

.file .name {
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	font-size: 15px;
}

.file .sub {
	color: var(--muted);
	font-size: 12px;
	margin-top: 3px;
}

.file .actions {
	display: flex;
	gap: 8px;
	align-items: center;
}

.empty {
	text-align: center;
	color: var(--muted);
	padding: 64px 0;
	border: 1.5px dashed var(--border);
	border-radius: var(--radius);
	background: var(--panel);
	font-size: 14px;
}

.logo-with-title {
	display: flex;
	align-items: center;
	gap: 10px;
}
