/* ============================================================
   Naturesphere 客户中枢 — 后台控制台样式
   设计语言继承自商城：暖沙大地棕 + 草木生机绿 + 柔和留白
   原则：专业可信、信息密度高、无障碍（WCAG AA、44px 触控、键盘可达）
   图标全部内联 SVG，禁止 emoji（Windows 字体兼容）
   ============================================================ */

:root {
  /* 品牌令牌（与商城同源） */
  --brand-50:  #fbf7f1;  --brand-100: #f3ead9;  --brand-200: #e6d4b4;
  --brand-300: #d5b88a;  --brand-400: #c19a63;  --brand-500: #a97f45;
  --brand-600: #8f6937;  --brand-700: #75542c;  --brand-800: #5c4123;  --brand-900: #44301a;
  --leaf-100:  #e7f0e0;  --leaf-300: #b6d3a4;  --leaf-500: #7fa965;  --leaf-700: #5d8347;
  --accent-500: #5b8db0;  --accent-100: #e3eef4;
  --success-500: #2f9e54;  --success-100: #dcf5e3;
  --warning-500: #c9821a;  --warning-100: #fbeed0;
  --error-500:   #d2453b;  --error-100:   #fbe1df;
  --info-500:    #3f87b0;  --info-100:    #e0f0f8;
  --neutral-50:#fafaf9; --neutral-100:#f5f5f4; --neutral-200:#e7e5e4;
  --neutral-300:#d6d3d1; --neutral-400:#a8a29e; --neutral-500:#78716c;
  --neutral-600:#57534e; --neutral-700:#44403c; --neutral-800:#292524; --neutral-900:#1c1917;

  --color-bg: #f6f4f0;          /* 后台底色略深，区分于商城 */
  --color-surface: #ffffff;
  --color-surface-2: #fbf9f6;
  --color-text: #292524;
  --color-text-strong: #1c1917;
  --color-text-muted: #78716c;
  --color-border: #e7e5e4;
  --color-border-strong: #d6d3d1;

  /* 品类语义色 */
  --cat-food: #7fa965;   --cat-health: #c0824a;  --cat-beauty: #b06fa6;  --cat-home: #5b8db0;

  --font-display: "PingFang SC","HarmonyOS Sans SC","Microsoft YaHei",system-ui,sans-serif;
  --font-body: "PingFang SC","HarmonyOS Sans SC","Microsoft YaHei",system-ui,sans-serif;
  --font-mono: "JetBrains Mono","SFMono-Regular",ui-monospace,Menlo,Consolas,monospace;

  --text-xs:0.75rem;  --text-sm:0.875rem;  --text-base:1rem;  --text-lg:1.125rem;
  --text-xl:1.25rem;  --text-2xl:1.5rem;   --text-3xl:1.875rem;

  --space-1:0.25rem; --space-2:0.5rem; --space-3:0.75rem; --space-4:1rem;
  --space-5:1.25rem; --space-6:1.5rem; --space-8:2rem; --space-10:2.5rem; --space-12:3rem;

  --radius-sm:8px; --radius-md:12px; --radius-lg:16px; --radius-xl:20px; --radius-full:9999px;
  --shadow-sm:0 1px 2px rgba(60,45,30,.06);
  --shadow-md:0 6px 18px rgba(60,45,30,.10);
  --shadow-lg:0 16px 40px rgba(60,45,30,.16);
  --ease-out:cubic-bezier(.22,1,.36,1);
  --dur-fast:150ms; --dur-normal:280ms;
  --sidebar-w:248px;
  --touch-min:44px;
}

* { box-sizing:border-box; margin:0; padding:0; }
html { scroll-behavior:smooth; -webkit-text-size-adjust:100%; }
body {
  font-family: var(--font-body); font-size: var(--text-base); line-height:1.5;
  color: var(--color-text); background: var(--color-bg);
  -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility;
}
img,svg { display:block; max-width:100%; }
button { font-family:inherit; font-size:inherit; color:inherit; border:none; background:none; cursor:pointer; }
a { color:inherit; text-decoration:none; }
input,select,textarea { font-family:inherit; font-size:inherit; color:inherit; }
ul,ol { list-style:none; }
:focus-visible { outline:2px solid var(--brand-500); outline-offset:2px; border-radius:var(--radius-sm); }

