/*
 * 共用组件：按钮、内页页头、区块标题、胶囊标签、菱形列表、传单纸张效果、微信块、提示条。
 * 颜色、圆角只引用 brand/*.css 的变量。移动优先，断点 768px、1100px。
 */

/* ---------- 版心和区块 ---------- */

.fm-section {
	box-sizing: border-box;
	max-width: var(--fm-width-page);
	margin-inline: auto;
	padding: 32px var(--fm-gutter);
}

.fm-band {
	background: var(--fm-color-tint-1);
}

.fm-band--deep {
	background: var(--fm-color-tint-2);
}

.fm-band--primary {
	background: var(--fm-color-primary);
	color: var(--fm-color-on-primary);
}

/* ---------- 标题 ---------- */

.fm-display {
	font-family: var(--fm-font-display);
	font-weight: 700;
	letter-spacing: 0.02em;
}

.fm-heading {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 12px;
	align-items: baseline;
	margin-bottom: 16px;
}

.fm-heading__title {
	margin: 0;
	color: var(--fm-color-primary);
	font-family: var(--fm-font-display);
	font-size: 28px;
	font-weight: 700;
	line-height: 1.3;
}

.fm-heading__en {
	color: var(--fm-color-accent);
	font-size: 14px;
	font-weight: 700;
}

.fm-heading__aside {
	margin-left: auto;
	color: var(--fm-color-text-muted);
	font-size: 14px;
}

.fm-heading__link {
	margin-left: auto;
	padding-block: 10px;
	font-weight: 700;
}

.fm-band--primary .fm-heading__title {
	color: var(--fm-color-on-primary);
}

.fm-lead {
	max-width: 36em;
	margin: 0;
	color: var(--fm-color-text-lead);
	font-size: 16px;
	line-height: 1.8;
}

/* ---------- 按钮 ---------- */

.fm-button {
	box-sizing: border-box;
	display: inline-flex;
	gap: 8px;
	align-items: center;
	justify-content: center;
	min-height: 52px;
	padding: 0 26px;
	border: 2px solid transparent;
	border-radius: var(--fm-radius-button);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
}

.fm-button--cta {
	background: var(--fm-color-cta);
	color: var(--fm-color-on-cta);

	&:hover {
		border-color: var(--fm-color-cta-edge);
		color: var(--fm-color-on-cta);
	}
}

.fm-button--accent {
	background: var(--fm-color-accent);
	color: var(--fm-color-on-primary);

	&:hover {
		background: var(--fm-color-primary);
		color: var(--fm-color-on-primary);
	}
}

.fm-button--outline {
	border-color: var(--fm-color-accent);
	background: transparent;
	color: var(--fm-color-accent);

	&:hover {
		background: var(--fm-color-tint-1);
		color: var(--fm-color-primary);
	}
}

.fm-button--block {
	display: flex;
	width: 100%;
}

.fm-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

/* ---------- 内页页头：面包屑、叶子图标、标题和英文副标题、简介 ---------- */

.fm-page-hero__inner {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: 14px;
	max-width: var(--fm-width-page);
	margin-inline: auto;
	padding: 20px var(--fm-gutter) 32px;
}

.fm-breadcrumb {
	color: var(--fm-color-text-muted);
	font-size: 14px;

	ol {
		display: flex;
		flex-wrap: wrap;
		gap: 4px;
		margin: 0;
		padding: 0;
		list-style: none;
	}

	li + li::before {
		content: "/";
		margin-right: 4px;
	}
}

.fm-page-hero__title-row {
	display: flex;
	gap: 14px;
	align-items: center;
}

.fm-page-hero__leaf {
	flex-shrink: 0;
	width: 60px; /* Logo 稻穗比例 100:59.5，高度和原来的图案差不多 */
	height: auto;
}

.fm-page-hero__titles {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 14px;
	align-items: baseline;
}

.fm-page-hero__title {
	margin: 0;
	color: var(--fm-color-primary);
	font-family: var(--fm-font-display);
	font-size: 36px;
	font-weight: 700;
	line-height: 1.15;
}

.fm-page-hero__en {
	color: var(--fm-color-accent);
	font-size: 18px;
	font-weight: 700;
}

.fm-page-hero__intro {
	max-width: 40em;
	margin: 0;
	color: var(--fm-color-text-lead);
	font-size: 16px;
	line-height: 1.8;
}

/* 带图片的页头（门店页）：手机上图片在下，电脑上左右两栏.
   上边距放在两栏外面（同第五版）：图片比文字高时也不会贴着导航栏 */
