/*--
Author: W3layouts
Author URL: http://w3layouts.com
License: Creative Commons Attribution 3.0 Unported
License URL: http://creativecommons.org/licenses/by/3.0/

由 Tomcat 迁移到 Nginx 时重构：
1. 去掉了对 jQuery / moment.js 的依赖（下拉菜单改由 js/app.js 实现）；
2. 用 flex 布局替代大面积 float + 二十多个断点的写法，断点收敛为 3 个；
3. 背景与图标优先使用 WebP（CSS image-set），PNG 作为兜底；
4. 修复了原样式中的笔误（1px solid#e2e2e2）与移动端易错位的魔法数值。
--*/

:root {
	--brand: #03a9f4;
	--brand-hover: #0288d1;
	--card-bg: #f4f4f4;
	--row-bg: #fdfdfd;
	--line: #e2e2e2;
	--text: #111;
	--text-muted: #777;
	--radius: 4px;
	--shadow: 0 1px 5px rgba(0, 0, 0, .3);
	--card-width: min(92vw, 430px);
	--font: 'Ubuntu', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	min-height: 100vh;
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.5;
	color: var(--text);
	background-color: #84dd83;
	background-image: url("../images/bg.png");
	background-image: image-set(url("../images/bg.webp") type("image/webp"), url("../images/bg.png") type("image/png"));
	background-repeat: no-repeat;
	background-position: center center;
	background-size: cover;
}

.brand {
	position: absolute;
	top: .75rem;
	left: 1rem;
	font-size: .875rem;
	font-weight: 600;
	color: #0b5c33;
	text-decoration: none;
	text-shadow: 0 1px 0 rgba(255, 255, 255, .4);
	z-index: 10;
}

.brand:hover,
.brand:focus-visible {
	color: #073d22;
	text-decoration: underline;
}

.wrap {
	width: min(94vw, 960px);
	margin: 0 auto;
	padding-bottom: 1px;
}

h1 {
	margin: clamp(2.5rem, 9vh, 6rem) 0 1.5rem;
	font-size: clamp(1.9rem, 4.2vw, 3rem);
	font-weight: 100;
	line-height: 1.2;
	color: #fff;
	text-align: center;
	text-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}

/* ---------- 名片卡片 ---------- */

.profile {
	position: relative;
	z-index: 2;
	width: var(--card-width);
	margin: 0 auto;
	background: var(--brand);
	border-radius: var(--radius) var(--radius) 0 0;
}

.user {
	padding: 1.75rem 1rem 0;
	text-align: center;
}

.toolbar {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: clamp(.75rem, 4vw, 2.25rem);
}

.avatar img {
	display: block;
	width: clamp(72px, 22vw, 105px);
	height: auto;
}

.user h2 {
	margin: 1rem 0 0;
	padding-bottom: 1.25rem;
	font-size: clamp(1.2rem, 3vw, 1.5rem);
	font-weight: 100;
	color: #fff;
	overflow-wrap: anywhere;
}

/* ---------- 图标 ---------- */

.icon {
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	background-repeat: no-repeat;
	background-position: center;
	background-size: 16px 16px;
}

.icon-star {
	background-image: url("../images/star.png");
	background-image: image-set(url("../images/star.webp") type("image/webp"), url("../images/star.png") type("image/png"));
}

.icon-pencil {
	background-image: url("../images/pencil.png");
	background-image: image-set(url("../images/pencil.webp") type("image/webp"), url("../images/pencil.png") type("image/png"));
}

/* ---------- 下拉菜单 ---------- */

.menu {
	position: relative;
	flex: 0 0 auto;
}

.menu-toggle {
	display: block;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background-color: transparent;
	background-image: url("../images/menu.png");
	background-image: image-set(url("../images/menu.webp") type("image/webp"), url("../images/menu.png") type("image/png"));
	background-repeat: no-repeat;
	background-position: center;
	background-size: 4px 16px;
	cursor: pointer;
	transition: background-color .2s ease;
}

.menu-toggle:hover,
.menu-toggle:focus-visible {
	background-color: rgba(255, 255, 255, .22);
	outline: 2px solid #fff;
	outline-offset: 1px;
}

.dropdown {
	position: absolute;
	top: calc(100% + 6px);
	right: -6px;
	z-index: 5;
	width: 152px;
	margin: 0;
	padding: 0;
	list-style: none;
	background: #fff;
	border-radius: 3px;
	box-shadow: var(--shadow);
	max-height: 0;
	overflow: hidden;
	visibility: hidden;
	opacity: 0;
	transition: max-height .35s ease, opacity .2s ease, visibility .35s;
}

.menu.is-open .dropdown {
	max-height: 320px;
	visibility: visible;
	opacity: 1;
}

.dropdown li + li {
	border-top: 1px solid #f0f0f0;
}

.dropdown a {
	display: block;
	padding: 10px 14px;
	font-size: .75rem;
	color: var(--text-muted);
	text-decoration: none;
}

.dropdown a:hover,
.dropdown a:focus-visible {
	background: var(--row-bg);
	color: var(--brand);
}

/* ---------- 联系方式 ---------- */

.sub-profile {
	width: var(--card-width);
	margin: 0 auto;
	padding: 20px 0 0;
	background: var(--card-bg);
}

