/* =====================================================================
 * CKIIU 买手店 · 管理后台样式
 * 设计体系：墨黑 #141414 / 米白 #F6F3ED / 纸白 #FFF / 克莱因蓝 #002FA7
 *           辅助蓝 #E9EEF9 / 灰 #8C8880 / 线 #E7E2D9 / 红 #D8442C
 * 风格：杂志编辑风、留白充分、hairline 1px、小标签 letter-spacing 大写
 * ===================================================================== */

/* ---------- 1. 变量与基础 ---------- */
:root {
  --ink: #141414;
  --paper: #F6F3ED;
  --white: #FFFFFF;
  --blue: #002FA7;
  --blue-soft: #E9EEF9;
  --gray: #8C8880;
  --line: #E7E2D9;
  --red: #D8442C;
  --red-soft: #F9E9E5;
  --green: #1F7A4D;
  --green-soft: #E6F2EB;
  --serif: 'Songti SC', 'SimSun', serif;
  --num: Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--ink); }
::selection { background: var(--blue); color: #fff; }

/* ---------- 2. 登录页 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  padding: 40px 20px;
}
.login-card {
  width: 420px;
  max-width: 100%;
  background: var(--white);
  padding: 56px 48px 40px;
  text-align: center;
}
.login-logo {
  font-family: var(--serif);
  font-size: 52px;
  letter-spacing: 10px;
  line-height: 1;
  padding-left: 10px;
}
.login-sub {
  margin-top: 18px;
  font-size: 13px;
  letter-spacing: 6px;
  color: var(--gray);
}
.login-line { height: 1px; background: var(--line); margin: 32px 0 26px; }
.login-card .fld { text-align: left; margin-bottom: 18px; }
.login-err {
  min-height: 18px;
  font-size: 12px;
  color: var(--red);
  margin-bottom: 10px;
  text-align: left;
}
.login-foot {
  margin-top: 34px;
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--gray);
}

/* ---------- 3. 布局：侧边栏 / 顶栏 / 内容 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--ink);
  color: var(--paper);
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
}
.logo { padding: 30px 28px 26px; border-bottom: 1px solid rgba(246, 243, 237, .14); }
.logo-en {
  display: block;
  font-family: var(--serif);
  font-size: 30px;
  letter-spacing: 8px;
  line-height: 1;
}
.logo-sub {
  display: block;
  margin-top: 10px;
  font-size: 10px;
  letter-spacing: 5px;
  color: var(--gray);
}
.menu { flex: 1; padding: 18px 0; overflow-y: auto; }
.menu-item {
  display: flex;
  align-items: baseline;
  gap: 12px;
  width: 100%;
  padding: 13px 26px;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  color: rgba(246, 243, 237, .62);
  font-size: 13px;
  letter-spacing: 2px;
  text-align: left;
  transition: color .15s, background .15s;
}
.menu-item:hover { color: var(--paper); background: rgba(255, 255, 255, .04); }
.menu-item.on {
  color: #fff;
  background: rgba(0, 47, 167, .18);
  border-left-color: var(--blue);
}
.menu-no { font-family: var(--num); font-style: italic; font-size: 11px; color: var(--gray); }
.menu-item.on .menu-no { color: #7d9be8; }
.side-foot {
  padding: 18px 26px 26px;
  font-size: 9px;
  letter-spacing: 2px;
  color: rgba(140, 136, 128, .6);
  border-top: 1px solid rgba(246, 243, 237, .1);
}
.main { flex: 1; margin-left: 220px; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 64px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
  position: sticky;
  top: 0;
  z-index: 40;
}
.page-title { font-family: var(--serif); font-size: 20px; font-weight: 400; letter-spacing: 4px; }
.top-right { display: flex; align-items: center; gap: 14px; }
.badge {
  display: inline-block;
  padding: 4px 12px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  letter-spacing: 2px;
}
.content { padding: 36px; flex: 1; }

/* ---------- 4. 通用组件 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 22px;
  background: var(--blue);
  border: 1px solid var(--blue);
  color: #fff;
  font-size: 13px;
  letter-spacing: 2px;
  transition: opacity .15s;
}
.btn:hover { opacity: .88; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-outline:hover { border-color: var(--ink); opacity: 1; }
.btn-danger { background: var(--red); border-color: var(--red); }
.btn-sm { height: 30px; padding: 0 14px; font-size: 12px; }
.btn-block { width: 100%; height: 44px; margin-top: 6px; }

.fld { display: block; margin-bottom: 18px; }
.fld-l {
  display: block;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--gray);
  margin-bottom: 7px;
}
.fld-hint { display: block; font-size: 11px; color: var(--gray); margin-top: 5px; }
.fld-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.fld-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }
.ipt {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  background: var(--white);
  border: 1px solid var(--line);
  outline: none;
  transition: border-color .15s;
  border-radius: 0;
}
.ipt:focus { border-color: var(--blue); }
textarea.ipt { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.6; }
select.ipt { appearance: none; background-image: none; }

.tag {
  display: inline-block;
  padding: 3px 10px;
  font-size: 11px;
  letter-spacing: 1px;
  white-space: nowrap;
}
.tag-blue { background: var(--blue-soft); color: var(--blue); }
.tag-gray { background: #efece6; color: var(--gray); }
.tag-red { background: var(--red-soft); color: var(--red); }
.tag-green { background: var(--green-soft); color: var(--green); }

/* 表格 */
.panel { background: var(--white); border: 1px solid var(--line); }
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.toolbar .ipt { width: 200px; }
.toolbar .ipt.kw { width: 240px; }
.toolbar .spacer { flex: 1; }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 2px;
  color: var(--gray);
  text-transform: uppercase;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.tbl td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.tbl tbody tr:hover { background: #faf8f4; }
.tbl tbody tr:last-child td { border-bottom: none; }
.thumb { width: 44px; height: 44px; object-fit: cover; display: block; background: var(--paper); }
.cell-name { font-weight: 500; }
.cell-sub { font-size: 12px; color: var(--gray); margin-top: 3px; }
.price { font-family: var(--num); font-size: 14px; }
.price-del { font-size: 12px; color: var(--gray); text-decoration: line-through; margin-top: 2px; }
.ops { white-space: nowrap; }
.lnk {
  background: none;
  border: none;
  color: var(--blue);
  font-size: 12px;
  padding: 0 6px;
}
.lnk:hover { text-decoration: underline; }
.lnk-danger { color: var(--red); }
.empty { padding: 56px 20px; text-align: center; color: var(--gray); letter-spacing: 2px; font-size: 13px; }

/* 骨架屏 */
.sk {
  display: block;
  height: 14px;
  background: linear-gradient(90deg, #efece6 25%, #f7f5f1 50%, #efece6 75%);
  background-size: 200% 100%;
  animation: sk 1.2s infinite;
}
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* 分页 */
.pager {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
}
.pager-info { font-size: 12px; color: var(--gray); margin-right: auto; letter-spacing: 1px; }
.pg {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  background: var(--white);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink);
}
.pg:hover:not(:disabled) { border-color: var(--ink); }
.pg.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.pg:disabled { color: #c8c4bc; cursor: not-allowed; }

/* 弹窗 */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 20, .45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 20px 20px;
  z-index: 100;
  overflow-y: auto;
}
.modal {
  width: 560px;
  max-width: 100%;
  background: var(--white);
  box-shadow: 0 12px 48px rgba(0, 0, 0, .18);
}
.modal-wide { width: 980px; }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { font-family: var(--serif); font-size: 18px; font-weight: 400; letter-spacing: 3px; }
.modal-x {
  background: none;
  border: none;
  font-size: 14px;
  color: var(--gray);
  padding: 4px 8px;
}
.modal-x:hover { color: var(--ink); }
.modal-body { padding: 26px 28px; max-height: 72vh; overflow-y: auto; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 18px 28px;
  border-top: 1px solid var(--line);
}

/* Toast */
#toast-box {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.toast {
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  padding: 11px 22px;
  font-size: 13px;
  letter-spacing: 1px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .1);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .25s, transform .25s;
}
.toast.in { opacity: 1; transform: translateY(0); }
.toast-err { border-left-color: var(--red); }

