/* ==========================================================================
   选品 · 排品 · 剪辑协作系统 — 全局样式
   设计令牌 + 组件 + 响应式（手机端表格自动转卡片）
   ========================================================================== */

:root {
  /* 品牌色 */
  --brand: #2563eb;
  --brand-600: #1d4ed8;
  --brand-700: #1e40af;
  --brand-50: #eff4ff;
  --brand-100: #dbe6fe;

  /* 语义色 */
  --ok: #067647;        --ok-bg: #ecfdf3;   --ok-line: #abefc6;
  --warn: #b54708;      --warn-bg: #fffaeb; --warn-line: #fedf89;
  --danger: #b42318;    --danger-bg: #fef3f2; --danger-line: #fecdca;
  --info: #175cd3;      --info-bg: #eff8ff; --info-line: #b2ddff;
  --violet: #5925dc;    --violet-bg: #f4f3ff; --violet-line: #d9d6fe;
  --pink: #c11574;      --pink-bg: #fdf2fa; --pink-line: #fcceee;

  /* 中性色 */
  --ink: #0f172a;
  --ink-2: #344054;
  --muted: #667085;
  --muted-2: #98a2b3;
  --line: #e4e7ec;
  --line-2: #f2f4f7;
  --bg: #f6f7f9;
  --card: #ffffff;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow: 0 4px 14px -4px rgba(16, 24, 40, .10), 0 2px 6px -2px rgba(16, 24, 40, .06);
  --shadow-lg: 0 24px 48px -12px rgba(16, 24, 40, .18);
  --nav-h: 60px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0 0 8px; }

/* ============================ 顶栏 ============================ */
.topbar {
  position: sticky; top: 0; z-index: 60;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 8px;
  padding: 0 16px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: 15px; color: var(--ink);
  text-decoration: none; white-space: nowrap; margin-right: 6px;
}
.brand:hover { text-decoration: none; }
.brand .logo {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff; font-size: 14px; font-weight: 700;
  display: grid; place-items: center;
  box-shadow: 0 2px 6px rgba(37, 99, 235, .35);
}

.nav-desktop { display: flex; align-items: center; gap: 1px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav-desktop::-webkit-scrollbar { display: none; }
.nav-desktop a {
  padding: 7px 11px; border-radius: 8px;
  color: var(--ink-2); font-size: 13.5px; white-space: nowrap;
  transition: background .14s, color .14s;
}
.nav-desktop a:hover { background: var(--line-2); color: var(--ink); text-decoration: none; }
.nav-desktop a.on { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }

.topbar-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.who { display: flex; flex-direction: column; line-height: 1.25; text-align: right; }
.who b { font-size: 13px; font-weight: 600; }
.who small { color: var(--muted-2); font-size: 11px; }
.logout {
  font-size: 12.5px; color: var(--muted); border: 1px solid var(--line);
  padding: 5px 10px; border-radius: 8px; white-space: nowrap;
}
.logout:hover { color: var(--danger); border-color: var(--danger-line); background: var(--danger-bg); text-decoration: none; }

.hamburger {
  display: none; width: 38px; height: 38px; padding: 0;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.hamburger span { display: block; width: 16px; height: 1.8px; background: var(--ink-2); border-radius: 2px; }

/* ============================ 抽屉菜单 ============================ */
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: 268px; z-index: 120;
  background: #fff; border-right: 1px solid var(--line);
  transform: translateX(-102%); transition: transform .24s cubic-bezier(.4, 0, .2, 1);
  display: flex; flex-direction: column; padding: 14px 12px calc(14px + env(safe-area-inset-bottom));
  overflow-y: auto;
}
.drawer.open { transform: none; box-shadow: var(--shadow-lg); }
.drawer .drawer-head { display: flex; align-items: center; gap: 9px; padding: 4px 8px 14px; }
.drawer .drawer-user {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 10px;
  background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 12px;
}
.drawer .drawer-user .avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, #60a5fa, #2563eb); color: #fff; font-weight: 700; font-size: 14px;
}
.drawer a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border-radius: 10px; color: var(--ink-2);
  font-size: 14.5px;
}
.drawer a:hover { background: var(--line-2); text-decoration: none; }
.drawer a.on { background: var(--brand); color: #fff; font-weight: 600; }
.drawer .drawer-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }

.scrim {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .42); z-index: 110;
  opacity: 0; pointer-events: none; transition: opacity .2s;
  backdrop-filter: blur(1px);
}
.scrim.open { opacity: 1; pointer-events: auto; }

/* ============================ 布局 ============================ */
main.wrap { max-width: 1320px; margin: 0 auto; padding: 20px 20px 72px; }
body.plain main.wrap { max-width: none; padding: 0; }

