/* Baleaf SEO Studio — UI */
:root {
  --c-primary: #4f46e5; --c-primary-600: #4338ca; --c-primary-50: #eef2ff;
  --c-bg: #f4f6fb; --c-card: #fff; --c-border: #e7eaf2; --c-text: #0f172a; --c-muted: #64748b;
  --bs-primary: #4f46e5; --bs-primary-rgb: 79, 70, 229;
  --bs-link-color: #4f46e5; --bs-link-color-rgb: 79, 70, 229; --bs-link-hover-color: #4338ca;
  --bs-body-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --bs-body-color: #0f172a; --bs-border-color: #e7eaf2;
}
body { background: var(--c-bg); font-size: 14px; }
a { text-decoration: none; }
.btn { border-radius: 10px; font-weight: 500; }
.btn-primary { --bs-btn-bg: #4f46e5; --bs-btn-border-color: #4f46e5; --bs-btn-hover-bg: #4338ca; --bs-btn-hover-border-color: #4338ca; --bs-btn-active-bg: #3730a3; --bs-btn-disabled-bg: #a5b4fc; --bs-btn-disabled-border-color: #a5b4fc; box-shadow: 0 4px 14px rgba(79,70,229,.25); }
.btn-outline-primary { --bs-btn-color: #4f46e5; --bs-btn-border-color: #c7d2fe; --bs-btn-hover-bg: #4f46e5; --bs-btn-hover-border-color: #4f46e5; --bs-btn-active-bg: #4338ca; }
.btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: var(--c-border); --bs-btn-hover-bg: #f8fafc; --bs-btn-hover-border-color: #d7dce8; }
.btn-icon { width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center; }
.text-bg-purple, .bg-purple { background: #7c3aed !important; color: #fff !important; }
.badge { font-weight: 500; letter-spacing: .02em; padding: .42em .7em; border-radius: 999px; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 248px; position: fixed; inset: 0 auto 0 0; z-index: 1040; display: flex; flex-direction: column;
  background: radial-gradient(600px 300px at 0 0, rgba(99,102,241,.22), transparent), linear-gradient(180deg, #0b1120, #111a33);
  color: #cbd5e1; transition: transform .25s ease; }
.brand { display: flex; gap: 12px; align-items: center; padding: 22px 20px 14px; }
.logo { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 18px;
  background: linear-gradient(135deg, #6366f1, #22d3ee); box-shadow: 0 6px 18px rgba(99,102,241,.45); }
.brand-name { color: #fff; font-weight: 700; letter-spacing: .01em; }
.brand-sub { font-size: 12px; color: #64748b; }
.sidebar nav { flex: 1; overflow-y: auto; padding: 4px 12px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: #475569; padding: 16px 10px 6px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #cbd5e1; margin-bottom: 2px; transition: .15s; }
.nav-item:hover { background: rgba(148,163,184,.1); color: #fff; }
.nav-item.active { background: linear-gradient(90deg, rgba(99,102,241,.38), rgba(99,102,241,.1)); color: #fff; box-shadow: inset 3px 0 0 #818cf8; }
.nav-item i { font-size: 17px; width: 20px; text-align: center; }
.sidebar-foot { padding: 14px 16px; border-top: 1px solid rgba(148,163,184,.12); }
.sidebar-foot .user { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #1e293b; color: #a5b4fc; display: grid; place-items: center; font-weight: 700; }
.sidebar-foot .btn { --bs-btn-color: #cbd5e1; --bs-btn-border-color: rgba(148,163,184,.25); --bs-btn-hover-bg: rgba(148,163,184,.12); --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: rgba(148,163,184,.4); }
.main { margin-left: 248px; flex: 1; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: 16px; padding: 14px 28px;
  background: rgba(244,246,251,.86); backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--c-border); }
.page-title { font-size: 19px; font-weight: 700; margin: 0; }
.page-sub { color: var(--c-muted); font-size: 13px; margin-top: 2px; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.content { padding: 24px 28px 80px; }
.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .sidebar.open + .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 1030; }
  .main { margin-left: 0; }
  .content { padding: 16px; }
  .topbar { padding: 12px 16px; flex-wrap: wrap; }
}

/* ---------- cards & tables ---------- */
.card { border: 1px solid var(--c-border); border-radius: 16px; box-shadow: 0 1px 2px rgba(15,23,42,.03), 0 8px 24px rgba(15,23,42,.04); }
.card-header { background: #fff; border-bottom: 1px solid var(--c-border); padding: 14px 18px; font-weight: 600; border-radius: 16px 16px 0 0 !important; display: flex; align-items: center; gap: 8px; }
.card-header .ms-auto { font-weight: 400; }
.stat-card { padding: 18px; display: flex; gap: 14px; align-items: center; height: 100%; }
.stat-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 20px; flex: none; }
.stat-num { font-size: 26px; font-weight: 700; line-height: 1.1; }
.stat-label { color: var(--c-muted); font-size: 13px; }
.table { --bs-table-bg: transparent; margin: 0; }
.table > :not(caption) > * > * { padding: .7rem .85rem; border-bottom-color: #eef1f6; }
.table thead th { font-size: 12px; color: var(--c-muted); font-weight: 600; background: #f8fafc; white-space: nowrap; }
.table td { vertical-align: middle; }
.table-hover tbody tr:hover > * { background: #fafbff; }
.table-wrap { overflow-x: auto; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; background: var(--c-primary-50); color: #4338ca; font-size: 12px; margin: 2px; white-space: nowrap; }
.chip.gray { background: #f1f5f9; color: #475569; }
.chip .x { cursor: pointer; opacity: .6; }
.chip .x:hover { opacity: 1; }
.empty { padding: 48px 20px; text-align: center; color: var(--c-muted); }
.empty i { font-size: 40px; display: block; margin-bottom: 8px; color: #cbd5e1; }
.muted { color: var(--c-muted); }
.small-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.text-truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- forms ---------- */
.form-control, .form-select { border-radius: 10px; border-color: #dfe3ec; }
.form-control:focus, .form-select:focus { border-color: #a5b4fc; box-shadow: 0 0 0 .2rem rgba(99,102,241,.15); }
.form-label { font-weight: 600; font-size: 13px; color: #334155; margin-bottom: .35rem; }
.form-text { font-size: 12px; }
textarea.code, .code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.55; }
.dropzone { border: 2px dashed #c7d2fe; border-radius: 14px; background: #f8faff; padding: 28px; text-align: center; cursor: pointer; transition: .15s; display: block; color: var(--c-muted); }
.dropzone:hover, .dropzone.drag { border-color: #6366f1; background: var(--c-primary-50); color: #4338ca; }
.dropzone i { font-size: 30px; display: block; color: #818cf8; margin-bottom: 6px; }
.counter { font-size: 12px; color: var(--c-muted); float: right; font-weight: 400; }
.counter.over { color: #dc2626; font-weight: 600; }

/* ---------- editor ---------- */
.editor-nav .nav-link { text-align: left; border-radius: 10px; color: #334155; padding: 10px 14px; display: flex; gap: 10px; align-items: center; margin-bottom: 4px; }
.editor-nav .nav-link:hover { background: #fff; }
.editor-nav .nav-link.active { background: var(--c-primary); color: #fff; box-shadow: 0 4px 14px rgba(79,70,229,.25); }
.editor-nav .nav-link .badge { margin-left: auto; }
.rich-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; border: 1px solid var(--c-border); border-bottom: 0; border-radius: 12px 12px 0 0; background: #f8fafc; position: sticky; top: 64px; z-index: 5; }
.rich-toolbar .btn { padding: 4px 9px; border-radius: 8px; }
.rich-toolbar .sep { width: 1px; background: var(--c-border); margin: 2px 4px; }
.rich-editor { min-height: 620px; border: 1px solid var(--c-border); border-radius: 0 0 12px 12px; padding: 32px 40px; background: #fff; outline: none; }
.article-body { font-size: 16px; line-height: 1.8; color: #1f2937; }
.article-body > * { max-width: 780px; margin-left: auto; margin-right: auto; }
.article-body h2 { font-size: 1.5rem; margin: 1.6em auto .6em; font-weight: 700; }
.article-body h3 { font-size: 1.18rem; margin: 1.3em auto .5em; font-weight: 700; }
.article-body img { max-width: 100%; height: auto; }
.article-body a { color: #4f46e5; text-decoration: underline; text-underline-offset: 3px; }
.article-body .bsg-product-card a { text-decoration: none; }
.bsg-image-slot { border: 2px dashed #f59e0b; background: #fffbeb; color: #b45309; border-radius: 12px; padding: 22px; text-align: center; margin: 24px auto; font-size: 14px; }
.slot-card { overflow: hidden; height: 100%; }
.slot-card .slot-media { aspect-ratio: 16/10; background: #f1f5f9; display: grid; place-items: center; overflow: hidden; }
.slot-card .slot-media img { width: 100%; height: 100%; object-fit: cover; }
.slot-card .slot-media .dropzone { width: 100%; height: 100%; border-radius: 0; border-width: 0; display: grid; place-content: center; }
.prompt-box { background: #f8fafc; border: 1px solid var(--c-border); border-radius: 10px; padding: 10px 12px; font-size: 13px; max-height: 150px; overflow: auto; white-space: pre-wrap; }
.serp { max-width: 640px; font-family: arial, sans-serif; padding: 16px 18px; border: 1px solid var(--c-border); border-radius: 14px; background: #fff; }
.serp .u { color: #202124; font-size: 13px; } .serp .t { color: #1a0dab; font-size: 20px; line-height: 1.3; margin: 2px 0; } .serp .d { color: #4d5156; font-size: 14px; }
.preview-frame { width: 100%; height: 78vh; border: 1px solid var(--c-border); border-radius: 14px; background: #fff; }
.product-pick { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--c-border); border-radius: 12px; margin-bottom: 10px; background: #fff; }
.thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; border: 1px solid var(--c-border); background: #f1f5f9; flex: none; }
.thumb-sm { width: 36px; height: 36px; object-fit: cover; border-radius: 8px; background: #f1f5f9; flex: none; }
.check-list { max-height: 320px; overflow: auto; border: 1px solid var(--c-border); border-radius: 12px; background: #fff; }
.check-list label { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid #f1f5f9; cursor: pointer; margin: 0; }
.check-list label:hover { background: #f8fafc; }
.step-card textarea { min-height: 220px; }
.picker-list { max-height: 52vh; overflow: auto; }
.picker-list .it { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.picker-list .it:hover { background: var(--c-primary-50); }

/* ---------- misc ---------- */
.cluster-card .card-header { flex-wrap: wrap; }
.kw-chips { padding: 10px 18px; border-bottom: 1px solid var(--c-border); background: #fcfcfe; }
.bar-chart { display: flex; gap: 8px; align-items: flex-end; height: 180px; }
.bar-chart .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; justify-content: flex-end; height: 100%; }
.bar-chart .b { width: 100%; max-width: 34px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, #818cf8, #4f46e5); min-height: 3px; position: relative; }
.bar-chart .b span { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 11px; color: #4338ca; font-weight: 600; }
.bar-chart .lbl { font-size: 11px; color: var(--c-muted); }
.drag-handle { cursor: grab; color: #94a3b8; font-size: 18px; }
.sortable-ghost { opacity: .45; background: var(--c-primary-50); }
.bulk-bar { position: sticky; bottom: 16px; z-index: 10; }
.bulk-bar .card { background: #0f172a; color: #fff; border: 0; }
.job-banner { border-radius: 14px; border: 1px solid #c7d2fe; background: linear-gradient(90deg, #eef2ff, #f5f3ff); padding: 12px 16px; display: flex; gap: 12px; align-items: center; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: #6366f1; box-shadow: 0 0 0 0 rgba(99,102,241,.6); animation: pulse 1.6s infinite; flex: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(99,102,241,.55); } 70% { box-shadow: 0 0 0 10px rgba(99,102,241,0); } 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0); } }
.prio { color: #f59e0b; letter-spacing: -2px; }
.toast { border-radius: 12px; border: 0; box-shadow: 0 10px 30px rgba(15,23,42,.15); }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(900px 500px at 10% 0%, #e0e7ff, transparent), radial-gradient(800px 500px at 100% 100%, #cffafe, transparent), #f8fafc; }
.login-card { width: 420px; max-width: 100%; padding: 36px; border-radius: 22px; background: #fff; box-shadow: 0 24px 60px rgba(15,23,42,.12); }
pre.output { white-space: pre-wrap; background: #0f172a; color: #e2e8f0; padding: 16px; border-radius: 12px; max-height: 60vh; overflow: auto; font-size: 12.5px; }
.nav-pills { --bs-nav-pills-link-active-bg: #4f46e5; --bs-nav-pills-border-radius: 10px; }
.nav { --bs-nav-link-color: #475569; --bs-nav-link-hover-color: #4338ca; }
.nav-pills .nav-link.active .badge { background: rgba(255,255,255,.9) !important; color: #4338ca !important; }
.dropdown-item:active { background: #4f46e5; }
.form-check-input:checked { background-color: #4f46e5; border-color: #4f46e5; }
.text-purple { color: #7c3aed; }

/* 主题短代码商品卡（发布后由主题 custom-blog-product-card 渲染） */
.bsg-product-slot { border: 1px dashed #a5b4fc; background: #f5f7ff; color: #4338ca; border-radius: 12px; padding: 14px 18px; margin: 24px auto;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; word-break: break-all; }
.bsg-product-slot::before { content: "🛍 商品卡片（主题渲染）"; display: block; font: 600 13px/1.6 var(--bs-body-font-family); color: #312e81; margin-bottom: 4px; }
.qa-box { border-radius: 14px; border: 1px solid #fde68a; background: #fffbeb; padding: 12px 16px; }
.qa-box li { margin-bottom: 4px; }

/* ---------- 内容簇 ---------- */
.funnel { display: flex; flex-direction: column; gap: 10px; }
.fn-row { display: flex; align-items: center; gap: 12px; }
.fn-label { width: 108px; flex: none; display: flex; flex-direction: column; font-size: 12px; line-height: 1.35; }
.fn-label span { color: var(--c-muted); }
.fn-track { flex: 1; display: flex; justify-content: center; }
.fn-bar { min-width: 40px; height: 34px; border-radius: 6px; color: #fff; font-weight: 700; font-size: 13px; display: grid; place-items: center;
  padding: 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fn-bar.miss { border: 2px dashed #f59e0b; color: #b45309; font-weight: 600; }
.funnel.big .fn-bar { height: 44px; }
.funnel .fn-row:first-child .fn-bar { color: #3730a3; }
.member-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--c-border); border-radius: 999px; font-size: 12px; background: #fff; }
.member-chip .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.method { padding: 8px 0; border-bottom: 1px dashed var(--c-border); } .method:last-child { border: 0; }
.check-step { display: flex; gap: 12px; padding: 9px 12px; border-left: 3px solid #cbd5e1; border-radius: 8px; background: #fafbff; margin-bottom: 8px; }
.check-step.ok { border-left-color: #10b981; } .check-step.warn { border-left-color: #f59e0b; background: #fffdf5; } .check-step.pending { border-left-color: #94a3b8; }
.nav-preview-body { border: 1px dashed var(--c-border); border-radius: 12px; padding: 4px 18px; background: #fff; font-size: 14px; }
.nav-preview-body > * { max-width: none; }
.health-list .h { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; margin-bottom: 4px; }

.struct-spec { border-top: 1px dashed var(--c-border); padding-top: 10px; }
#st_preview > * { max-width: 760px; }

/* 配图尺寸设置 */
.img-cfg-box { background: #f8fafc; border: 1px solid var(--c-border); border-radius: 12px; padding: 16px 18px; height: 100%; }
.crop-demo { display: flex; align-items: center; gap: 12px; min-height: 110px; }
.crop-frame { border: 2px dashed #818cf8; background: repeating-linear-gradient(45deg, #eef2ff, #eef2ff 8px, #f5f7ff 8px, #f5f7ff 16px); border-radius: 6px; }
