/* ==========================================================================
   BIN · INTELLIGENCE — 结构样式（令牌 / 布局 / 组件 / 特效）
   --------------------------------------------------------------------------
   主题只负责覆盖 :root 里的颜色令牌，见 themes.css。
   本文件不含任何主题专属选择器，改配色不必碰这里。
   ========================================================================== */

/* ==========================================================================
   1. 设计令牌
   ========================================================================== */
:root {
	/* —— 强调色三元组：所有渐变、光晕、粒子都由它们推导 —— */
	--c-cyan: #22d3ee;
	--c-violet: #a78bfa;
	--c-pink: #f472b6;
	--grad-aurora: linear-gradient(135deg, #22d3ee 0%, #a78bfa 50%, #f472b6 100%);
	--shadow-cyan: 0 0 60px -10px rgba(34, 211, 238, 0.55);

	/* —— 背景氛围光（主题覆盖） —— */
	--amb-1: rgba(34, 211, 238, 0.22);
	--amb-2: rgba(167, 139, 250, 0.20);
	--amb-3: rgba(244, 114, 182, 0.16);

	/* —— 表面与文字 —— */
	--bg-void: #05060f;
	--surface-1: rgba(255, 255, 255, 0.035);
	--surface-2: rgba(255, 255, 255, 0.06);
	--surface-3: rgba(255, 255, 255, 0.09);
	--border: rgba(255, 255, 255, 0.09);
	--border-strong: rgba(255, 255, 255, 0.18);
	--text: rgba(255, 255, 255, 0.96);
	--text-muted: rgba(255, 255, 255, 0.6);
	--text-faint: rgba(255, 255, 255, 0.38);
	--on-accent: #05060f;
	--grid-line: rgba(255, 255, 255, 0.032);
	--sheen: rgba(255, 255, 255, 0.14);
	--grain-opacity: 0.035;

	/* —— 语义色 —— */
	--ok: #34d399;
	--ok-soft: rgba(52, 211, 153, 0.14);
	--bad: #f87171;
	--bad-soft: rgba(248, 113, 113, 0.14);
	--warn: #fbbf24;

	/* —— 字体 —— */
	--font-display: 'Sora', 'Space Grotesk', system-ui, -apple-system, sans-serif;
	--font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
		'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
	--font-mono: 'JetBrains Mono', 'SF Mono', ui-monospace, 'Cascadia Mono', monospace;
	--font-eyebrow: 'Space Grotesk', var(--font-ui);

	/* —— 排版比例（流体） —— */
	--fs-display: clamp(2.1rem, 1.1rem + 4.1vw, 3.9rem);
	--fs-lead: clamp(0.95rem, 0.88rem + 0.4vw, 1.12rem);
	--fs-h3: clamp(1.02rem, 0.95rem + 0.35vw, 1.22rem);
	--fs-body: 1rem;
	--fs-sm: 0.85rem;
	--fs-xs: 0.72rem;

	/* —— 间距刻度 4 / 8 / 12 / 16 / 24 / 32 / 48 / 64 —— */
	--sp-1: 4px;
	--sp-2: 8px;
	--sp-3: 12px;
	--sp-4: 16px;
	--sp-6: 24px;
	--sp-8: 32px;
	--sp-12: 48px;
	--sp-16: 64px;

	/* —— 圆角与层次 —— */
	--r-sm: 8px;
	--r-md: 12px;
	--r-lg: 18px;
	--r-xl: 26px;
	--shadow-card: 0 1px 0 rgba(255, 255, 255, 0.06) inset,
		0 0 0 1px rgba(255, 255, 255, 0.03), 0 30px 60px -24px rgba(0, 0, 0, 0.7),
		0 12px 28px -18px rgba(0, 0, 0, 0.6);
	--shadow-raise: 0 24px 50px -18px rgba(0, 0, 0, 0.6);

	/* —— 动效 —— */
	--ease: cubic-bezier(0.22, 0.68, 0, 1);
	--ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
	--dur: 0.45s;

	/* —— 布局 —— */
	--maxw: 1120px;

	--noise-url: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ==========================================================================
   2. 重置与基础
   ========================================================================== */
*,
*::before,
*::after {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	min-height: 100vh;
	background: var(--bg-void);
	color: var(--text);
	font-family: var(--font-ui);
	font-size: var(--fs-body);
	line-height: 1.6;
	font-feature-settings: 'cv02', 'cv03', 'cv04', 'ss01';
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: hidden;
	transition: background 0.6s var(--ease-soft), color 0.6s var(--ease-soft);
}

/* 氛围光层 */
body::before {
	content: '';
	position: fixed;
	inset: -10%;
	z-index: -3;
	pointer-events: none;
	background:
		radial-gradient(ellipse 90% 60% at 12% 0%, var(--amb-1) 0%, transparent 60%),
		radial-gradient(ellipse 70% 50% at 88% 8%, var(--amb-2) 0%, transparent 60%),
		radial-gradient(ellipse 80% 62% at 50% 100%, var(--amb-3) 0%, transparent 62%);
	animation: ambienceDrift 26s var(--ease-soft) infinite alternate;
}

/* 网格纹理层 */
body::after {
	content: '';
	position: fixed;
	inset: 0;
	z-index: -2;
	pointer-events: none;
	background-image:
		linear-gradient(var(--grid-line) 1px, transparent 1px),
		linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
	background-size: 64px 64px;
	-webkit-mask-image: radial-gradient(ellipse 120% 90% at 50% 0%, #000 20%, transparent 78%);
	mask-image: radial-gradient(ellipse 120% 90% at 50% 0%, #000 20%, transparent 78%);
}

/* 颗粒质感层 */
.fx-grain {
	position: fixed;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	opacity: var(--grain-opacity);
	background-image: var(--noise-url);
	background-size: 180px 180px;
	mix-blend-mode: overlay;
}

/* 跟随鼠标的炫光 */
.fx-cursor {
	position: fixed;
	top: 0;
	left: 0;
	width: 460px;
	height: 460px;
	z-index: -1;
	pointer-events: none;
	opacity: 0;
	border-radius: 50%;
	transform: translate3d(-50%, -50%, 0);
	background: radial-gradient(
		circle,
		color-mix(in srgb, var(--c-violet) 42%, transparent) 0%,
		color-mix(in srgb, var(--c-cyan) 18%, transparent) 38%,
		transparent 68%
	);
	filter: blur(28px);
	transition: opacity 0.5s var(--ease-soft);
}
.fx-cursor.is-on {
	opacity: 0.75;
}
.fx-cursor.is-press {
	opacity: 1;
}

#particleCanvas {
	position: fixed;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	display: block;
}

::selection {
	background: color-mix(in srgb, var(--c-violet) 42%, transparent);
	color: var(--text);
}

:focus-visible {
	outline: 2px solid var(--c-cyan);
	outline-offset: 3px;
	border-radius: var(--r-sm);
}

/* ==========================================================================
   3. 关键帧
   ========================================================================== */
/* 主题切换整页过渡（JS 通过 APP_CONFIG.theme.transitionAnimation 引用，勿改名） */
@keyframes themeTransition {
	0% { filter: brightness(1); }
	50% { filter: brightness(1.12) saturate(1.06); }
	100% { filter: brightness(1); }
}

@keyframes ambienceDrift {
	0% { transform: translate3d(0, 0, 0) scale(1); }
	100% { transform: translate3d(0, -2.5%, 0) scale(1.06); }
}

@keyframes shimmer {
	0% { transform: translateX(-120%) rotate(25deg); }
	100% { transform: translateX(320%) rotate(25deg); }
}

@keyframes pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.78; }
}

@keyframes float {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-9px); }
}