/* chips（颜色/尺码/热搜词输入） */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 40px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: var(--white);
}
.chips:focus-within { border-color: var(--blue); }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 10px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
}
.chip-x {
  background: none;
  border: none;
  color: var(--blue);
  font-size: 12px;
  line-height: 1;
  padding: 0 2px;
  opacity: .7;
}
.chip-x:hover { opacity: 1; }
.chip-input {
  flex: 1;
  min-width: 90px;
  height: 26px;
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
}

/* 标签多选（商品标签） */
.tag-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.tagpick {
  padding: 6px 12px;
  background: var(--white);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--gray);
  letter-spacing: 1px;
}
.tagpick.on { background: var(--blue); border-color: var(--blue); color: #fff; }

/* 图片上传网格 */
.img-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.img-cell {
  position: relative;
  width: 84px;
  height: 84px;
  border: 1px solid var(--line);
  background: var(--paper);
}
.img-cell.main { outline: 1px solid var(--blue); }
.img-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-x {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 10px;
  line-height: 18px;
  padding: 0;
}
.img-tag {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: 1px 6px;
  background: var(--blue);
  color: #fff;
  font-size: 10px;
  letter-spacing: 1px;
}
.img-add {
  width: 84px;
  height: 84px;
  border: 1px dashed var(--line);
  background: var(--white);
  color: var(--gray);
  font-size: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.img-add span { font-size: 11px; letter-spacing: 1px; }
.img-add:hover { border-color: var(--blue); color: var(--blue); }
.img-add:disabled { opacity: .6; cursor: wait; }

/* 开关 */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { display: none; }
.switch .sw {
  width: 40px;
  height: 22px;
  background: #d8d3c9;
  position: relative;
  transition: background .15s;
}
.switch .sw::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  transition: left .15s;
}
.switch input:checked + .sw { background: var(--blue); }
.switch input:checked + .sw::after { left: 20px; }
.switch .sw-t { font-size: 13px; color: var(--gray); letter-spacing: 1px; }

/* ---------- 5. 看板 ---------- */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; }
.sec-title { font-size: 11px; letter-spacing: 4px; color: var(--gray); text-transform: uppercase; }
.sec-more { font-size: 11px; color: var(--gray); letter-spacing: 1px; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 2px solid var(--ink);
  padding: 20px 18px 16px;
}
.stat-card.hl { border-top-color: var(--blue); }
.stat-l { font-size: 10px; letter-spacing: 3px; color: var(--gray); }
.stat-v { font-family: var(--num); font-size: 26px; margin-top: 10px; line-height: 1.1; }
.stat-v.italic { font-style: italic; }
.stat-sub { font-size: 11px; color: var(--gray); margin-top: 8px; letter-spacing: 1px; }
.dash-note {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 14px 20px;
  font-size: 12px;
  color: var(--gray);
  letter-spacing: 1px;
  margin-bottom: 16px;
}
.dash-note b { font-family: var(--num); font-weight: 400; color: var(--ink); }
.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
.dash-card { background: var(--white); border: 1px solid var(--line); padding: 24px 26px 20px; }
.chart-bars { display: flex; align-items: flex-end; gap: 14px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; }
.bar-val { font-family: var(--num); font-style: italic; font-size: 11px; color: var(--gray); margin-bottom: 8px; white-space: nowrap; }
.bar-track { height: 150px; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.bar { width: 36px; min-height: 2px; background: var(--ink); }
.bar-col.today .bar { background: var(--blue); }
.bar-col.today .bar-val { color: var(--blue); }
.bar-date { font-size: 11px; color: var(--gray); margin-top: 10px; letter-spacing: 1px; }
.hb-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.hb-name { width: 64px; flex-shrink: 0; font-size: 13px; }
.hb-track { flex: 1; height: 10px; background: var(--paper); }
.hb-fill { height: 100%; background: var(--ink); min-width: 2px; }
.hb-fill.blue { background: var(--blue); }
.hb-val { width: 56px; text-align: right; font-family: var(--num); font-size: 12px; color: var(--gray); flex-shrink: 0; }

/* ---------- 6. 商品弹窗 ---------- */
.pm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 36px; }
.pm-col + .pm-col { border-left: 1px solid var(--line); padding-left: 36px; }
.pm-col > .fld:last-child { margin-bottom: 0; }
.sku-empty { font-size: 12px; color: var(--gray); padding: 14px 0; letter-spacing: 1px; }
.tbl-sku th, .tbl-sku td { padding: 9px 10px; font-size: 13px; }
.tbl-sku .ipt { height: 32px; padding: 0 8px; font-size: 13px; }

