* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

:root {
	--brand-red: #e31b23;
	--brand-red-dark: #c81018;
	--brand-red-glow: rgba(227, 27, 35, 0.25);
	--brand-red-light: rgba(227, 27, 35, 0.08);
	--text-primary: #1f2a3a;
	--text-muted: #8e9dae;
	--text-placeholder: #bec8d2;
	--bg-input: #f5f7fa;
	--border-light: #e9edf2;
	--card-bg: #ffffff;
	--footer-bg: #0c1427;
	--gold-accent: #c89d4b;
	--wechat-green: #07c160;
	--wechat-green-dark: #06ad56;
	--success-green: #52c41a;
	--shadow-card: 0 20px 35px -12px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.02);
}

body {
	font-family:
		'Inter',
		-apple-system,
		BlinkMacSystemFont,
		'Segoe UI',
		'PingFang SC',
		'Microsoft YaHei',
		'Helvetica Neue',
		sans-serif;
	min-height: 100vh;
	background:
		linear-gradient(to bottom, rgba(73, 84, 110, 0.268), rgba(14, 19, 30, 0.024)),
		url('') center/cover no-repeat fixed;
	display: flex;
	flex-direction: column;
	overflow-x: hidden;
	position: relative;
}

.bg-ambient {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 0;
	background:
		radial-gradient(ellipse at 30% 40%, rgba(227, 27, 35, 0.12) 0%, rgba(12, 20, 39, 0.9) 70%),
		repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.01) 0px, rgba(255, 255, 255, 0.01) 2px, transparent 2px, transparent 8px);
}

.bg-ambient::after {
	content: '';
	position: absolute;
	top: -20%;
	right: -10%;
	width: 80%;
	height: 80%;
	background: radial-gradient(circle, rgba(227, 27, 35, 0.08) 0%, transparent 70%);
	pointer-events: none;
}

.main-container {
	position: relative;
	z-index: 2;
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 32px 20px 90px;
	min-height: 100vh;
}

.login-card {
	background: var(--card-bg);
	backdrop-filter: blur(0px);
	border-radius: 28px;
	padding: 40px 36px 36px;
	width: 500px;
	max-width: 94vw;
	box-shadow: var(--shadow-card);
	transition: transform 0.2s ease;
	border: 1px solid rgba(255, 255, 255, 0.2);
}

@media (max-width: 560px) {
	.login-card {
		padding: 32px 24px 28px;
		border-radius: 24px;
	}
}

.brand-area {
	height: 152px;
	text-align: center;
	margin-bottom: 28px;
}

.henkel-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 12px;
}

.brand-logo {
	display: block;
	width: 148px;
	max-height: 120px;
	object-fit: contain;
}

.henkel-ring {
	border: 2.5px solid var(--brand-red);
	border-radius: 60px;
	padding: 6px 26px;
	transition: all 0.2s;
}

.henkel-word {
	font-size: 26px;
	font-weight: 700;
	color: var(--brand-red);
	letter-spacing: 2px;
}

.ciam-sub {
	font-size: 18px;
	font-weight: 700;
	color: var(--text-primary);
	letter-spacing: 6px;
	margin-top: 8px;
	opacity: 0.85;
}

.tabs-container {
	position: relative;
	margin-bottom: 32px;
}

.tabs-row {
	display: flex;
	position: relative;
	gap: 0;
}

.tab-btn {
	flex: 1;
	text-align: center;
	padding: 14px 0 16px;
	font-size: 16px;
	font-weight: 700;
	color: var(--text-muted);
	background: transparent;
	border: none;
	cursor: pointer;
	transition: color 0.25s ease;
	letter-spacing: 0.5px;
	position: relative;
	z-index: 2;
	/* 防止字体变化导致跳动 */
}

.tab-btn.active {
	color: var(--brand-red);
}

.tab-logo {
	width: 18px;
	height: 18px;
	object-fit: contain;
	margin-right: 4px;
	vertical-align: middle;
}

.tab-indicator-bar {
	position: absolute;
	bottom: 0;
	height: 3px;
	background: var(--brand-red);
	border-radius: 4px 4px 0 0;
	transition:
		left 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1),
		width 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
	z-index: 1;
}

.tabs-divider {
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 1px;
	background: var(--border-light);
}

.form-panel {
	display: none;
	animation: fadeSlideUp 0.3s ease forwards;
	min-height: 280px;
	width: 100%;
}