@keyframes glow {
	0%, 100% { box-shadow: 0 0 20px rgba(255, 255, 255, 0.1); }
	50% { box-shadow: 0 0 40px rgba(255, 255, 255, 0.3); }
}

@keyframes spin {
	to { transform: rotate(360deg); }
}

@keyframes borderSweep {
	to { transform: rotate(1turn); }
}

@keyframes rowIn {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: none; }
}

@keyframes ripple {
	to { transform: scale(2.6); opacity: 0; }
}

@keyframes gradientPan {
	0% { background-position: 0% 50%; }
	100% { background-position: 200% 50%; }
}

@keyframes ghostBreath {
	0%, 100% { opacity: 0.055; transform: translate(-50%, -50%) scale(1); }
	50% { opacity: 0.085; transform: translate(-50%, -50%) scale(1.03); }
}

/* ==========================================================================
   4. 滚动进场
   ========================================================================== */
/* Scoped under html.js on purpose: content may only be hidden when JavaScript
   is alive to reveal it again. If the bundle fails, everything stays visible. */
html.js .reveal {
	opacity: 0;
	transform: translateY(18px);
	transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
html.js .reveal.in {
	opacity: 1;
	transform: none;
}

/* ==========================================================================
   5. 主题切换器
   ========================================================================== */
.theme-switcher {
	position: fixed;
	top: var(--sp-6);
	right: var(--sp-6);
	z-index: 1000;
	width: 52px;
	height: 52px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	cursor: pointer;
	background: var(--surface-2);
	border: 1px solid var(--border);
	-webkit-backdrop-filter: blur(20px) saturate(1.4);
	backdrop-filter: blur(20px) saturate(1.4);
	box-shadow: var(--shadow-raise);
	transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
		border-color var(--dur) var(--ease);
}
.theme-switcher:hover {
	transform: translateY(-2px) scale(1.06) rotate(-8deg);
	border-color: var(--border-strong);
	box-shadow: var(--shadow-raise), var(--shadow-cyan);
}
.theme-switcher:active {
	transform: scale(0.95);
}
.theme-switcher-icon {
	display: grid;
	place-items: center;
	color: var(--text);
}
.theme-switcher-icon svg {
	width: 22px;
	height: 22px;
	stroke-width: 1.8;
}

.theme-menu {
	position: fixed;
	top: 88px;
	right: var(--sp-6);
	z-index: 1000;
	width: min(330px, calc(100vw - 32px));
	max-height: min(70vh, 620px);
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: var(--sp-4);
	border-radius: var(--r-lg);
	background: color-mix(in srgb, var(--bg-void) 84%, transparent);
	border: 1px solid var(--border);
	-webkit-backdrop-filter: blur(28px) saturate(1.5);
	backdrop-filter: blur(28px) saturate(1.5);
	box-shadow: var(--shadow-card);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-10px) scale(0.97);
	transition: opacity 0.28s var(--ease), transform 0.28s var(--ease), visibility 0.28s;
}
.theme-menu.show {
	opacity: 1;
	visibility: visible;
	transform: none;
}
.theme-menu::-webkit-scrollbar {
	width: 6px;
}
.theme-menu::-webkit-scrollbar-thumb {
	background: var(--border-strong);
	border-radius: 99px;
}