.sp1,
.sp2 {
	display: flex;
	align-items: center;
	gap: 14px;
	width: 86%;
	min-height: 70px;
	margin: 0 auto 2px;
	padding: 14px 16px;
	background: var(--row-bg);
	border-radius: 3px;
}

.sp2 {
	margin-bottom: 0;
}

.row-icon,
.row-action {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
}

.row-action {
	width: 20px;
	height: 20px;
	margin-left: auto;
}

.icon-phone {
	background-image: url("../images/ph.png");
	background-image: image-set(url("../images/ph.webp") type("image/webp"), url("../images/ph.png") type("image/png"));
}

.icon-mail {
	background-image: url("../images/mail.png");
	background-image: image-set(url("../images/mail.webp") type("image/webp"), url("../images/mail.png") type("image/png"));
}

.icon-msg {
	background-image: url("../images/msg.png");
	background-image: image-set(url("../images/msg.webp") type("image/webp"), url("../images/msg.png") type("image/png"));
}

.icon-clip {
	background-image: url("../images/clip.png");
	background-image: image-set(url("../images/clip.webp") type("image/webp"), url("../images/clip.png") type("image/png"));
}

.row-text {
	flex: 1 1 auto;
	min-width: 0;
	font-size: 15px;
	line-height: 1.45;
}

.row-text span {
	display: block;
	color: #333;
}

.row-text p {
	margin: .3em 0 0;
	color: var(--text);
	overflow-wrap: anywhere;
}

.row-text a {
	color: inherit;
	text-decoration: none;
}

.row-text a:hover,
.row-text a:focus-visible {
	text-decoration: underline;
}

/* ---------- 社交媒体 ---------- */

.social {
	width: var(--card-width);
	margin: 0 auto;
	padding-top: 1px;
	background: var(--card-bg);
	border-radius: 0 0 var(--radius) var(--radius);
}

.social ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	margin: 12px 0 0;
	padding: 0;
	border-top: 1px solid var(--line);
}

.social li {
	list-style: none;
	border-right: 1px solid var(--line);
}

.social li:last-child {
	border-right: 0;
}

.social a {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 10px 20px;
}

.icon-social {
	display: block;
	width: 45px;
	height: 45px;
	background-image: url("../images/sc-icons.png");
	background-image: image-set(url("../images/sc-icons.webp") type("image/webp"), url("../images/sc-icons.png") type("image/png"));
	background-repeat: no-repeat;
	background-size: 180px 90px;
}

.icon-social.fb {
	background-position: 0 0;
}

.icon-social.twit {
	background-position: -45px 0;
}

.icon-social.google {
	background-position: -90px 0;
}

.icon-social.link {
	background-position: -135px 0;
}

.social a:hover .icon-social.fb,
.social a:focus-visible .icon-social.fb {
	background-position: 0 -45px;
}

.social a:hover .icon-social.twit,
.social a:focus-visible .icon-social.twit {
	background-position: -45px -45px;
}

.social a:hover .icon-social.google,
.social a:focus-visible .icon-social.google {
	background-position: -90px -45px;
}

.social a:hover .icon-social.link,
.social a:focus-visible .icon-social.link {
	background-position: -135px -45px;
}

/* ---------- 页脚 ---------- */

.footer {
	margin-top: clamp(2rem, 8vh, 5rem);
	text-align: center;
}

.footer p {
	margin: 1.25rem 0;
	font-size: .8125rem;
	line-height: 1.7;
	color: #000;
}

.footer a {
	color: inherit;
	text-decoration: none;
}

.footer a:hover,
.footer a:focus-visible {
	text-decoration: underline;
}

/* ---------- 404 ---------- */

.not-found {
	width: var(--card-width);
	margin: 0 auto;
	padding: 2.5rem 1.5rem;
	text-align: center;
	background: #fff;
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}

.not-found .code {
	margin: 0;
	font-size: clamp(3rem, 12vw, 5rem);
	font-weight: 100;
	line-height: 1;
	color: var(--brand);
}

.not-found p {
	margin: 1rem 0 1.75rem;
	color: var(--text-muted);
}

.not-found a {
	display: inline-block;
	padding: .65rem 1.5rem;
	font-size: .875rem;
	color: #fff;
	text-decoration: none;
	background: var(--brand);
	border-radius: 999px;
	transition: background-color .2s ease;
}

.not-found a:hover,
.not-found a:focus-visible {
	background: var(--brand-hover);
}

/* ---------- 响应式 ---------- */

@media (min-width: 768px) {
	body {
		background-attachment: fixed;
	}
}

@media (max-width: 480px) {
	.brand {
		position: static;
		display: block;
		padding: .75rem 1rem 0;
		text-align: center;
	}

	h1 {
		margin-top: 1.5rem;
	}

	.sp1,
	.sp2 {
		width: 90%;
		gap: 12px;
		padding: 12px;
	}

	.social a {
		padding: 10px 14px;
	}
}

@media (max-width: 360px) {
	.user {
		padding-top: 1.25rem;
	}

	.sp1,
	.sp2 {
		width: 94%;
	}

	.row-text {
		font-size: 14px;
	}

	.social li {
		border-right: 0;
	}

	.social a {
		padding: 8px 11px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.dropdown,
	.menu-toggle,
	.not-found a {
		transition: none;
	}
}