.form-panel.active-panel {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
}

@keyframes fadeSlideUp {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.field-group {
	margin-bottom: 20px;
	width: 100%;
}

.phone-field,
.code-field {
	display: flex;
	align-items: center;
	height: 54px;
	background: var(--bg-input);
	border: 1.5px solid transparent;
	/* border-radius: 14px; */
	transition: all 0.2s;
	overflow: hidden;
}
.phone-field:hover,
.code-field:hover {
	border-color: var(--border-light);
}
.phone-field.focused,
.code-field.focused {
	background: #fff;
	border-color: var(--brand-red);
	box-shadow: 0 0 0 3px var(--brand-red-light);
}

.field-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	padding-left: 16px;
	color: var(--text-muted);
	transition: color 0.2s;
}
.phone-field.focused .field-icon,
.code-field.focused .field-icon {
	color: var(--brand-red);
}

.country-code-selector {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 0 12px 0 6px;
	height: 100%;
	background: transparent;
	border: none;
	border-right: 1px solid #e2e8f0;
	font-size: 15px;
	font-weight: 700;
	color: var(--text-primary);
	cursor: default;
	white-space: nowrap;
}
.country-code-selector .arrow {
	font-size: 10px;
	color: var(--text-muted);
	margin-left: 2px;
}

.phone-input-field,
.code-input-field {
	flex: 1;
	border: none;
	background: transparent;
	height: 100%;
	padding: 0 14px;
	font-size: 15px;
	outline: none;
	color: var(--text-primary);
}
.phone-input-field::placeholder,
.code-input-field::placeholder {
	color: var(--text-placeholder);
}

.send-code-btn {
	background: var(--brand-red);
	color: white;
	border: none;
	height: 100%;
	padding: 0 18px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s;
	white-space: nowrap;
	letter-spacing: 0.5px;
}

.send-code-btn:hover {
	background: var(--brand-red-dark);
}
.send-code-btn:disabled {
	background: #bec8d2;
	cursor: not-allowed;
	opacity: 0.7;
}

/* 微信登录面板 (内嵌二维码) */
.wechat-login-area {
	text-align: center;
	width: 100%;
	/* padding: 20px 0; */
}

.wechat-qrcode-container {
	display: flex;
	justify-content: center;
	align-items: center;
	width: 100%;
	min-height: 220px;
}

.wechat-qrcode-container .impowerBox .qrcode {
	width: 220px;
}
.wechat-qrcode-container .impowerBox .title {
	display: none;
}
.wechat-qrcode-container .impowerBox .info {
	width: 220px;
}
.wechat-qrcode-container .status_icon {
	display: none;
}
.wechat-qrcode-container .impowerBox .status {
	text-align: center;
}

.wechat-login-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	background: var(--wechat-green);
	color: white;
	border: none;
	height: 54px;
	padding: 0 32px;
	font-size: 16px;
	font-weight: 600;
	border-radius: 14px;
	cursor: pointer;
	transition: all 0.25s ease;
	box-shadow: 0 4px 8px rgba(7, 193, 96, 0.2);
	letter-spacing: 1px;
}

.wechat-login-btn:hover {
	background: var(--wechat-green-dark);
	transform: translateY(-1px);
	box-shadow: 0 8px 18px rgba(7, 193, 96, 0.3);
}