.theme-menu h4 {
	position: sticky;
	top: calc(var(--sp-4) * -1);
	z-index: 1;
	margin: calc(var(--sp-4) * -1) calc(var(--sp-4) * -1) var(--sp-3);
	padding: var(--sp-4) var(--sp-4) var(--sp-3);
	background: linear-gradient(180deg, color-mix(in srgb, var(--bg-void) 94%, transparent), transparent);
	font-family: var(--font-eyebrow);
	font-size: var(--fs-xs);
	font-weight: 700;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--text-faint);
}

.theme-group {
	margin: var(--sp-3) 0 var(--sp-1);
	font-family: var(--font-eyebrow);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--text-faint);
	display: flex;
	align-items: center;
	gap: var(--sp-2);
}
.theme-group::after {
	content: '';
	flex: 1;
	height: 1px;
	background: var(--border);
}

.theme-option {
	position: relative;
	overflow: hidden;
	display: flex;
	align-items: center;
	gap: var(--sp-3);
	padding: var(--sp-2) var(--sp-3);
	border-radius: var(--r-md);
	border: 1px solid transparent;
	cursor: pointer;
	font-size: var(--fs-sm);
	color: var(--text-muted);
	transition: background 0.2s var(--ease-soft), color 0.2s var(--ease-soft),
		border-color 0.2s var(--ease-soft), transform 0.2s var(--ease-soft);
}
.theme-option:hover {
	background: var(--surface-2);
	color: var(--text);
	transform: translateX(3px);
}
.theme-option.active {
	background: var(--surface-3);
	border-color: var(--border-strong);
	color: var(--text);
	font-weight: 600;
}
.theme-option.active::after {
	content: '';
	position: absolute;
	right: var(--sp-3);
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--c-cyan);
	box-shadow: 0 0 10px var(--c-cyan);
}
.theme-option span {
	display: inline-flex;
	align-items: center;
	gap: var(--sp-2);
	min-width: 0;
}
.theme-preview {
	flex: none;
	width: 30px;
	height: 30px;
	border-radius: 9px;
	border: 1px solid var(--border-strong);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.topt-ic {
	display: inline-grid;
	place-items: center;
}
.topt-ic svg {
	width: 14px;
	height: 14px;
	stroke-width: 2;
	opacity: 0.75;
}

/* ==========================================================================
   6. 容器与页头
   ========================================================================== */
.container {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: var(--maxw);
	margin: 0 auto;
	padding: var(--sp-12) var(--sp-6) var(--sp-16);
}

.header {
	position: relative;
	text-align: center;
	padding: var(--sp-8) 0 var(--sp-12);
}

.hero-ghost {
	position: absolute;
	top: 46%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: -1;
	font-family: var(--font-display);
	font-size: clamp(9rem, 26vw, 22rem);
	font-weight: 800;
	letter-spacing: -0.06em;
	line-height: 1;
	color: var(--text);
	opacity: 0.055;
	pointer-events: none;
	user-select: none;
	white-space: nowrap;
	animation: ghostBreath 9s var(--ease-soft) infinite;
}

.header h1 {
	font-family: var(--font-display);
	font-size: var(--fs-display);
	font-weight: 800;
	letter-spacing: -0.035em;
	line-height: 1.04;
	background: var(--grad-aurora);
	background-size: 200% auto;
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
	animation: gradientPan 9s linear infinite alternate;
	filter: drop-shadow(0 8px 30px color-mix(in srgb, var(--c-violet) 30%, transparent));
}

.header p {
	margin: var(--sp-4) auto 0;
	max-width: 62ch;
	font-size: var(--fs-lead);
	color: var(--text-muted);
	letter-spacing: 0.005em;
}

.hero-chips {
	margin-top: var(--sp-6);
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--sp-2);
}
.chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 14px;
	border-radius: 99px;
	background: var(--surface-1);
	border: 1px solid var(--border);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	font-family: var(--font-eyebrow);
	font-size: var(--fs-xs);
	font-weight: 600;
	letter-spacing: 0.08em;
	color: var(--text-muted);
	transition: transform 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.chip:hover {
	transform: translateY(-2px);
	color: var(--text);
	border-color: var(--border-strong);
}
.chip svg {
	width: 13px;
	height: 13px;
	stroke-width: 2.2;
}