.fm-page-hero--media .fm-page-hero__wrap {
	box-sizing: border-box;
	display: grid;
	gap: 0 40px;
	align-items: center;
	max-width: var(--fm-width-page);
	margin-inline: auto;
	padding: 20px var(--fm-gutter) 32px;
}

.fm-page-hero--media .fm-page-hero__inner {
	max-width: none;
	padding-inline: 0;
	padding-top: 0;
}

.fm-page-hero__media img {
	display: block;
	width: 100%;
	height: 220px;
	object-fit: cover;
	border-radius: var(--fm-radius-card);
}

/* ---------- 胶囊标签、菱形列表 ---------- */

.fm-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.fm-pill {
	display: inline-flex;
	align-items: center;
	padding: 4px 12px;
	border-radius: var(--fm-radius-pill);
	background: var(--fm-color-tint-2);
	color: var(--fm-color-text-placeholder);
	font-size: 14px;
	font-weight: 700;
}

.fm-pill--accent {
	padding: 6px 14px;
	background: var(--fm-color-accent);
	color: var(--fm-color-on-primary);
	font-size: 15px;
}

.fm-diamonds {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;

	li {
		display: flex;
		gap: 12px;
		font-size: 16px;
		line-height: 1.7;
	}

	li::before {
		content: "";
		flex-shrink: 0;
		width: 10px;
		height: 10px;
		margin-top: 9px;
		border-radius: var(--fm-radius-mark);
		background: var(--fm-color-decor);
		transform: rotate(45deg);
	}
}

/* ---------- 传单纸张：白边、阴影、略微倾斜、顶上一条胶带 ---------- */

.fm-paper {
	position: relative;
	margin: 0;
	padding: 8px;
	background: var(--fm-color-surface);
	box-shadow: var(--fm-shadow-card);
	transform: rotate(-1.2deg);

	&::before {
		content: "";
		position: absolute;
		top: -10px;
		left: 50%;
		width: 80px;
		height: 22px;
		margin-left: -40px;
		background: color-mix(in srgb, var(--fm-color-cta) 75%, transparent);
		transform: rotate(3deg);
	}

	img {
		display: block;
		width: 100%;
		height: auto;
	}
}

.fm-paper--tilt-right {
	transform: rotate(1.2deg);

	&::before {
		background: color-mix(in srgb, var(--fm-color-decor-3) 80%, transparent);
		transform: rotate(-4deg);
	}
}

/* ---------- 微信二维码块 ---------- */

.fm-wechat {
	display: flex;
	gap: 16px;
	align-items: center;
}

.fm-wechat__qr {
	flex-shrink: 0;
	width: 92px;
	height: 92px;
	border: 1px solid var(--fm-color-border);
	border-radius: var(--fm-radius-media);
	background: var(--fm-color-surface);
	object-fit: contain;
}

