/* ===== 客户案例 · 共享设计系统 ===== */
:root {
  /* 色板：深靛蓝主色 + 中性灰 + 增值琥珀色 */
  --bg: #f4f5f9;
  --surface: #ffffff;
  --surface-2: #fafbfd;
  --border: #e6e8f0;
  --border-strong: #d4d7e3;
  --text: #1a2233;
  --text-soft: #5a6478;
  --text-faint: #8b93a7;
  --primary: #4f46e5;
  --primary-soft: #eef0fe;
  --primary-strong: #3b34c9;
  --amber: #f59e0b;
  --amber-soft: #fef6e7;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --ok: #16a34a;
  --shadow-sm: 0 1px 2px rgba(20, 27, 51, .06);
  --shadow: 0 4px 14px rgba(20, 27, 51, .08);
  --shadow-lg: 0 12px 32px rgba(20, 27, 51, .14);
  --radius: 12px;
  --radius-sm: 8px;
  --nav-h: 60px;
  --maxw: 1320px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: 14px; }

/* ===== 顶部导航（logo + 客户按钮，参考 geokb 布局） ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: #dbe8fb;
  border-bottom: 1px solid #c4d4ec;
  box-shadow: var(--shadow-sm);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  padding-right: 16px;
  border-right: 1px solid rgba(0, 0, 0, .08);
  height: 100%;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: .5px;
  box-shadow: 0 2px 8px rgba(79, 70, 229, .35);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-title { font-weight: 700; font-size: 15px; color: var(--text); }
.brand-sub { font-size: 11px; color: var(--text-faint); }

/* logo 图片（远程引用） */
img.brand-logo {
  display: block;
  width: auto; max-width: 150px; height: 30px;
  background: transparent; box-shadow: none; border-radius: 6px;
  object-fit: contain;
}

/* ===== 鉴权页（登录） ===== */
.auth-wrap {
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  background: radial-gradient(1200px 600px at 80% -10%, #eef0fe 0%, transparent 60%), var(--bg);
}
.auth-card {
  width: 100%; max-width: 380px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden;
}
.auth-head { padding: 26px 24px 8px; text-align: center; }
.auth-head .logo { height: 40px; max-width: 180px; margin: 0 auto 12px; display: block; }
.auth-head h1 { font-size: 19px; font-weight: 800; }
.auth-head p { font-size: 13px; color: var(--text-faint); margin-top: 4px; }
.auth-body { padding: 14px 24px 24px; }
.auth-foot { text-align: center; padding: 0 24px 22px; font-size: 12px; color: var(--text-faint); }
.auth-foot a { color: var(--primary); font-weight: 600; }
.pw-field { position: relative; }
.pw-field .toggle-pw {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 16px; color: var(--text-faint); padding: 4px; line-height: 1;
}
.pw-field .toggle-pw:hover { color: var(--primary); }

/* 客户按钮横向滚动区 */
.cust-nav {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
  height: 100%;
}
.cust-nav::-webkit-scrollbar { height: 4px; }
.cust-nav::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

.cust-btn {
  white-space: nowrap;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-soft);
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: all .18s ease;
}
.cust-btn:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
.cust-btn.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(79, 70, 229, .3);
}

.nav-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  transition: all .18s ease;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-strong); }
.btn-ghost { background: var(--surface); color: var(--text-soft); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--primary); border-color: var(--primary); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border: 1px solid #f7c9c9; }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }

/* ===== 主内容容器 ===== */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 22px 20px 40px; }

/* 客户名称标题（纯文本） */
.case-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.case-title { font-size: 26px; font-weight: 800; letter-spacing: .3px; }
.case-title .star { color: var(--amber); }
.case-meta { font-size: 13px; color: var(--text-faint); }

/* 模块标签栏 */
.module-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  background: var(--surface);
  padding: 8px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  scrollbar-width: thin;
}
.module-tabs::-webkit-scrollbar { height: 4px; }
.module-tabs::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