/* ==========================================================================
   7. 主体卡片
   ========================================================================== */
.main-content {
	display: flex;
	flex-direction: column;
	gap: var(--sp-6);
}

/* 通用玻璃面板 */
.input-section,
.results-section,
.alert,
.stat-card,
.loading {
	position: relative;
	border-radius: var(--r-lg);
	background: var(--surface-1);
	border: 1px solid var(--border);
	-webkit-backdrop-filter: blur(22px) saturate(1.35);
	backdrop-filter: blur(22px) saturate(1.35);
	box-shadow: var(--shadow-card);
}

/* 顶部高光描边 */
.input-section::before,
.results-section::before,
.stat-card::before {
	content: '';
	position: absolute;
	inset: 0 0 auto;
	height: 1px;
	background: linear-gradient(90deg, transparent, var(--sheen), transparent);
	border-radius: inherit;
	pointer-events: none;
}

.input-section,
.results-section {
	padding: var(--sp-6);
}

h3 {
	display: flex;
	align-items: center;
	gap: var(--sp-2);
	margin-bottom: var(--sp-4);
	font-family: var(--font-display);
	font-size: var(--fs-h3);
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--text);
}
.h3-ic {
	display: inline-grid;
	place-items: center;
	width: 30px;
	height: 30px;
	border-radius: 9px;
	background: var(--surface-2);
	border: 1px solid var(--border);
	color: var(--c-cyan);
}
.h3-ic svg {
	width: 15px;
	height: 15px;
	stroke-width: 2.2;
}

/* ==========================================================================
   8. 提示条
   ========================================================================== */
