/* bid_ad 竞价广告 —— 侧栏广告位 + 投放页 / 后台通用样式 */

.bid-ad-card,
.bid-ad-page {
	--ba-brand: var(--brand, #356dff);
	--ba-brand-600: var(--brand-600, #2a5ae2);
	--ba-brand-soft: var(--brand-soft, #eef3ff);
	--ba-ink: var(--ink, #111827);
	--ba-ink2: var(--ink-2, #344054);
	--ba-mut: var(--mut, #667085);
	--ba-mut2: var(--mut-2, #98a2b3);
	--ba-line: var(--line, #e6ebf4);
	--ba-line2: var(--line-2, #f0f3f9);
	--ba-panel: #fff;
	--ba-r: var(--r, 14px);
	--ba-r-sm: var(--r-sm, 10px);
	--ba-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 10px 28px -18px rgba(16, 24, 40, .2);
}

/* ---------------- 侧边栏广告卡片 ---------------- */
.bid-ad-card {
	margin: 14px 0;
	background: var(--ba-panel);
	border: 1px solid var(--ba-line);
	border-radius: var(--ba-r);
	box-shadow: var(--ba-shadow);
	overflow: hidden;
	font-size: 13px;
	line-height: 1.5;
	color: var(--ba-ink);
}

.bid-ad-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 12px 12px 0;
}

.bid-ad-title {
	font-size: 14px;
	font-weight: 700;
	letter-spacing: .2px;
	color: var(--ba-ink);
}

.bid-ad-post {
	font-size: 12px;
	color: var(--ba-brand);
	text-decoration: none;
	white-space: nowrap;
}

.bid-ad-post:hover {
	color: var(--ba-brand-600);
	text-decoration: underline;
}

.bid-ad-sub {
	padding: 3px 12px 10px;
	font-size: 11.5px;
	color: var(--ba-mut);
	line-height: 1.5;
}

.bid-ad-grid {
	display: grid;
	gap: 0;
}

.bid-ad-grid-text {
	grid-template-columns: 1fr 1fr;
}

.bid-ad-grid-img {
	grid-template-columns: 1fr;
}

.bid-ad-cell {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 38px;
	padding: 0 6px;
	overflow: hidden;
	font-size: 12.5px;
	font-weight: 600;
	color: #fff;
	text-decoration: none;
	white-space: nowrap;
	text-overflow: ellipsis;
	text-shadow: 0 1px 1px rgba(0, 0, 0, .18);
	transition: filter .15s ease;
}

.bid-ad-cell:hover {
	color: #fff;
	filter: brightness(1.04);
}

.bid-ad-grid-text .bid-ad-cell:nth-child(2n) {
	border-left: 1px solid rgba(255, 255, 255, .34);
}

.bid-ad-grid-text .bid-ad-cell:nth-child(n+3) {
	border-top: 1px solid rgba(255, 255, 255, .3);
}

.bid-ad-cell-img {
	display: block;
	height: var(--bid-ad-thumb-h, 60px);
	padding: 0;
	background: var(--ba-line2);
}

.bid-ad-cell-img + .bid-ad-cell-img {
	border-top: 1px solid var(--ba-line);
}

.bid-ad-img {
	display: block;
	width: 100%;
	height: var(--bid-ad-thumb-h, 60px);
	object-fit: cover;
}

.bid-ad-cell-claimed {
	height: 38px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--ba-line2);
	border: 0;
	color: var(--ba-mut2);
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 1px;
	text-shadow: none;
}

.bid-ad-empty {
	padding: 14px 12px 16px;
	font-size: 12.5px;
	color: var(--ba-mut);
	text-align: center;
	border-top: 1px dashed var(--ba-line);
	margin: 8px 12px 0;
}

.bid-ad-empty a {
	color: var(--ba-brand);
}

/* 6 个渐变底（按顺位轮换） */
.bg-cell-1 { background-image: linear-gradient(100deg, #e5533d, #e9792e); }
.bg-cell-2 { background-image: linear-gradient(100deg, #6356e0, #8a6cff); }
.bg-cell-3 { background-image: linear-gradient(100deg, #0fa3ca, #3fc8ec); }
.bg-cell-4 { background-image: linear-gradient(100deg, #e39b16, #f3bd47); }
.bg-cell-5 { background-image: linear-gradient(100deg, #0f9d63, #2fcf8f); }
.bg-cell-6 { background-image: linear-gradient(100deg, #3f71dd, #6d9af2); }

/* ---------------- 投放页 ---------------- */
.bid-ad-page {
	max-width: 1080px;
	margin: 0 auto;
	padding: 20px 14px 48px;
	font-size: 14px;
	color: var(--ba-ink);
}

.bid-ad-page * {
	box-sizing: border-box;
}

.bid-ad-hero {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 16px;
}

.bid-ad-hero h1 {
	margin: 0 0 6px;
	font-size: 22px;
	font-weight: 700;
	letter-spacing: -.2px;
	color: var(--ba-ink);
}

.bid-ad-hero p {
	margin: 0;
	font-size: 13px;
	color: var(--ba-mut);
}

.bid-ad-hero-side {
	flex: 0 0 auto;
	text-align: right;
	padding: 10px 14px;
	background: var(--ba-brand-soft);
	border-radius: var(--ba-r-sm);
	min-width: 132px;
}

.bid-ad-hero-side span {
	display: block;
	font-size: 11.5px;
	color: var(--ba-mut);
}

.bid-ad-hero-side strong {
	display: block;
	margin-top: 2px;
	font-size: 19px;
	font-weight: 700;
	color: var(--ba-brand);
}

.bid-ad-hero-side em,
.bid-ad-stat em {
	font-style: normal;
	font-size: 12px;
	font-weight: 500;
	color: var(--ba-mut);
}

.bid-ad-alert {
	margin-bottom: 14px;
	padding: 10px 14px;
	border-radius: var(--ba-r-sm);
	background: #fff5f5;
	border: 1px solid #ffd7d7;
	color: #d92d20;
	font-size: 13px;
}

.bid-ad-stats {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 10px;
	margin-bottom: 16px;
}

.bid-ad-stat {
	background: var(--ba-panel);
	border: 1px solid var(--ba-line);
	border-radius: var(--ba-r-sm);
	padding: 12px 14px;
}

.bid-ad-stat span {
	display: block;
	font-size: 12px;
	color: var(--ba-mut);
}

.bid-ad-stat strong {
	display: block;
	margin-top: 4px;
	font-size: 19px;
	font-weight: 700;
	color: var(--ba-ink);
}

.bid-ad-panel {
	background: var(--ba-panel);
	border: 1px solid var(--ba-line);
	border-radius: var(--ba-r);
	box-shadow: var(--ba-shadow);
	padding: 16px 18px;
	margin-bottom: 16px;
}

.bid-ad-panel-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	padding-bottom: 12px;
	margin-bottom: 14px;
	border-bottom: 1px solid var(--ba-line2);
}

.bid-ad-panel-head b {
	font-size: 15px;
	font-weight: 700;
	color: var(--ba-ink);
}

.bid-ad-panel-head span {
	font-size: 12px;
	color: var(--ba-mut);
}

.bid-ad-locked p {
	margin: 8px 0 0;
	font-size: 13px;
	color: var(--ba-mut);
}

.bid-ad-form {
	display: block;
}

.bid-ad-field {
	display: block;
	margin-bottom: 12px;
}

.bid-ad-field > span {
	display: block;
	margin-bottom: 5px;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--ba-ink2);
}

.bid-ad-tip {
	display: block;
	margin-top: 2px;
	line-height: 1.45;
	font-style: normal;
	font-weight: 400;
	color: var(--ba-mut2);
	font-size: 11.5px;
}

.bid-ad-form .form-control {
	width: 100%;
	height: 38px;
	padding: 0 10px;
	font-size: 13px;
	border: 1px solid var(--ba-line);
	border-radius: var(--ba-r-sm);
	background: #fff;
	color: var(--ba-ink);
}

.bid-ad-form .form-control:focus {
	border-color: var(--ba-brand);
	outline: 0;
	box-shadow: 0 0 0 3px rgba(53, 109, 255, .12);
}

.bid-ad-form input[type="file"].form-control {
	padding: 7px 8px;
	height: auto;
}

.bid-ad-frow {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 14px;
}

.bid-ad-imgrow {
	display: none;
}

.bid-ad-imgrow.is-open {
	display: grid;
}

.bid-ad-rank-tip {
	display: block;
	margin-top: 6px;
	padding: 6px 10px;
	font-size: 11.5px;
	line-height: 1.5;
	color: var(--ba-brand-600);
	background: var(--ba-brand-soft);
	border-radius: 8px;
}

.bid-ad-estimate {
	padding-top: 1px;
}


.bid-ad-estimate strong {
	display: block;
	height: 38px;
	line-height: 38px;
	font-size: 16px;
	font-weight: 700;
	color: var(--ba-brand);
}

.bid-ad-submit {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
	margin-top: 4px;
}

.bid-ad-submit .btn-primary {
	min-width: 132px;
	height: 38px;
	border-radius: var(--ba-r-sm);
	font-size: 13.5px;
	font-weight: 600;
}

.bid-ad-note {
	flex: 1 1 260px;
	font-size: 12px;
	color: var(--ba-mut);
	line-height: 1.6;
}

.bid-ad-note b {
	color: var(--ba-ink2);
}

/* 我的广告列表 */
.bid-ad-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.bid-ad-item {
	display: grid;
	grid-template-columns: 228px minmax(0, 1fr) auto;
	gap: 14px;
	align-items: center;
	padding: 10px;
	border: 1px solid var(--ba-line2);
	border-radius: var(--ba-r-sm);
}

.bid-ad-preview {
	width: 228px;
	height: 60px;
	border-radius: 8px;
	overflow: hidden;
	background: var(--ba-line2);
	display: flex;
}

.bid-ad-preview img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.bid-ad-preview-text {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: 12.5px;
	font-weight: 600;
	text-shadow: 0 1px 1px rgba(0, 0, 0, .18);
	overflow: hidden;
	white-space: nowrap;
}

.bid-ad-item-main {
	min-width: 0;
}

.bid-ad-item-top {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.bid-ad-item-title {
	font-size: 13.5px;
	font-weight: 600;
	color: var(--ba-ink);
	text-decoration: none;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.bid-ad-item-title:hover {
	color: var(--ba-brand);
}

.bid-ad-pill {
	flex: 0 0 auto;
	font-size: 11px;
	font-weight: 600;
	padding: 2px 7px;
	border-radius: 999px;
	line-height: 16px;
}

.bid-ad-pill.is-on {
	background: #e7f7ef;
	color: #0f9d63;
}

.bid-ad-pill.is-off {
	background: #f2f4f7;
	color: #667085;
}

.bid-ad-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 7px 0 8px;
	font-size: 11.5px;
	color: var(--ba-mut);
}

.bid-ad-meta span {
	padding: 2px 7px;
	background: var(--ba-bg, #f4f6fb);
	border-radius: 6px;
}

.bid-ad-bar {
	height: 6px;
	border-radius: 999px;
	background: var(--ba-line2);
	overflow: hidden;
}

.bid-ad-bar i {
	display: block;
	height: 100%;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--ba-brand), #74a0ff);
	transition: width .3s ease;
}

.bid-ad-item-act {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
	justify-content: flex-end;
	max-width: 300px;
}

.bid-ad-inline {
	display: inline-block;
	margin: 0;
}

.bid-ad-item-act .btn {
	border-radius: 8px;
	font-size: 12px;
	padding: 4px 10px;
	border: 1px solid var(--ba-line);
	background: #fff;
	color: var(--ba-ink2);
}

.bid-ad-item-act .btn:hover {
	border-color: var(--ba-brand);
	color: var(--ba-brand);
}

.bid-ad-item-act .btn.bid-ad-danger:hover {
	border-color: #f04438;
	color: #f04438;
}

.bid-ad-edit {
	position: relative;
	display: inline-block;
}

.bid-ad-edit summary {
	list-style: none;
	cursor: pointer;
	display: inline-block;
}

.bid-ad-edit summary::-webkit-details-marker {
	display: none;
}

.bid-ad-editform {
	position: absolute;
	right: 0;
	top: 34px;
	z-index: 20;
	width: 300px;
	padding: 12px;
	background: #fff;
	border: 1px solid var(--ba-line);
	border-radius: var(--ba-r-sm);
	box-shadow: 0 12px 32px -12px rgba(16, 24, 40, .28);
}

.bid-ad-editform label {
	display: block;
	margin-bottom: 8px;
	font-size: 12px;
	color: var(--ba-mut);
}

.bid-ad-editform .form-control {
	width: 100%;
	height: 34px;
	margin-top: 3px;
	padding: 0 8px;
	border: 1px solid var(--ba-line);
	border-radius: 8px;
	font-size: 12.5px;
	color: var(--ba-ink);
}

.bid-ad-rules ul {
	margin: 0;
	padding-left: 18px;
}

.bid-ad-rules li {
	font-size: 12.5px;
	color: var(--ba-mut);
	line-height: 1.9;
}

.bid-ad-empty.bid-ad-page-empty {
	padding: 26px 0;
	text-align: center;
	color: var(--ba-mut);
	font-size: 13px;
}

/* 登录提示 */
.bid-ad-login-tip {
	text-align: center;
	padding: 34px 20px;
}

.bid-ad-login-tip h2 {
	margin: 0 0 8px;
	font-size: 18px;
	font-weight: 700;
	color: var(--ba-ink);
}

.bid-ad-muted {
	margin: 0 0 16px;
	font-size: 13px;
	color: var(--ba-mut);
}

/* 数据看板 */
.bid-ad-dash-stats {
	margin-bottom: 14px;
}

.bid-ad-dash-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
	gap: 20px;
}

.bid-ad-dash-sub {
	font-size: 12px;
	font-weight: 600;
	color: var(--ba-ink2);
	margin-bottom: 10px;
}

.bid-ad-chart {
	display: flex;
	align-items: flex-end;
	gap: 4px;
	height: 120px;
	padding-bottom: 4px;
	border-bottom: 1px solid var(--ba-line);
}

.bid-ad-chart-col {
	flex: 1 1 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-end;
	height: 100%;
	min-width: 0;
}

.bid-ad-chart-bar {
	width: 100%;
	max-width: 18px;
	min-height: 0;
	background: linear-gradient(180deg, var(--ba-brand), #8fb2ff);
	border-radius: 4px 4px 0 0;
	transition: height .3s ease;
}

.bid-ad-chart-col span {
	margin-top: 4px;
	font-size: 9px;
	color: var(--ba-mut2);
	white-space: nowrap;
}

.bid-ad-ranklist {
	list-style: none;
	margin: 0;
	padding: 0;
}

.bid-ad-ranklist li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 5px 0;
	font-size: 12.5px;
	border-bottom: 1px solid var(--ba-line2);
}

.bid-ad-ranklist li span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--ba-ink2);
}

.bid-ad-ranklist li b {
	flex: 0 0 auto;
	color: var(--ba-brand);
}

.bid-ad-ranklist li em {
	font-style: normal;
	font-size: 11px;
	font-weight: 400;
	color: var(--ba-mut);
}

.bid-ad-budget-warn {
	margin: 6px 0;
	padding: 5px 9px;
	font-size: 11.5px;
	color: #b54708;
	background: #fffaeb;
	border: 1px solid #fedf89;
	border-radius: 6px;
}

@media (max-width: 860px) {
	.bid-ad-dash-grid {
		grid-template-columns: 1fr;
	}
}

/* ---------------- 后台 ---------------- */
.bid-ad-admin .table td,
.bid-ad-admin .table th {
	vertical-align: middle;
	font-size: 13px;
}

.bid-ad-admin-preview {
	width: 150px;
	height: 40px;
	border-radius: 6px;
	overflow: hidden;
	background: var(--ba-line2, #f0f3f9);
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: 11.5px;
	font-weight: 600;
}

.bid-ad-admin-preview img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ---------------- 小屏 ---------------- */
@media (max-width: 860px) {
	.bid-ad-item {
		grid-template-columns: 1fr;
	}

	.bid-ad-preview {
		width: 100%;
		max-width: 320px;
	}

	.bid-ad-item-act {
		justify-content: flex-start;
		max-width: none;
	}

	.bid-ad-stats {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.bid-ad-hero {
		flex-direction: column;
		align-items: flex-start;
	}

	.bid-ad-hero-side {
		text-align: left;
	}
}

@media (max-width: 560px) {
	.bid-ad-frow {
		grid-template-columns: 1fr;
	}

	.bid-ad-grid-text {
		grid-template-columns: 1fr;
	}

	.bid-ad-grid-text .bid-ad-cell:nth-child(n+2) {
		border-left: 0;
		border-top: 1px solid rgba(255, 255, 255, .3);
	}

	.bid-ad-form .form-control {
		font-size: 14px;
	}
}

/* 后台「全部广告」表格：table-layout 是 fixed，必须给列定宽，min-width 不起作用 */
.bid-ad-admin .table .bid-ad-col-ad {
	width: 340px;
}

.bid-ad-admin .table .bid-ad-col-ad .font-weight-bold,
.bid-ad-admin .table .bid-ad-col-ad .text-muted.small a {
	display: block;
	max-width: 300px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* 「图片显示尺寸」这类一行两个数字输入框：外层 span 会被 .bid-ad-field > span 顶成 block */
.bid-ad-field > span.bid-ad-frow {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	margin-bottom: 0;
}

.bid-ad-field > span.bid-ad-frow .form-control {
	margin-bottom: 0;
}

/* 后台看板：手机上 14 个日期标签会把页面顶出横向滚动条，只留每 3 天一个 */
@media (max-width: 640px) {
	.bid-ad-chart {
		overflow: hidden;
	}

	.bid-ad-chart-col:nth-child(3n+2) span,
	.bid-ad-chart-col:nth-child(3n+3) span {
		display: none;
	}

	.bid-ad-chart-col span {
		font-size: 10px;
		letter-spacing: 0;
	}

	.bid-ad-dash-grid {
		gap: 14px;
	}

	/* 最后一天（今天）的标签始终显示，避免手机上看不到柱子是哪天 */
	.bid-ad-chart-col:last-child span {
		display: block;
	}
}