.page-head {
  display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.page-head h1 { font-size: 21px; }
.page-head .sub { color: var(--muted); font-size: 13px; margin: 3px 0 0; max-width: 820px; }
.page-head .head-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* 说明条 */
.note {
  display: flex; gap: 10px;
  background: var(--brand-50); border: 1px solid var(--brand-100);
  color: #1e3a8a; border-radius: var(--radius-sm);
  padding: 10px 14px; font-size: 12.8px; line-height: 1.65; margin: 0 0 14px;
}
.note::before {
  content: "i"; flex: 0 0 17px; height: 17px; margin-top: 1px;
  border-radius: 50%; background: var(--brand); color: #fff;
  font: 700 11px/17px Georgia, serif; text-align: center;
}
.note.warn { background: var(--warn-bg); border-color: var(--warn-line); color: #7a2e0e; }
.note.warn::before { background: #dc6803; content: "!"; }

/* 卡片 */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.card > h3 {
  font-size: 14.5px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.card > h3 .badge-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }

/* 指标卡 */
.stats {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.stat {
  position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.stat::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--brand);
}
.stat b { display: block; font-size: 25px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); line-height: 1.25; }
.stat span { color: var(--muted); font-size: 12.2px; }
.stat.blue::after { background: var(--brand); }
.stat.green::after { background: #12b76a; }
.stat.amber::after { background: #f79009; }
.stat.red::after { background: #f04438; }
.stat.violet::after { background: #7a5af8; }

/* ============================ 表格 ============================ */
.tablewrap {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: auto; max-height: calc(100vh - 220px);
}
.tablewrap.tall { max-height: none; }

table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; background: #fff; }
thead th {
  position: sticky; top: 0; z-index: 3;
  background: #f9fafb; color: var(--muted);
  font-size: 11.8px; font-weight: 600; letter-spacing: .02em; text-transform: none;
  text-align: left; white-space: nowrap;
  padding: 11px 14px; border-bottom: 1px solid var(--line);
  height: 44px; vertical-align: middle;
}
tbody td {
  padding: 11px 14px; border-bottom: 1px solid var(--line-2);
  vertical-align: middle; color: var(--ink-2); white-space: nowrap;
  height: 54px; line-height: 1.5;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) td { background: #fcfcfd; }
tbody tr:hover td { background: #f5f8ff; }
td.num, .num { font-family: var(--mono); font-size: 12.4px; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.wrap { word-break: break-word; max-width: 340px; white-space: normal; padding: 11px 14px; }
tbody td > div, tbody td > p { white-space: normal; }
.acc-line { white-space: normal; }
.acc-line .copyable { white-space: nowrap; }
td.center, th.center, td.c, th.c { text-align: center; }
td.r, th.r { text-align: right; }

/* 固定列宽表：列宽按 colgroup 分配，单元格垂直居中、等高，超长文本省略 */
table.fixed { table-layout: fixed; }
table.fixed > thead th, table.fixed > tbody td { overflow: hidden; }
table.fixed > tbody td:not(.wrap):not(.c):not(.acts) { text-overflow: ellipsis; }
table.fixed > tbody td.wrap { white-space: normal; overflow-wrap: anywhere; max-width: none; padding: 11px 14px; }
/* 两行截断（商品名等长文本） */
.clamp2 {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; white-space: normal; word-break: break-word;
  overflow-wrap: anywhere; line-height: 1.45;
}
.ellip { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 表格内操作区 */
.acts { white-space: normal; }
.row-acts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.row-acts.center { justify-content: center; }
.row-acts > form { display: inline-flex; }
a.lnk {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--line);
  color: var(--brand-600); font-size: 13px; line-height: 1;
}
a.lnk:hover { background: var(--brand-50); border-color: var(--brand-100); text-decoration: none; }
/* 链接列：打开 + 复制挂车链接 */
.lnk-cell { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: nowrap; }
button.copy-link { padding: 0 8px; font-size: 11.8px; min-height: 26px; height: 26px; line-height: 1; min-width: 42px; white-space: nowrap; }
button.lnk-arch {
  padding: 0 7px; font-size: 11.4px; min-height: 26px; height: 26px; line-height: 1;
  border: 1px solid var(--line); border-radius: 7px; background: var(--card, #fff);
  color: var(--muted); white-space: nowrap;
}
button.lnk-arch:hover { border-color: var(--brand-100); color: var(--brand-600); background: var(--brand-50); }
button.ghost { background: transparent; border-color: transparent; color: var(--muted); padding: 0 4px; }
button.ghost:hover { border-color: var(--line); color: var(--ink-2); background: var(--bg-2, #f6f7f9); }
/* 链接档案弹窗 */
.link-list { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow: auto; }
.link-row { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--card, #fff); }
.link-head { display: flex; align-items: center; gap: 6px; font-size: 12.8px; color: var(--ink); }
.link-url { margin-top: 4px; font-size: 11.6px; color: var(--muted); word-break: break-all;
  max-height: 32px; overflow: hidden; line-height: 1.45; }
.link-meta { margin-top: 3px; font-size: 11.4px; color: var(--muted); }
.link-acts { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.link-add { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  border-top: 1px dashed var(--line); padding-top: 10px; }
.link-add input { flex: 1 1 260px; min-width: 180px; }
/* 回传详情弹窗 */
.ret-title { font-weight: 600; font-size: 13.6px; line-height: 1.5; margin-bottom: 8px; color: var(--ink); }
.ret-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12.2px; color: var(--muted); margin-bottom: 12px; }
.ret-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; margin: 0; }
.ret-grid dt { font-size: 11.6px; color: var(--muted); }
.ret-grid dd { margin: 2px 0 0; font-size: 12.6px; color: var(--ink); word-break: break-all; }
.ret-grid dd.ret-multi { max-height: 58px; overflow: auto; white-space: pre-line; line-height: 1.6; }
.ret-h { font-size: 12.4px; color: var(--ink-2); margin: 16px 0 6px; }
.ret-video { font-size: 12.2px; line-height: 1.85; word-break: break-all; }
.ret-acc { display: inline-block; min-width: 74px; color: var(--muted); }
@media (max-width: 560px) { .ret-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* 发布绑定弹窗（抖音号 × 商品） */
.bind-list { display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow: auto; }
.bind-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.bind-acc { flex: 1 1 140px; min-width: 0; }
.bind-acc b { display: block; font-size: 12.8px; color: var(--ink); }
.bind-acc small { display: block; font-size: 11.4px; color: var(--muted); margin-top: 2px; }
.bind-meta { flex: 1 1 120px; font-size: 11.6px; color: var(--muted); word-break: break-all; line-height: 1.5; }
.tag.生效 { background: var(--ok-bg); color: var(--ok); }
.tag.已解除 { background: #f2f4f7; color: var(--muted-2); }
.bind-rel { flex: 1 1 100%; display: flex; gap: 6px; align-items: center; margin-top: 4px; }
.bind-rel input { flex: 1 1 auto; min-height: 30px; font-size: 12.2px; }
.bind-rel .mini { white-space: nowrap; }
/* 单元格内联表单（一行排布） */
.inline-form { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.inline-form input, .inline-form select { min-height: 30px; padding: 4px 8px; font-size: 12.4px; }
.inline-form input { flex: 1 1 90px; min-width: 0; }
.inline-form select { flex: 1 1 80px; min-width: 0; width: auto; }
.inline-form button { flex: 0 0 auto; }
/* 窄列里的两行表单：第一行整宽，第二行并排 */
.stack-form { display: grid; gap: 6px; }
.stack-form > select, .stack-form > input { width: 100%; min-height: 30px; padding: 4px 8px; font-size: 12.4px; }
.stack-form .row { display: flex; gap: 6px; align-items: center; }
.stack-form .row input, .stack-form .row select { flex: 1 1 96px; min-width: 0; min-height: 30px; padding: 4px 8px; font-size: 12.4px; }
.stack-form .row .old-no { flex: 2.4 1 150px; }
.stack-form .row button { flex: 0 0 auto; }
@media (max-width: 640px) {
  .stack-form .row { flex-wrap: wrap; }
  .stack-form .row .old-no { flex: 1 1 100%; }
}

/* 紧凑型表格（摘要 / 小列表） */
table.compact > thead th { height: 38px; padding: 8px 12px; }
table.compact > tbody td { height: auto; padding: 8px 12px; font-size: 12.8px; }
table.plain { background: transparent; }
table.plain td, table.plain th { padding: 7px 9px; }

/* 可复制字段 */
.copyable {
  cursor: pointer; font-family: var(--mono); font-size: 12.4px;
  border-bottom: 1px dashed var(--brand-100); color: var(--ink-2);
  border-radius: 3px; padding: 0 1px; transition: background .12s, color .12s;
}
.copyable:hover { background: var(--brand-50); color: var(--brand-700); }
.copyable.copied { background: var(--ok-bg); color: var(--ok); border-bottom-color: transparent; }

/* 标签 */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 11.8px; font-weight: 500; line-height: 1.7;
  white-space: nowrap; border: 1px solid transparent;
}
.tag::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .85; }
.tag.未添加 { background: #f2f4f7; color: #475467; }
.tag.已添加 { background: var(--info-bg); color: var(--info); }
.tag.已合作 { background: var(--ok-bg); color: var(--ok); }
.tag.拒绝合作 { background: var(--danger-bg); color: var(--danger); }
.tag.待剪辑 { background: var(--warn-bg); color: var(--warn); }
.tag.已接收 { background: var(--info-bg); color: var(--info); }
.tag.制作中 { background: var(--warn-bg); color: var(--warn); }
.tag.已回传 { background: #f0fdf9; color: #0f766e; }
.tag.待授权 { background: var(--warn-bg); color: var(--warn); }
.tag.已授权 { background: var(--ok-bg); color: var(--ok); }
.tag.投流中 { background: var(--violet-bg); color: var(--violet); }
.tag.已复盘 { background: #eef4ff; color: #3538cd; }
.tag.已退回 { background: var(--danger-bg); color: var(--danger); }
.tag.已取消 { background: #f2f4f7; color: var(--muted-2); }
.tag.老品 { background: var(--violet-bg); color: var(--violet); }
.tag.新品 { background: var(--info-bg); color: var(--info); }
.tag.团长品 { background: #fff4e5; color: #b54708; }
.tag.来源团长 { background: #fff4e5; color: #b54708; }
.tag.来源商家 { background: var(--ok-bg); color: var(--ok); }
.tag.首发 { background: var(--pink-bg); color: var(--pink); }
.tag.未授权 { background: #f2f4f7; color: var(--muted); }
.tag.正常 { background: var(--ok-bg); color: var(--ok); }

/* 商家 / 团长 二选一：单选胶囊 */
.seg { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 2px; }
.seg > label {
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 12px; font-size: 12.6px; line-height: 1.5; background: var(--card); color: var(--ink-2);
  transition: border-color .12s, background .12s, color .12s;
}
.seg > label:hover { border-color: var(--brand); }
.seg input[type=radio] { margin: 0; accent-color: var(--brand); }
.seg > label:has(input:checked) {
  background: var(--brand-50); border-color: var(--brand); color: var(--brand); font-weight: 600;
}
/* 保存后回到原页面时高亮刚改的那一行 */
tr:target { animation: rowflash 2.2s ease-out; }
@keyframes rowflash {
  0% { background: #fff4d6; }
  60% { background: #fff8e8; }
  100% { background: transparent; }
}

/* ============================ 按钮 ============================ */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-size: 13px; font-weight: 500;
  padding: 7px 13px; min-height: 34px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink-2); cursor: pointer;
  transition: background .12s, border-color .12s, box-shadow .12s, transform .06s;
  text-decoration: none; white-space: nowrap;
}
button:hover, .btn:hover { background: #f9fafb; border-color: #d0d5dd; text-decoration: none; }
button:active, .btn:active { transform: translateY(.5px); }
button:focus-visible, .btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--brand-100); outline-offset: 1px; border-color: var(--brand);
}
button.primary, .btn.primary {
  background: linear-gradient(180deg, #3b82f6, var(--brand));
  border-color: var(--brand-600); color: #fff;
  box-shadow: 0 1px 2px rgba(37, 99, 235, .3), inset 0 1px 0 rgba(255, 255, 255, .16);
}
button.primary:hover, .btn.primary:hover { background: linear-gradient(180deg, #2f74f0, var(--brand-600)); }
button.ghost, .btn.ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }
button.danger, .btn.danger { background: #fff; border-color: var(--danger-line); color: var(--danger); }
button.danger:hover, .btn.danger:hover { background: var(--danger-bg); }
button.mini, .btn.mini { min-height: 27px; padding: 3px 9px; font-size: 12.2px; border-radius: 7px; }
button.block, .btn.block { width: 100%; }
:disabled { opacity: .55; cursor: not-allowed; }

/* ============================ 表单 ============================ */
input, select, textarea {
  font: inherit; font-size: 13px; color: var(--ink);
  padding: 7px 10px; min-height: 34px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; transition: border-color .12s, box-shadow .12s;
  max-width: 100%;
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:hover, select:hover, textarea:hover { border-color: #d0d5dd; }
textarea { display: block; width: 100%; min-height: 64px; resize: vertical; line-height: 1.55; }
select { padding-right: 26px; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5' stroke='%23667085' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; }
input[type="file"] { padding: 6px 8px; font-size: 12.5px; max-width: 100%; }
input[type="file"]::file-selector-button {
  font: inherit; font-size: 12.5px; margin-right: 10px; padding: 4px 10px;
  border: 1px solid var(--line); border-radius: 7px; background: #fff; cursor: pointer;
}
label.field { display: block; margin-bottom: 10px; }
label.field > span { display: block; font-size: 12.2px; color: var(--muted); margin-bottom: 4px; }
label.field > input, label.field > select, label.field > textarea { width: 100%; }

/* 表单网格 */
.formgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-bottom: 10px; }
/* 排品表单：组号列要放下「1队1组-1（冬灵灵、糕糕小酱…）」，单独给宽一点 */
@media (min-width: 1100px) {
  .formgrid.sch-form { grid-template-columns: minmax(0,.95fr) minmax(0,1.05fr) minmax(0,1.4fr) minmax(0,2.2fr) minmax(0,.95fr) minmax(0,1fr); }
}
.formgrid.sch-form select { text-overflow: ellipsis; }
.formgrid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-bottom: 6px; }
.formgrid.compact input, .formgrid.compact select { font-size: 12.4px; min-height: 30px; padding: 4px 8px; }
.formgrid > label.field { margin-bottom: 0; }
.formgrid > input, .formgrid > select, .formgrid > textarea { width: 100%; }
select[multiple] { min-height: 150px; padding: 6px; line-height: 1.7; }
select[multiple] option { padding: 3px 6px; border-radius: 5px; }
select[multiple] option:checked {
  background: var(--brand-50) linear-gradient(0deg, var(--brand-50), var(--brand-50));
  color: var(--brand-700); font-weight: 600;
}

.toolbar {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px;
}
.toolbar form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar form input:not([type="date"]):not([type="file"]) { min-width: 230px; }
.toolbar > input { min-width: 230px; max-width: 340px; }
.toolbar .muted { margin-left: auto; }
.toolbar > input.filter-input { margin-left: auto; flex: 0 1 260px; min-width: 170px; }
.muted, small.muted { color: var(--muted); font-size: 12.2px; }

/* 折叠区 */
details.card { padding: 0; overflow: hidden; }
details.card > summary {
  cursor: pointer; list-style: none; padding: 13px 18px; font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 8px; color: var(--ink);
}
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before {
  content: "+"; width: 18px; height: 18px; border-radius: 6px; background: var(--brand-50);
  color: var(--brand); font-weight: 700; font-size: 13px; display: grid; place-items: center;
}
details.card[open] > summary::before { content: "−"; }
details.card > summary:hover { background: #fcfcfd; }
details.card > *:not(summary) { padding: 0 18px; }
details.card > form, details.card > div, details.card > p { padding-bottom: 14px; }
details > div > details, td details { font-size: 12.5px; }
details summary { cursor: pointer; }
td details summary { color: var(--brand-600); }

/* 分页 */
.pager { display: flex; gap: 8px; align-items: center; margin: 14px 0 0; flex-wrap: wrap; }

/* 提示条 */
.flash {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 11px 14px; border-radius: var(--radius-sm); font-size: 13px;
  margin-bottom: 14px; border: 1px solid transparent;
  animation: slideIn .22s ease-out;
}
.flash::before { font-weight: 700; }
.flash.ok { background: var(--ok-bg); border-color: var(--ok-line); color: #05603a; }
.flash.ok::before { content: "✓"; }
.flash.err { background: var(--danger-bg); border-color: var(--danger-line); color: #912018; white-space: pre-wrap; }
.flash.err::before { content: "!"; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 12px);
  background: #101828; color: #fff; font-size: 13px;
  padding: 9px 16px; border-radius: 999px; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; z-index: 300;
  max-width: 86vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============================ 导入页专用 ============================ */
.imp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.imp-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 10px; align-content: flex-start;
}
.imp-card .imp-top { display: flex; align-items: flex-start; gap: 10px; }
.imp-card .imp-icon {
  flex: 0 0 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: var(--brand-50); color: var(--brand-700); font-weight: 700; font-size: 14px;
}
.imp-card h3 { font-size: 14.5px; margin: 0; }
.imp-card .imp-desc { color: var(--muted); font-size: 12.4px; line-height: 1.6; margin: 0; }
.imp-card .imp-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.imp-card form { display: flex; flex-direction: column; gap: 8px; }
.imp-card .file-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.imp-card input[type="file"] { flex: 1 1 150px; min-width: 0; }
.imp-card .extra { display: flex; gap: 6px; flex-wrap: wrap; }
.imp-card .extra input, .imp-card .extra select { flex: 1 1 120px; min-width: 0; font-size: 12.5px; }
.pill-link {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12.4px;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--brand-100);
  background: var(--brand-50); color: var(--brand-700);
}
.pill-link:hover { background: var(--brand-100); text-decoration: none; }

/* 上传进度/结果 */
.upload-hint { font-size: 12px; color: var(--muted); }
.upload-hint:empty { display: none; }

/* ============================ 登录 ============================ */
.login-shell {
  min-height: 100vh; display: grid; place-items: center;
  background:
    radial-gradient(1000px 500px at 12% -10%, #dbeafe 0%, transparent 60%),
    radial-gradient(900px 480px at 100% 0%, #ede9fe 0%, transparent 55%),
    linear-gradient(180deg, #f8fafc, #f1f5f9);
  padding: 24px 18px;
}
.login-box {
  width: 100%; max-width: 396px; background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(255, 255, 255, .8); border-radius: 20px;
  padding: 30px 28px 26px; box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
}
.login-box .logo-lg {
  width: 46px; height: 46px; border-radius: 14px; margin-bottom: 16px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #fff;
  font-size: 20px; font-weight: 700; display: grid; place-items: center;
  box-shadow: 0 8px 20px -6px rgba(37, 99, 235, .5);
}
.login-box h1 { font-size: 22px; margin-bottom: 4px; }
.login-box .sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.login-box .row { margin-bottom: 12px; }
.login-box input { width: 100%; min-height: 44px; font-size: 15px; }
.login-box button { width: 100%; min-height: 44px; font-size: 15px; }
.login-foot { margin-top: 18px; color: var(--muted-2); font-size: 11.8px; text-align: center; line-height: 1.7; }

/* ============================ 弹窗 ============================ */
dialog.dlg {
  border: none; padding: 0; border-radius: 16px;
  width: min(560px, calc(100vw - 28px)); max-height: calc(100vh - 60px);
  background: #fff; box-shadow: var(--shadow-lg); color: var(--ink);
  overflow: auto;
}
dialog.dlg::backdrop { background: rgba(15, 23, 42, .44); backdrop-filter: blur(2px); }
dialog.dlg form { margin: 0; }
.dlg-head {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 20px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: #fff; z-index: 2;
}
.dlg-head h3 { font-size: 15px; margin: 0; flex: 1; }
.dlg-x {
  width: 30px; height: 30px; min-height: 30px; padding: 0;
  border-radius: 8px; border: 1px solid transparent; background: transparent;
  color: var(--muted); font-size: 18px; line-height: 1;
}
.dlg-x:hover { background: var(--line-2); color: var(--ink); }
.dlg-body { padding: 16px 20px 4px; }
.dlg-body .formgrid { margin-bottom: 2px; }
.dlg-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 20px 18px;
}
.dlg-sub { font-size: 12.4px; color: var(--muted); margin: -4px 0 12px; }
.dlg-sub b { color: var(--ink-2); font-weight: 600; }

/* ============================ 回传表特殊 ============================ */
table.t-returns { table-layout: fixed; min-width: 1020px; }
table.t-returns td.wrap { max-width: none; }
table.t-returns > tbody > tr > td { vertical-align: top; padding-top: 12px; }
table.t-returns textarea { min-height: 48px; font-size: 12.4px; }
table.t-returns .formgrid.compact input { min-height: 30px; }
.dateblock td:first-child {
  background: #f8fafc; font-weight: 600; white-space: nowrap; color: var(--ink);
}
.bigtext {
  font-family: var(--mono); font-size: 11.8px; line-height: 1.65;
  background: #fbfbfc; border: 1px solid var(--line-2); border-radius: 8px;
  padding: 8px 10px; max-height: 150px; overflow: auto; white-space: pre-wrap; word-break: break-all;
}
.fixed { font-family: var(--mono); }
.acc-line { font-size: 12.3px; line-height: 1.9; }
.acc-card { margin-bottom: 10px; }
.acc-card:last-child { margin-bottom: 0; }
button.copy-all {
  display: flex; width: fit-content; margin-top: 6px; white-space: nowrap;
  border-color: var(--brand-100); color: var(--brand-700); background: var(--brand-50);
}
button.copy-all:hover { background: var(--brand-100); border-color: var(--brand-100); }

/* ============================ 工作数据看板 ============================ */
.work-board { padding: 16px 18px 18px; }
.work-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.work-head h3 { margin: 0; }
.work-head h3 small { display: block; font-weight: 400; font-size: 11.8px; color: var(--muted); margin-top: 3px; }
.work-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.work-tools .date-form { display: flex; margin: 0; }
.work-tools input[type="date"] {
  min-height: 30px; padding: 4px 8px; font-size: 12.4px; width: 138px;
  border-radius: 9px; border: 1px solid var(--line); background: #fff;
}
.work-sub { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 18px 0 8px; font-size: 13px; }
.work-sub span { font-size: 11.8px; }
.tablewrap.tight { max-height: none; box-shadow: none; }
.who-cell b { display: block; font-size: 13px; color: var(--ink); font-weight: 600; line-height: 1.4; text-align: left; }
.who-cell small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; text-align: left; }
td .num.big { font-size: 14px; color: var(--ink); }
td .split { display: block; font-size: 11px; color: var(--muted-2); margin-top: 1px; }
.hand { color: var(--brand-600); font-style: normal; font-size: 11px; margin-left: 3px; }
td.hot { color: #b54708; font-weight: 700; }
table.dt > tfoot td {
  background: #f9fafb; border-top: 1px solid var(--line);
  font-weight: 600; color: var(--ink); white-space: nowrap;
  padding: 10px 14px; font-size: 12.6px;
}
.vtree { font-size: 12.2px; white-space: normal; }
.vtree summary {
  cursor: pointer; list-style: none; display: inline-flex; align-items: baseline; gap: 5px;
  padding: 2px 8px; border-radius: 7px; border: 1px solid var(--brand-100); background: var(--brand-50);
  color: var(--brand-700); width: fit-content;
}
.vtree summary::-webkit-details-marker { display: none; }
.vtree summary::after { content: "▾"; font-size: 10px; color: var(--brand-600); }
.vtree[open] summary::after { content: "▴"; }
.vtree summary b { font-size: 13.5px; }
.vtree summary .muted { font-size: 11.4px; }
.vtree ul { margin: 7px 0 0; padding: 6px 0 0; list-style: none; border-top: 1px dashed var(--line-2); }
.vtree li { display: flex; align-items: center; gap: 8px; padding: 2px 0; color: var(--ink-2); }
.vtree li .nm { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vtree li .no { color: var(--muted-2); font-family: var(--mono); font-size: 11px; }
.vtree li b { font-variant-numeric: tabular-nums; color: var(--ink); }


/* 日报：指标格子 / 账号清单 */
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
.kv {
  background: #fbfcfe; border: 1px solid var(--line-2); border-radius: 10px;
  padding: 9px 11px; display: flex; flex-direction: column; gap: 3px;
}
.kv span { font-size: 11.6px; color: var(--muted); }
.kv b { font-size: 19px; font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1.2; }
.kv b.hot { color: #b54708; }
.acct-list { list-style: none; margin: 0; padding: 0; font-size: 12.4px; }
.acct-list li { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--line-2); }
.acct-list li:last-child { border-bottom: none; }
.acct-list .nm { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.acct-list .no { color: var(--muted-2); font-family: var(--mono); font-size: 11px; }
.acct-list b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ============================ 底部 Tab（移动）============================ */
.tabbar {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding: 5px 4px calc(5px + env(safe-area-inset-bottom));
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 10.8px; color: var(--muted); padding: 4px 0; border-radius: 8px;
  text-decoration: none;
}
.tabbar a.on { color: var(--brand); font-weight: 600; }
.tabbar a i {
  font-style: normal; font-size: 17px; line-height: 1;
  width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px;
}
.tabbar a.on i { background: var(--brand-50); }

/* ============================ 响应式 ============================ */
@media (max-width: 1080px) {
  .nav-desktop a { padding: 7px 9px; font-size: 13px; }
  .who small { display: none; }
}

@media (max-width: 900px) {
  .grid2 { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  :root { --nav-h: 56px; }

  body { font-size: 14.5px; }

  .topbar { padding: 0 12px; gap: 6px; }
  .hamburger { display: flex; }
  .nav-desktop { display: none; }
  .brand { font-size: 14.5px; }
  .brand .logo { width: 26px; height: 26px; border-radius: 7px; font-size: 13px; }
  .who { display: none; }
  .logout { padding: 5px 9px; font-size: 12px; }

  main.wrap { padding: 14px 12px calc(78px + env(safe-area-inset-bottom)); }

  .page-head { align-items: flex-start; gap: 10px; margin-bottom: 12px; }
  .page-head h1 { font-size: 19px; }
  .page-head .sub { font-size: 12.6px; }
  .page-head .head-actions { margin-left: 0; width: 100%; }
  .page-head .head-actions > .btn, .page-head .head-actions > button { flex: 1 1 auto; }

  .card { padding: 14px; border-radius: 12px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat { padding: 11px 12px; border-radius: 12px; }
  .stat b { font-size: 21px; }
  .stat span { font-size: 11.5px; }

  .toolbar { gap: 8px; }
  .toolbar form { width: 100%; }
  .toolbar form input, .toolbar form select { flex: 1 1 130px; min-width: 0; }
  .toolbar form button { flex: 0 0 auto; }
  .toolbar > input, .toolbar > input.filter-input { flex: 1 1 100%; margin-left: 0; max-width: none; }
  .toolbar > .btn { flex: 1 1 auto; justify-content: center; }
  .toolbar .muted { margin-left: 0; }

  /* 表格 → 卡片 */
  .tablewrap { background: transparent; border: none; box-shadow: none; overflow: visible; max-height: none; }

  table.dt { display: block; width: 100%; font-size: 14px; table-layout: auto; }
  table.dt thead { display: none; }
  table.dt tbody { display: block; }
  table.dt tbody tr {
    display: block; background: #fff; border: 1px solid var(--line);
    border-radius: 13px; padding: 4px 2px; margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
  }
  table.dt tbody tr:hover td, table.dt tbody tr:nth-child(even) td { background: transparent; }
  table.dt tbody td {
    display: flex; flex-wrap: wrap; gap: 3px 12px; align-items: baseline;
    white-space: normal; overflow: visible; height: auto; min-height: 0;
    padding: 8px 13px; border: none; border-bottom: 1px solid var(--line-2);
    font-size: 13.5px; word-break: break-word; min-width: 0;
  }
  table.dt tbody td > * { flex: 1 1 100%; min-width: 0; }
  table.dt tbody td:last-child { border-bottom: none; }
  table.dt tbody td::before {
    content: attr(data-label);
    flex: 0 0 72px; max-width: 72px; color: var(--muted-2); font-size: 11.8px;
    line-height: 1.7; font-weight: 500; padding-top: 1px; word-break: break-word;
  }
  table.dt tbody td[data-label=""]::before, table.dt tbody td.no-label::before { display: none; }
  table.dt tbody td > * { min-width: 0; }
  table.dt tbody td form { width: 100%; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
  table.dt tbody td form input, table.dt tbody td form select, table.dt tbody td form textarea { flex: 1 1 110px; width: auto; min-width: 0; }
  table.dt tbody td form button { flex: 0 0 auto; }
  table.dt tbody td form textarea { flex: 1 1 100%; }
  table.dt tbody td > .tag, table.dt tbody td > a.lnk,
  table.dt tbody td > .copyable, table.dt tbody td > small { flex: 0 0 auto; }
  table.dt tbody td > a.btn { flex: 0 0 auto; min-width: 132px; }
  table.dt .row-acts { width: 100%; gap: 6px; }
  table.dt .row-acts > .btn, table.dt .row-acts > button, table.dt .row-acts > form { flex: 1 1 auto; }
  table.dt .row-acts > form > button { width: 100%; }
  .inline-form { width: 100%; }
  .inline-form input, .inline-form select { flex: 1 1 100%; }
  table.dt tbody td.wrap { max-width: none; }
  table.dt tbody td.num { white-space: normal; }
  /* 第一列作为卡片标题行 */
  table.dt tbody tr > td:first-child {
    font-weight: 600; color: var(--ink); font-size: 14px;
    background: transparent; border-bottom: 1px solid var(--line-2);
  }
  table.dt tbody tr > td:first-child::before { font-size: 11.8px; }

  /* 合计行在卡片模式下变成摘要条，避免撑出横向滚动 */
  table.dt > tfoot { display: block; width: 100%; }
  table.dt > tfoot tr {
    display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline;
    padding: 10px 13px; background: #f9fafb; border-top: 1px solid var(--line);
  }
  table.dt > tfoot td {
    display: inline-flex; align-items: baseline; gap: 5px;
    border: none; padding: 0; height: auto; background: transparent; font-size: 12px;
  }
  table.dt > tfoot td::before { content: attr(data-label); color: var(--muted-2); font-weight: 500; }
  table.dt > tfoot td[data-label=""] { font-weight: 700; color: var(--ink); flex: 0 0 100%; }
  table.dt > tfoot td .split { display: inline; margin-left: 3px; font-size: 11px; }
  table.dt tbody td .split { display: inline; margin-left: 5px; font-size: 11px; }
  table.dt tbody td .num.big { font-size: 13.5px; }
  /* 普通（非卡片化）表格：横向滚动 */
  .tablewrap > table:not(.dt) { min-width: 560px; }

  table.t-returns { table-layout: auto; min-width: 0; }
  .imp-grid { grid-template-columns: 1fr; }
  .imp-card { padding: 14px; }

  .formgrid { grid-template-columns: 1fr 1fr; }
  table.dt tbody td .formgrid { grid-template-columns: 1fr; }
  select[multiple] { min-height: 170px; }

  .tabbar { display: flex; }

  .pager { justify-content: space-between; }
  .pager .btn { flex: 1 1 auto; justify-content: center; }

  .flash { font-size: 13px; }
  .note { font-size: 12.4px; }
  details.card > summary { padding: 12px 14px; }
  details.card > *:not(summary) { padding: 0 14px; }
  details.card > form, details.card > div, details.card > p { padding-bottom: 12px; }

  input, select, textarea, button, .btn { font-size: 15px; min-height: 40px; }
  button.mini, .btn.mini { min-height: 32px; font-size: 12.5px; }
  input[type="file"] { font-size: 12.5px; min-height: 40px; }

  dialog.dlg { width: calc(100vw - 20px); max-height: calc(100vh - 40px); border-radius: 14px; }
  .dlg-head { padding: 13px 15px; }
  .dlg-body { padding: 14px 15px 4px; }
  .dlg-foot { padding: 12px 15px 15px; }
  .dlg-foot .btn, .dlg-foot button { flex: 1 1 0; }
}

@media (max-width: 480px) {
  .formgrid { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat b { font-size: 19px; }
  table.dt tbody td::before { flex: 0 0 62px; font-size: 11.5px; }
}

/* 打印 */
@media print {
  .topbar, .tabbar, .toolbar, .pager, .drawer, .scrim { display: none !important; }
  main.wrap { padding: 0; max-width: none; }
  .tablewrap { border: none; box-shadow: none; max-height: none; }
}

/* ============================ 组织：队 / 组 / 组号 ============================ */
.grp-select { width: 100%; min-height: 32px; padding: 4px 8px; font-size: 12.6px;
  border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.grp-no-box { display: flex; align-items: center; gap: 2px; font-size: 11.4px; color: var(--muted); }
.grp-no-box input { width: 40px; min-height: 30px; padding: 2px 4px; text-align: center;
  border-radius: 7px; border: 1px solid var(--line); font-family: var(--mono); }
.grp-no-box span { flex: 0 0 auto; max-width: 74px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.org-team { margin-bottom: 20px; }
.org-team-head { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 10px; }
.org-team-head h2 { font-size: 16px; }
.org-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.org-card { padding: 14px; }
.org-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.org-card-head b { font-size: 14.5px; }
.gn-list { display: flex; flex-direction: column; gap: 6px; }
.gn-row { display: flex; gap: 8px; align-items: baseline; font-size: 12.6px;
  border-bottom: 1px dashed var(--line-2); padding-bottom: 5px; }
.gn-row:last-child { border-bottom: none; }
.gn-no { flex: 0 0 auto; font-family: var(--mono); font-size: 11.4px; color: var(--brand-700);
  background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 6px; padding: 1px 6px; }
.gn-names { color: var(--ink-2); }
.org-card-foot { display: flex; gap: 8px; margin-top: 12px; }
.unassigned-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; padding: 3px 9px; border-radius: 999px; background: #f2f4f7;
  color: var(--ink-2); font-size: 12px; }
.chip:hover { background: var(--brand-50); color: var(--brand-700); text-decoration: none; }
.org-admin-team { padding: 12px 0; border-top: 1px dashed var(--line-2); }
.org-admin-team:first-of-type { border-top: none; padding-top: 4px; }
.org-admin-head { display: flex; align-items: center; gap: 10px; justify-content: space-between;
  flex-wrap: wrap; margin-bottom: 6px; }
.team-name-input { max-width: 150px; font-weight: 650; }
.unit-name-input { max-width: 180px; }

@media (max-width: 860px) {
  .org-grid { grid-template-columns: 1fr; }
  .org-card-foot .btn { flex: 1 1 auto; justify-content: center; }
  .org-admin-head { align-items: flex-start; }
  .team-name-input { max-width: 120px; }
  .unit-name-input { flex: 1 1 auto; }
  .gn-row { align-items: flex-start; }
}

.twoline { display: flex; flex-direction: column; line-height: 1.35; }
.twoline small { color: var(--muted-2); font-size: 11.4px; }
.org-card { display: flex; flex-direction: column; }
.org-card-foot { margin-top: auto; }

.org-admin-team td .inline-form { width: 100%; }
.org-admin-team .unit-name-input { flex: 1 1 80px; max-width: none; }

/* ============================ 组与组号：组内账号编辑 ============================ */
.gn-block { padding: 7px 0; border-bottom: 1px dashed var(--line-2); }
.gn-block:last-child { border-bottom: none; padding-bottom: 0; }
.gn-block-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 5px; flex-wrap: wrap; }
.gn-quota { font-size: 11px; color: var(--ink-2); background: #f2f4f7; border: 1px solid var(--line-2);
  border-radius: 999px; padding: 0 7px; }
.gn-quota.mixed { color: #b54708; background: #fffaeb; border-color: #fedf89; }
.gn-editor { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 11.6px; }
.gn-ed-name { color: var(--brand-700); font-weight: 600; }
.gn-ed-label { display: inline-flex; align-items: center; gap: 4px; color: var(--muted-2); }
.gn-ed-select { height: 26px; padding: 0 6px; border: 1px solid var(--line-2); border-radius: 6px;
  background: #fff; font-size: 12px; color: var(--ink); max-width: 132px; }
.gn-ed-select.empty { border-color: #fdb022; background: #fffcf5; color: #b54708; }
.gn-members { display: flex; flex-wrap: wrap; gap: 5px; }
.gn-chip { display: inline-flex; align-items: center; gap: 2px; max-width: 100%;
  padding: 2px 4px 2px 9px; border-radius: 999px; background: #f2f4f7;
  font-size: 12px; color: var(--ink-2); line-height: 1.7; }
.gn-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 132px; }
.gn-x { border: none; background: transparent; color: var(--muted-2); font-size: 14px; line-height: 1;
  padding: 1px 4px; cursor: pointer; border-radius: 999px; font-family: inherit; }
.gn-x:hover { background: #fee4e2; color: #b42318; }
.gn-add { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px;
  padding-top: 9px; border-top: 1px dashed var(--line-2); }
.gn-add select { flex: 1 1 100%; min-width: 0; }
.gn-add input { flex: 0 0 84px; width: 84px; text-align: center; }
.gn-add .mini { flex: 1 1 auto; justify-content: center; }
.org-flash { box-shadow: 0 0 0 3px var(--brand-100); transition: box-shadow .35s; }
.org-card { justify-content: flex-start; }
.org-card .org-card-head { margin-bottom: 4px; }

@media (max-width: 860px) {
  .gn-add { flex-wrap: wrap; }
  .gn-add select { flex: 1 1 100%; }
  .gn-add input { flex: 1 1 40%; width: auto; }
  .gn-add .mini { flex: 0 0 auto; }
  .gn-chip-name { max-width: 108px; }
}
.org-head-right { display: flex; align-items: center; gap: 6px; }

/* ============================ 今日待办 + 导航红点 ============================ */
.nav-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 16px;
  height: 16px; padding: 0 4px; margin-left: 5px; border-radius: 999px; background: #f04438;
  color: #fff; font-size: 10.5px; font-style: normal; font-weight: 700; line-height: 1; vertical-align: 1px; }

.todo-card { padding: 14px 16px 12px; }
.todo-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.todo-head h3 { margin: 0; }
.todo-count { font-size: 12px; border-radius: 999px; padding: 2px 9px; border: 1px solid var(--line); }
.todo-count.hot { color: var(--danger); background: var(--danger-bg); border-color: var(--danger-line); font-weight: 600; }
.todo-count.ok { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.todo-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; }
.todo-item { display: flex; align-items: baseline; gap: 8px; font-size: 13px; padding: 5px 2px;
  border-top: 1px dashed var(--line-2); }
.todo-item:first-child { border-top: none; }
.todo-item .tdot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); flex: 0 0 auto; }
.todo-item a { color: inherit; }
.todo-item a:hover { color: var(--brand-600); }
.todo-item.hot .tdot { background: #f04438; }
.todo-item.hot { color: #912018; }
.todo-item.warn .tdot { background: #f79009; }
.todo-item.warn { color: #93370d; }
.todo-item.ok .tdot { background: #12b76a; }
.todo-item.muted { color: var(--muted); }

/* 后台组织表：商务 / 剪辑列不换行，超长省略 */
.biz-cell b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; max-width: 100%; }
.biz-cell small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------- 合作总表（爆款库 / 问题库） ---------------- */
.coop-tabs { display: flex; gap: 4px; margin: 0 0 14px; border-bottom: 1px solid var(--line); }
.coop-tabs a {
  padding: 9px 16px; font-size: 13.5px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none;
}
.coop-tabs a:hover { color: var(--ink); }
.coop-tabs a.on { color: var(--brand); border-bottom-color: var(--brand); }
.coop-tabs a i {
  font-style: normal; font-size: 11.5px; font-weight: 600; margin-left: 6px;
  background: var(--line-2); color: var(--ink-2); border-radius: 999px; padding: 1px 7px;
}
.coop-tabs a.on i { background: var(--brand-50); color: var(--brand); }

.coop-scope { display: flex; gap: 6px; margin: 0 0 10px; }
.coop-scope a {
  font-size: 12.6px; padding: 4px 12px; border-radius: 999px; text-decoration: none;
  border: 1px solid var(--line); color: var(--ink-2); background: var(--card);
}
.coop-scope a:hover { border-color: var(--brand); }
.coop-scope a.on { background: var(--brand-50); border-color: var(--brand); color: var(--brand); font-weight: 600; }

.toolbar select {
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--ink); font-size: 12.8px;
}

/* 标记徽标：异常走红、爆品走金 */
.tag.异常 { background: var(--danger-bg); color: var(--danger); }
.tag.爆品 { background: #fff7e6; color: #b54708; }

/* 回传表：爆品 / 异常标记列 */
.mark-badges { display: flex; flex-direction: column; gap: 4px; align-items: center; margin-bottom: 6px; }
.mark-actions { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.mark-actions .mini { width: 100%; }
tr.row-bad > td { background: #fffbfa; }
.seg > label.is-off { opacity: .45; cursor: not-allowed; }
.seg > label.is-off:hover { border-color: var(--line); }

/* 日报自定义填报字段（后台配置） */
details.add-box { border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; background: var(--bg-2, #fafbfc); }
details.add-box > summary { cursor: pointer; font-size: 13px; color: var(--brand-600); font-weight: 600; }
details.add-box[open] > summary { margin-bottom: 10px; }
.field.span2 { grid-column: 1 / -1; }

/* 排品表单：商品ID → 挂车链接预览 */
.sch-link-preview {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 2px 0 14px; padding: 8px 11px; border: 1px dashed var(--line);
  border-radius: 9px; background: var(--bg-2, #fafbfc);
}
.sch-link-preview .lbl { font-size: 12.4px; color: var(--ink-2, #475467); font-weight: 600; }
.sch-link-preview .lbl small { font-weight: 400; color: var(--muted); margin-left: 4px; }
.sch-link-preview .lnk-cell { justify-content: flex-start; flex-wrap: wrap; gap: 8px; }