.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.skip-link { position:absolute; left:12px; top:-48px; z-index:300; background:var(--brand-700); color:#fff; padding:10px 16px; border-radius:var(--radius-md); transition:top var(--dur-fast); }
.skip-link:focus { top:12px; }

/* ============================== 布局骨架 ============================== */
.app { display:flex; min-height:100vh; }

/* 侧边栏 */
.sidebar {
  width: var(--sidebar-w); flex:none; position:sticky; top:0; height:100vh;
  background: linear-gradient(180deg, var(--brand-800), var(--brand-900));
  color:#f3ead9; display:flex; flex-direction:column; padding:var(--space-5) var(--space-4);
  z-index:40;
}
.brand { display:flex; align-items:center; gap:var(--space-3); padding:0 var(--space-2) var(--space-5); }
.brand-mark {
  width:40px; height:40px; flex:none;
  background:transparent;
  display:flex; align-items:center; justify-content:center;
}
.brand-name { font-weight:700; font-size:var(--text-lg); color:#fff; line-height:1.15; }
.brand-sub { font-size:var(--text-xs); color:#d5b88a; letter-spacing:.04em; }

.nav { display:flex; flex-direction:column; gap:4px; margin-top:var(--space-2); }
.nav-group { font-size:var(--text-xs); color:#b89a72; letter-spacing:.08em; padding:var(--space-4) var(--space-3) var(--space-2); text-transform:uppercase; }
.nav-item {
  display:flex; align-items:center; gap:var(--space-3); padding:var(--space-3) var(--space-3);
  border-radius:var(--radius-md); color:#e6d4b4; font-weight:500; min-height:var(--touch-min);
  transition:background var(--dur-fast), color var(--dur-fast); position:relative; text-align:left; width:100%;
}
.nav-item svg { width:20px; height:20px; flex:none; }
.nav-item:hover { background:rgba(255,255,255,.07); color:#fff; }
.nav-item.active { background:rgba(255,255,255,.14); color:#fff; }
.nav-item.active::before {
  content:""; position:absolute; left:0; top:50%; transform:translateY(-50%);
  width:4px; height:22px; border-radius:0 4px 4px 0; background:var(--leaf-500);
}
.nav-badge { margin-left:auto; background:var(--leaf-500); color:#10240f; font-size:11px; font-weight:700; padding:1px 8px; border-radius:999px; }

.sidebar-foot { margin-top:auto; padding:var(--space-3); border-top:1px solid rgba(255,255,255,.12); display:flex; align-items:center; gap:var(--space-3); }
.avatar-sm { width:34px; height:34px; border-radius:50%; background:var(--brand-300); color:var(--brand-900); display:flex; align-items:center; justify-content:center; font-weight:700; flex:none; }

/* 主区 */
.main { flex:1; min-width:0; display:flex; flex-direction:column; }

/* 顶栏 */
.topbar {
  position:sticky; top:0; z-index:30; height:64px; flex:none;
  background:rgba(255,255,255,.86); backdrop-filter:blur(8px);
  border-bottom:1px solid var(--color-border);
  display:flex; align-items:center; gap:var(--space-4); padding:0 var(--space-6);
}
.topbar h1 { font-size:var(--text-xl); font-weight:700; color:var(--color-text-strong); }
.topbar .crumb { font-size:var(--text-sm); color:var(--color-text-muted); }
.search {
  margin-left:auto; display:flex; align-items:center; gap:var(--space-2);
  background:var(--color-surface-2); border:1px solid var(--color-border);
  border-radius:var(--radius-full); padding:var(--space-2) var(--space-4); min-width:240px; min-height:var(--touch-min);
}
.search:focus-within { border-color:var(--brand-400); box-shadow:0 0 0 3px rgba(169,127,69,.12); }
.search input { border:none; background:none; outline:none; width:100%; }
.search svg { width:18px; height:18px; color:var(--color-text-muted); flex:none; }
.icon-btn {
  width:var(--touch-min); height:var(--touch-min); border-radius:50%;
  display:flex; align-items:center; justify-content:center; color:var(--color-text-strong);
  border:1px solid var(--color-border); background:var(--color-surface);
}
.icon-btn:hover { background:var(--color-surface-2); color:var(--brand-600); }

/* 内容容器 */
.content { padding:var(--space-6); max-width:1320px; width:100%; margin:0 auto; }
.page-head { display:flex; align-items:flex-end; justify-content:space-between; gap:var(--space-4); flex-wrap:wrap; margin-bottom:var(--space-6); }
.page-head h2 { font-size:var(--text-2xl); font-weight:700; color:var(--color-text-strong); }
.page-head p { color:var(--color-text-muted); font-size:var(--text-sm); margin-top:4px; }

/* ============================== 通用卡片/面板 ============================== */
.panel { background:var(--color-surface); border:1px solid var(--color-border); border-radius:var(--radius-lg); box-shadow:var(--shadow-sm); }
.panel-pad { padding:var(--space-5); }
.panel-head { display:flex; align-items:center; justify-content:space-between; gap:var(--space-3); padding:var(--space-4) var(--space-5); border-bottom:1px solid var(--color-border); }
.panel-head h3 { font-size:var(--text-lg); font-weight:700; color:var(--color-text-strong); }
.panel-head .hint { font-size:var(--text-xs); color:var(--color-text-muted); }

.grid { display:grid; gap:var(--space-4); }
.grid-2 { grid-template-columns:repeat(2,1fr); }
.grid-3 { grid-template-columns:repeat(3,1fr); }
.grid-4 { grid-template-columns:repeat(4,1fr); }
@media (max-width:1100px){ .grid-4{ grid-template-columns:repeat(2,1fr);} .grid-3{ grid-template-columns:repeat(2,1fr);} }
@media (max-width:720px){ .grid-2,.grid-3,.grid-4{ grid-template-columns:1fr; } }

/* KPI 卡 */
.kpi { background:var(--color-surface); border:1px solid var(--color-border); border-radius:var(--radius-lg); padding:var(--space-4) var(--space-5); box-shadow:var(--shadow-sm); position:relative; overflow:hidden; }
.kpi::after { content:""; position:absolute; right:-20px; top:-20px; width:80px; height:80px; border-radius:50%; background:var(--brand-50); opacity:.7; }
.kpi .label { font-size:var(--text-sm); color:var(--color-text-muted); display:flex; align-items:center; gap:var(--space-2); }
.kpi .label svg { width:18px; height:18px; color:var(--brand-500); }
.kpi .value { font-size:var(--text-3xl); font-weight:800; color:var(--color-text-strong); margin-top:var(--space-2); line-height:1; font-variant-numeric:tabular-nums; }
.kpi .delta { font-size:var(--text-xs); margin-top:var(--space-2); display:inline-flex; align-items:center; gap:4px; font-weight:600; }
.kpi .delta.up { color:var(--success-500); }
.kpi .delta.down { color:var(--error-500); }

/* 徽章 / 标签 */
.badge { display:inline-flex; align-items:center; gap:5px; font-size:var(--text-xs); font-weight:600; padding:3px 10px; border-radius:var(--radius-full); white-space:nowrap; }
.badge svg { width:13px; height:13px; }
.badge-brand { background:var(--brand-100); color:var(--brand-700); }
.badge-leaf  { background:var(--leaf-100);  color:var(--leaf-700); }
.badge-info  { background:var(--info-100);  color:var(--info-500); }
.badge-warn  { background:var(--warning-100); color:var(--warning-500); }
.badge-err   { background:var(--error-100);  color:var(--error-500); }
.badge-success { background:var(--success-100); color:var(--success-500); }
.badge-ghost { background:var(--neutral-100); color:var(--neutral-600); }

.chip { display:inline-flex; align-items:center; gap:5px; font-size:var(--text-xs); padding:4px 10px; border-radius:var(--radius-full); border:1px solid var(--color-border-strong); color:var(--color-text-muted); background:var(--color-surface); }
.chip.cat-food { border-color:var(--cat-food); color:var(--leaf-700); background:var(--leaf-100); }
.chip.cat-health { border-color:var(--cat-health); color:#9a5d24; background:#f8eede; }
.chip.cat-beauty { border-color:var(--cat-beauty); color:#8a4f80; background:#fbeef8; }
.chip.cat-home { border-color:var(--cat-home); color:#3f6f8c; background:#e6f0f5; }

/* 按钮 */
.btn { display:inline-flex; align-items:center; justify-content:center; gap:var(--space-2); min-height:var(--touch-min); padding:0 var(--space-5); font-size:var(--text-sm); font-weight:600; border-radius:var(--radius-full); border:1.5px solid transparent; transition:all var(--dur-fast) var(--ease-out); cursor:pointer; }
.btn svg { width:18px; height:18px; }
.btn:active { transform:scale(.97); }
.btn--primary { background:var(--brand-500); color:#fff; box-shadow:var(--shadow-sm); }
.btn--primary:hover { background:var(--brand-600); transform:translateY(-1px); box-shadow:var(--shadow-md); }
.btn--secondary { background:var(--color-surface); color:var(--color-text-strong); border-color:var(--color-border-strong); }
.btn--secondary:hover { border-color:var(--brand-500); color:var(--brand-600); background:var(--brand-50); }
.btn--ghost { background:transparent; color:var(--color-text-strong); }
.btn--ghost:hover { background:var(--color-surface-2); }
.btn--danger { background:#fff; color:var(--error-500); border:1px solid var(--error-500); }
.btn--danger:hover { background:var(--error-100); }
.btn--sm { min-height:36px; padding:0 var(--space-4); font-size:var(--text-xs); }
.btn--block { width:100%; }

/* ============================== 表格 ============================== */
.table-wrap { overflow-x:auto; }
table.data { width:100%; border-collapse:collapse; font-size:var(--text-sm); }
table.data th { text-align:left; font-weight:600; color:var(--color-text-muted); padding:var(--space-3) var(--space-4); border-bottom:1px solid var(--color-border); white-space:nowrap; position:sticky; top:0; background:var(--color-surface); }
table.data td { padding:var(--space-3) var(--space-4); border-bottom:1px solid var(--color-border); vertical-align:middle; }
table.data tbody tr { transition:background var(--dur-fast); cursor:pointer; }
table.data tbody tr:hover { background:var(--brand-50); }
table.data tbody tr:focus-visible { outline:2px solid var(--brand-500); outline-offset:-2px; }
.cust-cell { display:flex; align-items:center; gap:var(--space-3); }
.avatar { width:38px; height:38px; border-radius:50%; flex:none; display:flex; align-items:center; justify-content:center; font-weight:700; color:#fff; }
.avatar.m { background:linear-gradient(135deg,#5b8db0,#3f6f8c); }
.avatar.f { background:linear-gradient(135deg,#c0824a,#a97f45); }
.cust-name { font-weight:600; color:var(--color-text-strong); }
.cust-meta { font-size:var(--text-xs); color:var(--color-text-muted); }

/* 进度/占比条 */
.bar { height:8px; border-radius:999px; background:var(--neutral-200); overflow:hidden; min-width:80px; }
.bar > span { display:block; height:100%; border-radius:999px; background:var(--brand-500); }

/* 图表容器 */
.chart-card { background:var(--color-surface); border:1px solid var(--color-border); border-radius:var(--radius-lg); padding:var(--space-5); box-shadow:var(--shadow-sm); }
.chart-title { font-size:var(--text-sm); font-weight:600; color:var(--color-text-strong); margin-bottom:var(--space-4); display:flex; align-items:center; justify-content:space-between; }
.chart-title .sub { font-size:var(--text-xs); color:var(--color-text-muted); font-weight:400; }
svg.chart { width:100%; height:auto; display:block; overflow:visible; }

.legend { display:flex; flex-wrap:wrap; gap:var(--space-3); margin-top:var(--space-3); font-size:var(--text-xs); color:var(--color-text-muted); }
.legend i { width:10px; height:10px; border-radius:3px; display:inline-block; margin-right:5px; vertical-align:middle; }
.legend .lg { display:inline-flex; align-items:center; }

/* ============================== 抽屉（客户档案） ============================== */
.drawer { position:fixed; inset:0; z-index:100; display:flex; pointer-events:none; }
.drawer-mask { position:absolute; inset:0; background:rgba(28,25,23,0); transition:background var(--dur-normal); }
.drawer-panel {
  position:relative; margin-left:auto; width:100%; max-width:560px; height:100%;
  background:var(--color-surface); display:flex; flex-direction:column;
  transform:translateX(100%); transition:transform var(--dur-normal) var(--ease-out);
  box-shadow:var(--shadow-lg);
}
.drawer.open { pointer-events:auto; }
.drawer.open .drawer-mask { background:rgba(28,25,23,.5); }
.drawer.open .drawer-panel { transform:translateX(0); }
#drawerBody { display:flex; flex-direction:column; height:100%; min-height:0; }
.drawer-head { padding:var(--space-5); border-bottom:1px solid var(--color-border); display:flex; align-items:flex-start; gap:var(--space-4); }
.drawer-body { padding:var(--space-5); overflow:auto; flex:1; }
.drawer-close { margin-left:auto; width:var(--touch-min); height:var(--touch-min); border-radius:50%; display:flex; align-items:center; justify-content:center; color:var(--color-text-muted); }
.drawer-close:hover { background:var(--color-surface-2); color:var(--color-text-strong); }

.profile-hero { display:flex; align-items:center; gap:var(--space-4); }
.profile-hero .avatar { width:56px; height:56px; font-size:var(--text-lg); }
.sec-title { font-size:var(--text-sm); font-weight:700; color:var(--color-text-strong); margin:var(--space-6) 0 var(--space-3); display:flex; align-items:center; gap:var(--space-2); }
.sec-title svg { width:16px; height:16px; color:var(--brand-500); }
.kv { display:grid; grid-template-columns:96px 1fr; gap:var(--space-2) var(--space-3); font-size:var(--text-sm); padding:var(--space-2) 0; border-bottom:1px dashed var(--color-border); }
.kv .k { color:var(--color-text-muted); }
.kv .v { color:var(--color-text-strong); font-weight:500; }
.tag-row { display:flex; flex-wrap:wrap; gap:var(--space-2); }

/* 时间线 */
.timeline { position:relative; padding-left:var(--space-5); }
.timeline::before { content:""; position:absolute; left:7px; top:4px; bottom:4px; width:2px; background:var(--color-border); }
.tl-item { position:relative; padding:0 0 var(--space-4) var(--space-2); }
.tl-item::before { content:""; position:absolute; left:-18px; top:4px; width:14px; height:14px; border-radius:50%; background:var(--brand-500); border:3px solid var(--color-surface); box-shadow:0 0 0 1px var(--color-border); }
.tl-date { font-size:var(--text-xs); color:var(--color-text-muted); }
.tl-text { font-size:var(--text-sm); color:var(--color-text-strong); margin-top:2px; }

/* ============================== 专属塑品 ============================== */
.curation-grid { display:grid; grid-template-columns:320px 1fr; gap:var(--space-5); align-items:start; }
@media (max-width:900px){ .curation-grid{ grid-template-columns:1fr; } }
.cust-pick-list { display:flex; flex-direction:column; gap:var(--space-2); max-height:560px; overflow:auto; }
.cust-pick { display:flex; align-items:center; gap:var(--space-3); padding:var(--space-3); border:1px solid var(--color-border); border-radius:var(--radius-md); cursor:pointer; background:var(--color-surface); transition:all var(--dur-fast); text-align:left; width:100%; }
.cust-pick:hover { border-color:var(--brand-300); background:var(--brand-50); }
.cust-pick.active { border-color:var(--brand-500); box-shadow:0 0 0 3px rgba(169,127,69,.12); }
.cust-pick .avatar { width:40px; height:40px; }

.product-card { display:flex; align-items:center; gap:var(--space-4); padding:var(--space-4); border:1px solid var(--color-border); border-radius:var(--radius-md); margin-bottom:var(--space-3); }
.prod-thumb { width:56px; height:56px; border-radius:var(--radius-md); flex:none; display:flex; align-items:center; justify-content:center; font-weight:700; color:#fff; font-size:var(--text-lg); }
.prod-info { flex:1; min-width:0; }
.prod-name { font-weight:600; color:var(--color-text-strong); }
.prod-tag { font-size:var(--text-xs); color:var(--color-text-muted); }
.prod-price { font-weight:700; color:var(--brand-700); font-variant-numeric:tabular-nums; white-space:nowrap; }

.curation-empty { text-align:center; padding:var(--space-12) var(--space-4); color:var(--color-text-muted); }
.curation-empty svg { width:48px; height:48px; color:var(--brand-300); margin:0 auto var(--space-3); }

/* ============================== 表单 / 控件 ============================== */
.field { display:flex; flex-direction:column; gap:var(--space-2); margin-bottom:var(--space-4); }
.field label { font-size:var(--text-sm); font-weight:600; color:var(--color-text-strong); }
.input, .select, .textarea {
  width:100%; min-height:var(--touch-min); padding:var(--space-3) var(--space-4);
  border:1px solid var(--color-border-strong); border-radius:var(--radius-md);
  background:var(--color-surface); font-size:var(--text-sm); transition:all var(--dur-fast);
}
.input:focus, .select:focus, .textarea:focus { outline:none; border-color:var(--brand-500); box-shadow:0 0 0 3px rgba(169,127,69,.12); }
.seg-control { display:inline-flex; background:var(--color-surface-2); border:1px solid var(--color-border); border-radius:var(--radius-full); padding:4px; gap:4px; }
.seg-control button { padding:var(--space-2) var(--space-4); border-radius:var(--radius-full); font-size:var(--text-sm); font-weight:600; color:var(--color-text-muted); min-height:36px; }
.seg-control button.active { background:var(--brand-500); color:#fff; }

/* 提示条 / 空状态 */
.callout { display:flex; gap:var(--space-3); padding:var(--space-4); border-radius:var(--radius-md); font-size:var(--text-sm); }
.callout svg { width:20px; height:20px; flex:none; margin-top:1px; }
.callout-info { background:var(--info-100); color:#2c5f7d; }
.callout-warn { background:var(--warning-100); color:#8a5a10; }
.callout-info svg, .callout-warn svg { color:inherit; }

.note-line { font-size:var(--text-sm); color:var(--color-text-muted); line-height:1.6; }

/* 营销列表 */
.camp-row { display:flex; align-items:center; gap:var(--space-4); padding:var(--space-4); border:1px solid var(--color-border); border-radius:var(--radius-md); margin-bottom:var(--space-3); }
.camp-ico { width:44px; height:44px; border-radius:var(--radius-md); display:flex; align-items:center; justify-content:center; color:#fff; flex:none; }
.camp-ico svg { width:22px; height:22px; }

/* 响应式：侧栏折叠 */
@media (max-width:860px){
  .sidebar { position:fixed; left:0; top:0; transform:translateX(-100%); transition:transform var(--dur-normal) var(--ease-out); box-shadow:var(--shadow-lg); }
  .sidebar.open { transform:translateX(0); }
  .menu-toggle { display:inline-flex !important; }
  .topbar { padding:0 var(--space-4); }
  .content { padding:var(--space-4); }
  .search { min-width:0; width:160px; }
}
.menu-toggle { display:none; }
.scrim { position:fixed; inset:0; background:rgba(28,25,23,.5); z-index:39; display:none; }
.scrim.show { display:block; }

/* ============================== 智能文案助手工作台 ============================== */
.studio-grid { display:grid; grid-template-columns:360px 1fr; gap:var(--space-5); align-items:start; }
@media (max-width:980px){ .studio-grid { grid-template-columns:1fr; } }

.sp-prod-list { display:flex; flex-direction:column; gap:8px; max-height:260px; overflow:auto; margin-bottom:var(--space-3); }
.sp-prod { display:flex; align-items:center; gap:var(--space-3); padding:10px 12px; border:1px solid var(--color-border); border-radius:var(--radius-md); background:var(--color-surface); cursor:pointer; text-align:left; width:100%; min-height:var(--touch-min); transition:all var(--dur-fast); }
.sp-prod:hover { border-color:var(--brand-300); background:var(--brand-50); }
.sp-prod.active { border-color:var(--brand-500); box-shadow:0 0 0 3px rgba(169,127,69,.12); }
.sp-prod-thumb { width:38px; height:38px; border-radius:10px; flex:none; display:flex; align-items:center; justify-content:center; color:#fff; font-weight:700; position:relative; overflow:hidden; }
.sp-prod-thumb img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; display:block; }
.sp-cat-row { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:12px; }
.sp-cat { padding:5px 12px; border-radius:999px; border:1px solid var(--color-border); background:var(--color-surface); color:var(--color-text-muted); font-size:13px; cursor:pointer; transition:all var(--dur-fast); }
.sp-cat:hover { border-color:var(--brand-300); }
.sp-cat.active { background:var(--brand-500); border-color:var(--brand-500); color:#fff; }
.sp-prod-info { flex:1; min-width:0; }
.sp-prod-name { font-weight:600; font-size:var(--text-sm); color:var(--color-text-strong); }
.sp-prod-meta { font-size:var(--text-xs); color:var(--color-text-muted); display:flex; gap:6px; align-items:center; }
.sp-prod > svg { width:18px; height:18px; color:var(--color-text-muted); flex:none; }

.sp-scene-pal { display:grid; grid-template-columns:repeat(2,1fr); gap:var(--space-3); margin-bottom:var(--space-3); }
.sp-scene-chip { display:flex; align-items:center; gap:var(--space-3); padding:10px 12px; border:1px solid var(--color-border); border-radius:var(--radius-md); background:var(--color-surface); cursor:pointer; text-align:left; width:100%; transition:all var(--dur-fast); }
.sp-scene-chip:hover { border-color:var(--brand-300); }
.sp-scene-chip.active { border-color:var(--sc, var(--brand-500)); background:var(--brand-50); }
.sp-scene-ico { width:34px; height:34px; flex:none; display:flex; align-items:center; justify-content:center; }
.sp-scene-ico svg { width:100%; height:100%; }
.sp-scene-txt { display:flex; flex-direction:column; line-height:1.25; }
.sp-scene-txt b { font-size:var(--text-sm); color:var(--color-text-strong); }
.sp-scene-txt i { font-size:11px; color:var(--color-text-muted); font-style:normal; }

.sp-theme-row { display:inline-flex; gap:8px; margin-bottom:var(--space-3); flex-wrap:wrap; }
.sp-theme { padding:8px 16px; border-radius:999px; border:1px solid var(--color-border); font-size:var(--text-sm); font-weight:600; color:var(--color-text-muted); min-height:36px; }
.sp-theme.active { background:var(--brand-500); color:#fff; border-color:var(--brand-500); }
.sp-accent-row { display:flex; gap:10px; }
.sp-accent { width:30px; height:30px; border-radius:50%; border:2px solid #fff; box-shadow:0 0 0 1px var(--color-border-strong); cursor:pointer; }
.sp-accent.active { box-shadow:0 0 0 3px var(--brand-500); }

.studio-right { display:flex; flex-direction:column; gap:14px; }
.sopia-toolbar { display:flex; align-items:center; justify-content:space-between; gap:var(--space-3); flex-wrap:wrap; background:var(--color-surface); border:1px solid var(--color-border); border-radius:var(--radius-lg); padding:var(--space-3) var(--space-4); }
.sopia-tool-hint { font-size:var(--text-sm); color:var(--color-text-muted); }
.phone-frame { width:100%; max-width:400px; margin:0 auto; height:700px; background:#1c1917; border-radius:30px; padding:12px; box-shadow:var(--shadow-lg); }
.phone-frame iframe { width:100%; height:100%; border:none; border-radius:20px; background:#fff; }
.copy-panel-wrap { background:var(--color-surface); border:1px solid var(--color-border); border-radius:var(--radius-lg); padding:var(--space-3) var(--space-4); }
.copy-panel-wrap summary { cursor:pointer; font-size:var(--text-sm); font-weight:600; color:var(--color-text-strong); }
.copy-panel { margin-top:var(--space-3); display:flex; flex-direction:column; gap:10px; }
.copy-line { display:flex; gap:10px; align-items:flex-start; }
.copy-tag { flex:none; font-size:11px; font-weight:700; padding:2px 8px; border-radius:999px; color:#fff; }
.copy-hero { background:var(--brand-500); } .copy-point { background:var(--leaf-500); } .copy-scene { background:var(--accent-500); } .copy-origin { background:var(--warning-500); } .copy-cta { background:var(--success-500); }
.copy-line pre { margin:0; white-space:pre-wrap; font-size:var(--text-sm); line-height:1.6; color:var(--color-text); font-family:var(--font-body); }

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce){
  * { animation-duration:.01ms !important; transition-duration:.01ms !important; }
}

/* ---------- 商城实时订单面板 ---------- */
.live-card { padding: 18px 20px; }
.live-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:14px; }
.live-head .chart-title { margin:0; }
.live-sum { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-bottom:14px; }
.live-stat { background:var(--brand-50); border:1px solid var(--brand-200); border-radius:12px; padding:12px 14px; }
.live-stat .num { display:block; font-size:22px; font-weight:800; color:var(--brand-700); line-height:1.1; }
.live-stat .lbl { font-size:12px; color:var(--color-text-muted); }

/* 订单明细表：规整对齐，长商品名自动换行，不再溢出 */
.live-table { width:100%; border-collapse:collapse; font-size:13px; }
.live-table thead th { text-align:left; padding:10px 12px; color:var(--color-text-muted); font-weight:600;
  border-bottom:2px solid var(--color-border); white-space:nowrap; background:var(--color-surface-2); }
.live-table thead th.num, .live-table td.num { text-align:right; }
.live-table tbody td { padding:11px 12px; border-bottom:1px solid var(--color-border); vertical-align:top; color:var(--neutral-700); }
.live-table tbody tr:hover { background:var(--brand-50); }
.live-table .live-no { font-weight:700; color:var(--neutral-800); line-height:1.3; }
.live-table .live-no .cust-meta { display:block; font-weight:400; margin-top:2px; }
.live-table .live-cust { vertical-align:top; }
.live-table .cust-body { display:flex; flex-direction:column; align-items:flex-start; gap:3px; }
.live-table .cust-line { display:flex; align-items:center; gap:6px; }
.live-table .cust-line svg { color:var(--brand-500); flex:none; }
.live-table .cust-name { font-weight:600; color:var(--neutral-800); line-height:1.3; }
.live-table .cust-phone { font-size:var(--text-xs); color:var(--color-text-muted); }
.live-table .live-pay { white-space:nowrap; }
.pay-badge { display:inline-flex; align-items:center; padding:2px 9px; border-radius:999px; font-size:12px; font-weight:500; line-height:1.4; }
.pay-wx { background:var(--leaf-100); color:var(--leaf-700); }
.pay-ali { background:var(--accent-100); color:var(--accent-500); }
.pay-cod { background:var(--brand-100); color:var(--brand-700); }
.pay-other { background:var(--neutral-100); color:var(--color-text-muted); }
.live-table .live-tier { white-space:nowrap; }
.member-badge { display:inline-flex; align-items:center; gap:5px; padding:2px 9px; border-radius:999px; font-size:12px; font-weight:500; line-height:1.4; }
.member-badge::before { content:""; width:6px; height:6px; border-radius:50%; background:currentColor; flex:none; }
.mem-month { background:var(--leaf-100); color:var(--leaf-700); }
.mem-year { background:var(--brand-100); color:var(--brand-700); }
.mem-top { background:#f3e6cf; color:#8a6d3b; }
.mem-none { background:var(--neutral-100); color:var(--color-text-muted); }
.live-table .live-items { min-width:200px; line-height:1.5; word-break:break-word; }
.live-table .live-addr { max-width:240px; line-height:1.5; color:var(--neutral-800); word-break:break-word; }
.live-table .live-amt { font-weight:700; color:var(--brand-700); white-space:nowrap; }
.live-empty { padding:26px; text-align:center; color:var(--color-text-muted); font-size:13px; background:var(--color-surface-2); border-radius:10px; }
@media (max-width: 720px){
  .live-sum { grid-template-columns:repeat(2,1fr); }
  .live-table thead { display:none; }
  .live-table, .live-table tbody, .live-table tr, .live-table td { display:block; width:100%; }
  .live-table tr { border:1px solid var(--color-border); border-radius:10px; margin-bottom:10px; padding:6px 4px; }
  .live-table tbody td { border:none; padding:4px 12px; display:flex; justify-content:space-between; gap:12px; }
  .live-table tbody td::before { content:attr(data-label); color:var(--color-text-muted); font-size:12px; flex:none; }
  .live-table .live-items { min-width:0; }
}

/* 新客欢迎塑品卡 */
.welcome-sopia { display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap;
  background:linear-gradient(135deg,var(--brand-50),#fff); border:1px solid var(--brand-200); border-radius:14px; padding:14px 16px; }
.welcome-sopia-info { min-width:200px; }

/* 塑品预览弹窗 */
.sopia-modal { position:fixed; inset:0; z-index:60; display:none; }
.sopia-modal.open { display:flex; align-items:center; justify-content:center; }
.sopia-modal-mask { position:absolute; inset:0; background:rgba(28,25,23,.55); }
.sopia-modal-box { position:relative; width:min(440px,94vw); height:min(86vh,820px); background:#fff; border-radius:18px; overflow:hidden;
  box-shadow:0 24px 60px rgba(40,30,20,.35); display:flex; flex-direction:column; }
.sopia-modal-bar { display:flex; align-items:center; justify-content:space-between; padding:10px 14px; border-bottom:1px solid var(--color-border); font-weight:600; color:var(--neutral-800); }
.sopia-modal #sopiaModalFrame { flex:1; width:100%; border:none; background:var(--brand-50); }

/* ============ 售后处理 ============ */
.nav-badge--warn { background:#f59e0b; color:#3a2400; }
.as-tabs { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:16px; }
.as-tab { display:inline-flex; align-items:center; gap:6px; padding:7px 14px; border:1px solid var(--color-border-strong); background:var(--color-surface); border-radius:var(--radius-full); font-size:13px; color:var(--color-text-muted); cursor:pointer; transition:all var(--dur-fast); }
.as-tab:hover { border-color:var(--brand-500); color:var(--brand-600); }
.as-tab.active { background:var(--brand-500); border-color:var(--brand-500); color:#fff; }
.as-tab-n { font-size:11px; background:rgba(0,0,0,.08); border-radius:999px; padding:0 7px; }
.as-tab.active .as-tab-n { background:rgba(255,255,255,.25); }
.as-list { display:flex; flex-direction:column; gap:14px; }
.as-card { background:#fff; border:1px solid var(--color-border); border-radius:12px; padding:16px 18px; box-shadow:var(--shadow-sm); }
.as-card-top { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.as-card-no { font-weight:700; color:var(--color-text-strong); font-size:15px; }
.as-types { display:inline-flex; flex-wrap:wrap; gap:6px; margin-left:10px; vertical-align:middle; }
.as-card-meta { font-size:12px; color:var(--color-text-muted); margin-top:6px; }
.as-card-text { font-size:14px; line-height:1.7; color:var(--color-text); margin:10px 0; white-space:pre-wrap; }
.voice-admin-reply { font-size:13px; line-height:1.6; color:var(--color-text-muted); background:var(--color-surface-2); border-radius:10px; padding:10px 12px; margin:8px 0; }
.as-card-reason { font-size:14px; line-height:1.7; color:var(--neutral-700); margin:10px 0; white-space:pre-wrap; }
.as-files { display:flex; flex-wrap:wrap; gap:10px; margin-bottom:12px; }
.as-file { width:88px; height:88px; border-radius:10px; overflow:hidden; border:1px solid var(--color-border); display:flex; align-items:center; justify-content:center; background:var(--color-surface-2); color:var(--color-text-muted); flex-direction:column; gap:4px; text-decoration:none; }
.as-file img { width:100%; height:100%; object-fit:cover; }
.as-file--vid { font-size:11px; padding:6px; text-align:center; line-height:1.4; }
.as-card-foot { display:flex; gap:12px; align-items:flex-end; flex-wrap:wrap; }
.as-note { flex:1; min-width:200px; }
.as-actions { display:flex; gap:8px; flex-wrap:wrap; }
