/* ===========================================================================
   sport_theme · 用户中心 (My Account / Wishlist / Favorites / History) 共享样式
   - sp-user-hero: 头像 + 邮箱 + 操作按钮 (Edit Profile / Change Password / Sign out)
   - sp-user-menu: 精简 3 tab 菜单 (Wishlist / Favorites / History)
   - sp-account-card: 账户表单卡片 + 修复按钮溢出
   关键修复: 全局 box-sizing border-box + min-width:0 防止 flex 子项撑爆
=========================================================================== */

/* ============== 全局保护层: 防止任何子元素溢出 viewport ============== */
.sp-user-page,
.sp-user-page *,
.sp-user-page *::before,
.sp-user-page *::after {
	box-sizing: border-box;
}
.sp-user-page {
	background: #F5F5F6;
	min-height: 60vh;
	padding: 20px 16px 60px;
	font-family: 'Inter', -apple-system, Segoe UI, Arial, sans-serif;
	color: #1A1A1A;
	overflow-x: hidden;
	width: 100%;
	max-width: 100vw;
}
.sp-user-container {
	max-width: 1100px;
	margin: 0 auto;
	width: 100%;
	min-width: 0;
}

/* ============== Hero (sp_user_hero.htm) ============== */
.sp-user-hero {
	background: linear-gradient(135deg, #1A1A1A 0%, #2D2D2D 100%);
	border-radius: 14px;
	padding: 18px 20px;
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 16px;
	box-shadow: 0 6px 18px rgba(0,0,0,0.12);
	position: relative;
	overflow: hidden;
	min-width: 0;
}
.sp-user-hero::before {
	content: "";
	position: absolute;
	top: 0; right: 0;
	width: 200px; height: 100%;
	background: linear-gradient(135deg, transparent, rgba(229,57,53,0.18));
	pointer-events: none;
}
.sp-uh-avatar {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: linear-gradient(135deg, #E53935, #C62828);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 24px;
	font-weight: 800;
	font-family: 'Oswald','Inter',sans-serif;
	flex-shrink: 0;
	box-shadow: 0 4px 12px rgba(229,57,53,0.4);
	border: 3px solid rgba(255,255,255,0.12);
	z-index: 1;
}
.sp-uh-info { flex: 1; min-width: 0; z-index: 1; }
.sp-uh-greeting {
	color: #999;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1px;
	margin-bottom: 3px;
}
.sp-uh-email {
	color: #fff;
	font-size: 16px;
	font-weight: 700;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Hero 操作按钮组 */
.sp-uh-actions {
	display: flex;
	gap: 8px;
	flex-shrink: 0;
	z-index: 1;
}
.sp-uh-btn {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 10px 14px;
	background: rgba(255,255,255,0.08);
	color: #fff !important;
	border: 1.5px solid rgba(255,255,255,0.18);
	border-radius: 8px;
	font-family: 'Oswald','Inter',sans-serif;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	text-decoration: none !important;
	cursor: pointer;
	transition: all 0.2s ease;
	-webkit-tap-highlight-color: transparent;
	white-space: nowrap;
}
.sp-uh-btn:hover {
	background: rgba(229,57,53,0.85);
	border-color: #E53935;
}
.sp-uh-btn.is-active {
	background: #E53935;
	border-color: #E53935;
	box-shadow: 0 0 0 2px rgba(229,57,53,0.3);
}
.sp-uh-btn-out:hover {
	background: rgba(220,38,38,0.9);
	border-color: #dc2626;
}
.sp-uh-btn i { font-size: 13px; }

/* ============== 菜单 (user_muen.htm) ============== */
.sp-user-menu {
	background: #fff;
	border-radius: 14px;
	padding: 6px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.05);
	display: flex;
	gap: 4px;
	margin-bottom: 16px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	min-width: 0;
}
.sp-user-menu::-webkit-scrollbar { display: none; }
.sp-um-item {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	color: #555;
	text-decoration: none !important;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 700;
	font-family: 'Oswald','Inter',sans-serif;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	transition: all 0.18s ease;
	border: 1.5px solid transparent;
	-webkit-tap-highlight-color: transparent;
	white-space: nowrap;
	flex-shrink: 0;
	min-height: 40px;
}
.sp-um-item i {
	width: 16px;
	text-align: center;
	font-size: 14px;
	color: #999;
	transition: color 0.18s ease;
}
.sp-um-item:hover {
	background: #F5F5F6;
	color: #1A1A1A;
}
.sp-um-item:hover i { color: #E53935; }
.sp-um-item.is-active {
	background: linear-gradient(135deg, rgba(229,57,53,0.08), rgba(198,40,40,0.04));
	color: #E53935;
	border-color: rgba(229,57,53,0.25);
}
.sp-um-item.is-active i { color: #E53935; }

/* ============== Account 卡片 (my_account / change_account 用) ============== */
.sp-account-card {
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.05);
	overflow: visible;
	min-width: 0;
	width: 100%;
	max-width: 100%;
}
.sp-card-header {
	padding: 22px 28px 18px;
	border-bottom: 1px solid #f0f0f0;
}
.sp-card-header h2 {
	margin: 0 0 4px;
	font-size: 20px;
	font-weight: 800;
	color: #1A1A1A;
	font-family: 'Oswald','Inter',sans-serif;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}
.sp-card-sub { margin: 0; color: #888; font-size: 13px; }

.sp-account-form { padding: 22px 28px 28px; min-width: 0; }
.sp-field-group {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px 18px;
	min-width: 0;
}
.sp-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sp-field label {
	color: #444;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	display: flex;
	align-items: center;
	gap: 6px;
}
.sp-field label i { color: #E53935; font-size: 13px; width: 14px; text-align: center; }
.sp-field-opt { color: #999; font-size: 11px; font-weight: 500; text-transform: none; letter-spacing: 0; }
.sp-field input {
	width: 100%;
	max-width: 100%;
	padding: 12px 14px;
	background: #F5F5F6;
	border: 1.5px solid transparent;
	border-radius: 8px;
	color: #1A1A1A;
	font-size: 14px;
	font-family: inherit;
	outline: none;
	transition: all 0.18s ease;
	min-width: 0;
}
.sp-field input:focus {
	background: #fff;
	border-color: #E53935;
	box-shadow: 0 0 0 3px rgba(229,57,53,0.1);
}
.sp-field input::placeholder { color: #aaa; }

/* 提交按钮 - 关键: max-width + min-width:0 防止溢出 */
.sp-form-actions {
	margin-top: 24px;
	display: flex;
	justify-content: flex-end;
	min-width: 0;
	width: 100%;
}
.sp-submit-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 13px 28px;
	background: linear-gradient(135deg, #E53935 0%, #C62828 100%);
	color: #fff;
	border: none;
	border-radius: 8px;
	font-family: 'Oswald','Inter',sans-serif;
	font-size: 14px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	cursor: pointer;
	transition: all 0.2s ease;
	box-shadow: 0 8px 18px -4px rgba(229,57,53,0.45);
	-webkit-tap-highlight-color: transparent;
	max-width: 100%;
	min-width: 0;
	box-sizing: border-box;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.sp-submit-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 12px 22px -4px rgba(229,57,53,0.6);
}
.sp-submit-btn:active { transform: translateY(0); }
.sp-submit-btn i { font-size: 14px; flex-shrink: 0; }

/* 留空占位区 */
.sp-account-placeholder {
	margin-top: 16px;
	padding: 36px 24px;
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.04);
	text-align: center;
	border: 2px dashed #e0e0e0;
}
.sp-account-placeholder i {
	font-size: 32px;
	color: #ccc;
	display: block;
	margin-bottom: 10px;
}
.sp-placeholder-text {
	color: #999;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.3px;
}

/* ============== 平板 (≤ 1024px) ============== */
@media (max-width: 1024px) {
	.sp-uh-btn span { font-size: 11px; }
}

/* ============== 移动端 (≤ 768px) - 重点 ============== */
@media (max-width: 768px) {
	.sp-user-page { padding: 14px 10px 40px; }

	/* Hero 紧凑 + 按钮变图标 */
	.sp-user-hero {
		padding: 14px 14px;
		gap: 12px;
		border-radius: 12px;
		flex-wrap: wrap;
	}
	.sp-uh-avatar { width: 44px; height: 44px; font-size: 18px; }
	.sp-uh-greeting { font-size: 10px; margin-bottom: 2px; }
	.sp-uh-email { font-size: 13px; }

	/* 移动端按钮: 只显示图标, 变成 36×36 圆角方形 */
	.sp-uh-actions { gap: 6px; }
	.sp-uh-btn span { display: none; }
	.sp-uh-btn {
		min-width: 38px;
		min-height: 38px;
		padding: 0;
		justify-content: center;
		gap: 0;
	}
	.sp-uh-btn i { font-size: 16px; }

	/* 菜单 3 tab 强制三等分屏宽 (修复 BROWSE HISTORY 文字被切到屏幕外) */
	.sp-user-menu {
		padding: 4px;
		display: grid;
		grid-template-columns: repeat(3, 1fr);
		gap: 4px;
		overflow: visible;
	}
	.sp-um-item {
		padding: 9px 6px;
		font-size: 11px;
		min-height: 40px;
		min-width: 0;
		justify-content: center;
		gap: 5px;
		letter-spacing: 0.3px;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}
	.sp-um-item i { font-size: 13px; flex-shrink: 0; }
	.sp-um-item span {
		display: inline;
		min-width: 0;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	/* Account 卡片紧凑 */
	.sp-account-card { border-radius: 12px; }
	.sp-card-header { padding: 16px 16px 14px; }
	.sp-card-header h2 { font-size: 16px; }
	.sp-card-sub { font-size: 12px; }
	.sp-account-form { padding: 14px; }
	.sp-field-group { grid-template-columns: 1fr; gap: 12px; }
	.sp-field input { padding: 12px 14px; font-size: 16px; }

	/* 提交按钮 - 移动端全宽紧凑 (用更小 padding 防溢出) */
	.sp-form-actions {
		display: block;
		width: 100%;
	}
	.sp-submit-btn {
		display: flex;
		width: 100%;
		max-width: 100%;
		padding: 14px 12px;
		font-size: 13px;
		letter-spacing: 0.4px;
	}
}

/* ============== 极小屏 (≤ 360px) ============== */
@media (max-width: 360px) {
	.sp-uh-actions { width: 100%; justify-content: flex-end; margin-top: 6px; }
	.sp-uh-info { width: calc(100% - 56px); }
	.sp-submit-btn { padding: 13px 8px; font-size: 12px; letter-spacing: 0.2px; }

	/* 极小屏 menu: 文字更小, gap 更紧 */
	.sp-um-item { font-size: 10px; padding: 9px 4px; gap: 4px; letter-spacing: 0.2px; }
	.sp-um-item i { font-size: 12px; }
}