.mod-tab {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  transition: all .18s ease;
}
.mod-tab:hover { background: var(--primary-soft); color: var(--primary); }
.mod-tab.active { background: var(--primary); color: #fff; }
.mod-tab .premium-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--amber);
}
.mod-tab.active .premium-dot { background: #fde68a; }
.mod-tab.disabled { color: var(--text-faint); cursor: default; opacity: .7; }
.mod-tab.disabled:hover { background: transparent; color: var(--text-faint); }

/* iframe 容器 */
.frame-stage {
  margin-top: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.frame-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 13px;
}
.frame-bar .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); }
.frame-bar .dot.live { background: var(--ok); box-shadow: 0 0 0 3px rgba(22,163,74,.15); }
.frame-title { font-weight: 700; }
.frame-url {
  color: var(--text-faint);
  margin-left: auto;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
a.frame-url {
  text-decoration: none;
  cursor: pointer;
  transition: color .15s;
}
a.frame-url:hover {
  color: var(--primary);
  text-decoration: underline;
}
.copy-url-btn {
  flex-shrink: 0;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-soft);
  border: 1px solid var(--border);
  font-weight: 600;
  transition: all .15s ease;
}
.copy-url-btn:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
.copy-url-btn.copied { color: var(--ok); border-color: var(--ok); background: rgba(22,163,74,.08); }
.copy-url-btn.copy-fail { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }
.frame-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: var(--amber-soft); color: #92600a; font-weight: 700;
}

iframe.case-frame {
  width: 100%;
  height: 720px;
  border: none;
  display: block;
  background: #fff;
}

/* 空状态 */
.empty {
  padding: 56px 24px;
  text-align: center;
  color: var(--text-faint);
}
.empty-ico {
  width: 56px; height: 56px; margin: 0 auto 14px;
  border-radius: 16px;
  background: var(--primary-soft);
  display: grid; place-items: center;
  font-size: 24px;
}
.empty h3 { font-size: 16px; color: var(--text-soft); margin-bottom: 6px; font-weight: 700; }
.empty p { font-size: 13px; max-width: 360px; margin: 0 auto; }
.empty .btn { margin-top: 16px; }

/* ===== 管理页 ===== */
.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.admin-head h1 { font-size: 22px; font-weight: 800; }
.admin-head .sub { font-size: 13px; color: var(--text-faint); margin-top: 2px; }

.toolbar {
  display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap;
}
.toolbar-actions { display: flex; gap: 8px; flex-shrink: 0; }
.search-box {
  flex: 1; min-width: 220px; position: relative;
}
.search-box input {
  width: 100%; padding: 10px 14px 10px 38px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); transition: border-color .18s;
}
.search-box input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.search-box .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-faint); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.cust-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.cust-row:last-child { border-bottom: none; }
.cust-row:hover { background: var(--surface-2); }
.cust-info .name { font-weight: 700; font-size: 15px; }
.cust-info .meta { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.tag-list { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.tag {
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary-strong); font-weight: 600;
}
.tag.empty-tag { background: var(--bg); color: var(--text-faint); }
.row-actions { display: flex; gap: 8px; }

/* 表单弹层 */
.modal-mask {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15, 20, 40, .45);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  backdrop-filter: blur(2px);
}
.modal-mask.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 680px;
  margin: auto;
  overflow: hidden;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
}
.modal-head h2 { font-size: 18px; font-weight: 800; }
.modal-close { font-size: 22px; color: var(--text-faint); width: 32px; height: 32px; border-radius: 8px; }
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 22px; max-height: 70vh; overflow-y: auto; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 22px; border-top: 1px solid var(--border); background: var(--surface-2);
}

.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; font-weight: 700; font-size: 13px; margin-bottom: 6px; color: var(--text);
}
.form-group .hint { font-size: 12px; color: var(--text-faint); margin-top: 4px; }
.form-group .premium-flag { color: var(--amber); font-weight: 700; }
.form-control {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); transition: all .18s;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.form-control.invalid { border-color: var(--danger); }
.form-title-divider {
  font-size: 12px; font-weight: 700; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: .6px; margin: 22px 0 14px;
  padding-bottom: 8px; border-bottom: 1px dashed var(--border);
}

