.auth-loading {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	color: var(--muted);
}

.auth-page {
	min-height: 100vh;
	display: grid;
	place-items: center;
	padding: 28px 16px;
	background: var(--bg);
}

.auth-card {
	width: min(420px, 100%);
	display: grid;
	gap: 22px;
	padding: 28px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 8px;
}

.auth-brand {
	display: flex;
	align-items: center;
	gap: 10px;
}

.auth-card h1,
.auth-card p {
	margin: 0;
}

.auth-card h1 {
	font-size: 24px;
	line-height: 1.25;
}

.auth-card p {
	margin-top: 7px;
	color: var(--muted);
	font-size: 13px;
}

.auth-submit {
	width: 100%;
}

.auth-tabs .el-tabs__header {
	margin-bottom: 18px;
}

.topbar {
	height: 58px;
	background: var(--surface);
	border-bottom: 1px solid var(--line);
}

.topbar-inner {
	max-width: 1440px;
	height: 100%;
	margin: 0 auto;
	padding: 0 24px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

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

.brand-mark {
	display: inline-grid;
	place-items: center;
	width: 40px;
	height: 27px;
	border-radius: 5px;
	background: var(--ink);
	color: #fff;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0;
}

.topbar-meta {
	display: flex;
	align-items: center;
	gap: 12px;
	color: var(--muted);
	min-width: 0;
}

.account-select {
	width: 225px;
}

.account-select-popper {
	min-width: 260px;
}

.account-select-popper .el-select-dropdown__item {
	height: auto;
	min-height: 48px;
	padding-top: 6px;
	padding-bottom: 6px;
	line-height: 1.35;
}

.account-option {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.account-option strong {
	font-weight: 500;
}

.account-option span {
	color: var(--muted);
	font-size: 12px;
}

.topbar-user {
	max-width: 140px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.shell {
	max-width: 1440px;
	margin: 0 auto;
	padding: 22px 24px 48px;
}

.metrics {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 8px;
	overflow: hidden;
}

.metric {
	padding: 16px 18px;
	border-right: 1px solid var(--line);
	display: grid;
	gap: 7px;
}

.metric:last-child {
	border-right: 0;
}

.metric span {
	color: var(--muted);
	font-size: 12px;
}

.metric strong {
	font-size: 24px;
	line-height: 1.1;
}

.metric strong.ok {
	color: var(--accent);
	font-size: 16px;
	padding-top: 4px;
}

.metric strong.warn {
	color: var(--warn);
	font-size: 16px;
	padding-top: 4px;
}

.main-tabs {
	margin-top: 16px;
}

.section-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	margin-bottom: 13px;
}

.section-head h2,
.section-head p {
	margin: 0;
}

.section-head h2 {
	font-size: 18px;
	line-height: 1.25;
}

.section-head p {
	color: var(--muted);
	margin-top: 4px;
	font-size: 12px;
}

.toolbar {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.scope-select,
.goal-select {
	width: 126px;
}

.bid-switch {
	margin-bottom: 0;
}

.plan-filter-row {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 8px;
	width: 100%;
	min-height: 32px;
	margin-bottom: 14px;
}

.plan-filter-left {
	display: flex;
	align-items: center;
	gap: 8px;
	justify-self: start;
}

.plan-filter-right {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
	justify-self: end;
}

.plan-updated {
	justify-self: center;
	max-width: 200px;
	overflow: hidden;
	color: var(--muted);
	font-size: 12px;
	text-overflow: ellipsis;
	white-space: nowrap;
	text-align: center;
}

.plan-filter-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
	flex: 0 0 auto;
}

.plan-table {
	width: 100%;
	border: 1px solid var(--line);
	border-radius: 8px;
	overflow: hidden;
}

.plan-table .el-loading-text {
	color: var(--muted);
	font-size: 13px;
}

.plan-name {
	font-weight: 650;
	overflow-wrap: anywhere;
}

.plan-row-clickable {
	cursor: pointer;
}

.plan-more-button {
	color: var(--muted);
}

.plan-action-dialog {
	display: grid;
	gap: 10px;
}

.plan-action-summary {
	display: grid;
	gap: 4px;
	padding: 12px 14px;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--soft);
}

.plan-action-summary strong {
	overflow-wrap: anywhere;
}

.plan-action-summary span {
	color: var(--muted);
	font-size: 12px;
}

.plan-action-choice {
	display: flex;
	align-items: center;
	gap: 11px;
	width: 100%;
	padding: 12px 14px;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--surface);
	color: var(--ink);
	text-align: left;
	cursor: pointer;
}

.plan-action-choice:hover:not(:disabled) {
	border-color: var(--line-strong);
	background: var(--soft);
}