.alert {
	display: flex;
	align-items: flex-start;
	gap: var(--sp-3);
	padding: var(--sp-4) var(--sp-6);
	font-size: var(--fs-sm);
	line-height: 1.65;
	color: var(--text-muted);
}
.alert strong {
	color: var(--text);
	font-weight: 600;
}
.alert-info {
	border-left: 2px solid var(--c-cyan);
}
.alert-ic {
	flex: none;
	display: inline-grid;
	place-items: center;
	color: var(--c-cyan);
	margin-top: 2px;
}
.alert-ic svg {
	width: 17px;
	height: 17px;
	stroke-width: 2.2;
}

/* ==========================================================================
   9. 输入区
   ========================================================================== */
.input-area {
	width: 100%;
	min-height: 190px;
	resize: vertical;
	padding: var(--sp-4);
	border-radius: var(--r-md);
	background: color-mix(in srgb, var(--bg-void) 45%, transparent);
	border: 1px solid var(--border);
	color: var(--text);
	font-family: var(--font-mono);
	font-size: 0.95rem;
	line-height: 1.85;
	letter-spacing: 0.06em;
	font-variant-numeric: tabular-nums;
	transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease),
		background 0.3s var(--ease);
}
.input-area::placeholder {
	color: var(--text-faint);
	letter-spacing: 0.04em;
}
.input-area:focus {
	outline: none;
	border-color: color-mix(in srgb, var(--c-cyan) 60%, transparent);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-cyan) 12%, transparent), var(--shadow-cyan);
	background: color-mix(in srgb, var(--bg-void) 62%, transparent);
}

.input-hint {
	margin-top: var(--sp-3);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--sp-2) var(--sp-4);
	font-family: var(--font-eyebrow);
	font-size: var(--fs-xs);
	letter-spacing: 0.06em;
	color: var(--text-faint);
}
.input-hint kbd {
	padding: 2px 7px;
	border-radius: 6px;
	background: var(--surface-2);
	border: 1px solid var(--border);
	font-family: var(--font-mono);
	font-size: 10px;
	color: var(--text-muted);
}

/* ==========================================================================
   10. 按钮
   ========================================================================== */
.button-group {
	display: flex;
	flex-wrap: wrap;
	gap: var(--sp-3);
}

.btn {
	position: relative;
	overflow: hidden;
	isolation: isolate;
	flex: 1 1 190px;
	min-height: 52px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--sp-2);
	padding: var(--sp-3) var(--sp-6);
	border-radius: var(--r-md);
	border: 1px solid var(--border);
	background: var(--surface-2);
	color: var(--text);
	font-family: var(--font-ui);
	font-size: 0.92rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	cursor: pointer;
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
	transition: transform 0.22s var(--ease), box-shadow 0.32s var(--ease),
		border-color 0.32s var(--ease), filter 0.32s var(--ease);
}

/* 掠过式高光 */
.btn::after {
	content: '';
	position: absolute;
	top: -60%;
	left: 0;
	width: 45%;
	height: 220%;
	z-index: -1;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
	transform: translateX(-140%) rotate(25deg);
	opacity: 0;
	transition: opacity 0.3s;
}
.btn:hover::after {
	opacity: 1;
	animation: shimmer 0.9s var(--ease-soft);
}

.btn:hover {
	transform: translateY(-3px);
	border-color: var(--border-strong);
}
.btn:active {
	transform: translateY(-1px) scale(0.985);
}
.btn svg {
	width: 17px;
	height: 17px;
	stroke-width: 2.2;
}
.btn-ic {
	display: inline-grid;
	place-items: center;
}

.btn-primary {
	background: var(--grad-aurora);
	background-size: 200% auto;
	border-color: transparent;
	color: var(--on-accent);
	font-weight: 700;
	box-shadow: var(--shadow-cyan);
}
.btn-primary:hover {
	background-position: 100% 50%;
	filter: brightness(1.06) saturate(1.08);
	box-shadow: var(--shadow-cyan), 0 18px 40px -16px rgba(0, 0, 0, 0.6);
}

.btn-success {
	border-color: color-mix(in srgb, var(--ok) 40%, transparent);
	background: linear-gradient(135deg, var(--ok-soft), var(--surface-2));
	color: var(--ok);
}
.btn-success:hover {
	box-shadow: 0 0 40px -12px color-mix(in srgb, var(--ok) 60%, transparent);
}

.btn-warning {
	border-color: color-mix(in srgb, var(--bad) 34%, transparent);
	background: linear-gradient(135deg, var(--bad-soft), var(--surface-2));
	color: var(--bad);
}
.btn-warning:hover {
	box-shadow: 0 0 40px -12px color-mix(in srgb, var(--bad) 55%, transparent);
}