.field-row { display: flex; align-items: center; gap: 10px; }
.field-row label { margin: 0; flex: 0 0 150px; font-weight: 600; font-size: 13px; }
.field-row .form-control { flex: 1; }
.premium-pill { flex: 0 0 auto; font-size: 11px; padding: 3px 8px; border-radius: 999px; background: var(--amber-soft); color: #92600a; font-weight: 700; }

/* 确认弹窗 */
.confirm-body { padding: 24px; text-align: center; }
.confirm-ico { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 50%; background: var(--danger-soft); display: grid; place-items: center; font-size: 24px; }
.confirm-body h3 { font-size: 17px; margin-bottom: 6px; }
.confirm-body p { color: var(--text-soft); font-size: 13px; }

/* Toast */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: #fff; padding: 11px 20px; border-radius: 999px;
  font-size: 13px; font-weight: 600; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: all .3s ease; z-index: 300;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { background: var(--ok); }
.toast.err { background: var(--danger); }

/* 加载 / 错误状态 */
.loader { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 80px 0; color: var(--text-faint); }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--primary); animation: spin .7s linear infinite; }
.spinner.sm { width: 14px; height: 14px; border-width: 2px; border-color: rgba(255,255,255,.5); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn.is-loading { pointer-events: none; opacity: .75; }
.btn .spin-ico { display: inline-block; vertical-align: -2px; margin-right: 6px; }
.err-state { padding: 60px 24px; text-align: center; }
.err-state .empty-ico { background: var(--danger-soft); }
.err-state h3 { color: var(--danger); }
.err-state .retry-btn { margin-top: 14px; }

/* ===== 可复用溢出/折叠标签组件（栏目过多时自动收纳到「更多」菜单） ===== */
.ovf-tabs {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
  /* 注意：不要在此设置 overflow:hidden，否则会裁剪 .ovf-menu 下拉。
     溢出项的裁剪由 .ovf-scroll 的 overflow:hidden 负责。 */
}
.ovf-scroll {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  flex-wrap: nowrap;
  flex: 1 1 auto;
}
.ovf-item { flex-shrink: 0; }

.ovf-more {
  flex-shrink: 0;
  margin-left: auto;
  display: none;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.ovf-tabs.has-overflow .ovf-more { display: inline-flex; }
.ovf-more .caret { font-size: 10px; line-height: 1; opacity: .7; }

.ovf-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  min-width: 180px;
  max-width: 320px;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: none;
  scrollbar-width: thin;
}
.ovf-menu.open { display: block; animation: ovfPop .16s ease; }
.ovf-menu::-webkit-scrollbar { width: 6px; }
.ovf-menu::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 6px; }
@keyframes ovfPop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

/* 菜单内的项目：覆盖原 pill/tab 样式，统一为菜单条目 */
.ovf-menu .ovf-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.ovf-menu .ovf-menu-item:hover { background: var(--primary-soft); color: var(--primary); }
.ovf-menu .ovf-menu-item.active { background: var(--primary-soft); color: var(--primary); }
.ovf-menu .ovf-menu-item.disabled,
.ovf-menu .ovf-menu-item.disabled:hover { color: var(--text-faint); background: transparent; opacity: .7; }