.plan-action-choice:disabled {
	cursor: not-allowed;
	opacity: .55;
}

.plan-action-choice-icon {
	flex: 0 0 auto;
	font-size: 18px;
}

.plan-action-choice-copy {
	display: grid;
	gap: 3px;
	flex: 1;
}

.plan-action-choice-copy small {
	color: var(--muted);
}

.subtle {
	color: var(--muted);
	font-size: 12px;
	margin-top: 3px;
}

.mono {
	font-family: Consolas, "SFMono-Regular", monospace;
}

.loading-panel {
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 42px;
	margin-top: 8px;
	padding: 8px 12px;
	border: 1px solid var(--line);
	border-radius: 7px;
	background: var(--surface);
	color: var(--muted);
	font-size: 13px;
}

.detail-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 16px;
}

.detail-toolbar.is-loading {
	pointer-events: none;
	opacity: 0.62;
}

.detail-date-picker {
	width: 280px;
}

.detail-loading {
	margin-top: 0;
}

.detail-heading {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 14px;
}

.detail-heading > div {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.detail-heading span {
	color: var(--muted);
	font-size: 12px;
}

.detail-metrics {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	border: 1px solid var(--line);
	border-radius: 8px;
	overflow: hidden;
	margin-bottom: 16px;
	background: var(--surface);
}

.detail-metric {
	padding: 12px 14px;
	border-right: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
}

.detail-metric:nth-child(4n) {
	border-right: 0;
}

.detail-metric:nth-last-child(-n+4) {
	border-bottom: 0;
}

.detail-metric span {
	display: block;
	color: var(--muted);
	font-size: 12px;
}

.detail-metric strong {
	display: block;
	margin-top: 4px;
	font-size: 18px;
}

.detail-section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin: 20px 0 10px;
}

.detail-section-head h3 {
	margin: 0;
	font-size: 16px;
}

.detail-section-head span {
	color: var(--muted);
	font-size: 12px;
}

.material-table {
	width: 100%;
}

.material-row-main {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 7px;
	min-width: 0;
}

.material-row-link,
.material-row-name {
	min-width: 0;
	color: var(--ink);
	font-weight: 650;
	overflow-wrap: anywhere;
}

.material-row-link {
	text-decoration: none;
}

.material-row-link:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.material-row-sub {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 5px;
	color: var(--muted);
	font-size: 11px;
}

.material-video-thumb {
	position: relative;
	width: 158px;
	height: 158px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	background: var(--soft);
	border: 1px solid var(--line);
	border-radius: 6px;
	color: var(--muted);
	font: inherit;
	font-size: 13px;
	overflow: hidden;
}

.material-video-thumb.is-clickable {
	cursor: pointer;
}

.material-video-thumb:disabled {
	cursor: default;
}

.material-video-thumb.is-clickable:hover::after {
	content: "点击播放";
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.82);
	color: var(--ink);
	font-size: 13px;
}

.material-video-thumb img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.video-preview-body video {
	display: block;
	width: 100%;
	max-height: 62vh;
	background: var(--soft);
	border: 1px solid var(--line);
	border-radius: 6px;
}

.video-preview-error {
	margin: 0;
	padding: 28px 12px;
	background: var(--soft);
	border: 1px solid var(--line);
	border-radius: 6px;
	color: var(--muted);
	font-size: 13px;
	text-align: center;
}

.video-preview-meta {
	display: flex;
	gap: 12px;
	margin-top: 10px;
	color: var(--muted);
	font-size: 12px;
}

.plan-detail-dialog .el-dialog__body {
	max-height: 72vh;
	overflow: auto;
}

.settings-form {
	max-width: 820px;
	padding: 20px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 8px;
}

.settings-form + .settings-form {
	margin-top: 16px;
}

