.portal-wrap {
	max-width: 480px;
	margin: 120px auto 80px;
	padding: 0 20px;
}

/* 正文中的普通文字和链接应随句子自然换行；按钮等带类名的组件保留原布局。 */
p > span:not([class]),
p > a:not([class]) {
	display: inline;
}
.portal-wrap h1 {
	font-size: 28px;
	margin-bottom: 8px;
}
.portal-wrap p.lead {
	color: #5b6170;
	margin-bottom: 24px;
}
.portal-wrap label {
	display: block;
	margin: 14px 0 6px;
	font-weight: 600;
}
.portal-wrap input {
	width: 100%;
	height: 44px;
	padding: 0 12px;
	border: 1px solid #d5d8e0;
	border-radius: 6px;
}
.portal-wrap .ud-main-btn {
	margin-top: 22px;
	border: 0;
	cursor: pointer;
}
.portal-wrap .msg {
	margin-top: 16px;
	color: #9a3412;
}
.portal-wrap .ok {
	color: #166534;
}

.portal-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 28px;
}

.portal-wrap:has(.portal-bar) {
	margin-top: 36px;
}

.ud-header .navbar-btn {
	white-space: nowrap;
}

.ud-header .portal-account-slot {
	position: absolute;
	top: 50%;
	right: 12px;
	transform: translateY(-50%);
	z-index: 30;
}