/* 顶部模块切换（pill 风格，沿用 cust-btn 视觉） */
.module-nav { height: 100%; }
.module-nav .ovf-item {
  white-space: nowrap;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .18s ease;
}
.module-nav .ovf-item:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
.module-nav .ovf-item.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(79, 70, 229, .3);
}
.module-nav .ovf-item.disabled { color: var(--text-faint); opacity: .6; cursor: default; }
.module-nav .ovf-item.disabled:hover {
  color: var(--text-faint); background: var(--surface-2); border-color: var(--border);
}
.module-nav .ovf-item .premium-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--amber);
}
.module-nav .ovf-item.active .premium-dot { background: #fde68a; }
.module-nav .ovf-item .frame-badge { font-size: 10px; padding: 1px 6px; }

/* 主内容中的客户切换 */
.customer-switch {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 8px;
  margin-bottom: 16px;
  height: 48px;
}
.customer-switch-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .6px;
  padding: 0 8px 0 4px;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.customer-switch .ovf-scroll { gap: 4px; }
.customer-switch .ovf-item {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  background: transparent;
  border: 1px solid transparent;
  transition: all .18s ease;
}
.customer-switch .ovf-item:hover { background: var(--primary-soft); color: var(--primary); }
.customer-switch .ovf-item.active { background: var(--primary); color: #fff; }

/* 响应式 · 手机 H5 */
@media (max-width: 720px) {
  :root { --nav-h: 54px; }
  .wrap { padding: 16px 14px 32px; }
  .brand-text { display: none; }
  .brand { padding-right: 10px; }
  .case-title { font-size: 20px; }
  .case-head { gap: 8px; }
  .cust-row { grid-template-columns: 1fr; gap: 10px; }
  .row-actions { justify-content: flex-end; }
  .field-row { flex-wrap: wrap; }
  .field-row label { flex: 0 0 100%; }
  iframe.case-frame { height: 70vh; min-height: 460px; }
  .btn-sm { padding: 7px 11px; }
}

@media (max-width: 560px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 8px 12px; gap: 8px; }
  .brand { height: auto; padding-right: 0; border-right: none; }
  img.brand-logo { height: 26px; max-width: 120px; }
  .nav-actions { margin-left: auto; gap: 6px; flex-wrap: nowrap; overflow-x: auto; min-width: 0; scrollbar-width: none; }
  .nav-actions::-webkit-scrollbar { display: none; }
  .module-nav { order: 3; flex-basis: 100%; width: 100%; height: auto; border-top: 1px solid var(--border); padding-top: 6px; }
  .module-nav .ovf-item { padding: 6px 12px; font-size: 12px; }
  .customer-switch { padding: 6px; height: auto; }
  .customer-switch .ovf-item { padding: 7px 12px; font-size: 12px; }
  .customer-switch-label { display: none; }
  .module-tabs .mod-tab { padding: 8px 12px; }
  .frame-bar { flex-wrap: wrap; }
  .frame-url { max-width: 100%; flex-basis: 100%; }
}

/* ===== 外观设置卡片 ===== */
.appearance-card { padding: 18px 20px 20px; }
.appearance-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.appearance-head h2 { font-size: 17px; font-weight: 700; }
.appearance-hint { font-size: 12px; color: var(--text-faint); }
.appearance-body { display: flex; flex-direction: column; gap: 18px; }
.appearance-body .form-group { margin: 0; }
.appearance-body .form-group > label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.color-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 8px;
}
.color-swatch {
  position: relative;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
  overflow: hidden;
}
.color-swatch:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.color-swatch.is-active {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.color-swatch.is-active::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,.25);
  color: #fff;
}
.color-swatch[data-dark="1"]::after { color: #fff; }
.color-swatch:not([data-dark="1"])::after { color: #1a2233; text-shadow: none; }
.color-name { font-weight: 700; color: var(--primary); }
.logo-edit-row { display: flex; align-items: center; gap: 12px; }
.logo-preview {
  width: 64px;
  height: 36px;
  object-fit: contain;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
  padding: 2px;
  flex-shrink: 0;
}
.logo-edit-row .form-control { flex: 1; min-width: 0; }
.appearance-foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }

@media (max-width: 768px) {
  .color-grid { grid-template-columns: repeat(8, 1fr); }
  .appearance-card { padding: 14px; }
}
@media (max-width: 480px) {
  .color-grid { grid-template-columns: repeat(5, 1fr); }
  .logo-edit-row { flex-wrap: wrap; }
  .logo-preview { width: 100%; height: 48px; }
}

/* ===== 功能模块管理卡片 ===== */
.module-card { padding: 18px 20px 20px; }
.module-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.module-head h2 { font-size: 17px; font-weight: 700; margin: 0; }
.module-hint { font-size: 12px; color: var(--text-faint); flex: 1; min-width: 120px; }
.module-list { display: flex; flex-direction: column; }
.mod-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
}
.mod-row:last-child { border-bottom: none; }
.mod-info .name { font-weight: 600; font-size: 14px; color: var(--text); }
.mod-info .meta { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.mod-info .meta code {
  background: var(--primary-soft);
  color: var(--primary);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
}
.mod-info .premium-pill {
  display: inline-block;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 4px;
  vertical-align: middle;
}
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.order-btn {
  min-width: 32px;
  padding: 4px 8px !important;
  font-size: 14px;
  line-height: 1;
}
.order-btn:disabled { opacity: .35; cursor: not-allowed; }

/* 复选框行 */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-soft);
}
.checkbox-row input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; }

@media (max-width: 768px) {
  .module-card { padding: 14px; }
  .mod-row { grid-template-columns: 1fr; gap: 8px; }
  .row-actions { justify-content: flex-start; }
}

/* ===== 字体颜色色板（外观设置页） ===== */
.color-swatch.is-empty {
  position: relative;
  background: #fff !important;
  border: 1px dashed var(--border) !important;
}
.color-swatch.is-empty::after {
  content: "默认";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--text-faint);
  font-weight: 600;
}
/* 标题/副标题预览文字 */
#titlePreview, #subTitlePreview {
  font-weight: 600;
  margin-left: 6px;
}
#titlePreview { font-size: 14px; }
#subTitlePreview { font-size: 12px; opacity: .85; }