/* 点击水波 */
.fx-ripple {
	position: absolute;
	z-index: -1;
	border-radius: 50%;
	pointer-events: none;
	background: radial-gradient(circle, rgba(255, 255, 255, 0.5), transparent 70%);
	transform: scale(0);
	opacity: 0.85;
	animation: ripple 0.62s var(--ease-soft) forwards;
}

/* ==========================================================================
   11. 加载态
   ========================================================================== */
.loading {
	display: none;
	padding: var(--sp-8);
	text-align: center;
}
.loading.show {
	display: grid;
	place-items: center;
	gap: var(--sp-4);
}
.spinner {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 2px solid var(--border);
	border-top-color: var(--c-cyan);
	border-right-color: var(--c-violet);
	animation: spin 0.85s linear infinite;
	box-shadow: var(--shadow-cyan);
}
.loading p {
	font-family: var(--font-eyebrow);
	font-size: var(--fs-xs);
	font-weight: 700;
	letter-spacing: 0.24em;
	text-transform: uppercase;
	color: var(--text-muted);
	animation: pulse 1.6s ease-in-out infinite;
}

/* ==========================================================================
   12. 统计卡（JS 会把 display 设为 grid）
   ========================================================================== */
.statistics {
	grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	gap: var(--sp-4);
}

.stat-card {
	position: relative;
	overflow: hidden;
	padding: var(--sp-6);
	text-align: left;
	font-family: var(--font-eyebrow);
	font-size: var(--fs-xs);
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--text-faint);
	transform: perspective(700px) rotateX(var(--ry, 0deg)) rotateY(var(--rx, 0deg));
	transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease),
		border-color 0.35s var(--ease);
}
.stat-card:hover {
	border-color: var(--border-strong);
	box-shadow: var(--shadow-card), var(--shadow-cyan);
}

/* 旋转炫光描边 */
.stat-card::after {
	content: '';
	position: absolute;
	inset: -140%;
	z-index: -1;
	background: conic-gradient(
		from 0deg,
		transparent 0deg,
		color-mix(in srgb, var(--c-cyan) 55%, transparent) 40deg,
		transparent 90deg
	);
	opacity: 0;
	transition: opacity 0.4s var(--ease);
}
.stat-card:hover::after {
	opacity: 0.5;
	animation: borderSweep 3.4s linear infinite;
}

.stat-ic {
	display: inline-grid;
	place-items: center;
	width: 38px;
	height: 38px;
	margin-bottom: var(--sp-3);
	border-radius: 11px;
	background: var(--surface-2);
	border: 1px solid var(--border);
	color: var(--c-cyan);
}
.stat-ic svg {
	width: 18px;
	height: 18px;
	stroke-width: 2.2;
}

.stat-number {
	display: block;
	margin-bottom: 2px;
	font-family: var(--font-display);
	font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.7rem);
	font-weight: 800;
	letter-spacing: -0.03em;
	line-height: 1.05;
	text-transform: none;
	font-variant-numeric: tabular-nums;
	background: var(--grad-aurora);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
}

/* ==========================================================================
   13. 结果表
   ========================================================================== */
.results-section {
	display: none;
}
.table-scroll {
	overflow-x: auto;
	border-radius: var(--r-md);
	border: 1px solid var(--border);
}

.results-table {
	width: 100%;
	border-collapse: collapse;
	min-width: 720px;
	background: color-mix(in srgb, var(--bg-void) 35%, transparent);
}

.results-table th {
	position: sticky;
	top: 0;
	z-index: 1;
	padding: var(--sp-3) var(--sp-4);
	text-align: left;
	white-space: nowrap;
	background: color-mix(in srgb, var(--bg-void) 88%, transparent);
	-webkit-backdrop-filter: blur(20px);
	backdrop-filter: blur(20px);
	border-bottom: 1px solid var(--border-strong);
	font-family: var(--font-eyebrow);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--text-faint);
}

.results-table td {
	padding: var(--sp-3) var(--sp-4);
	border-bottom: 1px solid var(--border);
	font-size: 0.9rem;
	color: var(--text);
	vertical-align: middle;
}