@media (max-width: 991px) {
	.ud-header .portal-account-slot {
		right: 54px;
	}

	/* Keep the complete mobile menu reachable, including in short landscape views. */
	.ud-header .navbar-collapse {
		max-height: calc(100vh - 64px);
		max-height: calc(100dvh - 64px);
		overflow-y: auto;
		overscroll-behavior: contain;
		-webkit-overflow-scrolling: touch;
		scrollbar-gutter: stable;
		scrollbar-width: thin;
		scrollbar-color: #b8c5dd transparent;
	}
	.ud-header .navbar-collapse::-webkit-scrollbar { width: 6px; }
	.ud-header .navbar-collapse::-webkit-scrollbar-thumb { background: #b8c5dd; border-radius: 6px; }
	.ud-header .navbar-nav .nav-item > a {
		display: flex;
		align-items: center;
		min-height: 44px;
	}
}

@media (min-width: 992px) {
	.ud-header .navbar {
		flex-wrap: nowrap;
		align-items: center;
	}

	.ud-header .navbar-collapse {
		flex: 1 1 auto;
	}

	.ud-header .navbar-nav {
		margin-left: auto;
	}

	.ud-header .navbar-nav .nav-item {
		flex-shrink: 0;
		padding: 0 8px;
	}

	.ud-header .navbar-nav .nav-item > a {
		white-space: nowrap;
		padding-right: 4px;
		padding-left: 4px;
	}

	.ud-header .navbar-btn {
		position: static;
		top: auto;
		right: auto;
		display: flex;
		flex: none;
		align-items: center;
		margin-left: 12px;
		transform: none;
	}

	.ud-header .navbar-btn .ud-main-btn {
		padding: 8px 8px;
	}

	.ud-header .portal-account-slot:not([hidden]) + .navbar-btn {
		margin-right: 48px;
	}
}

@media (min-width: 992px) and (max-width: 1199px) {
	.ud-header .navbar-nav .nav-item {
		padding: 0 4px;
	}

	.ud-header .navbar-nav .nav-item > a,
	.ud-header .navbar-btn .ud-main-btn {
		font-size: 14px;
	}
}

.js-guest[hidden] {
	display: none !important;
}

.portal-account-slot {
	position: relative;
}

.portal-avatar {
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 50%;
	padding: 0;
	background: #3056d3;
	color: #fff;
	font-weight: 700;
	font-size: 15px;
	line-height: 1;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.portal-avatar:hover {
	filter: brightness(1.08);
}

.portal-avatar-lg {
	width: 56px;
	height: 56px;
	font-size: 22px;
	cursor: default;
}

.portal-menu {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	width: 240px;
	padding: 8px;
	background: #fff;
	color: #212b36;
	border-radius: 10px;
	box-shadow: 0 12px 32px rgba(16, 24, 40, 0.16);
	z-index: 40;
}

.portal-menu[hidden] {
	display: none !important;
}

.portal-menu-id {
	padding: 8px 10px 10px;
	border-bottom: 1px solid #eef0f4;
}

.portal-menu-id strong,
.portal-menu-id span {
	display: block;
}

.portal-menu-id strong {
	color: #212b36;
	font-size: 15px;
}

.portal-menu-id span {
	margin-top: 2px;
	color: #637381;
	font-size: 13px;
	word-break: break-all;
}

.portal-menu a,
.portal-menu button.portal-menu-item {
	display: block;
	width: 100%;
	margin: 2px 0 0;
	padding: 8px 10px;
	border: 0;
	border-radius: 6px;
	background: none;
	color: #212b36;
	font-size: 14px;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
}

.portal-menu a:hover,
.portal-menu button.portal-menu-item:hover {
	background: #f3f5f8;
	color: #212b36;
	opacity: 1;
}

body.portal-dialog-open {
	overflow: hidden;
}

.portal-dialog {
	position: fixed;
	inset: 0;
	z-index: 200;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 40px 16px;
	overflow: auto;
}

.portal-dialog[hidden] {
	display: none !important;
}

.portal-dialog-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(16, 24, 40, 0.45);
}

.portal-dialog-panel {
	position: relative;
	width: min(480px, 100%);
	margin: auto;
	padding: 20px 24px 32px;
	background: #fff;
	color: #212b36;
	border-radius: 12px;
	box-shadow: 0 24px 48px rgba(16, 24, 40, 0.2);
}

.portal-dialog-panel h2 {
	margin: 0 40px 0 0;
	font-size: 20px;
	line-height: 32px;
	color: #212b36;
}

.portal-dialog-panel .profile-head h2 {
	margin-right: 0;
}

.portal-dialog-panel label {
	display: block;
	margin: 14px 0 6px;
	font-weight: 600;
	color: #212b36;
}

.portal-dialog-panel input,
.portal-dialog-panel select {
	width: 100%;
	height: 44px;
	padding: 0 12px;
	border: 1px solid #d5d8e0;
	border-radius: 6px;
	background: #fff;
	color: #212b36;
}

.area-pick {
	position: relative;
}

.area-list {
	position: absolute;
	z-index: 3;
	left: 0;
	right: 0;
	top: calc(100% + 4px);
	max-height: 200px;
	margin: 0;
	padding: 4px;
	overflow: auto;
	list-style: none;
	background: #fff;
	border: 1px solid #d5d8e0;
	border-radius: 6px;
	box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
}

.area-list li {
	padding: 8px 10px;
	border-radius: 4px;
	cursor: pointer;
}

.area-list li[aria-selected="true"],
.area-list li:hover {
	background: #f3f5f8;
}

.area-list .area-empty {
	color: #637381;
	cursor: default;
}

.area-list .area-empty:hover {
	background: transparent;
}

.pw-field {
	position: relative;
}

.portal-dialog-panel .pw-field input {
	padding-right: 42px;
}

.pw-eye {
	position: absolute;
	top: 50%;
	right: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: #637381;
	transform: translateY(-50%);
	cursor: pointer;
}

.pw-eye svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.pw-eye.is-open {
	color: #3056d3;
}

.pw-eye.is-open svg {
	stroke-width: 2.4;
}

.portal-dialog-panel .ud-main-btn {
	margin-top: 22px;
	border: 0;
	cursor: pointer;
}

.portal-dialog-panel .ud-main-btn:disabled,
button.ud-main-btn:disabled {
	opacity: 0.55;
	cursor: default;
}

.portal-dialog-close {
	position: absolute;
	top: 20px;
	right: 16px;
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: #637381;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

.portal-dialog-close:hover {
	background: #f3f5f8;
	color: #212b36;
}

.portal-dialog-demo {
	margin-top: 28px;
}

[data-pw-block][hidden],
.portal-dialog [hidden] {
	display: none !important;
}

.portal-auth-links {
	margin-top: 16px;
}

.portal-close-link {
	margin-top: 28px;
}

.portal-close-link button {
	color: #9a3412;
}

.portal-auth-links button,
.portal-auth-links a {
	padding: 0;
	border: 0;
	background: none;
	color: #3056d3;
	font: inherit;
	cursor: pointer;
}

.profile-head {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 8px;
}

.profile-email {
	margin: 0 0 18px;
	color: #637381;
}

.portal-wrap h2 {
	font-size: 20px;
	margin-top: 28px;
}

.hero-carousel {
	position: relative;
}

.hero-carousel-viewport {
	overflow: hidden;
	border-radius: 12px;
}

.hero-carousel-track {
	display: flex;
	transition: transform 0.45s ease;
}

.hero-carousel-track img {
	flex: 0 0 100%;
	width: 100%;
	max-width: none;
	height: auto;
}

.hero-carousel-btn {
	position: absolute;
	top: 50%;
	z-index: 2;
	width: 36px;
	height: 36px;
	margin-top: -18px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	color: #212b36;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(16, 24, 40, 0.16);
}

.hero-carousel-btn::before {
	content: "";
	display: block;
	width: 8px;
	height: 8px;
	margin: 0 auto;
	border-top: 2px solid currentColor;
	border-right: 2px solid currentColor;
}

.hero-carousel-prev {
	left: 12px;
}

.hero-carousel-prev::before {
	transform: rotate(-135deg);
	margin-left: 14px;
}

.hero-carousel-next {
	right: 12px;
}

.hero-carousel-next::before {
	transform: rotate(45deg);
	margin-right: 14px;
}

.hero-carousel-btn:hover {
	background: #fff;
}

.hero-carousel-dots {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 14px;
}

.hero-carousel-dots button {
	width: 8px;
	height: 8px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.45);
	cursor: pointer;
}

.hero-carousel-dots button[aria-current="true"] {
	background: #fff;
}

.hero-carousel.is-single .hero-carousel-btn,
.hero-carousel.is-single .hero-carousel-dots {
	display: none;
}

@media (prefers-reduced-motion: reduce) {
	.hero-carousel-track {
		transition: none;
	}
}

/* 区号与号码分别输入，窄屏仍保持一行且允许收缩。 */
.phone-field { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; }
.phone-field > input, .phone-country-control { min-width: 0; max-width: 100%; }
.phone-country-control { position: relative; }
.phone-country-control::after { content: ""; position: absolute; right: 13px; top: 50%; width: 6px; height: 6px; border: solid #5b6170; border-width: 0 1px 1px 0; transform: translateY(-70%) rotate(45deg); pointer-events: none; }
/* 保留原生选择器的键盘和手机交互；收起时只展示区号，展开仍显示完整国家名称。
   macOS / WebKit 上单靠 color:transparent 挡不住选中项文字，必须一并清 -webkit-text-fill-color。 */
.portal-dialog-panel .phone-country-control .phone-country,
.phone-country-control .phone-country {
	appearance: none;
	-webkit-appearance: none;
	padding-right: 28px;
	background-image: none;
	color: transparent;
	-webkit-text-fill-color: transparent;
	text-shadow: none;
}
.portal-dialog-panel .phone-country-control .phone-country option,
.phone-country-control .phone-country option {
	color: #212529;
	-webkit-text-fill-color: #212529;
	background: #fff;
}
.phone-country-label { position: absolute; inset: 0 28px 0 12px; display: flex; align-items: center; pointer-events: none; white-space: nowrap; color: #212529; }
@media (max-width: 680px) { .phone-field > input, .phone-country-control select, .phone-country-label { font-size: 16px; } }

/* 首页蓝色背景上用白底蓝字，避免头像圆圈与背景融为一体。 */
.ud-header:not(.sticky) .portal-avatar { background: #fff; color: #3056d3; border: 1px solid #fff; }
.ud-header:not(.sticky) .portal-avatar:hover { background: #edf2ff; color: #2447b1; }
.ud-header:not(.sticky) .portal-avatar:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