/* ---------- 7. 订单 tabs / 详情 ---------- */
.otabs {
  display: flex;
  gap: 28px;
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
  background: var(--white);
  border-top: 1px solid var(--line);
}
.otab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 15px 2px;
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--gray);
  margin-bottom: -1px;
}
.otab:hover { color: var(--ink); }
.otab.on { color: var(--blue); border-bottom-color: var(--blue); }
.od-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.od-item:last-child { border-bottom: none; }
.od-item img { width: 56px; height: 56px; object-fit: cover; background: var(--paper); flex-shrink: 0; }
.od-item .n { font-weight: 500; }
.od-item .s { font-size: 12px; color: var(--gray); margin-top: 4px; }
.od-item .p { margin-left: auto; text-align: right; font-family: var(--num); white-space: nowrap; }
.od-block { margin-bottom: 22px; }
.od-block:last-child { margin-bottom: 0; }
.od-bt { font-size: 11px; letter-spacing: 3px; color: var(--gray); margin-bottom: 10px; text-transform: uppercase; }
.od-line { display: flex; justify-content: space-between; font-size: 13px; padding: 5px 0; }
.od-line .k { color: var(--gray); }
.od-line .v { font-family: var(--num); }
.od-line.total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; font-weight: 500; }
.od-line.total .v { font-size: 16px; }
.trace { position: relative; padding-left: 18px; }
.trace::before { content: ''; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.trace-item { position: relative; padding: 7px 0; font-size: 13px; }
.trace-item::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 13px;
  width: 5px;
  height: 5px;
  background: var(--blue);
}
.trace-item .t { font-size: 11px; color: var(--gray); font-family: var(--num); margin-right: 10px; }