.results-table tbody tr {
	animation: rowIn 0.45s var(--ease) both;
	animation-delay: calc(var(--i, 0) * 22ms);
	transition: background 0.2s var(--ease-soft);
}
.results-table tbody tr:hover {
	background: var(--surface-2);
}
.results-table tbody tr:last-child td {
	border-bottom: none;
}

/* 序号 */
.results-table td:nth-child(1) {
	width: 56px;
	font-family: var(--font-mono);
	font-size: 12px;
	font-weight: 700;
	color: var(--text-faint);
	font-variant-numeric: tabular-nums;
}
/* 卡号 */
.results-table td:nth-child(2) {
	font-family: var(--font-mono);
	font-size: 0.9rem;
	letter-spacing: 0.05em;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}
/* 开户行 */
.results-table td:nth-child(4) {
	font-weight: 500;
	letter-spacing: 0.02em;
}
/* BIN */
.results-table td:nth-child(6) {
	font-family: var(--font-mono);
	font-size: 0.86rem;
	color: var(--c-cyan);
	font-variant-numeric: tabular-nums;
}
/* 长度 */
.results-table td:nth-child(7) {
	font-family: var(--font-mono);
	font-size: 0.82rem;
	color: var(--text-muted);
	white-space: nowrap;
}

.status-valid,
.status-invalid {
	white-space: nowrap;
	font-weight: 600;
	font-size: 0.85rem;
}
.status-valid {
	color: var(--ok);
}
.status-invalid {
	color: var(--bad);
}
.st-ic {
	display: inline-grid;
	place-items: center;
	vertical-align: -3px;
	margin-right: 6px;
}
.st-ic svg {
	width: 15px;
	height: 15px;
	stroke-width: 2.4;
}

.card-type {
	display: inline-block;
	padding: 4px 11px;
	border-radius: 99px;
	border: 1px solid var(--border);
	background: var(--surface-2);
	font-family: var(--font-eyebrow);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	white-space: nowrap;
	color: var(--text-muted);
}
.card-type-debit {
	color: var(--c-cyan);
	border-color: color-mix(in srgb, var(--c-cyan) 40%, transparent);
	background: color-mix(in srgb, var(--c-cyan) 12%, transparent);
}
.card-type-credit {
	color: var(--c-pink);
	border-color: color-mix(in srgb, var(--c-pink) 40%, transparent);
	background: color-mix(in srgb, var(--c-pink) 12%, transparent);
}

/* ==========================================================================
   14. 页脚
   ========================================================================== */
.footer {
	margin-top: var(--sp-12);
	padding-top: var(--sp-6);
	border-top: 1px solid var(--border);
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: var(--sp-3);
	font-family: var(--font-eyebrow);
	font-size: var(--fs-xs);
	letter-spacing: 0.08em;
	color: var(--text-faint);
}
.footer a {
	color: var(--text-muted);
	text-decoration: none;
	border-bottom: 1px solid var(--border);
	transition: color 0.25s var(--ease);
}
.footer a:hover {
	color: var(--c-cyan);
}

/* ==========================================================================
   15. 响应式
   ========================================================================== */
@media (max-width: 900px) {
	:root {
		--maxw: 100%;
	}
	.container {
		padding: var(--sp-8) var(--sp-4) var(--sp-12);
	}
}

@media (max-width: 640px) {
	.theme-switcher {
		top: var(--sp-3);
		right: var(--sp-3);
		width: 46px;
		height: 46px;
	}
	.theme-menu {
		top: 72px;
		right: var(--sp-3);
		left: var(--sp-3);
		width: auto;
	}
	.header {
		padding: var(--sp-6) 0 var(--sp-8);
	}
	.input-section,
	.results-section {
		padding: var(--sp-4);
	}
	.alert {
		padding: var(--sp-4);
	}
	.btn {
		flex: 1 1 100%;
	}
	.fx-cursor {
		display: none;
	}
	.stat-card {
		padding: var(--sp-4);
	}
}

/* ==========================================================================
   16. 无障碍 · 降低动效
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}
	.reveal {
		opacity: 1;
		transform: none;
	}
	.fx-cursor,
	.fx-grain {
		display: none;
	}
}

@media print {
	#particleCanvas,
	.fx-grain,
	.fx-cursor,
	.theme-switcher,
	.theme-menu,
	.button-group {
		display: none !important;
	}
}
