/**
 * WP 附件美化 - 前端样式
 * 站点级配色由后台设置通过 CSS 变量（--wab-*）注入（wp_add_inline_style 追加覆盖）。
 * 注意：默认变量统一放在 :root，不要写在 .wab-card 内，否则会覆盖后台设置。
 */

:root {
	--wab-accent: #2563eb;
	--wab-accent-bg: var(--wab-accent);
	--wab-card-bg: #ffffff;
	--wab-radius: 12px;
	--wab-shadow: 0 2px 14px rgba(15, 23, 42, 0.08);
}

.wab-card {
	display: flex;
	align-items: center;
	gap: 16px;
	background: var(--wab-card-bg);
	background-size: cover;
	background-position: center;
	border: 1px solid rgba(15, 23, 42, 0.09);
	border-radius: var(--wab-radius);
	box-shadow: var(--wab-shadow);
	padding: 16px 18px;
	margin: 18px 0;
	font-family: inherit;
	color: inherit;
	box-sizing: border-box;
	transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.wab-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
	border-color: rgba(37, 99, 235, 0.35);
}

.wab-icon {
	flex: 0 0 auto;
	width: 58px;
	height: 58px;
	border-radius: calc(var(--wab-radius) * 0.7);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	color: #fff;
}

.wab-icon-svg {
	width: 26px;
	height: 26px;
	display: block;
}

.wab-ext {
	font-size: 9px;
	font-weight: 700;
	letter-spacing: 0.5px;
	line-height: 1;
	margin-top: 3px;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.wab-info {
	flex: 1 1 auto;
	min-width: 0;
}

.wab-name {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
	color: inherit;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wab-meta {
	margin-top: 6px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 0;
}

.wab-meta-item {
	font-size: 12px;
	color: #94a3b8;
}

.wab-meta-item:not(:last-child) {
	margin-right: 14px;
	position: relative;
}

.wab-meta-item:not(:last-child)::after {
	content: "";
	position: absolute;
	right: -9px;
	top: 50%;
	transform: translateY(-50%);
	width: 3px;
	height: 3px;
	border-radius: 50%;
	background: #cbd5e1;
}

.wab-actions {
	flex: 0 0 auto;
}

.wab-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: var(--wab-accent-bg);
	background-size: cover;
	background-position: center;
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	padding: 11px 18px;
	border-radius: calc(var(--wab-radius) * 0.7);
	text-decoration: none;
	box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
	transition: filter 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
	cursor: pointer;
}

.wab-btn svg {
	width: 15px;
	height: 15px;
	flex: 0 0 auto;
}

.wab-btn:hover,
.wab-btn:focus {
	color: #fff;
	text-decoration: none;
	filter: brightness(1.08);
	transform: translateY(-1px);
	box-shadow: 0 4px 10px rgba(15, 23, 42, 0.2);
}

.wab-btn:active {
	transform: translateY(0);
}

@media (max-width: 560px) {
	.wab-card {
		flex-wrap: wrap;
		padding: 14px;
		gap: 12px;
	}
	.wab-actions {
		width: 100%;
	}
	.wab-btn {
		width: 100%;
		justify-content: center;
	}
}

/* 布局样式：纵向（图标上、信息中、按钮下通栏） */
.wab-card-style-vertical {
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
}
.wab-card-style-vertical .wab-info,
.wab-card-style-vertical .wab-actions {
	width: 100%;
}
.wab-card-style-vertical .wab-btn {
	width: 100%;
	justify-content: center;
}

/* 布局样式：简洁（一行紧凑） */
.wab-card-style-compact {
	gap: 10px;
	padding: 10px 14px;
}
.wab-card-style-compact .wab-icon {
	width: 34px;
	height: 34px;
	border-radius: 8px;
}
.wab-card-style-compact .wab-icon-svg {
	width: 17px;
	height: 17px;
}
.wab-card-style-compact .wab-ext {
	display: none;
}
.wab-card-style-compact .wab-name {
	font-size: 14px;
}
.wab-card-style-compact .wab-meta {
	display: none;
}
.wab-card-style-compact .wab-btn {
	padding: 8px 13px;
	font-size: 12px;
}

/* 布局样式：居中（大图标居中、通栏按钮） */
.wab-card-style-centered {
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 12px;
	padding: 28px 20px;
}
.wab-card-style-centered .wab-icon {
	width: 72px;
	height: 72px;
	border-radius: 18px;
}
.wab-card-style-centered .wab-icon-svg {
	width: 32px;
	height: 32px;
}
.wab-card-style-centered .wab-info {
	width: 100%;
}
.wab-card-style-centered .wab-name {
	white-space: normal;
}
.wab-card-style-centered .wab-meta {
	justify-content: center;
}
.wab-card-style-centered .wab-actions {
	width: 100%;
}
.wab-card-style-centered .wab-btn {
	width: 100%;
	justify-content: center;
}

/* 布局样式：列表（行式，无圆角阴影） */
.wab-card-style-list {
	gap: 12px;
	padding: 10px 4px;
	margin: 0;
	border: none;
	border-bottom: 1px solid rgba(15, 23, 42, 0.12);
	border-radius: 0;
	box-shadow: none;
}
.wab-card-style-list:hover {
	transform: none;
	box-shadow: none;
	border-bottom-color: rgba(37, 99, 235, 0.5);
}
.wab-card-style-list .wab-icon {
	width: 40px;
	height: 40px;
	border-radius: 10px;
}
.wab-card-style-list .wab-icon-svg {
	width: 20px;
	height: 20px;
}
.wab-card-style-list .wab-btn {
	padding: 8px 14px;
	font-size: 12px;
}
