/* ============================================================
   HEARTH & HOLLOW — Admin stylesheet
   Reuses the storefront design tokens (canvas/ink/accent)
   ============================================================ */
:root {
  --canvas: #FAFAF7;
  --surface: #FFFFFF;
  --ink: #0A0A0A;
  --ink-soft: #3B3632;
  --ink-body: #5C564D;
  --muted: #737373;
  --faint: #A39C93;
  --accent: #8B6F47;
  --accent-hover: #7A5F3B;
  --hairline: #E8E4DD;
  --hairline-soft: #EDE9E2;
  --sidebar-bg: #171512;
  --sidebar-link: #D8D2C8;
  --sidebar-muted: #7A736A;
  --danger: #B4554A;
  --ok: #6E8B5E;

  --font-display: 'Cormorant Garamond', 'Times New Roman', serif;
  --font-body: 'Lora', Georgia, serif;
  --font-ui: 'Inter', 'Helvetica Neue', Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
/* hidden attribute must always win over component display rules (e.g. .modal-backdrop display:flex) */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { display: block; max-width: 100%; }

/* ---------- Login page ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1200px 600px at 70% -10%, rgba(139,111,71,.10), transparent 60%),
    var(--canvas);
  padding: 32px;
}
.login-shell { width: 100%; max-width: 400px; }
.login-brand { text-align: center; margin-bottom: 28px; }
.login-kicker {
  font-size: 12px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin-bottom: 12px;
}
.login-title {
  font-family: var(--font-display); font-weight: 600; font-size: 44px;
  line-height: 1.1; color: var(--ink);
}
.login-sub { color: var(--ink-body); font-family: var(--font-body); margin-top: 8px; }
.login-card {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 12px; padding: 32px;
  display: flex; flex-direction: column; gap: 18px;
}
.login-error { color: var(--danger); font-size: 13px; min-height: 18px; }
.login-hint { color: var(--faint); font-size: 12px; text-align: center; }

/* ---------- Form fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 12px; font-weight: 600; color: var(--ink-soft); letter-spacing: .3px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--hairline);
  border-radius: 4px; background: var(--surface); color: var(--ink);
  font-family: inherit; font-size: 14px; transition: border-color .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
textarea { resize: vertical; }
.field-label.sub { font-weight: 500; color: var(--muted); font-size: 11px; }
.field-hint { font-size: 11px; color: var(--faint); margin-top: 4px; }

/* ---------- Upload & attributes ---------- */
.upload-row { display: flex; align-items: center; gap: 12px; }
.upload-preview {
  width: 56px; height: 56px; border-radius: 6px; background-size: cover; background-position: center;
  border: 1px solid var(--hairline); flex-shrink: 0; background-color: var(--surface-warm, #EFEAE3);
}

/* ---------- 社交平台账号网格（会员画像「社交与推荐」/ 联盟客弹窗共用） ---------- */
.social-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 12px;
  margin-top: 6px;
}
/* 保存按钮靠右，与地址簿页脚保持一致的收尾方式 */
.ms-foot { display: flex; justify-content: flex-end; margin-top: 12px; }
@media (max-width: 720px) { .social-grid { grid-template-columns: 1fr; } }

/* ---------- 上传文件清理：文件网格 ----------
   布局尺寸照设计稿；配色改成后台既有 token，避免在暖白色面板里掺冷灰。 */
.file-list {
  display: grid;
  /* 自动适应宽度，每列最小 200px */
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  max-height: 480px; /* 限制最大高度，超出的内部滚动 */
  overflow-y: auto;
  padding: 8px;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: 8px;
}
.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--hairline-soft);
  border-radius: 6px;
}
/* 缩略图 + 右下角「单个删除」徽标。
   徽标叠在图上而不是当 flex 子项：否则它会吃掉文本宽度，
   把刚修好的「文件名 / 小字不截断」又挤回去。 */