.fm-wechat__text {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.fm-wechat__title {
	display: flex;
	gap: 6px;
	align-items: center;
	margin: 0;
	color: var(--fm-color-primary);
	font-size: 17px;
	font-weight: 700;

	svg {
		flex-shrink: 0;
		color: var(--fm-color-wechat);
	}
}

.fm-wechat__desc {
	margin: 0;
	color: var(--fm-color-text-muted);
	font-size: 15px;
	line-height: 1.6;
}

/* 深底上的微信块（首页手机版、门店页） */
.fm-wechat--panel {
	padding: 20px;
	border-radius: var(--fm-radius-card);
	background: var(--fm-color-primary);

	.fm-wechat__qr {
		width: 104px;
		height: 104px;
	}

	.fm-wechat__title {
		color: var(--fm-color-on-primary);
		font-family: var(--fm-font-display);
		font-size: 20px;
	}

	.fm-wechat__desc {
		color: var(--fm-color-on-footer);
		font-size: 14px;
	}
}

/* 浅底上的微信块（传单页） */
.fm-wechat--tint {
	padding: 20px 24px;
	border-radius: var(--fm-radius-card);
	background: var(--fm-color-tint-1);

	.fm-wechat__qr {
		width: 112px;
		height: 112px;
	}

	.fm-wechat__title {
		font-family: var(--fm-font-display);
		font-size: 22px;
	}
}

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

.fm-card {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 24px;
	border-radius: var(--fm-radius-card);
	background: var(--fm-color-tint-1);
}

.fm-card--primary {
	background: var(--fm-color-primary);
	color: var(--fm-color-on-primary);

	.fm-card__text {
		color: var(--fm-color-on-footer);
	}

	.fm-card__title {
		color: var(--fm-color-on-primary);
	}

	a:not(.fm-button) {
		color: var(--fm-color-on-primary);

		&:hover {
			color: var(--fm-color-highlight);
		}
	}
}

.fm-card--outline {
	border: 1px solid var(--fm-color-line);
	background: var(--fm-color-surface);
}

.fm-card__title {
	margin: 0;
	color: var(--fm-color-primary);
	font-family: var(--fm-font-display);
	font-size: 24px;
	font-weight: 700;
	line-height: 1.3;
}

.fm-card__text {
	margin: 0;
	color: var(--fm-color-text-muted);
	font-size: 16px;
	line-height: 1.8;
}

.fm-card .fm-button {
	align-self: flex-start;
}

/* ---------- 定义列表（地址、营业、电话） ---------- */

.fm-facts {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 12px 20px;
	margin: 0;
	font-size: 16px;
	line-height: 1.6;

	dt {
		color: var(--fm-color-accent);
		font-weight: 700;
	}

	dd {
		margin: 0;
	}
}

.fm-muted {
	color: var(--fm-color-text-muted);
}

.fm-small {
	font-size: 14px;
}

/* ---------- 地图 ---------- */

.fm-map {
	position: relative;
	min-height: 300px;
	overflow: hidden;
	border: 1px solid var(--fm-color-border);
	border-radius: var(--fm-radius-card);
	background: var(--fm-color-tint-1);

	iframe {
		position: absolute;
		inset: 0;
		width: 100%;
		height: 100%;
		border: 0;
	}
}

.fm-map--empty {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	text-align: center;
}

/* ---------- 区块编辑器的正文（关于、隐私说明、无障碍声明） ---------- */

.fm-text {
	font-size: 16px;
	line-height: 1.9;

	> * {
		margin-block: 0 1em;
	}

	h2,
	h3 {
		margin-block: 1.4em 0.5em;
		color: var(--fm-color-primary);
		font-family: var(--fm-font-display);
		font-weight: 700;
		line-height: 1.3;
	}

	h2 {
		font-size: 28px;
	}

	h3 {
		font-size: 22px;
	}

	> :first-child,
	.wp-block-column > :first-child {
		margin-top: 0;
	}

	p {
		color: var(--fm-color-text-muted);
	}

	img {
		max-width: 100%;
		height: auto;
		border-radius: var(--fm-radius-card);
	}

	/* 正文里的照片不超过 380px 高，多出的部分裁掉（第五版关于页「我们的故事」） */
	.wp-block-image img {
		width: 100%;
		max-height: 380px;
		object-fit: cover;
	}

	.wp-block-image {
		margin: 0;
	}

	ul,
	ol {
		padding-left: 1.4em;
	}

	.wp-block-columns {
		display: grid;
		gap: 24px 44px;
		align-items: center;
	}

	/* 「为什么选择我们」：白底卡片，放在浅紫底的整行区块里 */
	.fm-reasons {
		display: grid;
		gap: 20px;
		align-items: stretch;
	}

	.fm-reasons > .wp-block-column {
		display: flex;
		flex-direction: column;
		gap: 12px;
		padding: 28px 24px;
		border-radius: var(--fm-radius-card);
		background: var(--fm-color-surface);
		text-align: center;

		> * {
			margin: 0;
		}
	}

	.fm-reasons h3 {
		font-family: inherit;
		font-size: 20px;
	}

	.fm-reasons p {
		font-size: 15px;
		line-height: 1.7;
	}

	.wp-block-group.has-background {
		padding: 32px var(--fm-gutter);
		border-radius: var(--fm-radius-card);
	}
}

.fm-text--narrow {
	max-width: 800px;
}

.fm-band-block {
	background: var(--fm-color-tint-1);
}

/* ---------- 电脑版加大 ---------- */

@media (min-width: 768px) {

	.fm-section {
		padding-block: 56px;
	}

	.fm-heading {
		margin-bottom: 28px;
	}

	.fm-heading__title {
		font-size: 34px;
	}

	.fm-heading__en {
		font-size: 18px;
		font-weight: 500;
	}

	.fm-heading__aside {
		font-size: 16px;
	}

	.fm-lead {
		font-size: 17px;
	}

	.fm-page-hero__inner {
		padding-block: 28px 48px;
	}

	.fm-page-hero__leaf {
		width: 76px;
	}

	.fm-page-hero__title {
		font-size: 60px;
	}

	.fm-page-hero__en {
		font-size: 24px;
	}

	.fm-page-hero__intro {
		font-size: 18px;
	}

	.fm-page-hero--media .fm-page-hero__wrap {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		padding-block: 28px 48px;
	}

	.fm-page-hero__media img {
		height: 340px;
	}

	.fm-paper {
		padding: 10px;

		&::before {
			top: -12px;
			width: 96px;
			height: 26px;
			margin-left: -48px;
		}
	}

	.fm-card {
		padding: 32px;
	}

	.fm-card__title {
		font-size: 26px;
	}

	.fm-map {
		min-height: 340px;
	}

	.fm-text {
		font-size: 17px;

		h2 {
			font-size: 34px;
		}

		.wp-block-columns {
			grid-auto-flow: column;
			grid-auto-columns: minmax(0, 1fr);
		}

		.fm-reasons {
			grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
			grid-auto-flow: row;
		}
	}
}

/* 首页的区块标题更大 */
@media (min-width: 1100px) {

	.fm-heading--lg .fm-heading__title {
		font-size: 44px;
	}
}

/* ---------- 表单（顾客留言、求职申请共用；第五版 V5Reviews、V5Careers） ---------- */

.fm-form-card {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 24px 20px;
	border: 1px solid var(--fm-color-line);
	border-radius: var(--fm-radius-card);
	background: var(--fm-color-surface);
}

.fm-form-card__title {
	margin: 0;
	color: var(--fm-color-primary);
	font-family: var(--fm-font-display);
	font-size: 26px;
	font-weight: 700;
	line-height: 1.3;
}

.fm-form-card__intro {
	margin: 0 0 6px;
	color: var(--fm-color-text-muted);
	font-size: 15px;
	line-height: 1.7;
}

/* 没有 JS 时表单交不出去（人机验证要 JS），只显示提示 */
.fm-form-wrap {
	display: none;
}

.fm-js .fm-form-wrap {
	display: block;
}

.fm-form {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin: 0;
}

.fm-form__row {
	display: grid;
	gap: 16px;
}

.fm-form-field {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.fm-form-field__label {
	font-size: 15px;
	font-weight: 700;
}

.fm-form-field__input {
	box-sizing: border-box;
	width: 100%;
	min-height: 48px;
	padding: 0 14px;
	border: 1px solid var(--fm-color-input-border);
	border-radius: var(--fm-radius-button);
	background: var(--fm-color-surface);
	color: var(--fm-color-text);
	font: inherit;

	&[aria-invalid="true"] {
		border-color: var(--fm-color-error);
		box-shadow: inset 0 0 0 1px var(--fm-color-error);
	}
}

textarea.fm-form-field__input {
	min-height: 0;
	padding: 12px 14px;
	line-height: 1.7;
	resize: vertical;
}

.fm-form-field__hint {
	margin: 0;
	color: var(--fm-color-text-muted);
	font-size: 14px;
}

.fm-form-field__error {
	margin: 0;
	color: var(--fm-color-error);
	font-size: 14px;
	font-weight: 700;
}

.fm-form__note {
	margin: 4px 0 0;
	color: var(--fm-color-text-muted);
	font-size: 14px;
	line-height: 1.7;
}

/* 表单顶部的错误汇总、提交失败提示；没留联络方式时的确认提示 */
.fm-form__alert,
.fm-form__notice {
	margin: 0;
	padding: 14px 16px;
	border-left: 4px solid var(--fm-color-error);
	border-radius: var(--fm-radius-button);
	background: var(--fm-color-tint-1);
	font-size: 15px;
	line-height: 1.7;

	ul {
		margin: 6px 0 0;
		padding-left: 20px;
	}

	a {
		color: var(--fm-color-error);
		font-weight: 700;
	}
}

.fm-form__notice {
	border-left-color: var(--fm-color-accent);
}

.fm-form__success {
	padding: 20px;
	border-left: 4px solid var(--fm-color-cta-edge);
	border-radius: var(--fm-radius-button);
	background: var(--fm-color-tint-1);
	font-size: 17px;
	line-height: 1.8;
}

.fm-form .fm-button {
	align-self: flex-start;
	min-height: 54px;
	padding-inline: 32px;

	&[disabled] {
		opacity: 0.7;
		cursor: progress;
	}
}

/* 隐藏字段（防机器人）：移出屏幕，人看不到、读屏软件也不读 */
.fm-form__hp {
	position: absolute;
	left: -10000px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.fm-form__turnstile:empty {
	display: none;
}

@media (min-width: 768px) {

	.fm-form-card {
		padding: 36px;
	}

	.fm-form-card__title {
		font-size: 30px;
	}

	.fm-form__row {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* 申请表（V5Careers）：浅紫底、两栏；单选、多选、上传文件、同意条款 */
.fm-form-card--tint {
	border: 0;
	background: var(--fm-color-tint-1);
}

.fm-form--grid {
	display: grid;
	gap: 16px 20px;

	.fm-button {
		justify-self: start;
	}
}

.fm-form-choices {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0;
	padding: 0;
	border: 0;

	legend {
		padding: 0 0 8px;
	}
}

.fm-form-choices__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0 24px;
}

.fm-form-choice {
	display: flex;
	gap: 8px;
	align-items: center;
	min-height: 44px;
	font-size: 16px;
	cursor: pointer;

	input {
		width: 20px;
		height: 20px;
		margin: 0;
		accent-color: var(--fm-color-accent);
	}
}

.fm-form-field__file {
	min-height: 52px;
	padding: 12px 14px;
	border: 2px dashed var(--fm-color-input-border);
	cursor: pointer;
}

.fm-form-consent {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: 4px 10px;
	align-items: start;

	input {
		width: 22px;
		height: 22px;
		margin: 2px 0 0;
		accent-color: var(--fm-color-accent);
	}

	label {
		color: var(--fm-color-text-placeholder);
		font-size: 14px;
		line-height: 1.7;
	}

	.fm-form-field__error {
		grid-column: 2;
	}
}

@media (min-width: 768px) {

	.fm-form-card--tint {
		padding: 32px;
	}

	.fm-form--grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));

		.fm-form-field--wide,
		.fm-form-card__intro {
			grid-column: 1 / -1;
		}
	}
}

/* ---------- 传单订阅区（第五版：首页深紫 #v4-sub、传单页浅紫 #f-sub） ---------- */

.fm-subscribe {
	background: var(--fm-color-tint-1);
}

.fm-subscribe__inner {
	display: grid;
	gap: 24px;
	align-items: center;
	box-sizing: border-box;
	max-width: var(--fm-width-page);
	margin-inline: auto;
	padding: 36px var(--fm-gutter);
}

.fm-subscribe__text {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.fm-subscribe__title {
	margin: 0;
	color: var(--fm-color-primary);
	font-family: var(--fm-font-display);
	font-size: 28px;
	font-weight: 700;
	line-height: 1.3;
}

.fm-subscribe__intro {
	margin: 0;
	color: var(--fm-color-text-placeholder);
	font-size: 16px;
}

.fm-subscribe__form {
	gap: 10px;

	.fm-form-field__label {
		color: var(--fm-color-primary);
	}

	.fm-button {
		align-self: auto;
		min-height: 52px;
		padding-inline: 26px;
	}
}

.fm-subscribe__row {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;

	.fm-form-field__input {
		flex: 1 1 200px;
		width: auto;
		min-height: 52px;
		padding-inline: 16px;
	}
}

.fm-subscribe .fm-form-consent label {
	font-size: 14px;
	line-height: 1.6;
}

.fm-subscribe--home {
	background: var(--fm-color-primary);
	color: var(--fm-color-on-primary);

	.fm-subscribe__title,
	.fm-subscribe__form .fm-form-field__label {
		color: var(--fm-color-on-primary);
	}

	.fm-subscribe__intro,
	.fm-form-consent label {
		color: var(--fm-color-on-footer);
	}

	/* 深底上的出错文字用高亮绿，红色在深紫上对比不够 */
	.fm-form-field__error {
		color: var(--fm-color-highlight);
	}

	.fm-subscribe__row .fm-form-field__input {
		min-height: 54px;
		border: 0;
	}

	.fm-button {
		min-height: 54px;
		padding-inline: 30px;
	}

	.fm-subscribe__success {
		color: var(--fm-color-text);
	}
}

@media (min-width: 768px) {

	.fm-subscribe__inner {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.fm-subscribe__title {
		font-size: 34px;
	}

	.fm-subscribe--home {

		.fm-subscribe__inner {
			grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
			gap: 48px;
			padding-block: 56px;
		}

		.fm-subscribe__title {
			font-size: 36px;
		}
	}
}