.auth-account-list {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.form-action-error {
	color: var(--danger);
}

.el-table th.el-table__cell {
	background: var(--soft);
}

.el-dialog {
	border-radius: 8px;
}

@media (max-width: 820px) {
	.topbar-inner,
	.shell {
		padding-left: 14px;
		padding-right: 14px;
	}

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

	.metric:nth-child(2) {
		border-right: 0;
	}

	.metric:nth-child(-n+2) {
		border-bottom: 1px solid var(--line);
	}

	.metric:last-child {
		grid-column: 1 / -1;
		border-right: 0;
	}

	.section-head {
		align-items: flex-start;
		flex-direction: column;
	}

	.plan-filter-row {
		grid-template-columns: minmax(0, 1fr);
		align-items: stretch;
	}

	.plan-updated {
		width: 100%;
		max-width: none;
	}

	.plan-filter-right {
		width: 100%;
		flex-wrap: wrap;
		justify-self: stretch;
	}

	.plan-filter-left {
		width: 100%;
		flex-wrap: wrap;
		justify-self: stretch;
	}

	.plan-filter-actions {
		width: 100%;
		flex-wrap: wrap;
	}

	.plan-filter-actions .el-select {
		flex: 1;
		min-width: 120px;
	}

	.toolbar {
		width: 100%;
	}

	.toolbar .el-select {
		flex: 1;
		min-width: 120px;
	}

	.account-select {
		width: 180px;
	}

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

	.detail-metric:nth-child(2n) {
		border-right: 0;
	}

	.detail-metric:nth-child(4n) {
		border-right: 1px solid var(--line);
	}

	.detail-metric:nth-child(2n) {
		border-right: 0;
	}

	.detail-metric:nth-last-child(-n+4) {
		border-bottom: 1px solid var(--line);
	}

	.detail-metric:nth-last-child(-n+2) {
		border-bottom: 0;
	}

}

@media (max-width: 560px) {
	.topbar-meta > span:last-child,
	.brand strong {
		display: none;
	}

	.topbar-meta {
		gap: 7px;
	}

	.topbar-meta > .el-tag,
	.topbar-user {
		display: none;
	}

	.account-select {
		width: 142px;
	}

	.scope-select,
	.goal-select {
		width: 100%;
	}

	.plan-filter-actions {
		flex-direction: column;
		align-items: stretch;
	}

	.bid-switch {
		width: 100%;
	}

	.auth-card {
		padding: 22px;
	}

	.detail-toolbar {
		align-items: stretch;
	}

	.detail-toolbar .el-segmented {
		width: 100%;
		overflow-x: auto;
	}

	.detail-date-picker {
		width: 100%;
	}

}

/* 素材接口诊断弹窗（临时工具，素材库页面完成后可移除） */
.diagnose-dialog .el-dialog__body {
	max-height: min(70vh, 720px);
	overflow: auto;
}

.diagnose-toolbar {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 12px;
}

.diagnose-summary {
	color: var(--muted);
	font-size: 12px;
}

.diagnose-loading {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 28px 0;
	color: var(--muted);
	font-size: 13px;
}

.diagnose-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.diagnose-item {
	padding: 10px 12px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-left: 3px solid var(--line-strong);
	border-radius: 6px;
}

.diagnose-item.is-ok {
	border-left-color: var(--accent);
}

.diagnose-item.is-fail {
	border-left-color: var(--danger);
}

.diagnose-item.is-skip {
	border-left-color: var(--line-strong);
}

.diagnose-item-head {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
}

.diagnose-key {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 12px;
	color: var(--ink);
}

.diagnose-note {
	color: var(--muted);
	font-size: 12px;
}

.diagnose-path {
	margin-top: 4px;
	color: var(--muted);
	font-size: 11px;
	word-break: break-all;
}

.diagnose-error {
	margin-top: 6px;
	color: var(--danger);
	font-size: 12px;
	word-break: break-all;
}

.diagnose-json {
	max-height: 220px;
	margin: 8px 0 0;
	padding: 8px 10px;
	background: var(--soft);
	border-radius: 4px;
	color: var(--ink);
	font-size: 11px;
	line-height: 1.5;
	white-space: pre-wrap;
	word-break: break-all;
	overflow: auto;
}

/* 素材库列表（只读看板） */
.library-row {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.library-thumb {
	position: relative;
	flex: 0 0 auto;
	width: 84px;
	height: 84px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	background: var(--soft);
	border: 1px solid var(--line);
	border-radius: 6px;
	color: var(--muted);
	font: inherit;
	font-size: 12px;
	overflow: hidden;
}

.library-thumb.is-clickable {
	cursor: pointer;
}

.library-thumb.is-clickable:hover::after {
	content: "播放";
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.82);
	color: var(--ink);
	font-size: 12px;
}

.library-thumb img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.library-copy {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.library-title {
	color: var(--ink);
	font-weight: 650;
	overflow-wrap: anywhere;
}

.library-reasons {
	display: flex;
	flex-direction: column;
	gap: 2px;
	font-size: 12px;
}

.library-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
}

.library-pagination {
	display: flex;
	justify-content: flex-end;
	margin-top: 12px;
}

.material-sample {
	max-height: 260px;
	margin: 0;
	padding: 10px 12px;
	background: var(--soft);
	border-radius: 4px;
	color: var(--ink);
	font-size: 11px;
	line-height: 1.5;
	white-space: pre-wrap;
	word-break: break-all;
	overflow: auto;
}
