/* ============================================================
   友链页（2026-10 商务版 v3）
   全宽顶图 + 通栏横向卡片 + 底部申请栏 + 弹窗表单
   ============================================================ */
body:has(.ymw-friends) {
	overflow-x: hidden;
}

/* 这一页的容器放开到全宽，去掉 1200 容器和 15px 内边距 */
.ymw-container--friends {
	width: 100%;
	max-width: none;
	padding-left: 0;
	padding-right: 0;
}

.ymw-container--friends .joe_main {
	width: 100%;
	max-width: none;
}

.ymw-friends {
	max-width: none;
	padding: 0;
}

/* —— 全宽合作图 —— */
.ymw-friends__hero {
	position: relative;
	width: 100vw;
	min-height: 420px;
	margin-left: calc(50% - 50vw);
	overflow: hidden;
	background: #0b1a29;
}

.ymw-friends__hero-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center 42%;
	filter: grayscale(.4) contrast(1.06) brightness(.58);
	transform: scale(1.02);
}

.ymw-friends__hero::after {
	content: "";
	position: absolute;
	inset: 0;
	background:
		linear-gradient(90deg, rgba(6, 20, 34, .94) 0%, rgba(6, 20, 34, .76) 44%, rgba(6, 20, 34, .22) 100%),
		linear-gradient(180deg, rgba(6, 20, 34, .08) 0%, rgba(6, 20, 34, .42) 100%);
}

.ymw-friends__hero-inner {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	max-width: 1400px;
	min-height: 420px;
	margin: 0 auto;
	padding: 0 28px;
}

.ymw-friends__hero-copy {
	width: min(640px, 100%);
	color: #f4efe4;
}

.ymw-friends__kicker {
	margin: 0 0 10px;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: .2em;
	color: #17B7B7;
}

.ymw-friends__hero h1 {
	margin: 0 0 14px;
	font-family: inherit;
	font-size: 64px;
	font-weight: 800;
	line-height: 1.12;
	letter-spacing: -.01em;
	color: #f7f1e3;
}

.ymw-friends__hero p {
	max-width: 460px;
	margin: 0;
	font-size: 14px;
	line-height: 1.9;
	color: rgba(244, 239, 228, .72);
}

.ymw-friends__hero-actions {
	display: flex;
	align-items: center;
	gap: 22px;
	margin-top: 26px;
}

.ymw-friends__hero-link {
	font-size: 12px;
	color: rgba(255, 255, 255, .72);
	text-decoration: none;
	border-bottom: 1px solid rgba(255, 255, 255, .3);
	padding-bottom: 2px;
}

.ymw-friends__hero-link:hover {
	color: #fff;
	border-bottom-color: #fff;
	text-decoration: none;
}

.ymw-friends__hero-btn {
	display: inline-flex;
	align-items: center;
	height: 44px;
	padding: 0 24px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .1em;
	color: #0b1a29;
	background: #ffffff;
	border: 1px solid #ffffff;
	border-radius: 2px;
	cursor: pointer;
	transition: background .15s, border-color .15s;
}

.ymw-friends__hero-btn:hover {
	background: #e9f8f8;
	border-color: #e9f8f8;
}

/* —— 内容区 —— */
.ymw-friends__body {
	max-width: none;
	margin: 0 auto;
	padding: 0 16px 0;
}

.ymw-friends__partners {
	margin-top: 42px;
	scroll-margin-top: 92px;
}

.ymw-friends__section-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 20px;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--classA);
}

.ymw-friends__section-head h2 {
	margin: 0;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--main);
}

.ymw-friends__count {
	font-size: 11px;
	color: var(--minor);
}

.ymw-friends__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
	gap: 16px;
	margin-top: 18px;
}

/* 横向卡片：一张时铺满整行 */
.ymw-friend-card {
	display: grid;
	grid-template-columns: 64px minmax(0, 1fr);
	align-items: center;
	gap: 20px;
	min-height: 156px;
	padding: 22px 24px;
	background: var(--background);
	border: 1px solid var(--classA);
	color: inherit;
	text-align: left;
	text-decoration: none;
	transition: border-color .15s;
}

.ymw-page a.ymw-friend-card,
.ymw-page a.ymw-friend-card:hover {
	text-decoration: none !important;
}

.ymw-friend-card:hover {
	border-color: #17B7B7;
}

.ymw-friend-card__logo {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	overflow: hidden;
	background: var(--body-bg-color);
	border: 1px solid var(--classA);
}

.ymw-friend-card__logo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ymw-friend-card__logo b {
	font-size: 22px;
	font-weight: 700;
	color: #17B7B7;
}

.ymw-friend-card__body {
	display: flex;
	min-width: 0;
	flex-direction: column;
	gap: 6px;
}

.ymw-friend-card__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 20px;
}

.ymw-friend-card__head strong {
	overflow: hidden;
	font-size: 17px;
	font-weight: 650;
	line-height: 1.4;
	color: var(--main);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ymw-friend-card__self {
	display: inline-block;
	margin-left: 7px;
	padding: 1px 4px;
	font-style: normal;
	font-size: 9px;
	font-weight: 500;
	line-height: 1.4;
	color: #17B7B7;
	border: 1px solid currentColor;
	vertical-align: 1px;
}

.ymw-friend-card__meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	margin-top: 4px;
}