.file-thumb { position: relative; flex: 0 0 auto; width: 40px; height: 40px; }
.file-item img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  flex: 0 0 auto;
  background: var(--surface-warm, #EFEAE3);
}
.file-del {
  position: absolute; right: -4px; bottom: -4px;
  width: 18px; height: 18px; padding: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; line-height: 1;
  border: 1px solid var(--hairline); background: var(--surface); color: var(--muted);
  box-shadow: 0 0 0 2px var(--surface); /* 叠在图上时留一圈白边，保证可读 */
}
.file-del:hover { border-color: var(--danger); color: var(--danger); }
.file-del[disabled] { opacity: .4; cursor: not-allowed; }
.file-info {
  display: flex;
  flex-direction: column;
  min-width: 0; /* 文本过长时才能出省略号 */
}
.file-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 与文件名同样截断，否则窄格里 meta 换行会把卡片撑高 */
.file-meta {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.attr-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

/* ---------- v2: toolbar / multi-head panel ---------- */
.panel-head--col { flex-direction: column; align-items: stretch; gap: 10px; }
.panel-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar-hint { font-size: 12px; color: var(--faint); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.field-hint.inline { display: inline; margin-left: 8px; font-weight: 400; }

/* ---------- v2: multi-image upload ---------- */
.drop-zone {
  border: 1.5px dashed var(--hairline); border-radius: 8px; padding: 18px;
  text-align: center; color: var(--muted); font-size: 13px;
  transition: border-color .15s, background .15s;
}
.drop-zone.over { border-color: var(--accent); background: rgba(139,111,71,.05); }
.drop-zone .btn-mini { margin-left: 6px; }
.img-list { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.img-item {
  position: relative; width: 108px; border: 1px solid var(--hairline); border-radius: 8px;
  padding: 6px; background: var(--surface); cursor: grab;
}
.img-item.primary { border-color: var(--accent); }
.img-thumb { width: 94px; height: 72px; border-radius: 5px; background-size: cover; background-position: center; background-color: #EFEAE3; }
.img-primary-tag {
  position: absolute; top: -8px; right: -6px; background: var(--accent); color: #fff;
  font-size: 10px; padding: 2px 7px; border-radius: 999px;
}
.img-item-actions { display: flex; gap: 4px; justify-content: center; margin-top: 6px; }
.img-item-actions .btn-mini, .img-item-actions .btn-danger { font-size: 11px; padding: 3px 6px; }

/* ---------- v2: rich text editor ---------- */
.rte-toolbar { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.rte-toolbar button {
  border: 1px solid var(--hairline); border-radius: 4px; background: var(--surface);
  padding: 5px 10px; font-size: 12px; color: var(--ink-soft);
}
.rte-toolbar button:hover { border-color: var(--accent); color: var(--accent); }
.rte {
  min-height: 110px; max-height: 260px; overflow-y: auto;
  border: 1px solid var(--hairline); border-radius: 4px; padding: 12px;
  font-family: var(--font-body); font-size: 14px; line-height: 1.6; background: var(--surface);
}
.rte:focus { outline: none; border-color: var(--accent); }
.rte:empty::before { content: attr(data-placeholder); color: var(--faint); }
.rte ul, .rte ol { padding-left: 20px; }
.rte h3 { font-family: var(--font-display); font-size: 18px; margin: 8px 0 4px; }
/* Hero 首屏标语排版：色块按钮与字号下拉 */
.rte-toolbar button.sw { width: 24px; padding: 5px 0; border-color: var(--hairline); }
.rte-toolbar select {
  border: 1px solid var(--hairline); border-radius: 4px; background: var(--surface);
  padding: 4px 6px; font-size: 12px; color: var(--ink-soft); font-family: inherit;
}
.rte-toolbar .rt-colors { display: inline-flex; gap: 4px; align-items: center; }
.rte-wrap .rte { min-height: 64px; }

/* ---------- 站点文案：按页面折叠 + 关键词搜索 ---------- */
.cms-search { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cms-search input {
  flex: 1; min-width: 0; padding: 8px 12px; border: 1px solid var(--hairline);
  border-radius: 4px; font-size: 13px; font-family: inherit; background: var(--surface);
}
.cms-search input:focus { outline: none; border-color: var(--accent); }
details.cms-group {
  border: 1px solid var(--hairline); border-radius: 6px; margin-bottom: 10px;
  background: var(--surface); overflow: hidden;
}
details.cms-group > summary {
  cursor: pointer; list-style: none; padding: 10px 14px;
  display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600;
  color: var(--ink); background: var(--surface-warm, #F7F4EF);
}
details.cms-group > summary::-webkit-details-marker { display: none; }
details.cms-group > summary::before { content: '▸'; color: var(--faint); font-size: 12px; flex: none; }
details.cms-group[open] > summary::before { content: '▾'; }
.cms-group-name { flex: none; }
.cms-group-where { flex: 1; min-width: 0; font-weight: 400; font-size: 11px; color: var(--faint); }
.cms-group-count { flex: none; font-weight: 400; font-size: 11px; color: var(--faint); }
.cms-group-body { padding: 14px; border-top: 1px solid var(--hairline); }

/* 分类切页（站点文案 / 国际化）：每个分类一个 tab，下方只显示该分类的字段 */
.cms-tabs {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px;
  padding-bottom: 12px; border-bottom: 1px solid var(--hairline);
}
.cms-tab {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--hairline); border-radius: 999px; background: var(--surface);
  padding: 6px 12px; font-size: 12px; font-family: inherit; color: var(--ink-soft); cursor: pointer;
}
.cms-tab:hover { border-color: var(--accent); color: var(--accent); }
.cms-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.cms-tab-count { font-size: 10px; opacity: .7; }
/* 切页模式下的分组容器（不再折叠） */
div.cms-group {
  border: 1px solid var(--hairline); border-radius: 6px; margin-bottom: 10px;
  background: var(--surface); overflow: hidden;
}
.cms-group-head {
  display: flex; align-items: center; gap: 10px; margin: 0;
  padding: 10px 14px; font-size: 13px; font-weight: 600;
  color: var(--ink); background: var(--surface-warm, #F7F4EF);
}
div.cms-group--plain { border: none; background: transparent; }
div.cms-group--plain .cms-group-head { background: transparent; padding: 0 0 10px; }

/* ---------- 前台图片：首页首屏大图（多图滚动） ---------- */
.cms-hero-block {
  border: 1px solid var(--hairline); border-radius: 6px; padding: 12px 14px;
  margin-bottom: 16px; background: var(--surface-warm, #F7F4EF);
}
.cms-hero-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.cms-hero-head select {
  border: 1px solid var(--hairline); border-radius: 4px; background: var(--surface);
  padding: 4px 6px; font-size: 12px; color: var(--ink-soft); font-family: inherit;
}
.cms-hero-head .field-hint { margin: 0; }
#hero-images-list { margin-top: 12px; }
#hero-images-list .upload-row .btn-ghost[disabled] { opacity: .4; cursor: not-allowed; }

/* 顶栏全局搜索入口 */
.topbar-search {
  display: inline-flex; align-items: center; gap: 7px; margin-right: 10px;
  border: 1px solid var(--hairline); border-radius: 999px; background: var(--surface);
  padding: 6px 12px; font-size: 12px; font-family: inherit; color: var(--ink-soft); cursor: pointer;
}
.topbar-search:hover { border-color: var(--accent); color: var(--accent); }
.topbar-search.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.topbar-search kbd {
  font-family: inherit; font-size: 10px; padding: 1px 5px; border-radius: 4px;
  border: 1px solid var(--hairline); background: var(--surface-warm, #F7F4EF); color: var(--faint);
}

/* ---------- 商品列表：筛选栏 / CSV 提示 / 条件工具条 / 紧凑表格 ---------- */
.filter-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--hairline);
}
.filter-bar input[type="search"] {
  flex: 1 1 220px; min-width: 160px; padding: 7px 12px; font-size: 13px;
  font-family: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--hairline); border-radius: 4px;
}
.filter-bar input[type="search"]:focus,
.filter-bar select:focus { outline: none; border-color: var(--accent); }
.filter-bar select {
  padding: 7px 10px; font-size: 13px; font-family: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 4px;
  max-width: 190px;
}
#prod-filter-count { margin-left: auto; white-space: nowrap; }

/* CSV 规格列说明：默认只有一个 ⓘ，点开才展开 */
.hint-pop { position: relative; display: inline-flex; }
.hint-btn {
  width: 26px; height: 26px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--hairline); background: var(--surface);
  color: var(--ink-soft); font-size: 12px; font-style: italic; font-family: Georgia, serif; line-height: 1;
}
.hint-btn:hover, .hint-btn[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.hint-pop-body {
  position: absolute; top: 34px; right: 0; z-index: 40; width: 420px; max-width: 76vw;
  padding: 12px 14px; border: 1px solid var(--hairline); border-radius: 8px;
  background: var(--surface); box-shadow: 0 12px 32px rgba(0, 0, 0, .16);
  font-size: 11px; line-height: 1.7; color: var(--ink-soft);
}
.hint-pop-body b { display: block; margin-bottom: 6px; font-size: 12px; color: var(--ink); }
.hint-cols { display: block; color: var(--faint); word-break: break-word; }
.hint-note { display: block; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--hairline); }

/* 条件工具条：勾选商品后才出现 */
.bulk-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 12px 0; padding: 9px 14px; border-radius: 8px;
  border: 1px solid var(--accent); background: rgba(139, 111, 71, .08);
  position: sticky; top: 0; z-index: 6;
}
.bulk-count { font-size: 13px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.bulk-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* 紧凑表格：行高压缩 + 参数标签化 + 操作列右侧固定
   注意要写成 .table.table--compact（双类）才能压过后面的 .table th / .table td 内边距 */
.table.table--compact th { padding: 8px 10px; }
.table.table--compact td { padding: 6px 10px; vertical-align: middle; }
.table--compact .cell-thumb { width: 38px; height: 38px; border-radius: 6px; flex: none; }
.cell-product { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.cell-main { min-width: 0; }
.cell-name {
  font-weight: 600; font-size: 13px; color: var(--ink); line-height: 1.35;
  max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cell-id { font-weight: 400; font-size: 10px; color: var(--faint); }
/* 副标题：主标题下方灰字，突出卖点 / 场景 */
.cell-subtitle {
  margin-top: 1px; font-size: 11px; line-height: 1.35; color: var(--faint);
  max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cell-tags {
  display: flex; gap: 4px; margin-top: 3px;
  overflow: hidden; white-space: nowrap; max-width: 340px;
}
.attr-tag {
  flex: none; font-size: 10px; line-height: 1.6; padding: 0 6px; border-radius: 999px;
  background: var(--surface-warm, #F7F4EF); color: var(--ink-soft);
  border: 1px solid var(--hairline);
}
.table--compact .cell-cat {
  display: block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12px; color: var(--ink-soft);
}
.table--compact .cell-num { text-align: right; white-space: nowrap; }
.table--compact .cell-sub { margin-top: 1px; }
.table--compact .col-actions {
  position: sticky; right: 0; z-index: 2;
  background: var(--surface); box-shadow: -1px 0 0 var(--hairline);
}
.table--compact thead .col-actions { z-index: 3; }
.table--compact tbody tr:hover .col-actions { background: var(--surface-warm, #F7F4EF); }

/* ---------- 统一素材库弹窗 ---------- */
.media-modal { width: min(880px, 92vw); max-height: 88vh; display: flex; flex-direction: column; }
.panel-head-actions { display: flex; align-items: center; gap: 8px; }
.media-toolbar { display: flex; align-items: center; gap: 10px; margin: 12px 0 10px; }
.media-toolbar input[type="search"] {
  flex: 1; min-width: 0; padding: 8px 12px; border: 1px solid var(--hairline);
  border-radius: 4px; font-size: 13px; font-family: inherit; background: var(--surface);
}
.media-toolbar input[type="search"]:focus { outline: none; border-color: var(--accent); }
.media-grid {
  flex: 1; min-height: 140px; max-height: 54vh; overflow-y: auto; padding: 4px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px; align-content: start;
}
.media-card {
  position: relative; aspect-ratio: 1 / 1; border: 2px solid transparent; border-radius: 8px;
  background-color: var(--surface-warm, #F7F4EF); background-size: cover; background-position: center;
  cursor: pointer; overflow: hidden;
}
.media-card:hover { border-color: var(--accent); }
.media-card.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139, 111, 71, .2); }
.media-card.is-broken { border-color: #C0392B; }
.media-card-meta {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 6px;
  background: rgba(30, 27, 24, .62); color: #fff; font-size: 10px; line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.media-card-broken {
  position: absolute; top: 4px; right: 4px; z-index: 2; cursor: pointer;
  border: none; border-radius: 999px; background: #C0392B; color: #fff;
  font-size: 10px; font-family: inherit; padding: 2px 7px;
}

/* ---------- 所见即所得预览（右侧 iframe 实时呈现前台） ---------- */
.ef-preview {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 42vw);
  z-index: 130; display: flex; flex-direction: column;
  background: var(--surface); border-left: 1px solid var(--hairline);
  box-shadow: -8px 0 28px rgba(0, 0, 0, .08);
}
.ef-preview-head {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border-bottom: 1px solid var(--hairline); background: var(--surface-warm, #F7F4EF);
}
.ef-preview-head select {
  flex: 1; min-width: 0; border: 1px solid var(--hairline); border-radius: 4px;
  background: var(--surface); padding: 5px 8px; font-size: 12px;
  font-family: inherit; color: var(--ink-soft);
}
.ef-preview-body { flex: 1; min-height: 0; background: #fff; }
.ef-preview-body iframe { display: block; width: 100%; height: 100%; border: 0; }
.ef-preview-hint {
  margin: 0; padding: 10px 12px; font-size: 11px; line-height: 1.6;
  color: var(--faint); border-top: 1px solid var(--hairline);
}
/* 打开预览时把左侧内容让出空间，避免被遮住 */
body.ef-preview-open .main { padding-right: min(560px, 42vw); }
body.ef-preview-open.ef-preview-phone .ef-preview { width: 390px; }
body.ef-preview-open.ef-preview-phone .main { padding-right: 390px; }

/* ---------- 全局快速搜索（Ctrl / Cmd + K） ---------- */
.cmdk {
  position: fixed; inset: 0; z-index: 240;
  display: flex; align-items: flex-start; justify-content: center; padding-top: 11vh;
}
.cmdk-scrim { position: absolute; inset: 0; background: rgba(30, 27, 24, .42); }
.cmdk-box {
  position: relative; width: min(660px, 92vw); background: var(--surface);
  border-radius: 10px; overflow: hidden; box-shadow: 0 18px 50px rgba(0, 0, 0, .26);
}
.cmdk-box input {
  width: 100%; border: none; border-bottom: 1px solid var(--hairline);
  padding: 15px 16px; font-size: 14px; font-family: inherit;
  background: transparent; color: var(--ink); outline: none;
}
.cmdk-list { max-height: 52vh; overflow-y: auto; padding: 6px; }
.cmdk-item {
  display: flex; align-items: baseline; gap: 10px;
  padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 13px;
}
.cmdk-item.active { background: var(--surface-warm, #F7F4EF); }
.cmdk-item .t { flex: 1; min-width: 0; color: var(--ink); }
.cmdk-item .p { flex: none; font-size: 11px; color: var(--faint); }
.cmdk-empty { padding: 16px; font-size: 12px; color: var(--faint); text-align: center; }
/* 跳转后的目标高亮 */
.cmdk-flash { animation: cmdkFlash 1.7s ease; }
@keyframes cmdkFlash {
  0%, 100% { background-color: transparent; }
  15%, 65% { background-color: #FFF3D6; }
}

/* ---------- v2: variants ---------- */
.variant-row { display: grid; grid-template-columns: 1fr 1fr 1.2fr 0.9fr 0.7fr 44px; gap: 8px; margin-bottom: 8px; }
.variant-row input {
  padding: 8px 10px; border: 1px solid var(--hairline); border-radius: 4px;
  font-size: 13px; font-family: inherit; min-width: 0;
}
.variant-row input:focus { outline: none; border-color: var(--accent); }

/* ---------- v2: order & member detail ---------- */
.od-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; }
.od-items { list-style: none; display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.od-items li { font-size: 13px; color: var(--ink-soft); border-bottom: 1px dashed var(--hairline-soft); padding-bottom: 8px; }
.od-total { font-size: 14px; margin-top: 8px; }
.od-row { font-size: 13px; color: var(--ink-body); margin-top: 8px; }
.od-actions { display: flex; gap: 8px; margin-top: 14px; }

/* ---------- 订单详情：收件地址 ---------- */
.od-addr {
  border: 1px solid var(--hairline); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 20px; background: var(--surface-warm, #FAF8F4);
}
.od-addr-cur { font-size: 13px; color: var(--ink); margin-top: 4px; line-height: 1.45; }
.od-addr-list { display: flex; flex-direction: column; gap: 6px; }
.od-addr-pick {
  display: block; width: 100%; text-align: left; cursor: pointer;
  border: 1px solid var(--hairline); border-radius: 8px;
  padding: 8px 12px; background: var(--surface); transition: border-color .15s;
}
.od-addr-pick:hover { border-color: var(--accent); }
.od-addr-pick-h { display: block; font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.od-addr-pick-b { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
/* 联盟客表格的收件地址列：过长时截断，完整值放在 title 里 */
.cell-addr { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.stat { background: var(--canvas); border: 1px solid var(--hairline); border-radius: 8px; padding: 12px; }
.stat-v { font-family: var(--font-display); font-size: 22px; font-weight: 600; margin-top: 4px; }
.chart-box { padding: 16px 20px; }
.panel-note { font-size: 12px; color: var(--faint); padding: 0 20px 16px; }

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: #fff; padding: 10px 18px; border-radius: 4px;
  font-weight: 600; font-size: 14px; transition: background .15s;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-block { width: 100%; }
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--ink-body); padding: 10px 18px; border-radius: 4px;
  border: 1px solid var(--hairline); font-weight: 500; transition: border-color .15s, color .15s;
}
.btn-ghost:hover { border-color: var(--faint); color: var(--ink); }
.btn-danger { color: var(--danger); font-size: 13px; font-weight: 500; }
.btn-danger:hover { text-decoration: underline; }
.btn-mini {
  font-size: 12px; font-weight: 600; color: var(--accent);
  padding: 5px 10px; border: 1px solid var(--hairline); border-radius: 4px;
  transition: border-color .15s, background .15s;
}
.btn-mini:hover { border-color: var(--accent); background: var(--surface); }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--sidebar-bg); color: var(--sidebar-link);
  display: flex; flex-direction: column; padding: 24px 16px; position: sticky; top: 0;
  height: 100vh;
}
.side-brand { padding: 0 8px 20px; border-bottom: 1px solid #2E2A24; margin-bottom: 16px; }
.side-wordmark { display: block; font-size: 13px; letter-spacing: 2px; font-weight: 600; color: #fff; }
.side-tag { display: block; font-size: 11px; letter-spacing: 3px; text-transform: uppercase; color: var(--accent); margin-top: 4px; }

.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px;
  color: var(--sidebar-link); font-size: 14px; font-weight: 500;
  border-radius: 6px; text-align: left; transition: background .15s, color .15s;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: #2E2A24; color: #fff; }
.nav-item.active { background: var(--accent); color: #fff; }

.side-foot { border-top: 1px solid #2E2A24; padding-top: 16px; display: flex; flex-direction: column; gap: 4px; }
.side-link {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px;
  color: var(--sidebar-muted); font-size: 13px; border-radius: 6px; text-align: left;
  transition: color .15s;
}
.side-link svg { width: 16px; height: 16px; }
.side-link:hover { color: #fff; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 64px; background: var(--surface); border-bottom: 1px solid var(--hairline);
  display: flex; align-items: center; justify-content: space-between; padding: 0 32px;
  position: sticky; top: 0; z-index: 10;
}
.topbar-title { font-family: var(--font-display); font-weight: 600; font-size: 22px; }
.topbar-right { display: flex; align-items: center; gap: 12px; position: relative; }
.topbar-admin {
  display: flex; align-items: center; gap: 8px; color: var(--ink-body); font-size: 13px;
  background: none; border: 1px solid transparent; border-radius: 999px; padding: 4px 10px 4px 4px;
  cursor: pointer; transition: background .15s, border-color .15s;
}
.topbar-admin:hover { background: #faf8f4; border-color: var(--hairline, #e5e0d8); }
.admin-avatar {
  width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 11px;
}
.admin-avatar--lg { width: 32px; height: 32px; font-size: 13px; flex-shrink: 0; }

/* ---------- Admin dropdown menu ---------- */
.admin-menu {
  position: absolute; top: calc(100% + 8px); right: 0; width: 220px;
  background: var(--surface, #fff); border: 1px solid var(--hairline, #e5e0d8); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,.12); padding: 6px; z-index: 100;
}
.admin-menu-head {
  display: flex; align-items: center; gap: 12px; padding: 12px 12px 10px;
  border-bottom: 1px solid var(--hairline, #e5e0d8); margin-bottom: 6px;
}
.admin-menu-name { font-weight: 600; font-size: 13px; color: var(--ink, #2d2a26); }
.admin-menu-role { font-size: 11px; color: var(--muted, #a39c93); margin-top: 1px; }
.admin-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px;
  border: 0; background: none; border-radius: 8px; font-size: 13px; color: var(--ink-body, #4a453f);
  cursor: pointer; text-decoration: none; text-align: left;
}
/* 这三条一起看：SVG 只写了 viewBox、没写 width/height，
   不给 CSS 尺寸就会按浏览器默认对象尺寸（150×150）渲染 —— 菜单项图标因此撑爆整个下拉。
   尺寸必须在这里兜住，不能依赖 HTML 属性。 */
.admin-menu-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .7; }
.admin-menu-item:hover { background: #faf8f4; }
.admin-menu-item--danger { color: #c0392b; }
.admin-menu-item--danger:hover { background: #fdf2f0; }

/* ---------- Views ---------- */
.view { display: none; padding: 32px; }
.view.active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- Metrics ---------- */
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.metric-card {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px;
  padding: 20px;
}
.metric-label { font-size: 12px; color: var(--muted); letter-spacing: .5px; }
.metric-value { font-family: var(--font-display); font-size: 32px; font-weight: 600; margin-top: 6px; color: var(--ink); }
.metric-value.accent { color: var(--accent); }
.metric-note { font-size: 12px; color: var(--faint); margin-top: 4px; }

.dash-cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }

/* ---------- Panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px; margin-bottom: 20px; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--hairline-soft); }
.panel-title { font-family: var(--font-display); font-weight: 600; font-size: 18px; }
.panel-action { font-size: 13px; color: var(--accent); font-weight: 500; }
.panel-action:hover { text-decoration: underline; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--faint); font-weight: 600; padding: 12px 20px; border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
}
.table td { padding: 14px 20px; border-bottom: 1px solid var(--hairline-soft); font-size: 14px; color: var(--ink-soft); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--canvas); }

.cell-product { display: flex; align-items: center; gap: 12px; }
.cell-thumb {
  width: 40px; height: 40px; border-radius: 6px; background: var(--surface-warm, #EFEAE3);
  background-size: cover; background-position: center; border: 1px solid var(--hairline); flex-shrink: 0;
}
.cell-name { font-weight: 500; color: var(--ink); }
.cell-sub { font-size: 12px; color: var(--muted); }
.cell-actions { display: flex; gap: 8px; align-items: center; }
.cell-empty { color: var(--faint); font-size: 13px; text-align: center; padding: 32px; }

/* ---------- Badges / status ---------- */
.badge {
  display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: .2px;
}
.badge--active, .badge--paid, .badge--fulfilled { background: rgba(110,139,94,.14); color: var(--ok); }
.badge--pending { background: rgba(139,111,71,.14); color: var(--accent); }
.badge--draft { background: rgba(115,115,115,.14); color: var(--muted); }
.badge--cancelled, .badge--expired, .badge--inactive, .badge--archived { background: rgba(180,85,74,.12); color: var(--danger); }
.badge--low { background: rgba(180,85,74,.12); color: var(--danger); }

select.badge-select {
  border: 1px solid var(--hairline); border-radius: 999px; padding: 4px 10px;
  font-size: 12px; font-weight: 600; background: var(--surface); color: var(--ink-soft); cursor: pointer;
}
select.badge-select:focus { outline: none; border-color: var(--accent); }

/* ---------- Status bars ---------- */
.status-bars { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.sb-row { display: grid; grid-template-columns: 80px 1fr 32px; align-items: center; gap: 12px; }
.sb-label { font-size: 13px; color: var(--ink-body); }
.sb-track { height: 8px; background: var(--hairline-soft); border-radius: 999px; overflow: hidden; }
.sb-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s ease; }
.sb-count { font-size: 13px; font-weight: 600; text-align: right; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(10,10,10,.4);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 24px;
}
.modal {
  background: var(--surface); border-radius: 12px; width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto; padding: 24px;
}
.modal--lg { max-width: 860px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-close { font-size: 26px; line-height: 1; color: var(--faint); }
.modal-close:hover { color: var(--ink); }
.modal form { display: flex; flex-direction: column; gap: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 4px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; right: 24px; background: var(--ink); color: #fff;
  padding: 12px 18px; border-radius: 8px; font-size: 13px; z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,.18); animation: slide-up .25s ease;
}
.toast.error { background: var(--danger); }
@keyframes slide-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-cols { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
  .side-brand { border-bottom: none; padding: 0; margin: 0; }
  .side-nav { flex-direction: row; flex: 1 1 auto; }
  .side-foot { border-top: none; padding: 0; flex-direction: row; }
  .nav-item span, .side-link span { display: none; }
  .view { padding: 20px 16px; }
  .topbar { padding: 0 16px; }
  .field-row { grid-template-columns: 1fr; }
  .attr-grid { grid-template-columns: 1fr; }
  .od-grid { grid-template-columns: 1fr; }
  .variant-row { grid-template-columns: 1fr 1fr; }
  .profile-stats { grid-template-columns: 1fr; }
  .member-metrics-container { grid-template-columns: repeat(2, 1fr); }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
}

/* ---------- Specs (taxonomy editor) ---------- */
.spec-group {
  border: 1px solid var(--line, #e5e0d8); border-radius: 10px;
  margin-bottom: 10px; background: #faf8f4; overflow: hidden;
}
.spec-group summary {
  cursor: pointer; padding: 10px 14px; font-size: 13px; font-weight: 600;
  color: var(--ink, #2d2a26); user-select: none; list-style: none;
  display: flex; align-items: center; gap: 8px;
}
.spec-group summary::before { content: '▸'; transition: transform .15s ease; font-size: 11px; color: var(--muted, #a39c93); }
.spec-group[open] summary::before { transform: rotate(90deg); }
.spec-group summary:hover { background: #f3efe8; }
.spec-group > *:not(summary) { margin: 4px 14px 12px; }
.attr-grid--2 { grid-template-columns: repeat(2, 1fr) !important; }
.attr-grid--3 { grid-template-columns: repeat(3, 1fr) !important; }
.attr-grid--4 { grid-template-columns: repeat(4, 1fr) !important; }
/* 场景行：窄列放适用环境下拉，场景多选 chips 占满余宽 */
.attr-grid--scene { grid-template-columns: 240px 1fr !important; }
.field--check {
  display: flex; align-items: center; gap: 8px; padding: 8px 0;
  font-size: 13px; cursor: pointer;
}
.field--check input { width: 16px; height: 16px; accent-color: var(--primary, #8b6f47); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--line, #e5e0d8); border-radius: 999px;
  padding: 5px 12px; font-size: 12px; cursor: pointer; background: #fff;
}
.chip input { accent-color: var(--primary, #8b6f47); }
.chip:has(input:checked) { border-color: var(--primary, #8b6f47); background: #f3efe8; }
@media (max-width: 720px) {
  .attr-grid--2, .attr-grid--3, .attr-grid--4, .attr-grid--scene { grid-template-columns: 1fr !important; }
  .addr-defaults { grid-template-columns: 1fr; }
  .addr-foot { flex-direction: column; align-items: stretch; }
  .addr-foot .field-hint { max-width: none; }
}

/* ---------- Member profile (4-dimension) ---------- */
.profile-head { display: flex; align-items: center; gap: 16px; padding: 4px 2px 16px; border-bottom: 1px solid var(--line, #e5e0d8); }
.avatar-lg {
  width: 56px; height: 56px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 24px; font-weight: 600; font-family: Inter, sans-serif;
}
.profile-head-info { flex: 1; min-width: 0; }
.profile-name-row { display: flex; align-items: center; gap: 10px; }
.profile-name { font-size: 19px; font-weight: 700; color: var(--ink, #2d2a26); }
.profile-meta { font-size: 12px; color: var(--muted, #a39c93); margin-top: 2px; }
.profile-head-actions { display: flex; gap: 8px; flex: 0 0 auto; }
/* 指标区改成整块通栏后，页签区随之占满整宽（原 230px 左栏 + 右侧 RFM 条的两栏布局已合并） */
.profile-body { display: block; margin-top: 18px; }
/* 会员画像指标区：10 张卡，顺序即分组（核心消费 / 会员与积分 / RFM 与最近行为） */
.member-metrics-container { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 18px; }
.member-metrics-container .metric-card {
  background: #faf8f4; border: 1px solid var(--line, #e5e0d8); border-radius: 10px;
  padding: 10px 12px; min-width: 0;
}
/* .label / .value 名字太通用，必须限定在容器内，避免影响其它模块 */
.member-metrics-container .metric-card .label {
  display: block; font-size: 11px; line-height: 1.3;
  color: var(--muted, #a39c93); letter-spacing: .04em;
}
.member-metrics-container .metric-card .value {
  display: block; font-size: 17px; font-weight: 700; line-height: 1.3;
  color: var(--ink, #2d2a26); margin-top: 4px;
}
.profile-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.profile-stats .stat { background: #faf8f4; border: 1px solid var(--line, #e5e0d8); border-radius: 10px; padding: 12px 14px; }
.profile-stats .stat .stat-v { font-size: 20px; font-weight: 700; color: var(--ink, #2d2a26); margin: 2px 0; }
.profile-main { min-width: 0; }
.rfm-cell { background: #faf8f4; border: 1px solid var(--line, #e5e0d8); border-radius: 8px; padding: 10px 12px; }
.rfm-k { display: block; font-size: 11px; color: var(--muted, #a39c93); letter-spacing: .04em; }
.rfm-v { display: block; font-size: 15px; font-weight: 700; color: var(--ink, #2d2a26); margin-top: 3px; }
.profile-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line, #e5e0d8); margin-bottom: 14px; }
.profile-tab {
  padding: 9px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
  border: none; background: none; color: var(--muted, #a39c93);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.profile-tab.active { color: var(--ink, #2d2a26); border-bottom-color: var(--primary, #8b6f47); }
.profile-pane { display: none; }
.profile-pane.active { display: block; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tag {
  display: inline-flex; padding: 4px 12px; font-size: 12px; border-radius: 999px;
  background: #f3efe8; color: var(--ink, #2d2a26); border: 1px solid #e5ded2;
}
.tag--alt { background: #eef3ee; border-color: #d8e3d8; color: #3c5a3c; }

/* ---------- 会员画像：地址簿页签 ---------- */
/* 默认地址概览（账单 / 送货各一张卡，只读回显） */
.addr-defaults { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 16px; }
.addr-def {
  border: 1px solid var(--hairline); border-radius: 10px;
  padding: 10px 14px; background: var(--surface-warm, #FAF8F4);
}
.addr-def-k { font-size: 11px; color: var(--muted); letter-spacing: .04em; }
.addr-def-v { font-size: 13px; color: var(--ink); margin-top: 5px; line-height: 1.45; }
.addr-def-v b { display: block; font-size: 12px; font-weight: 700; color: var(--ink); }
.addr-def-empty { font-size: 12px; color: var(--faint); margin-top: 5px; }
/* 会员级联系电话：地址未单独填写电话时的兜底 */
.addr-member { margin-bottom: 18px; }
/* 地址列表区头：标题 + 新增按钮 */
.addr-list-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 8px;
}
.addr-list { display: flex; flex-direction: column; gap: 10px; }
.addr-card {
  border: 1px solid var(--hairline); border-radius: 10px;
  padding: 12px 14px; background: var(--surface);
}
.addr-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 10px;
}
.addr-no { font-size: 12px; font-weight: 600; color: var(--ink-soft); letter-spacing: .3px; }
/* 「待补全」：v1 单行地址迁过来的条目缺城市 / 国家，仍可保存，但要提醒运营补齐 */
.addr-todo {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px;
  background: #F7EDE4; color: #A66A4A; font-size: 11px; font-weight: 600; letter-spacing: 0;
}
.addr-field-gap { margin-top: 10px; }
.addr-flags { display: flex; flex-wrap: wrap; gap: 0 24px; margin-top: 4px; }
/* 空态：没有地址时的占位 */
.addr-empty {
  border: 1px dashed var(--hairline); border-radius: 10px;
  padding: 20px 14px; text-align: center; color: var(--faint); font-size: 12px;
}
/* 页脚：说明 + 保存（放在列表之后，编辑完就近可存） */
.addr-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--hairline-soft);
}
.addr-foot .field-hint { margin: 0; max-width: 70%; }

/* ---------- 推广链接面板（单品）---------- */
.share-pop {
  position: fixed; z-index: 1200; width: 400px; max-width: calc(100vw - 24px);
  background: #fff; border: 1px solid var(--line, #e5e0d8); border-radius: 12px;
  box-shadow: 0 18px 44px rgba(45, 42, 38, .18); padding: 14px 16px 16px;
}
.share-pop-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.share-pop-title { font-size: 13px; font-weight: 600; color: var(--ink, #2d2a26); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-pop-close { border: none; background: none; font-size: 18px; line-height: 1; cursor: pointer; color: var(--muted, #a39c93); padding: 2px 6px; }
.share-pop-close:hover { color: var(--ink, #2d2a26); }
.share-pop-body .field-label { display: block; margin-bottom: 5px; }
.share-pop .chip { font-family: inherit; color: var(--ink, #2d2a26); }
.share-pop .chip--on { border-color: var(--primary, #8b6f47); background: #f3efe8; font-weight: 600; }
.share-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.share-row input {
  flex: 1; min-width: 0; padding: 7px 10px; font-size: 12px;
  border: 1px solid var(--line, #e5e0d8); border-radius: 8px; background: #faf8f5; color: var(--ink, #2d2a26);
}
.share-qr-actions { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.share-qr { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.share-qr img { width: 180px; height: 180px; border: 1px solid var(--line, #e5e0d8); border-radius: 10px; background: #fff; }

/* ---------- SEO / GEO 得分指示器 ---------- */
.cell-seo { text-align: center; }
.seo-pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; padding: 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; cursor: help; border: 1px solid transparent;
}
.seo-pill--good { background: #eaf4ea; color: #2f6b3a; border-color: #cfe4cf; }
.seo-pill--mid { background: #fdf3e3; color: #9a6a1c; border-color: #f0ddba; }
.seo-pill--low { background: #fceceb; color: #a83a30; border-color: #f2cfcb; }

/* ---------- 评价管理 ---------- */
.rv-stars { color: #d9a441; letter-spacing: 1px; font-size: 12px; white-space: nowrap; }
#view-reviews .cell-subtitle { max-width: 360px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#view-reviews .cell-thumb { width: 44px; height: 44px; }
.note-list { list-style: none; margin: 0 0 10px; padding: 0; }
.note-list li {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--line, #e5e0d8); border-radius: 8px; margin-bottom: 8px;
}
.note-text { flex: 1; font-size: 13px; color: var(--ink, #2d2a26); }
.note-meta { font-size: 11px; color: var(--muted, #a39c93); white-space: nowrap; }
.refcode-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.refcode {
  font-family: monospace; font-size: 15px; letter-spacing: 1px; font-weight: 700;
  color: var(--primary, #8b6f47); background: #faf8f4; border: 1px dashed #d8c9b0;
  padding: 6px 14px; border-radius: 6px;
}
@media (max-width: 900px) {
  .member-metrics-container { grid-template-columns: repeat(3, 1fr); }
  .profile-head { flex-wrap: wrap; }
}

/* ---------- Referral & affiliate (marketing) ---------- */
.ref-rule-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0 16px; }
.ref-rule-strip--4 { grid-template-columns: repeat(4, 1fr); }
/* 风控规则 与 打款通道 并排；窄屏落成上下 */
.ref-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 18px; border-top: 1px solid var(--line, #e5e0d8); padding-top: 16px; }
.asset-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 12px; }
.asset-card { border: 1px solid var(--line, #e5e0d8); border-radius: 10px; overflow: hidden; background: #fff; }
.asset-card .thumb { height: 180px; background-size: contain; background-position: center; background-repeat: no-repeat; background-color: #faf8f4; }
.asset-card .meta { padding: 10px 12px; }
.asset-card .meta .n { font-size: 12px; font-weight: 600; color: var(--ink, #2d2a26); line-height: 1.3; }
.asset-card .meta .s { font-size: 11px; color: var(--muted, #a39c93); margin-top: 2px; }
.asset-card .dl { display: block; text-align: center; font-size: 12px; padding: 8px; color: var(--primary, #8b6f47); border-top: 1px solid var(--line, #e5e0d8); text-decoration: none; font-weight: 600; }
.asset-card .dl:hover { background: #faf8f4; }
.comm-row { display: flex; align-items: center; gap: 12px; }
.mono { font-family: monospace; }
@media (max-width: 900px) {
  .asset-grid { grid-template-columns: repeat(2, 1fr); }
  .ref-rule-strip,
  .ref-rule-strip--4,
  .ref-two-col { grid-template-columns: 1fr; }
}

/* ---------- Social share config & analytics ---------- */
.share-platform-toggles { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.checkbox-inline {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px;
  color: var(--ink, #2d2a26); cursor: pointer; user-select: none;
}
.checkbox-inline input { width: 16px; height: 16px; accent-color: var(--primary, #8b6f47); cursor: pointer; }
#share-default-text { width: 100%; resize: vertical; min-height: 60px; }

/* ============================================================
   店铺装修：微型 Tabs + 粘性保存条 + 单行内联控件
   一次只编辑一个模块（Tabs），每个配置项压到一行（inline-flex），
   保存按钮提到页面顶部粘性条（不再每个模块各放一个）。
   沿用上方既有 token 与间距值，不引入新色板。
   ============================================================ */

/* 粘性工具条：模块 Tabs + 未保存提示 + 统一保存 */
.cfg-bar {
  position: sticky; top: 64px; z-index: 9;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-bottom: 20px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .04);
}
.cfg-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.cfg-tab {
  border: 1px solid var(--hairline); border-radius: 999px; background: var(--surface);
  padding: 7px 14px; font-size: 13px; font-family: inherit; color: var(--ink-soft); cursor: pointer;
}
.cfg-tab:hover { border-color: var(--accent); color: var(--accent); }
.cfg-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.cfg-bar-right { display: flex; align-items: center; gap: 12px; }
.cfg-dirty { font-size: 12px; font-weight: 600; color: var(--accent); }
.cfg-dirty::before { content: '●'; font-size: 9px; margin-right: 5px; vertical-align: 1px; }
/* 一次只显示一个模块 */
.cfg-pane { margin-bottom: 0; }

/* 面板内边距：.panel 自身没有 padding，字段此前直接贴着卡片边线 */
.cfg-body { padding: 20px; }

/* 双栏：左 2/3 文案，右 1/3 配图与控制 */
.cfg-2col { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.cfg-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ---------- 单行内联控件：页面配图 / 推荐位 ----------
   [缩略图] 名称+所在页面 [路径] [显示方式] [上传替换][恢复默认] [状态 Badge] */
.img-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 0; border-bottom: 1px solid var(--hairline-soft);
}
.img-row:last-child { border-bottom: none; padding-bottom: 0; }
.img-row-thumb {
  width: 44px; height: 44px; flex: none; border-radius: 6px; border: 1px solid var(--hairline);
  background-color: #EFEAE3; background-size: cover; background-position: center; background-repeat: no-repeat;
}
.img-row-name { flex: none; width: 168px; font-size: 12px; font-weight: 600; color: var(--ink-soft); line-height: 1.35; }
.img-row-name .sub { display: block; font-weight: 400; font-size: 11px; color: var(--faint); }
/* 名称即前台深链：点开就能看到这张图实际在哪一页 */
a.img-row-name { text-decoration: none; cursor: pointer; }
a.img-row-name:hover, a.img-row-name:hover .sub { color: var(--accent); }
.img-row-name .go { margin-left: 4px; font-size: 10px; color: var(--faint); }
a.img-row-name:hover .go { color: var(--accent); }
.img-row input[type="text"] {
  flex: 1 1 200px; min-width: 130px; padding: 6px 8px; font-size: 12px; font-family: inherit;
  border: 1px solid var(--hairline); border-radius: 4px;
  background: var(--surface); color: var(--ink-soft); transition: border-color .15s;
}
.img-row input[type="text"]:focus { outline: none; border-color: var(--accent); }
.img-row select {
  flex: none; padding: 6px 8px; font-size: 12px; font-family: inherit;
  border: 1px solid var(--hairline); border-radius: 4px; background: var(--surface); color: var(--ink-soft);
}
.img-row-actions { display: flex; gap: 6px; flex: none; }
/* 状态提示不单独占行，收成小号灰字 Badge */
.img-row-badge {
  flex: none; padding: 2px 8px; border-radius: 999px; font-size: 11px;
  border: 1px solid var(--hairline); background: var(--surface-warm, #F7F4EF); color: var(--faint);
}
.img-row-badge.is-custom { color: var(--accent); border-color: rgba(139, 111, 71, .35); background: transparent; }

/* ---------- 页面内容 · 配图（上传式，不再让用户手填路径） ----------
   隐藏的 input[data-pageimg-input] 仍是值的唯一来源，上传/恢复默认都写回它，
   loadPages / 各保存函数继续按 id 读写，不受影响。 */
.pageimg-row { display: flex; align-items: center; gap: 12px; }
.pageimg-thumb {
  width: 64px; height: 64px; flex: none; border-radius: 6px;
  border: 1px solid var(--hairline); background-color: var(--surface-warm, #EFEAE3);
  background-size: cover; background-position: center; background-repeat: no-repeat;
}
/* 未自定义时预览的是前台默认图，压暗以示区别 */
.pageimg-thumb.is-default { opacity: .5; }
.pageimg-info { flex: 1; min-width: 0; }
.pageimg-name { display: block; font-size: 12px; font-weight: 600; color: var(--ink-soft); word-break: break-all; }
.pageimg-name.is-default { font-weight: 400; color: var(--faint); }
.pageimg-info .field-hint { display: block; margin-top: 2px; }

/* 图片尺寸标注：后台每个图片位都标出建议尺寸，全站最低 1024×1024 */
.img-size {
  flex: none; padding: 2px 7px; border-radius: 999px; white-space: nowrap;
  border: 1px dashed var(--hairline); background: transparent;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; color: var(--faint);
}
.img-size-note {
  font-size: 11px; color: var(--faint); margin: 0 0 10px; line-height: 1.6;
}
.img-size-note b { color: var(--ink-soft); font-weight: 600; }
.img-size-note code {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px;
  padding: 1px 5px; border-radius: 4px; background: var(--surface-warm, #F7F4EF); color: var(--accent);
}

/* ---------- 单行内联控件：首屏大图 ----------
   右栏只有 1/3 宽，操作按钮收成单字 + title 提示 */
.himg-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 0; border-bottom: 1px solid var(--hairline-soft);
}
.himg-row:last-child { border-bottom: none; padding-bottom: 0; }
.himg-row-thumb {
  position: relative; width: 44px; height: 44px; flex: none; border-radius: 6px;
  border: 1px solid var(--hairline); background-color: #EFEAE3;
  background-size: cover; background-position: center; background-repeat: no-repeat;
}
.himg-row-no {
  position: absolute; left: -6px; top: -6px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 600; line-height: 16px; text-align: center;
}
.himg-row input[type="text"] {
  flex: 1; min-width: 0; padding: 5px 7px; font-size: 11px; font-family: inherit;
  border: 1px solid var(--hairline); border-radius: 4px; background: var(--surface); color: var(--ink);
}
.himg-row input[type="text"]:focus { outline: none; border-color: var(--accent); }
.himg-row-actions { display: flex; gap: 4px; flex: none; }
.himg-row-actions .btn-ghost { padding: 4px 7px; font-size: 11px; line-height: 1; }
.himg-row-actions .btn-ghost[disabled] { opacity: .4; cursor: not-allowed; }

/* ---------- 买家秀：折叠条目（默认只展开前两条） ---------- */
details.ugc-item {
  border: 1px solid var(--hairline); border-radius: 8px; margin-bottom: 10px;
  background: var(--surface); overflow: hidden;
}
details.ugc-item > summary {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  cursor: pointer; list-style: none; background: var(--surface-warm, #F7F4EF);
}
details.ugc-item > summary::-webkit-details-marker { display: none; }
details.ugc-item > summary::before { content: '▸'; color: var(--faint); font-size: 12px; flex: none; }
details.ugc-item[open] > summary::before { content: '▾'; }
.ugc-sum-thumb {
  width: 40px; height: 40px; border-radius: 6px; flex: none;
  border: 1px solid var(--hairline); background-color: #EFEAE3;
  background-size: cover; background-position: center; background-repeat: no-repeat;
}
.ugc-sum-title { flex: none; font-size: 13px; font-weight: 600; color: var(--ink); }
.ugc-sum-meta {
  flex: 1; min-width: 0; font-size: 11px; color: var(--faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ugc-item-body { padding: 14px; border-top: 1px solid var(--hairline); }
.ugc-item .field-row--3 { grid-template-columns: 1fr 1fr 1fr; }
/* 买家秀配图：缩略图 + 路径 + 操作，压在一行 */
.ugc-img-row { display: flex; align-items: center; gap: 8px; }
.ugc-img-row-thumb {
  width: 44px; height: 44px; flex: none; border-radius: 6px;
  border: 1px solid var(--hairline); background-color: #EFEAE3;
  background-size: contain; background-position: center; background-repeat: no-repeat;
}
.ugc-img-row input[type="text"] {
  flex: 1; min-width: 0; padding: 6px 8px; font-size: 12px; font-family: inherit;
  border: 1px solid var(--hairline); border-radius: 4px; background: var(--surface); color: var(--ink-soft);
}
.ugc-img-row input[type="text"]:focus { outline: none; border-color: var(--accent); }
.ugc-img-row-actions { display: flex; gap: 6px; flex: none; }

/* ---------- 设置页：子标签页（邮件 / AI 助手 / 配送与仓库 / 文件清理） ----------
   复用店铺装修的 cfg-bar / cfg-tab 粘性标签条；面板按 data-spane 分组，一次只显示一组。 */
#view-settings .panel[data-spane] { display: none; }
#view-settings .panel[data-spane].active { display: block; }

/* ---------- 邮件设置：发送邮件地址（会员同步）列表 ---------- */
.mail-rcpt-list { margin-top: 8px; max-height: 260px; overflow: auto; border: 1px solid var(--hairline); border-radius: 8px; background: var(--surface); }
.mail-rcpt-row {
  display: flex; align-items: baseline; gap: 10px;
  padding: 8px 12px; font-size: 13px; color: var(--ink-soft);
  border-bottom: 1px solid var(--hairline-soft); cursor: pointer;
}
.mail-rcpt-row:last-child { border-bottom: none; }
.mail-rcpt-row:hover { background: var(--canvas); }
.mail-rcpt-row.is-expired { opacity: 0.45; }
.mail-rcpt-row .rcpt-sub { margin-left: auto; color: var(--faint); font-size: 12px; text-align: right; }
.mail-rcpt-empty { padding: 14px 12px; color: var(--muted); font-size: 13px; }

@media (max-width: 1180px) {
  .cfg-2col { grid-template-columns: 1fr; }
  .ugc-item .field-row--3 { grid-template-columns: 1fr 1fr; }
  /* 窄屏让名称与按钮先缩、收起两个 Badge（尺寸与状态都已在名称的悬浮提示里），保证仍是一行 */
  .img-row-name { width: 132px; }
  .img-row-actions .btn-ghost { padding: 7px 9px; }
  .img-row-badge, .img-size { display: none; }
  .himg-row { flex-wrap: wrap; }
}
