/* 配色照原超级淘客（FastAdmin 绿色皮肤）：绿色顶栏、深灰侧栏、选中项更深的灰；红色只用于错误 / 删除 */
:root {
  --side: #222d32; --side-hover: #1e282c; --side-sub: #2c3b41; --side-text: #b8c7ce; --brand: #18bc9c; --brand-dark: #15a589;
  --danger: #e74c3c;
  --bg: #ecf0f5; --card: #fff; --line: #e6e9ee; --text: #333; --muted: #8a919c; --ok: #18a058; --warn: #f39c12;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.5 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; }
.hidden { display: none !important; }

/* 登录 */
.auth { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #1f2733, #3a2230); }
.auth form { width: 340px; max-width: calc(100vw - 32px); background: #fff; border-radius: 14px; padding: 28px; }
.auth h2 { margin: 0 0 4px; } .auth p { color: var(--muted); margin: 0 0 18px; }

/* 布局 */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-text); overflow-y: auto; max-height: 100vh; position: sticky; top: 0; }
.logo { color: #fff; font-size: 18px; font-weight: 700; height: 50px; line-height: 50px; padding: 0 20px; background: var(--brand-dark); text-align: center; }
/* 左上角用户卡片 + 菜单搜索（照原超级淘客） */
.user-panel { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.user-panel .av { width: 42px; height: 42px; border-radius: 50%; background: #fff; color: var(--side); display: grid; place-items: center; font-weight: 700; flex: none; }
.user-panel b { color: #fff; display: block; font-size: 14px; } .user-panel small { color: var(--side-text); font-size: 12px; }
.user-panel small i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-right: 4px; }
.side-search { margin: 4px 12px 10px; }
.side-search input { width: 100%; border: 0; border-radius: 3px; padding: 7px 10px; background: #374850; color: #fff; }
.side-search input::placeholder { color: #8aa4af; }
.side .grp > .gt, .side a.it { display: flex; align-items: center; gap: 8px; padding: 11px 15px; color: var(--side-text); text-decoration: none; cursor: pointer; user-select: none; border-left: 3px solid transparent; }
.side .gt:hover, .side a.it:hover { background: var(--side-hover); color: #fff; }
.side .sub { display: none; background: var(--side-sub); }
.side .grp.open .sub { display: block; }
.side .grp.open > .gt { background: var(--side-hover); color: #fff; border-left-color: var(--brand); }
.side .sub a.it { padding-left: 38px; font-size: 13px; }
.side a.it.active { background: var(--side-hover); color: #fff; border-left-color: var(--brand); }
.side .sub a.it.active { background: #1a2226; }
.side .ic { width: 16px; text-align: center; }
.side .arrow { margin-left: auto; transition: transform .2s; font-size: 10px; } .grp.open .arrow { transform: rotate(90deg); }
.main { min-width: 0; }
.top { height: 50px; background: var(--brand); color: #fff; display: flex; align-items: center; padding: 0 16px; gap: 12px; position: sticky; top: 0; z-index: 5; }
.top .title { font-size: 15px; font-weight: 600; flex: 1; }
.top .muted { color: rgba(255,255,255,.85); }
.top .btn { background: transparent; border-color: rgba(255,255,255,.5); color: #fff; }
/* 多标签页（同时开几个页面，照原超级淘客顶部的页面标签） */
.page-tabs { display: flex; gap: 2px; background: #fff; border-bottom: 1px solid var(--line); padding: 0 8px; overflow-x: auto; position: sticky; top: 50px; z-index: 4; }
.page-tabs a { display: flex; align-items: center; gap: 6px; padding: 8px 12px; color: #666; text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; font-size: 13px; }
.page-tabs a.on { color: var(--brand); border-bottom-color: var(--brand); background: #f6fbfa; }
.page-tabs a .close { color: #aaa; font-size: 14px; line-height: 1; padding: 0 2px; } .page-tabs a .close:hover { color: var(--danger); }
.menu-btn { display: none; }
.content { padding: 20px; }
/* 菜单项里的标签页（如 用户列表：全部 / 沉睡 / 从没下单） */
.tabbar { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.tabbar a { padding: 8px 16px; color: #555; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabbar a.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.tabbar a:hover { color: var(--brand); }

/* 卡片 / 表格 */
.card { background: var(--card); border-radius: 10px; padding: 16px; box-shadow: 0 1px 2px rgba(0,0,0,.04); margin-bottom: 16px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
.toolbar .grow { flex: 1; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
th { background: #fafbfc; color: #555; font-weight: 600; }
tr:hover td { background: #fbfcfd; }
th:last-child, td:last-child { position: sticky; right: 0; background: #fff; box-shadow: -6px 0 6px -6px rgba(0,0,0,.12); max-width: none; }
th:last-child { background: #fafbfc; }
td img { width: 36px; height: 36px; object-fit: cover; border-radius: 4px; vertical-align: middle; }
.ops { display: flex; gap: 6px; flex-wrap: wrap; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.tag { display: inline-block; padding: 0 8px; border-radius: 10px; font-size: 12px; background: #eef1f5; color: #555; }
.tag.on { background: #e8f7ee; color: var(--ok); } .tag.off { background: #fdecec; color: var(--danger); }

/* 按钮 / 表单 */
.btn { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 6px 14px; cursor: pointer; color: var(--text); }
.btn:hover { border-color: #c9ced6; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; } .btn.primary:hover { background: var(--brand-dark); }
.btn.sm { padding: 2px 10px; font-size: 12px; }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: .6; cursor: wait; }
.input, select.input, textarea.input { border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; background: #fff; min-width: 0; }
.input:focus { outline: none; border-color: var(--brand); }
.form .fi { margin-bottom: 14px; }
.form label.lb { display: block; color: #555; margin-bottom: 4px; font-size: 13px; }
.form .req::after { content: " *"; color: var(--danger); }
.form .input { width: 100%; }
/* 可点选的标签块（备注设置、群发选标签） */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips a, .chips label { border: 1px solid var(--line); border-radius: 14px; padding: 3px 12px; cursor: pointer; color: #555; text-decoration: none; background: #fff; font-size: 13px; }
.chips a:hover, .chips label:hover { border-color: var(--brand); color: var(--brand); }
.chips label.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chips label input { display: none; }
.rm-parts { margin-top: 14px; padding: 12px; background: #f7faf9; border-radius: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 48px; }
.rm-part { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 3px 4px 3px 10px; display: inline-flex; gap: 4px; align-items: center; }
.rm-sep { color: var(--muted); font-style: normal; font-weight: 700; }
.rm-preview { background: #fff8e6; border-radius: 6px; padding: 10px 12px; font-size: 15px; }
.lic-bar { background: #fff4e5; color: #ad6800; padding: 8px 16px; font-size: 13px; }
.lic-bar a { color: #ad6800; text-decoration: underline; }
.count-box { background: #e8f8f5; color: #0f7a64; border-radius: 6px; padding: 10px 12px; margin-bottom: 10px; position: sticky; bottom: 0; }
.count-box .count-main { font-weight: 600; line-height: 1.6; }
.count-box.stale { background: #fff4e5; color: #ad6800; }
.count-box details { margin-top: 6px; font-size: 13px; } .count-box summary { cursor: pointer; }
.count-box ul { margin: 6px 0 0; padding-left: 18px; color: #333; }
/* 客户详情 / 员工待办 */
.pf-head { display: flex; gap: 14px; align-items: center; }
.av-lg { width: 56px; height: 56px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 22px; font-weight: 700; flex: none; }
.pf-kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 14px; }
.pf-kv span { display: block; font-size: 12px; } .pf-kv b { font-weight: 500; word-break: break-all; }
.timeline { margin-top: 10px; }
.tl { display: grid; grid-template-columns: 130px 26px 1fr; gap: 6px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.tl-t { color: var(--muted); font-size: 13px; } .tl-i { text-align: center; }
.tl-order { background: #f6fbf9; } .tl-level { background: #fffaf0; }
.todo-it { padding: 8px 0; border-bottom: 1px dashed var(--line); }
/* 选人面板：按维度分块 */
.who-group { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px 2px; margin-bottom: 12px; background: #fcfdfd; }
.who-title { font-weight: 700; color: var(--brand-dark); margin-bottom: 8px; }
.form .hint { color: var(--muted); font-size: 12px; margin-top: 3px; }
.form details.adv { border: 1px dashed var(--line); border-radius: 6px; padding: 8px 12px; margin-bottom: 14px; }
.form details.adv summary { cursor: pointer; color: var(--brand); user-select: none; }
.form details.adv[open] summary { margin-bottom: 12px; }
.form .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; max-height: 160px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; padding: 8px; }

/* 弹窗 / 提示 */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal-box { background: #fff; border-radius: 12px; width: min(560px, 100%); min-width: 0; max-height: calc(100vh - 32px); overflow-y: auto; }
.modal-head { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; }
.modal-head b { flex: 1; } .x { border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--muted); }
#modal-body { padding: 18px; }
pre.result { white-space: pre-wrap; word-break: break-all; background: #f7f8fa; border-radius: 8px; padding: 12px; margin: 0; max-height: 50vh; overflow: auto; }
#toast { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 60; }
#toast div { background: #333; color: #fff; padding: 8px 18px; border-radius: 20px; margin-bottom: 8px; box-shadow: 0 4px 12px rgba(0,0,0,.15); }
#toast div.err { background: var(--danger); }

/* 控制台 */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: #fff; border-radius: 10px; padding: 14px 16px; }
.stat .k { color: var(--muted); font-size: 13px; } .stat .v { font-size: 24px; font-weight: 700; margin-top: 2px; } .stat .s { color: var(--muted); font-size: 12px; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; font-size: 12px; color: var(--muted); }
.bars .b i { display: block; width: 100%; max-width: 44px; background: var(--brand); border-radius: 4px 4px 0 0; min-height: 2px; }
.grid2 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.convert-out { margin-top: 12px; }
.convert-out .ci { border-bottom: 1px dashed var(--line); padding: 8px 0; word-break: break-all; }
.ok { color: var(--ok); } .err { color: var(--danger); } .muted { color: var(--muted); }
/* 控制台顶部三块（照原超级淘客）：订单数据 / 群数据 / 热门功能 */
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.seg a { margin-left: 14px; color: #bbb; cursor: pointer; padding-bottom: 4px; border-bottom: 2px solid transparent; }
.seg a.on { color: var(--brand); border-bottom-color: var(--brand); }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.kpis span { display: block; color: #aaa; font-size: 13px; } .kpis b { font-size: 20px; } .kpis em.warn { color: var(--warn); font-style: normal; }
.hot { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; text-align: center; }
.hot a { color: #333; text-decoration: none; font-size: 13px; padding: 6px 0; border-radius: 6px; }
.hot a:hover { background: #f4f7f6; color: var(--brand); }
.hot i { display: block; font-style: normal; font-size: 24px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 240px; z-index: 30; transform: translateX(-100%); transition: transform .2s; max-height: none; }
  .shell.nav-open .side { transform: none; }
  .menu-btn { display: inline-block; }
  .content { padding: 12px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .page-tabs { display: none; }
}
