:root {
  --brand: #4F46E5;
  --brand-soft: #EEF0FF;
  --bg: #F6F8FC;
  --surface: #FFFFFF;
  --surface-2: #FBFBFE;
  --text: #1D2433;
  --text-2: #465066;
  --muted: #7C869B;
  --border: #E6EAF2;
  --border-strong: #D6DCE9;
  --success: #15803D;
  --success-soft: #E9F8EE;
  --danger: #C4383B;
  --danger-soft: #FDEDED;
  --warn: #A16207;
  --warn-soft: #FEF6E4;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 2px 8px rgba(28, 39, 74, .04), 0 12px 32px rgba(28, 39, 74, .06);
  --shadow-lg: 0 24px 64px rgba(24, 33, 65, .16);
}

* { box-sizing: border-box; }
/* 作者样式的 display 会覆盖 UA 的 [hidden]{display:none}，这里统一兜底 */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }

/* ---------- 通用控件 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 9px 16px; font-size: 13px; font-weight: 600;
  background: var(--surface); color: var(--text-2); white-space: nowrap;
  transition: background .15s, border-color .15s, transform .1s, box-shadow .15s;
}
.btn:hover { text-decoration: none; border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover { background: #423BD1; border-color: #423BD1; color: #fff; }
.btn-outline { border-color: var(--border-strong); background: var(--surface); color: var(--text-2); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: #F5D3D3; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-lg { padding: 12px 22px; font-size: 14px; }
.link-quiet { color: var(--text-2); font-size: 13px; font-weight: 550; }

.field { display: block; margin-bottom: 14px; }
.field > span:first-child { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.field input, .field textarea, .field select, .input {
  width: 100%; border: 1px solid var(--border-strong); background: var(--surface);
  border-radius: var(--radius-sm); padding: 9px 11px; outline: none; font-size: 13px;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus, .field select:focus, .input:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, .1);
}
.field textarea { min-height: 90px; resize: vertical; }
.field-row { display: flex; gap: 8px; }
.field-row input { flex: 1; min-width: 0; }
.field-hint { font-size: 11px; color: var(--muted); margin-top: 5px; }
.field-error { color: var(--danger); font-size: 12px; min-height: 18px; margin: -6px 0 8px; }
.checkbox { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.checkbox input { width: 15px; height: 15px; accent-color: var(--brand); }

.badge {
  display: inline-flex; align-items: center; gap: 4px; border-radius: 999px;
  padding: 2px 9px; font-size: 11px; font-weight: 600;
  background: var(--brand-soft); color: var(--brand); white-space: nowrap;
}
.badge.gray { background: #F1F3F8; color: var(--muted); }
.badge.green { background: var(--success-soft); color: var(--success); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- 顶部导航 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1220px; margin: 0 auto; padding: 0 24px; height: 64px;
  display: flex; align-items: center; gap: 22px;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), #8B5CF6); color: #fff; font-size: 15px; font-weight: 800;
}
.brand-logo { height: 30px; width: auto; max-width: 150px; object-fit: contain; display: block; }
.brand-logo[hidden] { display: none; }
.topnav { display: flex; gap: 18px; margin-left: 6px; }
.topnav a { color: var(--text-2); font-size: 13px; font-weight: 550; }
.topnav a.active { color: var(--brand); }
/* 顶部其他外链：与主导航同一视觉语言，可横向溢出滚动 */
.top-ext-links { display: flex; align-items: center; gap: 18px; margin-left: 6px; max-width: 46vw; overflow-x: auto; scrollbar-width: none; }
.top-ext-links::-webkit-scrollbar { display: none; }
.top-ext-links:empty { display: none; }
.top-ext-links a { color: var(--text-2); font-size: 13px; font-weight: 550; white-space: nowrap; }
.top-ext-links a:hover { color: var(--brand); }
.topbar-spacer { flex: 1; }
.search-box { position: relative; width: 260px; }
.search-box input {
  width: 100%; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface-2); padding: 8px 14px 8px 34px; font-size: 13px; outline: none;
}
.search-box input:focus { border-color: var(--brand); background: #fff; }
.search-box::before {
  content: ''; position: absolute; left: 13px; top: 50%; width: 13px; height: 13px;
  transform: translateY(-50%); border: 1.6px solid var(--muted); border-radius: 50%; opacity: .8;
}
.search-box::after {
  content: ''; position: absolute; left: 24px; top: 57%; width: 6px; height: 1.6px;
  background: var(--muted); transform: rotate(45deg); opacity: .8;
}
.user-area { display: flex; align-items: center; gap: 10px; }
.user-chip { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-2); max-width: 170px; }
.user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 700;
}
.user-chip.clickable { cursor: pointer; }
.user-chip.clickable:hover .user-name { color: var(--brand); }

/* ---------- 首页 ---------- */
.wrap { max-width: 1220px; margin: 0 auto; padding: 0 24px; }
.hero { padding: 48px 0 30px; }
.hero-inner {
  position: relative; overflow: hidden; border-radius: 20px; padding: 42px 44px;
  background: linear-gradient(118deg, #EEF0FF 0%, #F7F5FF 48%, #FDF3F8 100%);
  border: 1px solid #E9E8FA;
}
.hero-inner::after {
  content: ''; position: absolute; right: -70px; top: -110px; width: 320px; height: 320px;
  border-radius: 50%; background: radial-gradient(circle, rgba(139, 92, 246, .18), rgba(139, 92, 246, 0) 70%);
}
.hero h1 { font-size: 30px; letter-spacing: -.03em; margin-bottom: 10px; }
.hero p { font-size: 14px; color: var(--text-2); max-width: 560px; }
.hero-notice {
  display: inline-flex; margin-top: 20px; gap: 8px; align-items: center;
  background: rgba(255, 255, 255, .75); border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 999px; padding: 7px 14px; font-size: 12px; color: var(--text-2);
}
.hero-stats { display: flex; gap: 30px; margin-top: 26px; position: relative; z-index: 1; }
.hero-stat strong { display: block; font-size: 22px; line-height: 1.2; }
.hero-stat span { font-size: 11px; color: var(--muted); }

.toolbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 18px 0 16px; border-bottom: 1px solid var(--border); margin-bottom: 22px;
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.chip {
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  border-radius: 999px; padding: 6px 14px; font-size: 12px; font-weight: 550;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.toolbar-right { display: flex; align-items: center; gap: 8px; }
.toolbar-right select {
  border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm);
  padding: 7px 10px; font-size: 12px; outline: none;
}

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 18px; align-items: stretch; }
.grid.list-view { grid-template-columns: 1fr; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); cursor: pointer;
  transition: transform .16s, box-shadow .16s, border-color .16s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(28, 39, 74, .11); border-color: #D9DCF4; }