.wechat-login-btn:active {
	transform: translateY(1px);
}
.wechat-login-btn:disabled {
	background: #8a98a9;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

.wechat-login-btn svg {
	width: 22px;
	height: 22px;
	fill: white;
}

.wechat-hint {
	font-size: 12px;
	color: var(--text-muted);
	/* margin-top: 18px; */
	line-height: 1.5;
}

.terms-row {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0px 6px 15px;
}

.terms-check {
	width: 18px;
	height: 18px;
	accent-color: var(--brand-red);
	margin-top: 2px;
	cursor: pointer;
}

.terms-text {
	font-size: 12px;
	line-height: 1.5;
	color: var(--text-muted);
	padding-top: 2px;
}

.terms-link {
	color: var(--brand-red);
	text-decoration: none;
	font-weight: 700;
	transition: opacity 0.2s;
}

.terms-link:hover {
	opacity: 0.8;
	text-decoration: underline;
}

.login-action-btn {
	width: 100%;
	height: 54px;
	background: var(--brand-red);
	border: none;
	border-radius: 14px;
	font-size: 17px;
	font-weight: 700;
	color: white;
	letter-spacing: 4px;
	cursor: pointer;
	transition: all 0.25s ease;
	box-shadow: 0 4px 8px rgba(227, 27, 35, 0.2);
}

.login-action-btn:hover {
	background: var(--brand-red-dark);
	transform: translateY(-1px);
	box-shadow: 0 8px 18px var(--brand-red-glow);
}

.login-action-btn:active {
	transform: translateY(1px);
}
.login-action-btn:disabled {
	background: #8a98a9;
	transform: none;
	box-shadow: none;
	cursor: not-allowed;
	letter-spacing: 2px;
}

/* 回调中 (loading) */
.callback-area {
	text-align: center;
	padding: 60px 0;
}

.spinner {
	width: 48px;
	height: 48px;
	border: 4px solid var(--bg-input);
	border-top-color: var(--brand-red);
	border-radius: 50%;
	margin: 0 auto 24px;
	animation: spin 0.8s linear infinite;
}

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

.callback-area h2 {
	font-size: 18px;
	color: var(--text-primary);
	margin-bottom: 8px;
	font-weight: 600;
}

.callback-area p {
	font-size: 14px;
	color: var(--text-muted);
}

/* 绑定 (无 fId 关联) */
.binding-header {
	text-align: center;
	margin-bottom: 24px;
	padding: 0 8px;
}

.binding-header h2 {
	font-size: 18px;
	color: var(--text-primary);
	margin-bottom: 8px;
	font-weight: 600;
}

.binding-header p {
	font-size: 13px;
	color: var(--text-muted);
	line-height: 1.6;
}

.binding-header .fId-hint {
	font-size: 11px;
	color: var(--text-placeholder);
	margin-top: 8px;
	font-family: monospace;
	word-break: break-all;
}

/* 成功 */
.success-area {
	text-align: center;
	padding: 50px 0 30px;
}

.success-icon {
	width: 72px;
	height: 72px;
	border-radius: 50%;
	background: var(--success-green);
	color: white;
	font-size: 38px;
	font-weight: bold;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 24px;
	box-shadow: 0 4px 16px rgba(82, 196, 26, 0.3);
}

.success-area h2 {
	font-size: 20px;
	color: var(--text-primary);
	margin-bottom: 12px;
	font-weight: 600;
}

.token-display {
	font-size: 12px;
	color: var(--text-muted);
	background: var(--bg-input);
	padding: 12px 16px;
	border-radius: 8px;
	word-break: break-all;
	margin-bottom: 24px;
	font-family: monospace;
	text-align: left;
	line-height: 1.5;
}

.success-area .login-action-btn {
	background: var(--text-muted);
	letter-spacing: 2px;
}

.success-area .login-action-btn:hover {
	background: var(--text-primary);
}

.global-footer {
	position: fixed;
	bottom: 0;
	left: 0;
	width: 100%;
	z-index: 2;
	background: var(--footer-bg);
	padding: 14px 0 18px;
	text-align: center;
	backdrop-filter: blur(2px);
	border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-legal-text {
	font-size: 11px;
	color: rgba(255, 255, 255, 0.55);
	line-height: 1.6;
	letter-spacing: 0.4px;
}

.footer-legal-text a {
	color: rgba(255, 255, 255, 0.55);
	text-decoration: none;
	transition: color 0.2s;
}

.footer-legal-text a:hover {
	color: rgba(255, 255, 255, 0.8);
}

@media (max-width: 700px) {
	.login-card {
		padding: 28px 20px 24px;
	}
	.tab-btn {
		font-size: 15px;
	}
}

.toast-msg {
	position: fixed;
	top: 24px;
	left: 50%;
	transform: translateX(-50%) translateY(-80px);
	background: rgba(0, 0, 0, 0.8);
	backdrop-filter: blur(12px);
	color: white;
	padding: 10px 24px;
	border-radius: 40px;
	font-size: 14px;
	z-index: 200;
	transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.4, 1.1);
	pointer-events: none;
	white-space: nowrap;
	font-weight: 700;
}

.toast-msg.show {
	transform: translateX(-50%) translateY(0);
}

#wechatQrcode {
	width: 200px;
	height: 200px;
	overflow: hidden;
	margin: 0 auto;
}

#wechatQrcode iframe {
	width: 400px !important;
	height: 310px !important;
	transform: scale(0.714);
	transform-origin: 0 0;
	padding-left: 137px;
}
