:root {
	--bg: #f8fafc;
	--surface: #ffffff;
	--surface-hover: #f1f5f9;
	--text: #0f172a;
	--muted: #475569;
	--border: #e2e8f0;
	--drop-bg-hover: #eff6ff;
	--drop-bg-dragover: #dbeafe;
	--primary: #2563eb;
	--primary-hover: #1d4ed8;
	--primary-light: #eff6ff;
	--disabled: #94a3b8;
	--success: #059669;
	--success-bg: #ecfdf5;
	--error: #dc2626;
	--error-bg: #fef2f2;
	--subtext: #64748b;
	--file-name: #2563eb;
	--btn-download: #059669;
	--shadow: 0 1px 3px 0 rgb(0 0 0 / 0.08), 0 1px 2px -1px rgb(0 0 0 / 0.08);
	--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.08);
}
@font-face {
	font-family: "Noto Color Emoji";
	src: url("../fonts/noto-color-emoji-full-400-normal.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}
[data-theme="dark"] {
	--bg: #0f172a;
	--surface: #1e293b;
	--surface-hover: #334155;
	--text: #f1f5f9;
	--muted: #94a3b8;
	--border: #334155;
	--drop-bg-hover: #1e3a5f;
	--drop-bg-dragover: #1e40af;
	--primary: #3b82f6;
	--primary-hover: #60a5fa;
	--primary-light: #1e3a5f;
	--disabled: #475569;
	--success: #22c55e;
	--success-bg: #052e16;
	--error: #ef4444;
	--error-bg: #450a0a;
	--subtext: #94a3b8;
	--file-name: #60a5fa;
	--btn-download: #22c55e;
	--shadow: 0 1px 3px 0 rgb(0 0 0 / 0.25), 0 1px 2px -1px rgb(0 0 0 / 0.25);
	--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.25), 0 4px 6px -4px rgb(0 0 0 / 0.25);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
	font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Noto Color Emoji";
	max-width: 680px;
	margin: 0 auto;
	padding: 24px 20px;
	background: var(--bg);
	color: var(--text);
	transition: background .25s ease, color .25s ease;
	-webkit-font-smoothing: antialiased;
}
.top-bar {
	position: fixed;
	top: 16px;
	right: 16px;
	display: flex;
	align-items: center;
	gap: 10px;
	z-index: 1000;
}
.icon-btn {
	background: var(--surface);
	border: 1px solid var(--border);
	color: var(--text);
	padding: 8px 10px;
	border-radius: 10px;
	cursor: pointer;
	font-size: 1rem;
	line-height: 1;
	box-shadow: var(--shadow);
	transition: transform .1s ease, box-shadow .2s ease, background .15s ease, border-color .15s ease;
	user-select: none;
}
.icon-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.icon-btn:active { transform: translateY(0); }
.lang-dropdown {
	position: absolute;
	top: 52px;
	right: 0;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 12px;
	overflow: hidden;
	display: none;
	flex-direction: column;
	box-shadow: var(--shadow-lg);
	min-width: 160px;
}
.lang-dropdown.open { display: flex; }
.lang-option { padding: 12px 14px; cursor: pointer; display: flex; align-items: center; gap: 10px; background: transparent; border: none; width: 100%; text-align: left; font-size: 1rem; color: var(--text); transition: background .15s ease; }
.lang-option:hover { background: var(--surface-hover); }
.card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 16px;
	padding: 24px;
	margin: 16px 0;
	box-shadow: var(--shadow);
	transition: background .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.tool-card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 16px;
	padding: 24px;
	box-shadow: var(--shadow);
	transition: background .25s ease, border-color .25s ease, box-shadow .25s ease;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 12px;
}
.tool-card:hover { box-shadow: var(--shadow-lg); }
.tool-card .tool-icon { font-size: 3rem; }
.tool-card .tool-name { font-size: 1.15rem; font-weight: 700; }
.tool-card .tool-desc { color: var(--muted); font-size: 0.9rem; line-height: 1.5; }
.tool-card .tool-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 20px;
	background: var(--primary);
	color: #fff;
	text-decoration: none;
	border-radius: 12px;
	font-weight: 600;
	font-size: 0.9rem;
	transition: background .15s ease, transform .1s ease;
}
.tool-card .tool-link:hover { background: var(--primary-hover); transform: translateY(-1px); }
.tool-card .tool-link:active { transform: translateY(0); }
h1 {
	font-size: clamp(1.5rem, 1rem + 2vw, 2rem);
	margin: 0 0 6px;
	letter-spacing: -0.02em;
	line-height: 1.15;
}
.subtitle {
	color: var(--muted);
	margin: 0 0 6px;
	font-size: clamp(0.9rem, 0.8rem + 0.8vw, 1.05rem);
	line-height: 1.5;
}
.hero {
	text-align: center;
	padding: 60px 0 32px;
}
.hero h1 { font-size: clamp(2rem, 3vw, 3rem); margin-bottom: 12px; }
.tools-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 16px;
	margin: 24px 0;
}
.drop-zone {
	border: 2px dashed var(--border);
	border-radius: 14px;
	padding: 36px 18px;
	text-align: center;
	cursor: pointer;
	transition: border-color .15s ease, background .15s ease, transform .1s ease;
	background: transparent;
	position: relative;
}
.drop-zone:hover { border-color: var(--primary); background: var(--drop-bg-hover); }
.drop-zone.dragover { border-color: var(--primary); background: var(--drop-bg-dragover); transform: scale(1.005); }
#fileInput { display: none; }
.drop-prompt { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.drop-icon { font-size: 3.5rem; }
.drop-main { font-weight: 600; color: var(--text); font-size: 1.05rem; }
.drop-main u { text-decoration-thickness: 2px; text-underline-offset: 3px; }
.drop-sub { font-size: 0.9rem; color: var(--subtext); margin-top: 2px; }
#fileNameDisplay {
	display: none;
	margin-top: 12px;
	font-weight: 600;
	color: var(--file-name);
	background: var(--primary-light);
	border-radius: 10px;
	padding: 10px 14px;
	align-items: center;
	gap: 8px;
	justify-content: center;
}
button[type="submit"] {
	background: var(--primary);
	color: #fff;
	border: none;
	padding: 14px 24px;
	border-radius: 12px;
	font-size: 1.05rem;
	font-weight: 600;
	cursor: pointer;
	width: 100%;
	letter-spacing: 0.01em;
	box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.08);
	transition: transform .1s ease, background .15s ease, box-shadow .15s ease;
}
button[type="submit"]:hover { background: var(--primary-hover); box-shadow: var(--shadow-lg); transform: translateY(-1px); }
button[type="submit"]:active { transform: translateY(0); }
button[type="submit"]:disabled { background: var(--disabled); cursor: not-allowed; transform: none; box-shadow: none; }
#status { margin-top: 16px; }
.status-card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 14px;
	padding: 16px 18px;
	box-shadow: var(--shadow);
	transition: background .25s ease, border-color .25s ease;
}
.error { color: var(--error); }
.success { color: var(--success); }
.status-card.error { background: var(--error-bg); border-color: var(--error); }
.status-card.success { background: var(--success-bg); border-color: var(--success); }
.status-row { display: flex; align-items: center; gap: 12px; }
.spinner {
	width: 20px; height: 20px;
	border: 3px solid var(--border);
	border-top-color: var(--primary);
	border-radius: 50%;
	animation: spin 0.9s linear infinite;
	flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
a.download {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 12px;
	padding: 12px 18px;
	background: var(--btn-download);
	color: #fff;
	text-decoration: none;
	border-radius: 12px;
	font-weight: 600;
	box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.08);
	transition: transform .1s ease, box-shadow .2s ease, filter .15s ease;
}
a.download:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); filter: brightness(1.05); }
a.download:active { transform: translateY(0); }
.link-note {
	margin-top: 10px;
	font-size: 0.85rem;
	color: var(--subtext);
	line-height: 1.45;
}
.back-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--primary);
	text-decoration: none;
	font-weight: 600;
	margin-bottom: 16px;
}
.back-link:hover { text-decoration: underline; }
.site-footer {
	text-align: center;
	padding: 32px 0 16px;
	color: var(--muted);
	font-size: 0.85rem;
	border-top: 1px solid var(--border);
	margin-top: 48px;
}
@media (max-width: 520px) {
	body { padding: 16px 14px; padding-top: 72px; }
	.top-bar { top: 10px; right: 10px; gap: 8px; }
	.icon-btn { padding: 7px 9px; border-radius: 10px; }
	.card { padding: 18px; border-radius: 14px; }
	.tool-card { padding: 18px; }
	.drop-zone { padding: 28px 14px; border-radius: 12px; }
	button[type="submit"] { padding: 13px 18px; border-radius: 12px; font-size: 1rem; }
	a.download { padding: 11px 16px; border-radius: 12px; }
	.lang-dropdown { top: 48px; right: 0; min-width: 150px; }
	.tools-grid { grid-template-columns: 1fr; }
}
.noto-color-emoji-regular { font-family: "Noto Color Emoji", sans-serif; font-weight: 400; font-style: normal; font-size: inherit; }
.noto-color-emoji-regular { font-family: "Noto Color Emoji" !important; font-weight: 400; font-style: normal; font-size: inherit; }