.cover {
  min-height: 138px; position: relative; display: grid; place-items: center;
  background: linear-gradient(135deg, #E7E9FF, #F3EAFE);
  color: rgba(255, 255, 255, .95); font-size: 40px; font-weight: 800; letter-spacing: -.04em;
}
/* 图文原比例完整展示：不再按固定高度裁切，长图/竖图都能看全；上限 360px 避免超长竖图把网格卡片撑得过高 */
.cover img { width: 100%; height: auto; max-height: 360px; object-fit: contain; display: block; }
.cover-tag { position: absolute; left: 12px; top: 12px; background: rgba(255, 255, 255, .9); color: var(--text-2); }
.cover-pin { position: absolute; right: 12px; top: 12px; background: rgba(79, 70, 229, .92); color: #fff; }
.card-body { padding: 15px 16px 16px; flex: 1; display: flex; flex-direction: column; }
/* 标题固定一行，超出省略；保证每张卡片标题区高度一致 */
.card-title { font-size: 15px; font-weight: 650; line-height: 1.45; margin-bottom: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 简介固定两行（不足两行也占两行高度），超出省略；配合弹性布局让页脚上下对齐 */
.card-summary {
  font-size: 12px; color: var(--muted); line-height: 1.65; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: calc(1.65em * 2);
}
.card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 0; }
.tag { font-size: 11px; color: var(--text-2); background: #F3F5FA; border-radius: 5px; padding: 2px 7px; }
.card-foot {
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--border); margin-top: 14px; padding-top: 11px;
  font-size: 11px; color: var(--muted);
}
/* 网格视图：封面统一高度，保证同一行卡片「上下对齐」（标题、页脚基线一致）。
   grid-template-rows:100% 让图片的 100% 按 200px 解析，避免被内容撑成 360px 后溢出盖住正文。 */
.grid:not(.list-view) .cover { height: 200px; min-height: 200px; grid-template-rows: 100%; overflow: hidden; }
.grid:not(.list-view) .cover img { height: 100%; max-height: 100%; width: 100%; object-fit: contain; }
.list-view .card { flex-direction: row; }
.list-view .cover { width: 170px; height: auto; min-height: 118px; max-height: 170px; flex: none; }
.list-view .cover img { height: 100%; object-fit: cover; }
.list-view .card-body { padding: 14px 18px; }

.pager {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: center;
  gap: 7px; flex-wrap: wrap; padding: 22px 0 6px;
}
.pager-info { font-size: 12px; color: var(--muted); margin-right: 8px; }
.pager-dots { color: var(--muted); padding: 0 3px; }
.pager .chip { padding: 5px 11px; }

.empty {
  text-align: center; padding: 64px 20px; color: var(--muted);
  background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius);
}
.empty-emoji { font-size: 34px; margin-bottom: 10px; }
.skeleton { background: linear-gradient(90deg, #EFF1F7, #F8F9FC, #EFF1F7); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: var(--radius); height: 280px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

footer.site-foot { margin-top: 56px; border-top: 1px solid var(--border); padding: 24px 0 40px; color: var(--muted); font-size: 12px; }

/* ---------- 弹窗 / 抽屉 ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgba(18, 24, 42, .42);
  backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px;
}
.modal {
  width: 100%; max-width: 440px; max-height: 90vh; overflow: auto; position: relative;
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 26px;
}
.modal.wide { max-width: 720px; }
.modal-close {
  position: absolute; right: 16px; top: 14px; border: 0; background: transparent;
  font-size: 24px; line-height: 1; color: var(--muted); padding: 4px 8px; border-radius: 8px;
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-head { margin-bottom: 20px; }
.modal-head h2 { font-size: 19px; margin-bottom: 5px; }
.tabs { display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 4px; margin-bottom: 18px; }
.tab { flex: 1; border: 0; background: transparent; padding: 7px; border-radius: 7px; font-size: 12px; font-weight: 600; color: var(--muted); }
.tab.active { background: var(--surface); color: var(--brand); box-shadow: 0 1px 4px rgba(28, 39, 74, .08); }
.auth-foot { font-size: 11px; text-align: center; margin-top: 16px; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(18, 24, 42, .38); }
.drawer {
  position: fixed; right: 0; top: 0; bottom: 0; width: min(560px, 100%);
  background: var(--surface); box-shadow: var(--shadow-lg); z-index: 56;
  overflow-y: auto; animation: slideIn .22s ease-out;
}
@keyframes slideIn { from { transform: translateX(30px); opacity: .6; } to { transform: translateX(0); opacity: 1; } }
.drawer-head { padding: 22px 26px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 16px; }
.drawer-head h2 { font-size: 19px; line-height: 1.4; }
.drawer-body { padding: 22px 26px 32px; }
.detail-cover { height: auto; min-height: 190px; border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; display: grid; place-items: center; font-size: 54px; font-weight: 800; color: rgba(255,255,255,.9); background: linear-gradient(135deg, #E7E9FF, #F3EAFE); }
.detail-cover img { width: 100%; height: auto; object-fit: contain; }
.detail-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.detail-content { color: var(--text-2); line-height: 1.85; font-size: 13px; white-space: pre-wrap; margin: 14px 0 22px; }
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 8px 12px; font-size: 12px; padding: 16px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 22px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--text-2); word-break: break-all; }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- 提示 ---------- */
.global-alert { max-width: 1220px; margin: 16px auto 0; padding: 11px 16px; border-radius: var(--radius-sm); font-size: 12px; }
.global-alert.error { background: var(--danger-soft); color: var(--danger); border: 1px solid #F5D3D3; }
.global-alert.info { background: var(--brand-soft); color: var(--brand); border: 1px solid #DBDCFA; }
#toastWrap { position: fixed; right: 22px; bottom: 22px; z-index: 90; display: flex; flex-direction: column; gap: 9px; }
.toast {
  background: #20263A; color: #fff; border-radius: 10px; padding: 10px 16px; font-size: 12px;
  box-shadow: var(--shadow-lg); animation: toastIn .2s ease-out; max-width: 320px;
}
.toast.success { background: #1B7A47; }
.toast.error { background: #B73538; }
.toast.out { opacity: 0; transition: opacity .4s; }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ---------- 后台 ---------- */
.admin-shell { display: flex; min-height: calc(100vh - 64px); }
.admin-side {
  width: 220px; flex: none; border-right: 1px solid var(--border);
  background: var(--surface); padding: 22px 14px;
}
.side-label { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 0 10px; margin: 12px 0 8px; }
.side-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 13px; font-weight: 550; margin-bottom: 3px; border: 1px solid transparent;
}
.side-item:hover { background: var(--surface-2); text-decoration: none; }
.side-item.active { background: var(--brand-soft); color: var(--brand); border-color: #DEE0FA; }
.side-icon { width: 18px; text-align: center; font-size: 14px; }
.side-tag {
  margin-left: auto; font-size: 10px; font-weight: 700; line-height: 1.7;
  min-width: 18px; text-align: center; padding: 0 5px; border-radius: 999px;
  background: #EDF0F7; color: var(--muted);
}
.side-item.active .side-tag { background: var(--brand); color: #fff; }
.admin-main { flex: 1; min-width: 0; padding: 28px 32px 60px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head h1 { font-size: 22px; }
.page-head p { color: var(--muted); font-size: 12px; margin-top: 4px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 18px; }
.panel h3 { font-size: 15px; margin-bottom: 4px; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.panel > p.panel-desc { font-size: 12px; color: var(--muted); margin-bottom: 18px; }

table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 11px; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid var(--border); color: var(--text-2); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: var(--surface-2); }
td.actions { white-space: nowrap; text-align: right; }
td.actions .btn { margin-left: 5px; }
.admin-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.admin-toolbar .input { max-width: 260px; }
.admin-toolbar select {
  border: 1px solid var(--border-strong); background: var(--surface);
  border-radius: var(--radius-sm); padding: 8px 10px; font-size: 12px; outline: none;
}
/* 资源列表：全部 / 已刮削 / 未刮削 分段筛选 */
.seg-filter {
  display: inline-flex; align-items: center; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 3px;
}
.seg-item {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: transparent; color: var(--text-2);
  font-family: inherit; font-size: 12px; font-weight: 600; line-height: 1.4;
  padding: 6px 12px; border-radius: 7px; cursor: pointer; white-space: nowrap;
}
.seg-item:hover { color: var(--brand); }
.seg-item.active { background: var(--brand-soft); color: var(--brand); box-shadow: inset 0 0 0 1px rgba(79,70,229,.18); }
.seg-count {
  font-style: normal; font-size: 11px; font-weight: 700; line-height: 1.5;
  min-width: 20px; text-align: center; padding: 1px 6px;
  border-radius: 999px; background: #EDF0F7; color: var(--muted);
}
.seg-item.active .seg-count { background: var(--brand); color: #fff; }
.seg-count.warn { background: var(--warn-soft); color: var(--warn); }
.seg-item.active .seg-count.warn { background: var(--warn); color: #fff; }
.table-title { font-weight: 600; color: var(--text); }
.table-wrap { overflow-x: auto; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
.gate {
  max-width: 520px; margin: 70px auto; text-align: center; background: var(--surface);
  border: 1px solid var(--border); border-radius: 18px; padding: 40px 34px; box-shadow: var(--shadow);
}
.gate-icon { width: 52px; height: 52px; border-radius: 16px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-size: 24px; margin: 0 auto 16px; }
.gate h2 { font-size: 19px; margin-bottom: 8px; }
.gate p { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.file-drop {
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 16px;
  text-align: center; background: var(--surface-2); font-size: 12px; color: var(--muted);
}
.file-drop input { display: block; margin: 10px auto 0; font-size: 12px; }
.admin-note { font-size: 11px; color: var(--muted); line-height: 1.7; }

@media (max-width: 900px) {
  .search-box { width: 180px; }
  .topnav { display: none; }
  /* 平板：卡片更宽，给封面稍大的上限让图文尽量完整，但仍受约束避免竖图把卡片撑得过高 */
  .cover img { max-height: 420px; }
  .admin-side { width: 68px; padding: 18px 8px; }
  .side-item span:not(.side-icon), .side-label { display: none; }
  .side-item { justify-content: center; }
  .admin-main { padding: 22px 16px 50px; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  /* 顶栏改为两行：第一行品牌 + 用户区，第二行全宽搜索框（手机端搜索必须可见，不能隐藏） */
  .topbar-inner { flex-wrap: wrap; height: auto; padding: 8px 14px; gap: 10px; }
  .brand { flex: 1 1 auto; min-width: 0; }
  .topnav { display: none; }
  .topbar-spacer { display: none; }
  .user-area { order: 2; margin-left: auto; }
  .search-box { order: 3; width: 100%; flex: 1 0 100%; }
  .search-box input { padding: 11px 14px 11px 36px; font-size: 14px; }

  .wrap { padding: 0 14px; }
  .hero { padding: 26px 0 20px; }
  .hero-inner { padding: 26px 22px; border-radius: 16px; }
  .hero h1 { font-size: 23px; }
  .hero p { font-size: 13px; }
  .hero-stats { gap: 18px; margin-top: 18px; }
  .hero-stat strong { font-size: 19px; }

  .grid { grid-template-columns: 1fr; gap: 14px; }
  .list-view .cover { width: 104px; min-height: 92px; }
  .card-title { font-size: 14px; }

  /* 工具栏：分类胶囊单独一行横向滚动，避免堆成高墙；控件换行且更易点按 */
  .toolbar { gap: 10px 12px; padding: 14px 0; }
  .chips {
    flex: 1 0 100%; order: 2; flex-wrap: nowrap; overflow-x: auto;
    gap: 8px; padding-bottom: 4px; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .chips::-webkit-scrollbar { display: none; }
  .chips .chip { flex: none; }
  .toolbar-right { width: 100%; order: 3; flex-wrap: wrap; gap: 8px; }
  .toolbar-right .chip, .toolbar-right select { white-space: nowrap; }

  .detail-cover { min-height: 150px; border-radius: 14px; }
  .drawer-head { padding: 18px 18px 14px; }
  .drawer-body { padding: 18px 18px 30px; }
}

/* ---------- 认证表单（前台弹窗与后台登录页共用） ---------- */
.auth-form .tabs { margin-bottom: 16px; }
.auth-form .field { margin-bottom: 12px; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.auth-links button {
  border: 0; background: transparent; color: var(--brand);
  font-size: 12px; font-weight: 550; padding: 2px 0;
}
.auth-links button:hover { text-decoration: underline; }
.auth-tip {
  font-size: 12px; color: var(--text-2); background: var(--brand-soft);
  border: 1px solid #E0E1FA; border-radius: 9px;
  padding: 9px 12px; margin-bottom: 16px; line-height: 1.65;
}
.align-self-center { align-self: center; }

/* ---------- 独立后台登录页 ---------- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-page-side {
  position: relative; overflow: hidden; padding: 44px 56px;
  display: flex; flex-direction: column; color: #fff;
  background: linear-gradient(150deg, #3D36C4 0%, #6D48D9 55%, #9B5CE6 100%);
}
.auth-page-side::after {
  content: ''; position: absolute; right: -130px; bottom: -160px;
  width: 440px; height: 440px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.16), rgba(255,255,255,0) 70%);
}
.auth-page-side .brand { color: #fff; position: relative; z-index: 1; }
.auth-page-side .brand:hover { text-decoration: none; }
.auth-page-side .brand-mark { background: rgba(255,255,255,.22); }
.auth-page-intro { margin: auto 0; max-width: 430px; position: relative; z-index: 1; }
.auth-page-intro h1 { font-size: 38px; line-height: 1.3; letter-spacing: -.035em; margin: 18px 0 16px; }
.auth-page-intro p { color: rgba(255,255,255,.84); font-size: 14px; line-height: 1.9; }
.auth-page-intro ul { list-style: none; padding: 0; margin: 26px 0 0; }
.auth-page-intro li { position: relative; padding-left: 22px; color: rgba(255,255,255,.9); font-size: 13px; margin-bottom: 12px; }
.auth-page-intro li::before { content: '✓'; position: absolute; left: 0; font-weight: 700; color: #C9F5D8; }
.auth-back { color: rgba(255,255,255,.82); font-size: 13px; position: relative; z-index: 1; }
.auth-back:hover { color: #fff; }
.auth-page-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 32px; background: var(--bg); }
.auth-card {
  width: 100%; max-width: 400px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 18px;
  padding: 30px; box-shadow: var(--shadow);
}
.auth-card > h2 { font-size: 21px; margin-bottom: 5px; }
.auth-card > p { font-size: 12px; margin-bottom: 22px; }
.auth-page-foot { font-size: 11px; color: var(--muted); margin-top: 18px; }

@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-page-side { padding: 26px 28px; min-height: 200px; }
  .auth-page-intro { margin: 30px 0 10px; }
  .auth-page-intro h1 { font-size: 25px; margin: 12px 0 8px; }
  .auth-page-intro ul { display: none; }
  .auth-page-main { padding: 30px 16px 50px; }
}

/* ---------- 批量导入（Excel / CSV） ---------- */
.import-help {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 16px;
  font-size: 12px; color: var(--text-2); line-height: 1.8;
}
.import-help-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.import-issues {
  margin-top: 12px; padding: 10px 12px; border-radius: 8px;
  background: var(--warn-soft); color: var(--warn);
  font-size: 11px; line-height: 1.85; max-height: 140px; overflow: auto;
}
.import-issues div { white-space: pre-wrap; }

/* ---------- 刮削设置 ---------- */
.scrape-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px 16px; }
.scrape-check {
  padding: 9px 11px; border: 1px solid var(--border);
  border-radius: 9px; background: var(--surface-2);
}
.scrape-grid > .checkbox:not(.scrape-check) { padding: 4px 0; }
#scrapePreview .btn-sm { margin: 2px 3px 2px 0; }
#scrapePreview .input { min-width: 180px; }

/* ---------- 独立刮削板块（批量刮削工作台） ---------- */
.scrape-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px 22px; margin-bottom: 16px;
}
.scrape-step { font-size: 12px; font-weight: 700; color: var(--brand); letter-spacing: .04em; margin-bottom: 14px; }
.scrape-step .muted { font-weight: 500; font-size: 11px; float: right; }
.scrape-label { font-size: 11px; color: var(--muted); font-weight: 600; margin: 14px 0 8px; }
/* 批量刮削顶部：刮削覆盖情况 */
.scrape-coverage {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.cov-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--text-2); font-family: inherit;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 12px; cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.cov-pill:hover { border-color: var(--brand); color: var(--brand); }
.cov-pill.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.cov-pill.active b { color: #fff; }
.cov-pill.warn.active { background: var(--warn); border-color: var(--warn); color: #fff; }
.cov-pill.warn.active b { color: #fff; }
.cov-pill b { font-size: 13px; font-weight: 700; color: var(--text); }
.cov-pill.warn { background: var(--warn-soft); border-color: #F3E1BC; color: var(--warn); }
.cov-pill.warn b { color: var(--warn); }
.cov-hint { font-size: 12px; color: var(--muted); margin-left: auto; }
/* 批量刮削：当前生效配置摘要 */
.scrape-board-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 2px 0 12px; }
.chip-meta {
  font-size: 11px; font-weight: 600; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px 10px;
}
.meta-link { font-size: 12px; font-weight: 600; color: var(--brand); text-decoration: none; margin-left: auto; }
.meta-link:hover { text-decoration: underline; }
/* 刮削设置：四块配置统一一个板块，并列排布 */
.scrape-nav { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.scrape-nav-item {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text-2);
  font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.scrape-nav-item:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.scrape-nav-icon {
  flex: none; width: 20px; height: 20px; border-radius: 6px;
  display: grid; place-items: center; font-size: 12px;
  background: var(--brand-soft); color: var(--brand);
}
.scrape-unified { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.scrape-block { min-width: 0; scroll-margin-top: 90px; }
.scrape-block-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.scrape-block-icon {
  flex: none; width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center; font-size: 15px;
  background: var(--brand-soft); color: var(--brand);
}
.scrape-block-name { font-size: 15px; font-weight: 700; color: var(--text); }
.scrape-block-meta { margin-left: auto; font-size: 12px; color: var(--muted); text-align: right; }
/* 每块内部第一张卡片（状态卡/面板）与标题之间留点呼吸 */
.scrape-block > .cfg-status:first-child,
.scrape-block > .cfg-toolbar:first-child { margin-top: 0; }
.cfg-toolbar { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 12px; }
@media (max-width: 980px) {
  .scrape-unified { grid-template-columns: 1fr; gap: 18px; }
  .scrape-nav { gap: 8px; }
}
@media (max-width: 800px) {
  .cfg-tabs { display: grid; grid-template-columns: 1fr 1fr; }
  .cfg-tab { flex: none; }
}
/* 刮削设置：分组标题 */
.cfg-group { border-top: 1px solid var(--border); margin-top: 20px; padding-top: 18px; }
.cfg-group h3 { font-size: 14px; font-weight: 700; color: var(--text); margin: 0 0 4px; }
.cfg-group .panel-desc { font-size: 12px; color: var(--muted); margin: 0 0 14px; }
.cfg-group .scrape-grid { margin-bottom: 4px; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
.scrape-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 13px 15px; cursor: pointer;
}
.scrape-opt.on { background: #F5F6FF; border-color: #DCDDFA; }
.scrape-opt-text strong { display: block; font-size: 13px; }
.scrape-opt-text small { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.scrape-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch { flex: none; width: 38px; height: 21px; border-radius: 999px; background: #CBD2E0; position: relative; transition: background .18s; }
.switch::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.16); transition: transform .18s;
}
.scrape-opt.on .switch { background: var(--brand); }
.scrape-opt.on .switch::after { transform: translateX(17px); }
.scrape-preview { border: 1px solid var(--border); border-radius: 10px; margin: 12px 0; max-height: 480px; overflow-y: auto; }
.scrape-row {
  display: grid; grid-template-columns: 26px minmax(0,1fr) 20px minmax(0,1fr) auto;
  align-items: center; gap: 10px; padding: 9px 12px;
  border-bottom: 1px solid var(--border); font-size: 12px;
}
.scrape-row:last-child { border-bottom: 0; }
.scrape-row:nth-child(odd) { background: var(--surface-2); }
.scrape-idx { color: var(--muted); font-size: 11px; }
.scrape-from { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scrape-from .badge { margin-left: 6px; }
.scrape-arrow { color: var(--brand); font-weight: 700; }
.scrape-to { color: var(--brand); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scrape-row-actions { display: flex; align-items: center; gap: 6px; }
.scrape-run {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px; margin: 14px 0;
}
.scrape-run-head { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; flex-wrap: wrap; }
.scrape-run-head span { color: var(--muted); }
.scrape-bar { height: 7px; border-radius: 999px; background: #E6EAF4; overflow: hidden; margin: 10px 0; }
.scrape-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), #8B5CF6); transition: width .2s; }
.scrape-logs { margin: 8px 0 10px; max-height: 130px; overflow-y: auto; font-size: 11px; line-height: 1.9; }
.scrape-log.ok { color: var(--success); }
.scrape-log.bad { color: var(--danger); }
.scrape-log.warn { color: var(--warn); }
.scrape-run-head b { color: var(--success); }
.scrape-rich {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 5px;
  background: #E8F7EE; color: #12805C; font-size: 10px; font-weight: 700; white-space: nowrap;
}
.scrape-remote {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 5px;
  background: #EAF1FF; color: #2D5BD0; font-size: 10px; font-weight: 700; white-space: nowrap;
}
.scrape-note {
  margin-top: 14px; padding: 12px 14px; border-radius: 10px;
  background: #FFF8E8; border: 1px solid #F3E2B8; color: #7A5B15;
  font-size: 11.5px; line-height: 1.8;
}
.scrape-note strong { display: block; margin-bottom: 3px; }
.scrape-panel .field { display: block; margin-top: 12px; }
.scrape-panel .field > span { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 600; }
.scrape-panel textarea.input { min-height: 76px; resize: vertical; font-size: 12px; line-height: 1.7; }
@media (max-width: 700px) {
  .scrape-row { grid-template-columns: 22px 1fr 16px; }
  .scrape-to, .scrape-row-actions, .scrape-rich { display: none; }
}

/* ---------- 刮削设置 · 状态总览 / 诊断 / 折叠 ---------- */
.cfg-status {
  display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start;
  background: linear-gradient(120deg, #EEF4FF, #F7F4FF);
  border: 1px solid #DCE4FB; border-radius: 14px; padding: 16px 18px; margin-bottom: 16px;
}
.cfg-status.is-off { background: var(--surface-2); border-color: var(--border); }
.cfg-led {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-size: 19px; font-weight: 700; flex: none;
}
.cfg-status.is-off .cfg-led { background: #B7BFCE; }
.cfg-status-title { font-size: 15px; font-weight: 700; color: var(--text); }
.cfg-status-title .badge { margin-left: 6px; vertical-align: 2px; }
.cfg-status-sub { font-size: 12px; color: var(--text-2); margin-top: 5px; line-height: 1.65; }
.cfg-status-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.cfg-pill {
  font-size: 11px; padding: 3px 9px; border-radius: 999px; background: #fff;
  border: 1px solid #DCE4FB; color: #44507A;
}
.cfg-status.is-off .cfg-pill { border-color: var(--border); color: var(--muted); }

.cfg-main-switch { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 2px 0 4px; }
.cfg-main-switch .scrape-opt { flex: none; min-width: 118px; }
.cfg-lead { font-size: 13px; font-weight: 600; color: var(--text); }
.cfg-lead small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.7; }

.cfg-rate { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); max-width: 460px; }
.cfg-rate .field > span { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 600; }
.cfg-rate .admin-note { margin-top: 8px; }
.cfg-test { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.cfg-test-result { font-size: 12px; line-height: 1.6; }
.cfg-test-result.ok { color: var(--success); font-weight: 600; }
.cfg-test-result.bad { color: var(--danger); font-weight: 600; }

.cfg-adv { margin-top: 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.cfg-adv > summary {
  cursor: pointer; padding: 13px 16px; font-size: 13px; font-weight: 600; color: var(--text-2);
  list-style: none; display: flex; align-items: center; gap: 8px;
}
.cfg-adv > summary::-webkit-details-marker { display: none; }
.cfg-adv > summary::before { content: '\25B8'; color: var(--brand); font-size: 12px; transition: transform .18s; }
.cfg-adv[open] > summary::before { transform: rotate(90deg); }
.cfg-adv > summary small { font-weight: 400; color: var(--muted); font-size: 11px; margin-left: auto; }
.cfg-adv-body { padding: 2px 16px 18px; border-top: 1px solid var(--border); }
.cfg-adv-body h4 { font-size: 12px; margin: 18px 0 8px; color: var(--text-2); }
.cfg-adv-body .panel-desc { margin-bottom: 10px; }
.cfg-hint {
  font-size: 11px; color: var(--warn); background: var(--warn-soft);
  padding: 8px 11px; border-radius: 8px; line-height: 1.7; margin-bottom: 12px;
}

.scrape-statebar {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  border-radius: 10px; font-size: 12px; line-height: 1.6; margin-bottom: 14px; flex-wrap: wrap;
}
.scrape-statebar.ok { background: var(--success-soft); border: 1px solid #BFE8D2; color: #0E6E4E; }
.scrape-statebar.warn { background: var(--warn-soft); border: 1px solid #F3E2B8; color: #7A5B15; }
.scrape-statebar > .btn { margin-left: auto; flex: none; }
.scrape-statebar .scrape-remote { background: #fff; }
@media (max-width: 700px) { .cfg-main-switch { flex-direction: column; align-items: stretch; } }

/* ---------- 接口配置 ---------- */
.api-list { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.api-row {
  display: grid; grid-template-columns: minmax(200px, .95fr) minmax(0, 1.35fr);
  gap: 14px 20px; padding: 14px 16px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--surface-2); align-items: start;
}
.api-row-offline { background: linear-gradient(120deg, #F1F8F3, #F7FBFF); border-color: #D8EBDD; }
.api-name { font-size: 13px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.api-name .badge { font-weight: 500; }
.api-use { font-size: 11.5px; color: var(--brand); margin-top: 3px; }
.api-desc { font-size: 11.5px; color: var(--muted); line-height: 1.7; margin-top: 5px; }
.api-desc code, .api-path { font-family: ui-monospace, Consolas, monospace; font-size: 11px; background: #fff; border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; }
.api-fields { min-width: 0; }
.api-url { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.api-path { display: inline-block; color: var(--text-2); }
.api-meta-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.api-on { font-size: 12px; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.api-on.is-static { color: var(--muted); cursor: default; }
.api-on input { accent-color: var(--brand); }
.api-state { font-size: 11.5px; color: var(--muted); }
.api-state.ok { color: var(--success); font-weight: 600; }
.api-state.bad { color: var(--danger); font-weight: 600; }
.api-state.warn { color: var(--warn); font-weight: 600; }
.api-key-wrap { display: flex; gap: 6px; align-items: center; }
.api-key-wrap .input { flex: 1; min-width: 0; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.api-actions-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.api-daily { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.api-daily-switch { font-size: 13px; }
.api-daily-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 200px)); gap: 12px; margin-top: 12px; }
.api-daily .admin-note { margin-top: 10px; }
.api-steps { margin: 0 0 14px; padding-left: 20px; font-size: 12.5px; line-height: 1.9; color: var(--text-2); }
.api-steps code { font-family: ui-monospace, Consolas, monospace; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
@media (max-width: 780px) {
  .api-row { grid-template-columns: 1fr; }
  .api-daily-fields { grid-template-columns: 1fr; }
}

/* ---------- 命名规则板块 ---------- */
.naming-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px;
}
.naming-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.naming-panel > .admin-note { margin-bottom: 16px; }
.naming-card { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
.naming-card > summary {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  cursor: pointer; list-style: none; background: var(--surface-2); font-size: 13px;
}
.naming-card > summary::-webkit-details-marker { display: none; }
.naming-card > summary::after { content: '⌄'; margin-left: auto; color: var(--muted); font-size: 16px; }
.naming-card[open] > summary::after { content: '⌃'; }
.naming-icon { font-size: 16px; }
.naming-summary {
  color: var(--muted); font-size: 11px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; max-width: 62%;
}
.naming-body { padding: 16px; border-top: 1px solid var(--border); background: #FAFBFF; }
.naming-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 10px; }
.naming-frag {
  display: grid; grid-template-columns: 44px minmax(0,1fr) 22px auto; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 9px; padding: 8px 10px; opacity: .62;
}
.naming-frag.on { opacity: 1; border-color: #DCDDFA; background: #fff; }
.naming-frag-label { font-size: 11px; color: var(--muted); }
.naming-frag .input { padding: 6px 9px; font-size: 12px; }
.naming-pencil {
  border: 0; background: transparent; color: var(--muted);
  font-size: 13px; padding: 2px 4px; border-radius: 5px;
}
.naming-pencil:hover { background: var(--surface-2); color: var(--brand); }
.naming-switch { display: inline-flex; cursor: pointer; }
.naming-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.naming-frag .switch { width: 34px; height: 19px; }
.naming-frag .switch::after { width: 15px; height: 15px; }
.naming-frag.on .switch { background: var(--brand); }
.naming-frag.on .switch::after { transform: translateX(15px); }
.naming-insert {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin: 14px 0 10px; font-size: 11px; color: var(--muted);
}
.naming-insert .chip { padding: 3px 9px; font-size: 11px; }
.naming-preview {
  background: var(--brand-soft); border: 1px solid #E0E1FA;
  border-radius: 9px; padding: 9px 12px; font-size: 12px; color: var(--text-2);
}
.naming-preview strong { color: var(--brand); margin-left: 8px; }
.naming-foot { margin-top: 12px; text-align: right; }

/* ---------- AI 清洗配置 ---------- */
.ai-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px;
}
.ai-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.ai-panel > .admin-note { margin-bottom: 14px; }
.ai-notice {
  background: var(--brand-soft); border: 1px solid #E0E1FA;
  border-radius: 10px; padding: 12px 14px; margin-bottom: 18px;
  font-size: 12px; color: var(--text-2);
}
.ai-notice strong { color: var(--brand); display: block; margin-bottom: 4px; }
.ai-notice p { line-height: 1.75; }
.ai-section-title {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 12px; font-weight: 700; color: var(--text-2);
  margin: 20px 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.ai-model-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.ai-model-card {
  display: flex; flex-direction: column; gap: 4px; text-align: left; min-height: 74px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 12px;
}
.ai-model-card:hover { border-color: var(--brand); }
.ai-model-card.active { background: #F5F6FF; border-color: var(--brand); box-shadow: 0 0 0 2px rgba(79,70,229,.12); }
.ai-model-card.disabled { opacity: .5; cursor: not-allowed; }
.ai-model-card strong { font-size: 12px; }
.ai-model-card small { font-size: 10px; color: var(--muted); word-break: break-all; }
.ai-segment {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 4px; max-width: 520px;
}
.ai-seg { border: 0; background: transparent; color: var(--muted); border-radius: 7px; padding: 7px; font-size: 12px; font-weight: 600; }
.ai-seg.active { background: var(--surface); color: var(--brand); box-shadow: 0 1px 4px rgba(28,39,74,.08); }
.ai-test { display: flex; gap: 10px; flex-wrap: wrap; }
.ai-test .input { flex: 1; min-width: 260px; }
.ai-test-out {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 9px; padding: 10px 12px; margin-top: 10px;
  font-size: 12px; line-height: 1.9;
}
.ai-test-out strong { color: var(--brand); }

/* ---------- AI 主图：未刮削资源手动生成封面 ---------- */
.btn-ai {
  border-color: transparent; color: #fff;
  background: linear-gradient(135deg, #6D5DF6, #9B5CF6);
  box-shadow: 0 2px 8px rgba(109, 93, 246, .26);
}
.btn-ai:hover { background: linear-gradient(135deg, #5B4BE8, #8B4CE8); color: #fff; }
.btn-ai:disabled { opacity: .55; box-shadow: none; }

.ac-wrap { display: grid; grid-template-columns: 226px minmax(0, 1fr); gap: 20px; align-items: start; }
.ac-preview {
  position: relative; width: 100%; aspect-ratio: 2 / 3; overflow: hidden;
  background: linear-gradient(160deg, #F2F3FB, #E6E8F4);
  border: 1px solid var(--border); border-radius: 12px;
  display: grid; place-items: center;
}
.ac-preview.square { aspect-ratio: 1 / 1; }
.ac-preview.wide { aspect-ratio: 16 / 9; }
.ac-preview > svg { display: block; width: 100%; height: 100%; }
.ac-empty { text-align: center; font-size: 11px; color: var(--muted); line-height: 1.8; padding: 14px; }
.ac-empty-icon { display: block; font-size: 22px; margin-bottom: 8px; opacity: .8; }
.ac-fail { color: var(--danger); }
.ac-loading { text-align: center; font-size: 12px; color: var(--text-2); line-height: 1.9; }
.ac-spin {
  display: inline-block; width: 18px; height: 18px; margin-bottom: 10px; border-radius: 50%;
  border: 2px solid var(--brand-soft); border-top-color: var(--brand); animation: acspin .8s linear infinite;
}
@keyframes acspin { to { transform: rotate(360deg); } }
.ac-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; font-size: 11px; color: var(--muted); min-height: 20px; }
.ac-right { min-width: 0; }
.ac-group { margin-top: 14px; }
.ac-label { display: block; font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: 7px; }
.ac-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ac-chip {
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2);
  border-radius: 999px; padding: 6px 13px; font-size: 12px; font-weight: 600;
  transition: background .15s, border-color .15s, color .15s;
}
.ac-chip:hover { border-color: var(--brand); color: var(--brand); }
.ac-chip.active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.ac-right textarea { min-height: 78px; }
@media (max-width: 640px) {
  .ac-wrap { grid-template-columns: 1fr; }
  .ac-preview { max-width: 220px; margin: 0 auto; }
}

/* ================= 会员（前台专区 + 后台管理） ================= */
.badge.gold { background: linear-gradient(135deg, #FFF1CF, #FFE1A8); color: #8A5B00; box-shadow: inset 0 0 0 1px #F2D79B; }
.avatar.is-member { background: linear-gradient(135deg, #FFD98A, #E8A93D); color: #4A2E00; }

/* 首页会员专区 */
.member-zone {
  margin: 2px 0 22px; padding: 20px 22px; border-radius: 18px;
  background: linear-gradient(120deg, #FFF9EC 0%, #FFF4F8 55%, #F4F2FF 100%);
  border: 1px solid #F3E4C8;
}
.mz-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.mz-copy h2 { font-size: 17px; margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.mz-copy h2::before { content: '👑'; font-size: 16px; }
.mz-copy p { margin: 0; font-size: 12px; color: var(--text-2); }
.mz-state { display: flex; align-items: center; gap: 8px; flex: none; }
.mz-exp { font-size: 11px; color: var(--muted); }
.mz-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.mz-card {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid #EFE6D6; border-radius: 12px;
  padding: 12px 13px; font-family: inherit; color: var(--text); cursor: pointer;
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.mz-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #E4D3B4; }
.mz-card.active { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, .08); }
.mz-icon { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: #FFF4DE; font-size: 17px; }
.mz-card.is-locked .mz-icon { background: #F3F5F9; filter: grayscale(1); }
.mz-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.mz-text strong { font-size: 13px; font-weight: 650; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mz-text small { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mz-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
.mz-count { font-size: 11px; color: var(--muted); }
.mz-lock { font-size: 11px; font-weight: 600; color: var(--brand); }
.mz-card.is-locked .mz-lock { color: var(--warn); }

/* 当前所在板块提示条 */
.member-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--surface); border: 1px dashed #E4D3B4; border-radius: 12px;
  padding: 10px 14px; margin-bottom: 14px;
}
.mb-title { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.mb-icon { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: #FFF4DE; }
.mb-actions { display: flex; gap: 8px; }

/* 上锁的卡片 / 详情 */
.card-locked .cover img { filter: grayscale(.3) blur(1.2px); }
.cover-lock {
  position: absolute; right: 12px; bottom: 12px;
  background: rgba(24, 26, 38, .74); color: #FFE7A8; border: 1px solid rgba(255, 255, 255, .16);
}
.lock-panel {
  border: 1px dashed #E4D3B4; background: #FFFBF2; border-radius: 12px;
  padding: 18px; text-align: center; margin-top: 14px;
}
.lock-emoji { font-size: 26px; margin-bottom: 6px; }
.lock-panel h4 { font-size: 13px; margin: 0 0 6px; }
.lock-panel p { font-size: 12px; color: var(--muted); margin: 0; line-height: 1.7; }

/* 开通会员弹窗 */
.member-modal { max-width: 460px; }
.mm-ok { background: var(--success-soft); color: var(--success); border-radius: 10px; padding: 10px 14px; font-size: 12px; margin-bottom: 14px; }
.mm-sec { margin-bottom: 14px; }
.mm-sec h4 { font-size: 12px; font-weight: 700; color: var(--text); margin: 0 0 8px; }
.mm-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.mm-list li { display: flex; align-items: center; gap: 8px; font-size: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; }
.mm-ico { font-size: 15px; }
.mm-name { flex: 1; font-weight: 600; color: var(--text-2); }
.mm-lv { font-size: 11px; color: var(--muted); }
.mm-text { font-size: 12px; color: var(--text-2); margin: 0; line-height: 1.7; }
.mm-price { font-size: 13px; font-weight: 700; color: #8A5B00; background: linear-gradient(135deg, #FFF1CF, #FFE6B6); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; }

/* 后台：会员管理 */
.m-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.m-stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.m-stat span { font-size: 11px; color: var(--muted); font-weight: 600; }
.m-stat strong { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.m-stat strong.warn { color: var(--warn); }
.m-stat small { font-size: 11px; color: var(--muted); }
.m-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.m-search { max-width: 280px; }
.m-user { display: flex; align-items: center; gap: 9px; }
.m-user small { display: block; font-size: 10px; color: var(--muted); font-family: ui-monospace, Consolas, monospace; }
.m-note { max-width: 190px; color: var(--muted); font-size: 12px; }
.danger-text { color: var(--danger); }
.danger-text:hover { background: var(--danger-soft); color: var(--danger); }

/* 后台：会员板块 */
.blk-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.blk-list { display: flex; flex-direction: column; gap: 10px; }
.blk-row { display: flex; align-items: center; gap: 14px; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; background: var(--surface-2); }
.blk-row.is-off { opacity: .62; }
.blk-ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: #FFF4DE; font-size: 19px; flex: none; }
.blk-main { flex: 1; min-width: 0; }
.blk-title { font-size: 13px; font-weight: 650; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.blk-desc { font-size: 12px; color: var(--muted); margin: 3px 0 0; }
.blk-rule { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.blk-cat {
  font-size: 11px; font-weight: 550; color: var(--text-2);
  background: #F3F5FA; border: 1px solid var(--border);
  border-radius: 6px; padding: 2px 8px;
}
.blk-cat.gray { color: var(--muted); background: var(--surface); }
.blk-cat.all { color: #1D5FBF; background: #EAF3FF; border-color: #CFE3FF; }
.blk-cat.none { color: #9A6B12; background: #FFF7E6; border-color: #F5DFB2; }
.blk-cat.bound { color: #8A5B12; background: #FFFCF3; border-color: #F0DFB8; }
.blk-cat i { font-style: normal; font-size: 10px; margin-left: 5px; opacity: .75; }

/* ================= 分类管理：行式列表 + 绑定会员 ================= */
.cat-head {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding: 0 2px 12px; margin-bottom: 12px; border-bottom: 1px solid var(--border);
}
.cat-head > span:first-child { font-size: 13px; font-weight: 650; color: var(--text); }
.cat-head b { color: var(--brand); margin-left: 3px; }
.cat-head-note { font-size: 12px; color: var(--muted); margin-left: auto; }
.cat-list { display: flex; flex-direction: column; gap: 10px; }
.cat-row {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 16px; background: var(--surface-2);
}
.cat-row.is-bound { border-color: #F0DFB8; background: #FFFCF3; }
.cat-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.cat-main { flex: 1; min-width: 0; }
.cat-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 650; }
.cat-count {
  font-size: 11px; font-weight: 550; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 1px 9px;
}
.cat-sub { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11px; color: var(--muted); margin-top: 4px; }
.cat-plan { color: #8A5B12; }
.cat-plan.none { color: var(--muted); opacity: .7; }

/* 分类资源：手动勾选配置 */
.cr-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.cr-toolbar .input { flex: 1 1 180px; min-width: 0; }
.cr-sec { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 12px; }
.cr-sec-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.cr-sec-head strong { font-size: 12px; }
.cr-sec-head span { font-size: 11px; color: var(--muted); }
.cr-list { max-height: 180px; overflow: auto; padding: 4px 0; }
.cr-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 12px;
  font-size: 12px; cursor: pointer;
}
.cr-item:hover { background: var(--surface-2); }
.cr-item input { flex: none; accent-color: var(--brand); margin: 0; }
.cr-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-cat {
  flex: none; font-size: 10px; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 5px; padding: 1px 6px;
}
.cr-empty { padding: 18px 12px; text-align: center; font-size: 12px; color: var(--muted); }
.cat-ops { display: flex; align-items: center; gap: 8px; flex: none; }
.cat-bind {
  border: 1px dashed var(--border); background: transparent; color: var(--text-2);
  border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 600;
  font-family: inherit; cursor: pointer; transition: .16s;
}
.cat-bind:hover { border-style: solid; border-color: var(--brand); color: var(--brand); }
.cat-bind.is-on { border-style: solid; background: #FFF4DE; border-color: #F0DFB8; color: #8A5B12; }
.cat-bind.is-svip { background: #F3ECFE; border-color: #DFCFF8; color: #6A3FB8; }
.cat-link {
  border: none; background: none; color: var(--brand);
  font-size: 12px; font-weight: 600; font-family: inherit; cursor: pointer; padding: 5px 4px;
}
.cat-link:hover { text-decoration: underline; }
.cat-icon {
  width: 28px; height: 28px; border: 1px solid var(--border); background: var(--surface);
  border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--text-2); line-height: 1;
}
.cat-icon:hover { border-color: var(--brand); color: var(--brand); }
.cat-icon.danger:hover { border-color: #F3C6C6; background: #FFF5F5; color: #D14343; }

/* 绑定会员弹窗的选项卡 */
.lv-cards { display: flex; flex-direction: column; gap: 8px; }
.lv-card {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; background: var(--surface); cursor: pointer; transition: .16s;
}
.lv-card input { width: 15px; height: 15px; margin: 0; accent-color: var(--brand); }
.lv-card-name { font-size: 13px; font-weight: 650; }
.lv-card-desc { font-size: 12px; color: var(--muted); margin-left: auto; }
.lv-card.is-on { border-color: var(--brand); }
.lv-card.is-on .lv-card-name { color: var(--brand); }
.blk-count { flex: none; text-align: center; min-width: 58px; }
.blk-count strong { display: block; font-size: 18px; }
.blk-count span { font-size: 10px; color: var(--muted); }
.blk-ops { display: flex; align-items: center; gap: 6px; flex: none; }
.switch-wrap { display: inline-flex; align-items: center; cursor: pointer; position: relative; }
.switch-wrap input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-wrap input:checked + .switch { background: var(--brand); }
.switch-wrap input:checked + .switch::after { transform: translateX(17px); }

/* 板块表单：分类 / 等级 勾选胶囊 */
.pick-group { display: flex; flex-wrap: wrap; gap: 8px; }
.pick-group.is-dim { opacity: .42; pointer-events: none; }
.pick-pill { position: relative; display: inline-flex; }
.pick-pill input { position: absolute; opacity: 0; width: 0; height: 0; }
.pick-pill span {
  display: inline-flex; align-items: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  border-radius: 999px; padding: 7px 14px; font-size: 12px; font-weight: 550;
  cursor: pointer; transition: background .16s, border-color .16s, color .16s;
}
.pick-pill span:hover { border-color: var(--brand); color: var(--brand); }
.pick-pill input:checked + span {
  background: var(--brand); border-color: var(--brand); color: #fff;
  box-shadow: 0 2px 8px rgba(79, 70, 229, .22);
}
.pick-pill input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.pick-pill span .pick-tag { font-style: normal; font-size: 10px; font-weight: 600; margin-left: 5px; opacity: .6; }
.pick-pill input:checked + span .pick-tag { opacity: .95; }
.pick-empty { font-size: 12px; color: var(--muted); }

.adv-box {
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface-2); padding: 0 14px; margin: 2px 0 16px;
}
.adv-box > summary {
  cursor: pointer; list-style: none; padding: 11px 0;
  font-size: 12px; font-weight: 600; color: var(--text-2);
  display: flex; align-items: center; justify-content: space-between;
}
.adv-box > summary::-webkit-details-marker { display: none; }
.adv-box > summary::after { content: '⌄'; color: var(--muted); font-size: 13px; transition: transform .18s; }
.adv-box[open] > summary::after { transform: rotate(180deg); }
.adv-box .adv-body { padding: 2px 0 14px; }
.adv-box .field:last-of-type { margin-bottom: 8px; }

@media (max-width: 900px) {
  .m-stats { grid-template-columns: 1fr 1fr; }
  .blk-row { flex-wrap: wrap; align-items: flex-start; gap: 10px 12px; }
  .blk-ico { width: 34px; height: 34px; border-radius: 9px; font-size: 16px; }
  .blk-main { flex: 1 1 calc(100% - 46px); }
  .blk-count { order: 5; min-width: 0; display: flex; align-items: baseline; gap: 4px; text-align: left; }
  .blk-count strong { font-size: 15px; }
  .blk-ops { order: 6; width: auto; margin-left: auto; }
  .cat-row { flex-wrap: wrap; align-items: flex-start; }
  .cat-main { flex: 1 1 calc(100% - 26px); }
  .cat-ops { width: 100%; justify-content: flex-end; }
  .cat-head-note { margin-left: 0; flex: 1 0 100%; }
  .mz-head { flex-wrap: wrap; }
}

/* ================= 会员：开通弹窗套餐卡片 ================= */
.mm-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 8px; }
.mm-plan {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 10px; padding: 11px 12px; cursor: pointer;
  font-family: inherit; text-align: left; transition: .16s;
}
.mm-plan:hover { border-color: var(--brand); }
.mm-plan.active { border-color: var(--brand); background: #FFF6ED; box-shadow: inset 0 0 0 1px var(--brand); }
.mm-plan-name { font-size: 13px; font-weight: 650; }
.mm-plan-price { font-size: 17px; font-weight: 750; color: var(--brand); }
.mm-plan-meta { font-size: 11px; color: var(--muted); line-height: 1.35; }
.mm-plan-scope { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-price small { font-size: 12px; font-weight: 500; color: var(--muted); }
.mm-apply { margin-top: 14px; text-align: center; }
.mm-apply .admin-note { margin-top: 8px; font-size: 11px; }

/* ================= 后台：板块会员管理（三 Tab） ================= */
.hub { width: 100%; }
/* 后台在宽屏上撑满，前台仍保持 1220 居中 */
body.admin-body .topbar-inner { max-width: none; }
body.admin-body .global-alert { max-width: none; margin: 16px 32px 0; }
.hub-crumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted); margin-bottom: 16px;
}
.hub-crumb i { font-style: normal; opacity: .6; }
.hub-crumb .btn { margin-left: auto; }
.hub-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.hub-ico {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  display: grid; place-items: center; font-size: 21px;
  background: #FFF1E3; color: #B45309;
}
.hub-head h2 { margin: 0; font-size: 19px; font-weight: 700; }
.hub-head p { margin: 3px 0 0; }
.hub-tabs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 5px; margin-bottom: 16px;
}
.hub-tab {
  border: 0; background: transparent; color: var(--text-2);
  font-family: inherit; font-size: 13px; font-weight: 600;
  padding: 10px 8px; border-radius: 9px; cursor: pointer; transition: .16s;
}
.hub-tab:hover { color: var(--brand); }
.hub-tab.active { background: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .1); }
.hub-panel { padding: 0; overflow: hidden; }
.hub-check {
  border: 1px solid #F0DFB8; background: #FFFCF3; border-radius: 12px;
  padding: 14px 18px; margin-bottom: 14px;
}
.hub-check.ok { border-color: #CBEAD3; background: #F2FBF5; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hub-check.ok strong { color: #15803D; font-size: 13px; }
.hub-check.ok span { font-size: 12px; color: var(--text-2); }
.hub-check-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.hub-check-head strong { font-size: 13px; color: #8A5B12; }
.hub-check ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.hub-check li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface); border: 1px solid #F0DFB8; border-radius: 8px; padding: 8px 12px;
}
.hub-check li b { display: block; font-size: 12px; font-weight: 650; }
.hub-check li small { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.hub-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 16px 20px;
}
.hub-bar > span { font-size: 13px; color: var(--text-2); }
.hub-bar b { color: var(--brand); font-size: 15px; }
.hub-bar-ops { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hub-table { width: 100%; border-collapse: collapse; }
.hub-table th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--muted);
  padding: 11px 20px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  background: var(--surface-2); white-space: nowrap;
}
.hub-table td { padding: 13px 20px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
.hub-table tr:last-child td { border-bottom: 0; }
.hub-key {
  font-size: 12px; color: var(--muted); background: var(--surface-2);
  padding: 2px 7px; border-radius: 5px;
}
.hub-price { font-weight: 700; color: var(--text); }
.hub-chip {
  display: inline-block; font-size: 11px; font-weight: 550; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 2px 8px; margin: 1px 4px 1px 0;
}
.hub-chip.cat { color: #8A5B12; background: #FFFCF3; border-color: #F0DFB8; }
.hub-chip.clickable { font-family: inherit; cursor: pointer; }
.hub-chip.clickable:hover { border-color: var(--brand); color: var(--brand); }
.mm-list li.mm-off { opacity: .48; }
.mm-list li.mm-off .mm-ico { filter: grayscale(1); }
.hub-state {
  border: 1px solid transparent; border-radius: 6px; padding: 3px 10px;
  font-size: 11px; font-weight: 600; font-family: inherit; cursor: pointer;
}
.hub-state.on { color: #15803D; background: #EAF7EE; border-color: #CBEAD3; }
.hub-state.off { color: var(--muted); background: var(--surface-2); border-color: var(--border); }
.hub-actions { white-space: nowrap; text-align: right; }
.hub-actions > * + * { margin-left: 6px; }
.hub-sub { display: block; font-size: 11px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.hub-note {
  margin: 0; padding: 12px 20px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--muted); background: var(--surface-2);
}
.hub-more { padding: 0; overflow: hidden; margin-top: 14px; }
.hub-more-sum {
  list-style: none; cursor: pointer; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.hub-more-sum::-webkit-details-marker { display: none; }
.hub-more-sum strong { font-size: 13px; }
.hub-more-sum small { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.hub-more-caret { font-size: 12px; color: var(--muted); }
.hub-more[open] .hub-more-caret { color: var(--brand); }
.hub-more[open] .hub-more-sum { border-bottom: 1px solid var(--border); }
.hub-more-body { padding: 16px 20px 20px; }

/* 会员板块总开关卡片 */
.master-switch {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 18px; margin-bottom: 16px;
  background: var(--surface);
}
.master-switch.is-on { border-color: var(--brand-line); background: var(--brand-soft); }
.master-switch.is-off { border-color: var(--border-strong); background: var(--surface-2); }
.ms-ico {
  width: 46px; height: 46px; border-radius: 12px; flex: none;
  display: grid; place-items: center; font-size: 22px;
  background: var(--surface); border: 1px solid var(--border);
}
.ms-body { flex: 1 1 260px; min-width: 0; }
.ms-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ms-head strong { font-size: 15px; font-weight: 700; color: var(--text); }
.ms-state {
  font-size: 11px; font-weight: 700; line-height: 1; padding: 4px 9px;
  border-radius: 999px; border: 1px solid transparent;
}
.ms-state.on { color: #047857; background: #e7f4ee; border-color: #a7d9c4; }
.ms-state.off { color: var(--muted); background: var(--surface); border-color: var(--border-strong); }
.ms-desc { margin: 5px 0 0; font-size: 12px; line-height: 1.55; color: var(--text-2); }
.side-tag.tag-off { color: var(--danger); background: var(--danger-soft); border-color: var(--danger); }

/* 后台「关于」板块 */
.about-panel { padding: 0; overflow: hidden; }
.about-card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 34px 20px 28px; border-bottom: 1px solid var(--border);
}
.about-logo {
  width: 64px; height: 64px; border-radius: 18px; margin-bottom: 14px;
  display: grid; place-items: center;
  font-size: 30px; font-weight: 800; color: #fff;
  background: var(--brand); box-shadow: 0 6px 18px rgba(4, 120, 87, .25);
}
.about-card h2 { margin: 0; font-size: 20px; }
.about-sub { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.about-contact { padding: 24px 26px 28px; }
.about-contact h3 { margin: 0 0 10px; font-size: 14px; color: var(--text); }
.about-contact p {
  margin: 0; padding: 14px 16px; font-size: 14px; line-height: 1.8;
  color: var(--text); background: var(--brand-soft);
  border: 1px solid var(--brand-line); border-radius: 10px;
  word-break: break-all;
}

@media (max-width: 700px) {
  .hub-tab { font-size: 12px; padding: 9px 4px; }
  .hub-table th, .hub-table td { padding: 11px 12px; }
  .hub-bar { padding: 14px; }
  .hub-more-sum, .hub-more-body { padding-left: 14px; padding-right: 14px; }
}

.pay-panel { padding: 0; overflow: hidden; }
.pay-sum {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 16px 20px; cursor: pointer; list-style: none;
}
.pay-sum::-webkit-details-marker { display: none; }
.pay-sum-title { font-size: 14px; font-weight: 650; color: var(--text); }
.pay-sum-hint { font-size: 12px; color: var(--muted); flex: 1; min-width: 0; }
.pay-caret { color: var(--muted); font-size: 12px; transition: transform .18s; }
.pay-panel[open] .pay-caret { transform: rotate(180deg); }
.pay-panel > form { padding: 0 20px 18px; }
.pay-panel[open] .pay-sum { border-bottom: 1px solid var(--border); }
.pay-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 16px 0 6px; }
.pay-head h3 { margin: 0; font-size: 14px; }
.pay-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.pay-panel .panel-desc { margin: 0 0 14px; }

.qr-edit { display: flex; gap: 14px; align-items: flex-start; }
.qr-preview {
  width: 112px; height: 112px; flex: none; border-radius: 10px;
  border: 1px dashed #D8DEE9; background: var(--surface-2);
  display: grid; place-items: center; overflow: hidden;
  font-size: 11px; color: var(--muted); text-align: center; line-height: 1.5;
}
.qr-preview img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; background: #fff; display: block; }
.qr-ops { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.qr-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.qr-src { font-weight: 600; color: var(--text-2); margin-right: 6px; }
.cfg-tip { font-size: 12px; color: var(--muted); margin: 4px 0 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* 前台：开通方式 */
.mm-pay {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px;
}
.mm-pay-linkonly { align-items: stretch; }
.mm-qr {
  width: 132px; height: 132px; flex: none; border-radius: 10px; overflow: hidden;
  background: #fff; border: 1px solid var(--border); padding: 5px; display: block;
}
.mm-qr img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; margin: 0 auto; }
.mm-pay-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.mm-pay-side .mm-text { margin: 0; }
.mm-pay-btn { align-self: flex-start; }

@media (max-width: 560px) {
  .qr-edit { flex-direction: column; }
  .qr-preview { width: 140px; height: 140px; }
  .mm-pay { flex-wrap: wrap; }
  .mm-qr { width: 128px; height: 128px; }
  .mm-pay-side { flex: 1 1 180px; }
}

@media (max-width: 700px) {
  .pay-sum { align-items: flex-start; }
  .pay-sum-hint { flex: 1 0 100%; order: 3; }
  .pay-caret { order: 2; margin-left: auto; line-height: 18px; }
}

/* ================= 大屏（PC）精修：更舒展的节奏与留白 ================= */
@media (min-width: 1100px) {
  .hero { padding: 56px 0 34px; }
  .hero-inner { padding: 48px 52px; }
  .hero h1 { font-size: 34px; }
  .hero p { font-size: 15px; }
  .hero-stats { gap: 42px; margin-top: 30px; }
  .grid { gap: 20px; }
  .card-body { padding: 17px 18px 18px; }
  .card-title { font-size: 16px; }
  .toolbar { padding: 20px 0 18px; }
}

/* ================= 站点设置：图片字段 / 公告弹窗 / 顶部外链 ================= */
.panel h3.sub {
  font-size: 13px; font-weight: 700; letter-spacing: .02em; color: var(--text);
  margin: 24px 0 12px; padding-top: 16px; border-top: 1px dashed var(--border);
}
.img-field { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.img-field .img-pick { flex: 0 0 auto; max-width: 240px; font-size: 12px; }
.img-field .input { flex: 1 1 260px; min-width: 0; }
.img-prev-wrap { margin-top: 10px; }
.img-prev-wrap .img-prev {
  display: block; max-height: 120px; max-width: 100%;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2);
}

/* 首页公告弹窗 */
.announce-mask {
  position: fixed; inset: 0; z-index: 70;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(15, 18, 32, .55); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  animation: announceFade .18s ease-out;
}
.announce-card {
  position: relative; width: min(520px, 100%); max-height: 86vh; overflow: auto;
  background: var(--surface); border-radius: 16px; padding: 22px;
  box-shadow: 0 24px 60px rgba(15, 18, 32, .28); text-align: center;
}
.announce-x {
  position: absolute; right: 10px; top: 8px; width: 32px; height: 32px;
  border: none; background: transparent; color: var(--muted);
  font-size: 22px; line-height: 1; cursor: pointer; border-radius: 8px;
}
.announce-x:hover { background: var(--surface-2); color: var(--text); }
.announce-img {
  display: block; width: 100%; height: auto; max-height: 52vh;
  object-fit: contain; border-radius: 10px; margin: 0 auto 14px;
}
.announce-text {
  color: var(--text-2); font-size: 14px; line-height: 1.8;
  text-align: left; word-break: break-word;
}
.announce-ok { margin-top: 18px; width: 100%; }
@keyframes announceFade { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 640px) {
  /* 顶部外链在手机端单独占一行，可横向滑动 */
  .top-ext-links {
    order: 4; flex: 1 0 100%; max-width: none; margin-left: 0;
    gap: 14px; padding-bottom: 2px;
  }
  .top-ext-links a { font-size: 12px; }
  .brand-logo { height: 26px; max-width: 120px; }
  .announce-card { padding: 18px; border-radius: 14px; }
  .announce-img { max-height: 44vh; }
  .img-field .img-pick { max-width: 100%; }
}

/* ================= 文本添加：自动识别 ================= */
.ta-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 6px; }
.ta-panel {
  margin: 10px 0 18px; border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; background: var(--surface-2);
}
.ta-head {
  padding: 10px 14px; font-size: 12px; color: var(--text-2);
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.ta-list { max-height: 320px; overflow: auto; }
.ta-row { padding: 12px 14px; background: var(--surface); border-bottom: 1px solid var(--border); }
.ta-row:last-child { border-bottom: 0; }
.ta-row-top { display: flex; align-items: center; gap: 8px; }
.ta-row-top .ta-title { flex: 1; min-width: 0; font-weight: 600; }
.ta-row-meta { display: grid; grid-template-columns: 148px minmax(0, 1fr) auto; gap: 8px; align-items: center; margin-top: 8px; }
.ta-row-meta .ta-cat, .ta-row-meta .ta-tags { font-size: 12px; padding: 7px 10px; }
.ta-flags { display: flex; gap: 6px; white-space: nowrap; }
.ta-summary {
  margin-top: 8px; font-size: 12px; color: var(--muted); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

@media (max-width: 640px) {
  .ta-row-meta { grid-template-columns: minmax(0, 1fr); }
  .ta-flags { justify-content: flex-start; }
  .ta-list { max-height: none; }
}

/* ---------- 顶部「搭建同款点我」与联系方式弹窗 ---------- */
.top-contact-btn {
  border: 0; background: transparent; padding: 0; cursor: pointer;
  color: var(--brand); font-weight: 650; font-size: 14px; white-space: nowrap;
  font-family: inherit;
}
.top-contact-btn:hover { text-decoration: underline; }
.contact-pop-backdrop {
  position: fixed; inset: 0; z-index: 90; padding: 20px;
  background: rgba(20, 28, 45, .45);
  display: flex; align-items: center; justify-content: center;
}
.contact-pop {
  position: relative; width: 100%; max-width: 460px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 26px 28px 24px;
  box-shadow: var(--shadow-lg); animation: contactPop .18s ease-out;
}
@keyframes contactPop {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.contact-pop h3 { font-size: 16px; margin-bottom: 12px; color: var(--text); }
.contact-pop p { color: var(--text-2); font-size: 14px; line-height: 1.95; word-break: break-all; }
.contact-pop .modal-close { position: absolute; top: 12px; right: 14px; }
@media (max-width: 640px) {
  .top-contact-btn { font-size: 13px; }
  .contact-pop { padding: 22px 20px; }
}
