/* ============================================================
   Apple Account 登录页（本地研究复刻）样式
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
	--black: #1d1d1f;
	--gray: #6e6e73;
	--line: #d2d2d7;
	--blue: #0071e3;
	--blue-hover: #0077ed;
	--bg: #ffffff;
	--field-bg: #fbfbfd;
	--error: #d70015;
	--radius: 18px;
}

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

body {
	font-family: "SF Pro Text", "SF Pro Display", -apple-system, BlinkMacSystemFont,
		"Helvetica Neue", "Segoe UI", "PingFang SC", "Hiragino Sans GB",
		"Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
	color: var(--black);
	background: var(--bg);
	line-height: 1.47;
	-webkit-font-smoothing: antialiased;
	min-height: 100vh;
}

.login-page {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 40px 24px;
}

/* ---------------- 卡片 ---------------- */
.login-card {
	position: relative;
	width: 100%;
	max-width: 430px;
	background: #fff;
	border: 1px solid #e8e8ed;
	border-radius: var(--radius);
	box-shadow: 0 4px 28px rgba(0, 0, 0, .06);
	padding: 40px 44px 36px;
	text-align: center;
	animation: cardIn .35s ease both;
}
@keyframes cardIn {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: none; }
}

.login-brand { color: var(--black); margin-bottom: 18px; }
.login-brand svg { display: block; margin: 0 auto; }

.login-title {
	font-size: 28px;
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: -.01em;
	margin-bottom: 10px;
}
.login-subtitle {
	font-size: 15px;
	color: var(--gray);
	margin-bottom: 28px;
}
.login-subtitle strong { color: var(--black); font-weight: 500; word-break: break-all; }

/* ---------------- 输入框（悬浮标签） ---------------- */
.field {
	position: relative;
	text-align: left;
}
.field input {
	width: 100%;
	height: 54px;
	padding: 18px 16px 6px;
	font-size: 16px;
	color: var(--black);
	background: var(--field-bg);
	border: 1px solid var(--line);
	border-radius: 12px;
	outline: none;
	transition: border-color .2s, box-shadow .2s, background .2s;
}
.field input:focus {
	border-color: var(--blue);
	box-shadow: 0 0 0 4px rgba(0, 113, 227, .15);
	background: #fff;
}
.field label {
	position: absolute;
	left: 16px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 16px;
	color: #86868b;
	pointer-events: none;
	transition: transform .18s ease, font-size .18s ease, color .18s ease;
	transform-origin: left center;
}
.field input:focus + label,
.field input:not(:placeholder-shown) + label {
	transform: translateY(-13px);
	font-size: 12px;
	color: var(--gray);
}
.field input:focus + label { color: var(--blue); }
.field.has-error input { border-color: var(--error); }
.field.has-error input:focus { box-shadow: 0 0 0 4px rgba(215, 0, 21, .12); }

/* 悬浮标签占位技巧 */
.field input:placeholder-shown:not(:focus) + label { cursor: text; }

/* 密码框与小眼睛 */
.field-password input { padding-right: 50px; }
.eye-btn {
	position: absolute;
	right: 6px;
	top: 50%;
	transform: translateY(-50%);
	width: 40px;
	height: 40px;
	border: 0;
	background: none;
	color: #86868b;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
}
.eye-btn:hover { color: var(--black); }
.eye-btn svg { width: 20px; height: 16px; }
.eye-btn svg[hidden] { display: none; }

.field-error {
	color: var(--error);
	font-size: 13px;
	margin: 8px 2px 0;
	text-align: left;
}

/* ---------------- 操作区 ---------------- */
.login-actions {
	display: flex;
	justify-content: flex-end;
	margin-top: 22px;
	min-height: 52px;
	align-items: center;
}
.arrow-btn {
	width: 52px;
	height: 52px;
	border-radius: 50%;
	border: 0;
	background: var(--blue);
	color: #fff;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background .2s, transform .15s, box-shadow .2s;
	box-shadow: 0 6px 16px rgba(0, 113, 227, .3);
}
.arrow-btn:hover { background: var(--blue-hover); transform: scale(1.04); }
.arrow-btn:active { transform: scale(.96); }
.arrow-btn:disabled { opacity: .6; cursor: default; transform: none; }
.arrow-btn svg { fill: currentColor; }
.arrow-btn .arrow-icon { display: block; }
.arrow-btn.is-loading .arrow-icon { display: none; }

.spinner {
	display: none;
	width: 20px;
	height: 20px;
	border: 2.5px solid rgba(255, 255, 255, .35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: spin .7s linear infinite;
}
.arrow-btn.is-loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- 链接区 ---------------- */
.login-links {
	margin-top: 26px;
	font-size: 14px;
	color: var(--gray);
}
.login-links a {
	color: var(--blue);
	text-decoration: none;
}
.login-links a:hover { text-decoration: underline; }
.login-links p { margin-top: 12px; }
.login-links p a { margin-left: 4px; }

/* ---------------- 返回按钮 ---------------- */
.back-btn {
	position: absolute;
	left: 14px;
	top: 16px;
	width: 36px;
	height: 36px;
	border: 0;
	background: none;
	color: var(--black);
	cursor: pointer;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .2s;
}
.back-btn:hover { background: rgba(0, 0, 0, .05); }
.back-btn svg { fill: currentColor; }

/* ---------------- 成功页 ---------------- */
.login-success .success-icon { margin-bottom: 16px; animation: pop .4s cubic-bezier(.2, .8, .3, 1.2) both; }
@keyframes pop { from { transform: scale(.5); opacity: 0; } to { transform: none; opacity: 1; } }

.download-hint {
	font-size: 13px;
	color: var(--gray);
	margin-bottom: 22px;
}
.download-hint a { color: var(--blue); text-decoration: none; margin-left: 4px; }
.download-hint a:hover { text-decoration: underline; }

.button-home {
	display: inline-block;
	padding: 12px 26px;
	border-radius: 980px;
	background: var(--blue);
	color: #fff;
	font-size: 15px;
	text-decoration: none;
	transition: background .2s, transform .15s;
}
.button-home:hover { background: var(--blue-hover); }
.button-home:active { transform: scale(.97); }

/* ---------------- 页脚 ---------------- */
.login-footer {
	margin-top: 28px;
	text-align: center;
	font-size: 12px;
	color: #86868b;
}
.login-footer a { color: var(--gray); text-decoration: none; }
.login-footer a:hover { color: var(--black); text-decoration: underline; }
.login-footer .dot { margin: 0 10px; color: #b6b6bb; }
.research-note {
	margin-top: 10px;
	max-width: 430px;
	line-height: 1.5;
}

/* ---------------- 响应式（手机） ---------------- */
@media (max-width: 560px) {
	.login-page { padding: 24px 16px; justify-content: flex-start; padding-top: max(24px, env(safe-area-inset-top)); }
	.login-card {
		border: 0;
		box-shadow: none;
		padding: 28px 8px 24px;
		max-width: 420px;
		animation: none;
	}
	.login-title { font-size: 26px; }
	.login-subtitle { margin-bottom: 24px; }
	.research-note { padding: 0 8px; }
}

@media (prefers-reduced-motion: reduce) {
	.login-card, .success-icon { animation: none; }
	.spinner { animation-duration: 1.4s; }
}
