:root { --ink:#2b2b2b; --muted:#8a8a8a; --line:#e6e2da; --bg:#faf8f4;
        --surface:#fff; --surface-2:#fcfbf9; --surface-3:#f7f4ef;
        --accent:#8c2f27; --accent-soft:#f6e6e3; --accent-hover:#7a2820;
        --ok:#2f7d4f; --warn:#a86a1f; --topbar:52px;
        --ok-bg:#e4f1e8; --warn-bg:#f8ecdc; --bad-bg:#f7e3e1;
        --hover:#faf7f3; --shadow:rgba(0,0,0,.18); }
/* 暗色：只换变量，不动结构。侧栏/表格/面板都跟着走，
   所以任何新增组件只要用变量就自动适配（不要在组件里写死颜色）。 */
html[data-theme="dark"] { --ink:#e6e1d9; --muted:#9a938a; --line:#3a3630;
        --bg:#1c1a17; --surface:#26231f; --surface-2:#2b2723; --surface-3:#332e29;
        --accent:#d98b7f; --accent-soft:#4a2f2a; --accent-hover:#e8a094;
        --ok:#7fc79b; --warn:#dfae6a; --hover:#302b26; --shadow:rgba(0,0,0,.5);
        --ok-bg:#22392c; --warn-bg:#3a2f1d; --bad-bg:#46272a; }
* { box-sizing:border-box; }
body { margin:0; font:15px/1.6 -apple-system,"PingFang SC","Microsoft YaHei",sans-serif;
       color:var(--ink); background:var(--bg); }
a { color:var(--accent); text-decoration:none; }
a:hover { text-decoration:underline; }
.wrap { display:flex; min-height:100vh; }
.side { width:212px; background:var(--surface); border-right:1px solid var(--line);
        padding:16px 0; }
/* 品牌两行：上行大字居中（品牌），下行小字（产品定位）。
   「反显」= 色块上的字：桌面端做成深色底 + 浅色字，比纯文字更有识别度，
   但侧栏本身是浅色，所以用左侧色条 + 字色区分，避免整块色导致菜单发闷。 */
.brand { padding:2px 14px 16px; border-bottom:1px solid var(--line);
         margin-bottom:10px; text-align:center; }
.brand__name { display:block; font-size:22px; font-weight:700; letter-spacing:.12em;
               color:var(--accent); line-height:1.2; }
.brand__sub { display:block; font-size:11px; letter-spacing:.18em; color:var(--muted);
              margin-top:4px; }
/* 分组可折叠：用原生 <details>，不依赖 JS；当前页所在组自动展开 */
.side details { margin:2px 0; }
.side details > summary { margin:12px 0 2px; padding:6px 16px 4px; font-size:13px;
    color:var(--muted); cursor:pointer; list-style:none; display:flex;
    align-items:center; gap:4px; user-select:none; }
.side details > summary::-webkit-details-marker { display:none; }
.side details > summary:hover { color:var(--ink); }
.side details > summary::after { content:""; width:9px; height:9px; flex:0 0 auto;
    margin-right:2px; background-repeat:no-repeat; background-position:center;
    background-size:9px 9px; opacity:.55; transition:transform .15s;
    background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%238a8a8a' stroke-width='2' stroke-linecap='round'><path d='M3 4.5l3 3 3-3'/></svg>"); }
.side details[open] > summary::after { transform:rotate(180deg); }
.side details[open] > summary { color:var(--ink); }
/* 菜单项：图标 + 中文名 + 英文术语 + 待办角标；当前项左侧色条 */
.side a { display:flex; align-items:center; gap:8px; padding:7px 14px 7px 16px;
          color:var(--ink); font-size:14px; line-height:1.25;
          border-left:3px solid transparent; }
.side a:hover { background:var(--hover); color:var(--accent); text-decoration:none; }
.side a.on { background:var(--accent-soft); color:var(--accent); font-weight:600;
             border-left-color:var(--accent); }
.nav-icon { width:16px; height:16px; flex:0 0 16px; opacity:.75; }
.side a.on .nav-icon { opacity:1; }
.nav-label { flex:1 1 auto; }
/* 英文/行业术语：小一号、淡色，给「对得上行业」用，不抢中文的眼睛 */
.nav-en { flex:0 0 auto; font-size:11px; color:var(--muted);
          border:1px solid var(--line); border-radius:3px; padding:0 4px; }
.nav-badge { flex:0 0 auto; min-width:18px; text-align:center; font-size:11px;
             font-weight:600; color:#fff; background:var(--accent);
             border-radius:9px; padding:1px 5px; }
/* 子分组标题（商品 / 订单与售后 / 内容运营…）：比组标题更轻、缩进更多 */
.nav-block { padding:8px 16px 3px 22px; font-size:11px; letter-spacing:.06em;
             color:var(--muted); }
.nav-grp__name { font-weight:600; white-space:nowrap; }
/* 组说明只在**展开时**显示：收起时那一行要留给「组名 + 待办角标」，
   挤在一起会把「福慧小店」折成两行（窄侧栏下尤其明显） */
.nav-grp__sub { display:none; }
.side details[open] .nav-grp__sub { display:inline; }
.nav-badge--grp { margin-left:auto; margin-right:16px; }
.nav-grp__sub { font-size:11px; color:#bdb3a6; margin-left:6px; font-weight:400; }
/* 全宽：管理后台是工作台，大屏应充分利用（原先限宽 1180px 浪费近半屏） */
.main { flex:1; padding:20px 26px; min-width:0; }
h2 { margin:0 0 4px; font-size:20px; }
.sub { color:var(--muted); font-size:13px; margin-bottom:16px; }
table { border-collapse:collapse; width:100%; background:var(--surface);
        border:1px solid var(--line); font-size:14px; }
th,td { text-align:left; padding:8px 10px; border-bottom:1px solid var(--line); }
th { background:var(--surface-3); font-weight:600; font-size:13px; color:var(--ink); }
tr:last-child td { border-bottom:0; }
.num { text-align:right; font-variant-numeric:tabular-nums; }
.tag { display:inline-block; padding:1px 7px; border-radius:10px; font-size:12px;
       background:var(--surface-3); color:var(--ink); }
.tag.ok { background:var(--ok-bg); color:var(--ok); }
.tag.warn { background:var(--warn-bg); color:var(--warn); }
.tag.bad { background:var(--bad-bg); color:var(--accent); }
/* 说明：容器统一用 .panel（见「列表页规范组件」段）。
   原先并存 .card 与 .panel 两套，导致详情页/工作台/列表页三种写法 —— 已废弃 .card。 */
.row { display:flex; gap:14px; flex-wrap:wrap; }
.row > * { flex:1 1 220px; }
.kpi { font-size:24px; font-weight:600; }
/* 无图占位块（约六成 SKU 没图；留空会让整列塌陷，列表看着像坏的） */
.thumb, .thumb--ph { width:44px; height:44px; }
.thumb--ph { display:flex; align-items:center; justify-content:center;
             color:#c3bcb0; font-size:11px; }

/* 表格单元格里的行内表单（报销确认/支付等操作按钮） */
.inline-form { display:inline; }
/* 行内表单里的窄输入（改名、改排序、重置密码）——尺寸进 CSS，不写行内样式 */
.inline-form input[type="number"] { width:64px; }
.inline-form input[type="password"] { width:110px; }
.inline-form input[type="text"], .inline-form input:not([type]) { width:150px; }
.row-actions { display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
/* 表单字段下方的解释文字（说明为什么这么填，不是报错） */
.field-hint { font-size:12px; margin-top:4px; }
/* 使用说明：流程图用等宽字体（对齐靠空格，不要被比例字体搞歪） */
.flow { background:var(--surface-3); border:1px solid var(--line); border-radius:4px;
        padding:14px 16px; overflow-x:auto; font-size:13px; line-height:1.6;
        font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.steps { margin:0; padding-left:22px; }
.steps li { margin-bottom:6px; }
.guide-list { margin:0; padding-left:20px; }
.guide-list li { margin-bottom:4px; }

/* ==================== 使用说明：一图看懂（真流程图）====================
   用 CSS 画流程块 + 箭头，不用等宽字符拼图——字符图在手机上折行就废了，
   而这一页正是给新人看的（业务方反馈「一图看懂看得挺累」）。 */
.flowmap { display:flex; flex-direction:column; align-items:stretch;
           max-width:820px; margin:0 auto 4px; }
.flowmap__step { display:flex; gap:14px; background:var(--surface);
                 border:1px solid var(--line); border-radius:8px; padding:14px 16px; }
.flowmap__step:hover { border-color:var(--accent); }
.flowmap__num { flex:0 0 34px; height:34px; border-radius:50%; background:var(--accent);
                color:#fff; font-weight:700; font-size:16px; display:flex;
                align-items:center; justify-content:center; }
.flowmap__body { flex:1; min-width:0; }
.flowmap__head { display:flex; align-items:center; gap:8px; font-size:16px; }
.flowmap__head b { font-size:16px; }
.flowmap__ic { color:var(--accent); display:inline-flex; }
.flowmap__ic svg { width:20px; height:20px; display:block; }
.flowmap__what { margin:6px 0 0; font-size:14px; line-height:1.6; }
.flowmap__eg { margin:6px 0 0; font-size:13px; color:var(--muted); line-height:1.6;
               background:var(--surface-2); border-radius:4px; padding:7px 10px; }
.flowmap__links { display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; }
.flowmap__link { font-size:12px; border:1px solid var(--line); border-radius:14px;
                 padding:3px 10px; color:var(--accent); background:var(--surface); }
.flowmap__link:hover { border-color:var(--accent); background:var(--accent-soft);
                       text-decoration:none; }
/* 箭头：竖直居中一盘，窄屏也照样看得懂 */
.flowmap__arrow { display:flex; justify-content:center; color:var(--accent);
                  opacity:.55; padding:2px 0; }
.flowmap__arrow svg { width:20px; height:26px; display:block; }
/* 新商品逐步做 / 给程序用：带编号的大步骤 */
.steps-detail { margin:0; padding-left:0; list-style:none; counter-reset:sd;
                max-width:820px; }
.steps-detail > li { counter-increment:sd; position:relative; background:var(--surface);
                     border:1px solid var(--line); border-radius:8px;
                     padding:14px 16px 14px 56px; margin-bottom:10px; }
.steps-detail > li::before { content:counter(sd); position:absolute; left:16px; top:14px;
                             width:26px; height:26px; border-radius:50%;
                             background:var(--accent-soft); color:var(--accent);
                             font-weight:700; font-size:14px; display:flex;
                             align-items:center; justify-content:center; }
.steps-detail__t { font-weight:600; font-size:15px; margin-bottom:5px; }
.steps-detail__d { font-size:14px; line-height:1.65; color:var(--ink); }
.steps-detail__go { display:inline-block; margin-top:7px; font-size:13px; }
@media (max-width: 560px) {
  .flowmap__step { gap:10px; padding:12px; }
  .flowmap__num { flex-basis:28px; height:28px; font-size:14px; }
  .steps-detail > li { padding:12px 13px 12px 46px; }
  .steps-detail > li::before { left:12px; top:12px; width:22px; height:22px; font-size:13px; }
}
/* 面板里的一段说明（比 .field-hint 大一点、带内边距） */
.panel-note { padding:12px 14px 10px; }
/* 视觉隐藏但保留在 DOM/表单里（点击由 label 触发） */
.is-hidden { display:none; }
.field-hint a { color:var(--accent); }

/* 表单底部的操作区（提交 + 返回） */
.form-actions { margin-top:16px; display:flex; gap:10px; align-items:center; }
.form-actions--wide { margin-bottom:24px; }

/* 维护出口：每个操作的参数输入与原因 */
.mop-form { min-width:280px; }
.mop-form input { margin:2px 0; }
.mop-form .mop-confirm { font-size:12px; display:block; margin:2px 0; }
.mop-form .mop-confirm input { width:auto; }
/* KPI 卡做成可点（点进对应列表），否则数字只是数字。
   标题行右侧配主题色图标 + 标题下方灰色小字说明「这个数是什么」——
   工作台是每天第一眼看的，不该靠记忆解读。 */
.kpi-card { display:block; background:var(--surface); border:1px solid var(--line);
            border-radius:6px; padding:14px 16px; color:inherit;
            text-decoration:none; transition:border-color .12s; }
.kpi-card:hover { border-color:var(--accent); text-decoration:none; }
.kpi-card__top { display:flex; align-items:center; justify-content:space-between;
                 gap:10px; }
.kpi-card h3 { margin:0; font-size:15px; color:var(--muted); font-weight:600; }
.kpi-card__ic { flex:0 0 auto; color:var(--accent); opacity:.9; }
.kpi-card__ic svg { width:24px; height:24px; display:block; }
.kpi-card .kpi { font-size:26px; font-weight:700; margin-top:6px; }
.kpi-card__hint { font-size:12px; color:var(--muted); margin-top:4px; line-height:1.45; }
.muted { color:var(--muted); font-size:13px; }
form.inline { display:flex; gap:8px; align-items:flex-end; flex-wrap:wrap; margin-bottom:14px; }
input,select,textarea { font:14px inherit; padding:6px 8px; border:1px solid var(--line);
                        border-radius:3px; background:var(--surface); color:var(--ink); width:100%; }
label { font-size:12px; color:var(--muted); display:block; }
.field { margin-bottom:10px; }
button { font:14px inherit; padding:6px 14px; border:1px solid var(--accent);
         background:var(--accent); color:#fff; border-radius:3px; cursor:pointer; }
button.ghost { background:var(--surface); color:var(--accent); }
.notice { padding:8px 12px; border-radius:3px; margin-bottom:12px; font-size:14px; }
.notice.ok { background:#e4f1e8; color:var(--ok); }
.notice.err { background:#f7e3e1; color:var(--accent); }
/* 缩略图（列表页图集列）：桌面 44px，窄屏转卡片时放大 */
.thumb { width:44px; height:44px; object-fit:cover; border-radius:3px;
         border:1px solid var(--line); vertical-align:middle; background:#f4f1ec; }
.thumb-cell { display:flex; align-items:center; gap:6px; }
.thumbs { display:flex; align-items:center; gap:4px; }
.badge-n { font-size:12px; color:var(--muted); }
/* 顶栏：桌面隐藏（它只是窄屏的抽屉入口 + 品牌）
   桌面端右上角的「明暗切换 + 用户菜单」由 .usernav--desktop 承担。 */
.topbar { display:none; align-items:center; gap:10px; height:var(--topbar);
          padding:0 12px; background:var(--surface);
          border-bottom:1px solid var(--line); }
.topbar__brand { font-size:15px; }
.topbar__spacer { flex:1; }
.nav-toggle { display:none; }
.backdrop { display:none; }

/* ==================== 右上角：明暗切换 + 用户菜单 ====================
   侧栏回答「去哪一页」，右上回答「我是谁」——用户相关的东西集中在这里。
   窄屏在 .topbar 里，桌面在 .main 顶部，同一份 include。 */
.usernav { position:sticky; top:0; z-index:40; display:flex; justify-content:flex-end; }
.usernav--desktop { margin:-6px 0 6px; padding:6px 0 10px; background:var(--bg); }
.usernav__inner { display:flex; align-items:center; gap:8px; }
.iconbtn { display:inline-flex; align-items:center; justify-content:center;
           width:36px; height:36px; padding:0; border:1px solid var(--line);
           border-radius:18px; background:var(--surface); color:var(--ink);
           cursor:pointer; }
.iconbtn:hover { border-color:var(--accent); color:var(--accent); }
.iconbtn svg { width:17px; height:17px; display:block; }
/* 图标只显示当前该显示的那一个：亮色模式显示「月亮」（点它去暗色） */
.iconbtn__moon { display:none; }
html[data-theme="dark"] .iconbtn__sun { display:none; }
html[data-theme="dark"] .iconbtn__moon { display:block; }

.usermenu { position:relative; }
.usermenu__btn { display:flex; align-items:center; gap:8px; padding:4px 10px 4px 4px;
                 border:1px solid var(--line); border-radius:20px;
                 background:var(--surface); color:var(--ink); cursor:pointer; }
.usermenu__btn:hover { border-color:var(--accent); }
.usermenu__avatar { width:28px; height:28px; flex:0 0 28px; border-radius:50%;
                    background:var(--accent); color:#fff; font-size:14px;
                    font-weight:600; display:flex; align-items:center; justify-content:center; }
.usermenu__who { display:flex; flex-direction:column; line-height:1.15; text-align:left; }
.usermenu__name { font-size:13px; font-weight:600; }
.usermenu__role { font-size:11px; color:var(--muted); }
.usermenu__caret { width:0; height:0; border-left:4px solid transparent;
                   border-right:4px solid transparent; border-top:5px solid var(--muted); }
.usermenu__pop { position:absolute; right:0; top:calc(100% + 8px); min-width:262px;
                 background:var(--surface); border:1px solid var(--line);
                 border-radius:6px; box-shadow:0 8px 28px var(--shadow);
                 padding:6px; display:none; z-index:80; }
.usermenu.is-open .usermenu__pop { display:block; }
.usermenu__pop a { display:flex; gap:10px; align-items:flex-start; padding:9px 10px;
                   border-radius:4px; color:var(--ink); }
.usermenu__pop a:hover { background:var(--hover); text-decoration:none; }
.usermenu__pop b { display:block; font-size:14px; font-weight:600; }
.usermenu__pop em { display:block; font-style:normal; font-size:12px;
                    color:var(--muted); margin-top:2px; }
.usermenu__ico { flex:0 0 18px; color:var(--accent); padding-top:1px; }
.usermenu__ico svg { width:17px; height:17px; display:block; }
.usermenu__sep { height:1px; background:var(--line); margin:5px 4px; }
.usermenu__out b { color:var(--accent); }
/* 复制按钮的兜底文本域（execCommand 路径需要它可见于布局才能 select） */
.copy-proxy { position:fixed; left:-9999px; top:0; opacity:0; }

/* ==================== 我的 API 与密钥 ====================
   这一页的任务全是「复制一段文本」，所以把要复制的东西做成一行一行的块：
   左标签、中间等宽代码、右边复制按钮。 */
.copy-row { display:flex; align-items:center; gap:10px; flex-wrap:wrap;
            padding:9px 0; border-bottom:1px dashed var(--line); }
.copy-row:last-of-type { border-bottom:0; }
.copy-row__k { flex:0 0 150px; font-size:13px; color:var(--muted); }
.copy-row code { flex:1 1 260px; min-width:0; word-break:break-all;
                 background:var(--surface-3); border:1px solid var(--line);
                 border-radius:4px; padding:6px 9px; font-size:13px;
                 font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
/* 一次性明文：黄底提醒「只有这一次」 */
.notice.warn { background:var(--warn-bg); color:var(--warn); }
.token-reveal { display:flex; align-items:center; gap:10px; flex-wrap:wrap;
                margin-top:8px; }
.token-reveal code { flex:1 1 280px; min-width:0; word-break:break-all;
                     background:var(--surface); border:1px solid var(--line);
                     border-radius:4px; padding:7px 10px; font-size:13px;
                     color:var(--ink);
                     font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.token-mask { font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
              font-size:13px; color:var(--muted); margin-right:6px; letter-spacing:.05em; }
.callout { border-left:3px solid var(--accent); background:var(--surface-2);
           border-radius:0 4px 4px 0; padding:11px 14px; margin-top:12px;
           font-size:14px; }
.callout code { background:var(--surface-3); border:1px solid var(--line);
                border-radius:3px; padding:1px 5px; font-size:13px; }
.callout--warn { border-left-color:var(--warn); }
/* 上传区 */
.drop { border:1.5px dashed var(--line); border-radius:4px; padding:16px; text-align:center;
        color:var(--muted); font-size:14px; cursor:pointer; background:var(--surface-2); }
.drop.is-over { border-color:var(--accent); background:var(--accent-soft); color:var(--accent); }
.media-list { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.media-item { position:relative; width:78px; height:78px; border:1px solid var(--line);
              border-radius:3px; overflow:hidden; background:#f4f1ec; cursor:grab; }
.media-item img { width:100%; height:100%; object-fit:cover; display:block; }
.media-item .rm { position:absolute; top:1px; right:1px; background:rgba(0,0,0,.55);
                  color:#fff; border:0; border-radius:2px; font-size:12px; line-height:1;
                  padding:3px 5px; cursor:pointer; }
.media-item .ord { position:absolute; bottom:1px; left:1px; background:rgba(0,0,0,.55);
                   color:#fff; font-size:11px; padding:1px 4px; border-radius:2px; }

/* ===================== 响应式：≤1024 / ≤860 / ≤560 / 触屏 ===================== */

@media (max-width: 1024px) {
  .side { width:170px; }
  .main { padding:16px; }
}

/* 侧栏变抽屉 + 表格转卡片 */
@media (max-width: 860px) {
  .topbar { display:flex; }
  /* 窄屏：用户区在顶栏里，主区顶部那一份不重复显示 */
  .usernav--desktop { display:none; }
  .usermenu__who { display:none; }   /* 窄屏只留头像，把宽度让给品牌 */
  .nav-toggle { display:inline-flex; align-items:center; justify-content:center;
                width:36px; height:36px; border:1px solid var(--line); border-radius:3px;
                background:var(--surface); cursor:pointer;
                /* 必须显式给 color：全局 button{color:#fff} 会让 SVG 的
                   currentColor 变白，白线画在白底上 = 看不见 */
                color:var(--ink); }
  .nav-toggle svg { flex:0 0 auto; display:block; }  /* 防 flex 把图标压扁 */
  .wrap { flex-direction:column; }
  .side { position:fixed; top:0; bottom:0; left:0; z-index:60; width:232px;
          transform:translateX(-100%); transition:transform .2s ease; overflow-y:auto; }
  .side.is-open { transform:none; box-shadow:0 0 24px var(--shadow); }
  .backdrop { display:none; position:fixed; inset:0; background:rgba(43,38,34,.32); z-index:55; }
  .backdrop.is-open { display:block; }
  .main { padding:14px; max-width:none; }
  .row > * { flex:1 1 100%; }

  /* 表格转卡片：用 data-label 显示列名（同一份 HTML，纯 CSS 切换） */
  .table--cards thead { display:none; }
  .table--cards, .table--cards tbody, .table--cards tr, .table--cards td {
    display:block; width:100%; }
  .table--cards { border:0; background:transparent; }
  .table--cards tr { border:1px solid var(--line); border-radius:4px;
                     margin-bottom:8px; padding:8px; background:var(--surface); }
  .table--cards td { border:0; padding:4px 6px; display:flex;
                     align-items:flex-start; gap:8px; }
  .table--cards td::before { content:attr(data-label); flex:0 0 76px;
                             color:var(--muted); font-size:12px; padding-top:3px; }
  .table--cards td[data-label=""]::before { display:none; }
  .table--cards td.num { text-align:left; }
  .table--cards .thumb { width:56px; height:56px; }
}

@media (max-width: 560px) {
  .main { padding:10px; }
  h2 { font-size:18px; }
  .card { padding:11px 12px; }
  form.inline > * { flex:1 1 100%; }
  .kpi { font-size:21px; }
}

/* 触屏：按钮与输入框加大；输入框 16px 防 iOS 自动缩放 */
@media (pointer: coarse) {
  button, .btn { min-height:42px; padding:10px 16px; }
  input,select,textarea { min-height:44px; font-size:16px; }
  .side a { padding:12px 16px; }
  th,td { padding:11px 12px; }
}

/* POS 的样式**全部**在 static/css/pos.css（选择器以 .pos-app 打头）。
   这里原先还有一份 .pos-tile / .pos-grid 的重复定义，与 pos.css 打架
   （同一个类两处字号不同），已删——收银台只有一个样式来源。 */


/* ==================== 列表页规范组件（page_head / tabs / toolbar / pager / panel）==================== */
.page-head { display:flex; align-items:flex-start; justify-content:space-between;
             gap:16px; flex-wrap:wrap; margin-bottom:14px; }
.page-head h2 { margin:0; }
.page-head .sub { margin:4px 0 0; }
.page-head__actions { display:flex; gap:8px; align-items:center; }
.btn { display:inline-flex; align-items:center; justify-content:center; gap:6px;
       padding:7px 14px; border:1px solid var(--line); border-radius:3px; background:var(--surface);
       color:var(--ink); font-size:14px; cursor:pointer; text-decoration:none;
       white-space:nowrap; }
.btn:hover { border-color:var(--accent); color:var(--accent); text-decoration:none; }
.btn--primary { background:var(--accent); border-color:var(--accent); color:#fff; }
.btn--primary:hover { background:var(--accent-hover); color:#fff; }
.btn--ghost { background:var(--surface); color:var(--accent); border-color:var(--accent); }
.btn--sm { padding:4px 10px; font-size:13px; }

/* 状态 Tab：横向滚动（窄屏不换行挤压）*/
.tabs { display:flex; gap:2px; border-bottom:1px solid var(--line); margin-bottom:14px;
        overflow-x:auto; scrollbar-width:none; }
.tabs::-webkit-scrollbar { display:none; }
.tab { padding:8px 14px; font-size:14px; color:#666; white-space:nowrap;
       border-bottom:2px solid transparent; margin-bottom:-1px; }
.tab:hover { color:var(--accent); text-decoration:none; }
.tab.is-active { color:var(--accent); font-weight:600; border-bottom-color:var(--accent); }
.tab__n { display:inline-block; min-width:18px; padding:0 5px; border-radius:9px;
          background:var(--surface-3); color:var(--muted); font-size:11px; text-align:center;
          font-weight:400; vertical-align:1px; }
.tab.is-active .tab__n { background:var(--accent-soft); color:var(--accent); }

/* 多字段搜索栏 */
.toolbar { display:flex; gap:10px; align-items:flex-end; flex-wrap:wrap;
           background:var(--surface); border:1px solid var(--line); border-radius:4px;
           padding:12px 14px; margin-bottom:14px; }
.toolbar .f { flex:1 1 168px; min-width:140px; }
.toolbar .f label { margin-bottom:3px; }
.toolbar .f input, .toolbar .f select { padding:7px 9px; }
.toolbar .fb { display:flex; gap:8px; flex:0 0 auto; padding-bottom:1px; }

/* 分页器 */
.pager { display:flex; align-items:center; gap:14px; flex-wrap:wrap;
         padding:11px 2px 2px; font-size:13px; color:#666; }
.pager__info b { color:var(--ink); }
.pager__pages { display:flex; gap:3px; align-items:center; margin-left:auto; }
.pg { display:inline-flex; align-items:center; justify-content:center;
      min-width:31px; height:31px; padding:0 6px; border:1px solid var(--line);
      border-radius:3px; background:var(--surface); color:var(--ink); font-size:13px; }
.pg:hover { border-color:var(--accent); color:var(--accent); text-decoration:none; }
.pg.is-current { background:var(--accent); border-color:var(--accent); color:#fff; font-weight:600; }
.pg.is-disabled { color:var(--muted); background:var(--surface-2); opacity:.6; }
.pg.is-gap { border:0; background:transparent; color:#bbb; min-width:14px; }
.htmx-indicator { display:none; font-size:12px; color:var(--muted); }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display:inline; }
.pager__size select { padding:5px 8px; font-size:13px; width:auto; }

/* 内容区块 */
.panel { background:var(--surface); border:1px solid var(--line); border-radius:4px;
         margin-bottom:16px; overflow:hidden; }
.panel__head { display:flex; align-items:center; justify-content:space-between;
               gap:12px; padding:11px 14px; border-bottom:1px solid var(--line);
               background:var(--surface-2); }
.panel__head h3 { margin:0; font-size:14px; }
.panel__actions { display:flex; gap:8px; }
.panel__body { padding:14px; }
.panel__body > table { border:0; }
.panel--flush > .panel__body { padding:0; }
.empty { padding:32px 16px; text-align:center; color:var(--muted); }
.empty__hint { margin-top:6px; font-size:13px; color:var(--muted); }

/* 详情页的字段网格（替代原来松散的 .row） */
.kv { display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:12px 22px; }
.kv > div > .k { font-size:12px; color:var(--muted); margin-bottom:2px; }
.kv > div > .v { font-size:14px; }

@media (max-width: 860px) {
  .toolbar .f { flex:1 1 100%; }
  .toolbar .fb { width:100%; }
  .toolbar .fb .btn, .toolbar .fb button { flex:1; }
  .pager__pages { margin-left:0; width:100%; justify-content:center; flex-wrap:wrap; }
  .pager__info { width:100%; text-align:center; }
  .pager__size { width:100%; text-align:center; }
  .page-head__actions { width:100%; }
  .page-head__actions .btn { flex:1; }
}

@media print { .side, .topbar, form, button, .noprint, .tabs, .toolbar, .pager,
               .page-head__actions { display:none !important; }
               .main { padding:0; max-width:none; } body { background:#fff; }
               .card { border:0; margin:0; } .table--cards td::before { display:none; } }


.login-wrap { min-height:100vh; display:flex; align-items:center; justify-content:center;
              padding:24px; }
.login-card { width:100%; max-width:340px; background:var(--surface); border:1px solid var(--line);
              border-radius:5px; padding:26px 24px; }
.login-brand { font-size:16px; font-weight:600; letter-spacing:.02em; margin-bottom:20px;
               text-align:center; color:var(--accent); line-height:1.4; }
.login-card .field { margin-bottom:14px; }
.login-card .field input { padding:9px 10px; }
.login-card button { width:100%; padding:10px; margin-top:4px; font-size:15px; }
@media (pointer: coarse) {
  .login-card input { min-height:46px; font-size:16px; }   /* 防 iOS 自动缩放 */
  .login-card button { min-height:46px; }
}

/* Markdown 编辑器（EasyMDE）兜底：
   后台全局 `button{color:#fff}` 会把工具栏字色刷成白字白底——
   工具栏一律继承编辑器颜色。图标本体走 editor-icons.css 的内联 SVG，
   **这里不出现任何图标字体**（缺字形就是空方块，且本项目不引外部字体） */
.EasyMDE .editor-toolbar { color:var(--ink); }
.EasyMDE .editor-toolbar button { color:inherit; }
.EasyMDE .editor-toolbar .separator { border-left:1px solid var(--line); height:24px; }

/* 必填字段的视觉标记：输入框/下拉带 required 时显示橙色左边条
   （纯 CSS：required 在输入框上，用 :has 反选前面的 .k 标签） */
.kv > div:has(input[required]) > .k::after,
.kv > div:has(select[required]) > .k::after,
.field-hint.required::after { content: ""; }
.kv > div:has(input[required]) > .k,
.kv > div:has(select[required]) > .k { color:#8c5a2b; }
.kv > div:has(input[required]) > .k::after { content:" *"; color:var(--accent); }

/* 角色多选（人员管理）：一行一个角色 + 说明，勾选框加大便于点 */
.role-picker { display:flex; flex-direction:column; gap:6px; }
.role-opt { display:flex; gap:8px; align-items:flex-start; padding:8px 10px;
            border:1px solid var(--line); border-radius:4px; cursor:pointer; }
.role-opt:hover { border-color:var(--accent); }
.role-opt input { width:auto; margin-top:2px; }
.role-opt__body { display:flex; flex-direction:column; gap:2px; }
.role-opt__name { font-weight:600; }
.role-opt__desc { font-size:12px; }
@media (pointer: coarse) { .role-opt { padding:12px; } .role-opt input { width:22px; height:22px; } }

/* SKU 组成编辑器：一行 = 货品下拉 + 用量 + 删除 */
.comp-row { display:flex; gap:8px; align-items:center; margin-bottom:6px;
            flex-wrap:wrap; }
.comp-row select { flex:1 1 240px; max-width:420px; width:auto; }
.comp-row input[type="number"] { width:80px; }

/* 货品弹窗选择器：编号+名称双列、分类筛选、关键词搜索 */
.ipick__btn { flex:0 0 auto; }
.ipick__picked { margin-left:8px; }
.ipick__dialog { border:1px solid var(--line); border-radius:6px; padding:14px;
                 width:min(640px, 92vw); max-height:80vh; }
.ipick__dialog::backdrop { background:rgba(0,0,0,.35); }
.ipick__head { display:grid; grid-template-columns:1fr 1fr auto;
               gap:8px; align-items:center; margin-bottom:6px; }
.ipick__head b { grid-column:1 / -1; }
.ipick__q { width:100%; }
.ipick__table { width:100%; }
.ipick__table tbody { display:block; max-height:46vh; overflow-y:auto; }
.ipick__table thead, .ipick__table tbody tr { display:table; width:100%;
                                               table-layout:fixed; }
.ipick__table tbody tr { cursor:pointer; }
.ipick__table tbody tr:hover { background:var(--hover); }
.ipick__table td:first-child { font-family:ui-monospace, Menlo, Consolas, monospace;
                               white-space:nowrap; }
.ipick__none { padding:12px; text-align:center; }
@media (pointer: coarse) { .ipick__btn, .ipick__close { min-height:44px; } }
/* （完）货品弹窗选择器样式 */