/* ---------- 8. 会员 / 佣金 / 提现 ---------- */
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--paper); display: block; }
.mem-cell { display: flex; align-items: center; gap: 12px; }
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.wt-tabs { display: flex; gap: 10px; }

/* ---------- 9. 运营 / 设置 ---------- */
.ops-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; align-items: start; }
.ops-card { background: var(--white); border: 1px solid var(--line); padding: 24px 26px; }
.ops-card + .ops-card { margin-top: 16px; }
.bn-img { width: 96px; height: 44px; object-fit: cover; display: block; background: var(--paper); }
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.set-card { background: var(--white); border: 1px solid var(--line); padding: 26px 28px; }
.set-card.wide { grid-column: 1 / -1; }
.set-card h4 {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 3px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.set-foot { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); text-align: right; }
.lv-tbl .ipt { height: 34px; }
.set-hint { font-size: 11px; color: var(--gray); margin-top: 5px; letter-spacing: 1px; }

/* ---------- 10. 滚动条 ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d8d3c9; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 11. 响应式 ---------- */
@media (max-width: 1280px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar { width: 64px; }
  .logo-en, .logo-sub, .menu-item span:not(.menu-no), .side-foot { display: none; }
  .menu-item { justify-content: center; padding: 14px 0; }
  .main { margin-left: 64px; }
  .content { padding: 20px; }
  .pm-grid, .set-grid, .ops-grid { grid-template-columns: 1fr; }
  .pm-col + .pm-col { border-left: none; padding-left: 0; }
}