.ymw-friend-card__host {
	font-size: 11px;
	letter-spacing: .01em;
	color: var(--seat);
}

.ymw-friend-card__visit {
	font-size: 11px;
	font-weight: 600;
	color: var(--minor);
}

.ymw-friend-card__visit i {
	font-style: normal;
	color: var(--theme);
}

.ymw-friend-card:hover .ymw-friend-card__visit {
	color: var(--theme);
}

.ymw-friend-card__desc {
	overflow: hidden;
	font-size: 13px;
	line-height: 1.7;
	color: var(--routine);
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* 虚位以待：一条通栏 */
.ymw-friends__empty {
	display: flex;
	align-items: center;
	gap: 18px;
	width: 100%;
	margin-top: 14px;
	padding: 16px 28px;
	background: transparent;
	border: 1px dashed var(--classB);
	color: var(--minor);
	text-align: left;
	cursor: pointer;
	transition: border-color .15s, color .15s;
}

.ymw-friends__empty:hover {
	border-color: #17B7B7;
	color: var(--routine);
}

.ymw-friends__empty strong {
	flex: none;
	font-size: 13px;
	font-weight: 600;
	color: var(--main);
}

.ymw-friends__empty span {
	flex: 1;
	min-width: 0;
	font-size: 12px;
}

.ymw-friends__empty i {
	flex: none;
	font-style: normal;
	font-size: 11px;
	color: #17B7B7;
}


/* —— 合作原则三栏 —— */
.ymw-friends__notes {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 36px;
	margin-top: 44px;
	padding-top: 30px;
	border-top: 1px solid var(--classA);
}

.ymw-friends__note-item>span {
	display: block;
	margin-bottom: 10px;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .14em;
	color: var(--theme);
}

.ymw-friends__note-item h3 {
	margin: 0 0 8px;
	font-size: 15px;
	font-weight: 650;
	color: var(--main);
}

.ymw-friends__note-item p {
	margin: 0;
	font-size: 12px;
	line-height: 1.85;
	color: var(--minor);
}

/* —— 底部申请栏 —— */
.ymw-friends__applyband {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 40px;
	width: 100vw;
	margin-top: 48px;
	margin-left: calc(50% - 50vw);
	padding: 38px 32px;
	color: #f4efe4;
	background: #0b1a29;
}

.ymw-friends__applyband-copy {
	max-width: 640px;
}

.ymw-friends__applyband h2 {
	margin: 0 0 12px;
	font-family: inherit;
	font-size: 36px;
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: -.01em;
	color: #f7f1e3;
}

.ymw-friends__applyband-copy>p {
	margin: 0;
	font-size: 12px;
	line-height: 1.85;
	color: rgba(244, 239, 228, .66);
}

.ymw-friends__rules-line {
	margin-top: 14px !important;
	padding-top: 12px;
	border-top: 1px solid rgba(255, 255, 255, .12);
	font-size: 11px !important;
	color: rgba(244, 239, 228, .42) !important;
}

.ymw-friends__applyband-actions {
	flex: none;
	width: 280px;
}

.ymw-friends__applybtn {
	display: block;
	width: 100%;
	height: 46px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .1em;
	color: #0b1a29;
	background: #ffffff;
	border: 1px solid #ffffff;
	border-radius: 2px;
	cursor: pointer;
	transition: background .15s, border-color .15s;
}

.ymw-friends__applybtn:hover {
	background: #e9f8f8;
	border-color: #e9f8f8;
}

.ymw-friends__applyband-actions p {
	margin: 14px 0 0;
	font-size: 10px;
	line-height: 1.7;
	color: rgba(244, 239, 228, .45);
}

.ymw-friends__applyband-actions a {
	color: #17B7B7;
}

/* —— 申请弹窗 —— */
.ymw-friend-modal {
	position: fixed;
	inset: 0;
	margin: auto;
	width: min(680px, calc(100vw - 32px));
	max-height: calc(100vh - 40px);
	padding: 0;
	color: var(--routine);
	background: var(--background);
	border: 1px solid var(--classA);
	border-radius: 2px;
}

.ymw-friend-modal::backdrop {
	background: rgba(4, 16, 28, .62);
	backdrop-filter: blur(3px);
}

.ymw-friend-modal__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	padding: 22px 26px 18px;
	border-bottom: 1px solid var(--classA);
}

.ymw-friend-modal__head h2 {
	margin: 0;
	font-size: 21px;
	font-weight: 700;
	color: var(--main);
}

.ymw-friend-modal__close {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	padding: 0;
	font-size: 20px;
	line-height: 1;
	color: var(--minor);
	background: transparent;
	border: 1px solid var(--classA);
	border-radius: 1px;
	cursor: pointer;
}

.ymw-friend-modal__close:hover {
	color: var(--main);
	border-color: var(--minor);
}

.ymw-friend-modal__body {
	max-height: calc(100vh - 140px);
	padding: 20px 26px 26px;
	overflow: auto;
}

.ymw-friend-modal__note {
	margin: 0 0 20px;
	font-size: 12px;
	line-height: 1.8;
	color: var(--minor);
}

.ymw-friends__fetchline {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
	margin: -2px 0 18px;
}

.ymw-friends__fetch {
	height: 34px;
	padding: 0 14px;
	font-size: 11px;
	font-weight: 600;
	color: #17B7B7;
	background: transparent;
	border: 1px solid rgba(23, 183, 183, .55);
	border-radius: 1px;
	cursor: pointer;
	transition: background .15s, border-color .15s;
}

.ymw-friends__fetch:hover {
	background: rgba(23, 183, 183, .1);
	border-color: #17B7B7;
}

.ymw-friends__fetch:disabled {
	opacity: .55;
	cursor: default;
}

.ymw-friends__fetchmsg {
	font-size: 11px;
	line-height: 1.6;
	color: var(--minor);
}

.ymw-friends__fetchmsg.is-error {
	color: #b45454;
}

.ymw-friends__logorow {
	display: flex;
	align-items: center;
	gap: 10px;
}

.ymw-friends__logopreview {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	overflow: hidden;
	background: var(--body-bg-color);
	border: 1px solid var(--classB);
}

.ymw-friends__logopreview img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ymw-friends__logorow input {
	flex: 1;
	min-width: 0;
}

.ymw-friends__captcha {
	display: flex;
	align-items: stretch;
	gap: 10px;
}

.ymw-friends__captcha input {
	flex: 1;
	min-width: 0;
}

.ymw-friends__captcha img {
	flex: none;
	width: 112px;
	height: 42px;
	object-fit: cover;
	cursor: pointer;
	background: #fff;
	border: 1px solid var(--classB);
}

.ymw-friend-modal .ymw-form {
	margin: 0;
}

.ymw-friend-modal .ymw-field input[type="text"],
.ymw-friend-modal .ymw-field input[type="url"] {
	height: 42px;
	background: var(--body-bg-color);
	border: 1px solid var(--classB);
	border-radius: 2px;
	box-shadow: none;
}

.ymw-friend-modal .ymw-field input[type="text"]:focus,
.ymw-friend-modal .ymw-field input[type="url"]:focus {
	background: var(--background);
	border-color: var(--theme);
	box-shadow: none;
}

.ymw-friend-modal .ymw-form__foot {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-top: 22px;
}

.ymw-friend-modal .ymw-btn {
	width: 100%;
	height: 44px;
	border-radius: 2px;
	font-size: 13px;
}

.ymw-friend-modal .ymw-done {
	margin: 0;
}

body.ymw-modal-open {
	overflow: hidden;
}

@media (max-width: 900px) {
	.ymw-friends__hero {
		min-height: 340px;
	}

	.ymw-friends__hero-inner {
		min-height: 340px;
		padding: 0 20px;
	}

	.ymw-friends__hero h1 {
		font-size: 40px;
	}

	.ymw-friends__body {
		padding: 0 12px 0;
	}

	.ymw-friends__grid {
		grid-template-columns: 1fr;
	}

	.ymw-friend-card {
		grid-template-columns: 52px minmax(0, 1fr);
		gap: 14px;
		min-height: 108px;
		padding: 18px;
	}

	.ymw-friend-card__logo {
		width: 52px;
		height: 52px;
	}

	.ymw-friend-card__head {
		align-items: flex-start;
		flex-direction: column;
		gap: 2px;
	}

	.ymw-friends__notes {
		grid-template-columns: 1fr;
		gap: 22px;
		margin-top: 32px;
	}

	.ymw-friends__empty {
		align-items: flex-start;
		flex-direction: column;
		gap: 4px;
		padding: 16px 18px;
	}

	.ymw-friends__empty i {
		margin-top: 4px;
	}

	.ymw-friends__applyband {
		align-items: flex-start;
		flex-direction: column;
		gap: 24px;
		padding: 26px 16px;
	}

	.ymw-friends__applyband h2 {
		font-size: 28px;
	}

	.ymw-friends__applyband-actions {
		width: 100%;
	}

	.ymw-friend-modal {
		width: calc(100vw - 20px);
		max-height: calc(100vh - 20px);
	}

	.ymw-friend-modal__head {
		padding: 18px 18px 14px;
	}

	.ymw-friend-modal__body {
		max-height: calc(100vh - 120px);
		padding: 16px 18px 20px;
	}

	.ymw-friend-modal .ymw-grid {
		grid-template-columns: 1fr;
		gap: 0;
	}
}

/* 友链页：贴住固定头部和页脚，不留上下空档 */
body:has(.ymw-friends) {
	padding-top: 68px;
}

.ymw-container--friends .joe_main {
	padding-bottom: 0;
}

body:has(.ymw-friends) .ymw-ft {
	margin-top: 0;
}

@media (max-width: 900px) {
	body:has(.ymw-friends) {
		padding-top: 52px;
	}
}
