:root {
  --bg: #0A0A0B;
  --panel: #0F0F11;
  --raise: #15151A;
  --line: rgba(255, 255, 255, .075);
  --line2: rgba(255, 255, 255, .16);
  --txt: #E6E4DF;
  --dim: #82807A;
  --dim2: #55534E;
  --accent: #C8A96A;
  --ok: #4E9E6E;
  --warn: #BE8C3C;
  --bad: #AC5252;
  --c-bracelet: #C8A96A;
  --c-static: #6E8FA8;
  --c-taxidermy: #A8766B;
  --c-bone: #8CA86B;
  --sans: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", "Cascadia Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--txt);
  font-family: var(--sans);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: 0;
  outline: none;
}
button { cursor: pointer; }
::selection { background: var(--accent); color: #000; }

/* 滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.22); }

/* ========== 布局 ========== */
#app { display: grid; grid-template-columns: 178px 1fr; height: 100vh; }

/* ---------- 侧栏 ---------- */
#side {
  border-right: 1px solid var(--line);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  padding: 22px 0 14px;
}
.brand {
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.brand b {
  display: block;
  font-size: 12px;
  letter-spacing: .22em;
  font-weight: 600;
  color: var(--txt);
}
.brand span {
  display: block;
  margin-top: 5px;
  font-size: 10px;
  letter-spacing: .16em;
  color: var(--dim2);
  text-transform: uppercase;
}
.nav { flex: 1; }
.nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 20px;
  color: var(--dim);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color .12s, background .12s;
}
.nav a:hover { color: var(--txt); background: rgba(255,255,255,.025); }
.nav a.on { color: var(--txt); border-left-color: var(--accent); background: rgba(200,169,106,.05); }
.nav a i { font-style: normal; font-size: 10px; color: var(--dim2); font-family: var(--mono); }
.nav a.on i { color: var(--accent); }
.side-foot {
  padding: 12px 20px 0;
  border-top: 1px solid var(--line);
  font-size: 10px;
  color: var(--dim2);
  line-height: 1.7;
}
.dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--ok); margin-right: 5px; vertical-align: 1px; }
.dot.off { background: var(--bad); }

/* ---------- 主区 ---------- */
#main { overflow-y: auto; overflow-x: hidden; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  height: 52px; padding: 0 26px;
  background: rgba(10,10,11,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 14px; font-weight: 500; letter-spacing: .04em; }
.topbar .meta { font-size: 11px; color: var(--dim2); font-family: var(--mono); }
.topbar .meta b { color: var(--dim); font-weight: 400; }

.view { padding: 24px 26px 60px; }

/* ========== 通用 ========== */
.btn {
  padding: 6px 13px;
  border: 1px solid var(--line2);
  font-size: 12px;
  color: var(--txt);
  transition: background .12s, border-color .12s;
  white-space: nowrap;
}
.btn:hover { background: rgba(255,255,255,.055); border-color: rgba(255,255,255,.3); }
.btn.pri { background: var(--accent); border-color: var(--accent); color: #12100A; font-weight: 500; }
.btn.pri:hover { background: #D8BC83; }
.btn.ghost { border-color: transient; border-color: var(--line); color: var(--dim); }
.btn.ghost:hover { color: var(--txt); }
.btn.danger { color: var(--bad); border-color: rgba(172,82,82,.35); }
.btn.danger:hover { background: rgba(172,82,82,.12); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn.sm { padding: 3px 8px; font-size: 11px; }

input.f, select.f, textarea.f {
  width: 100%;
  padding: 7px 10px;
  background: var(--raise);
  border: 1px solid var(--line);
  color: var(--txt);
}
input.f:focus, select.f:focus, textarea.f:focus { border-color: var(--accent); }
input.f::placeholder { color: var(--dim2); }

/* 标题区 */
.head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; gap: 16px; }
.head h2 { font-size: 19px; font-weight: 400; letter-spacing: .01em; }
.head p { margin-top: 6px; font-size: 11.5px; color: var(--dim); }
.head .acts { display: flex; gap: 8px; flex-shrink: 0; }

/* 数字条 */
.nums { display: flex; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.num {
  flex: 1; padding: 16px 0 15px 0; border-right: 1px solid var(--line);
  position: relative;
}
.num:last-child { border-right: 0; }
.num:nth-child(n+2) { padding-left: 20px; }
.num .k { font-size: 10px; letter-spacing: .16em; color: var(--dim2); text-transform: uppercase; }
.num .v { font-size: 27px; font-family: var(--mono); font-weight: 300; margin-top: 7px; letter-spacing: -.02em; }
.num .sub { font-size: 10.5px; color: var(--dim2); margin-top: 3px; font-family: var(--mono); }
.num.acc .v { color: var(--accent); }

/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  text-align: left; font-weight: 400; font-size: 10px; letter-spacing: .14em;
  color: var(--dim2); text-transform: uppercase;
  padding: 0 10px 9px 0; border-bottom: 1px solid var(--line2); white-space: nowrap;
}
tbody td { padding: 12px 10px 12px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover { background: rgba(255,255,255,.02); }
tbody tr.click { cursor: pointer; }
td.r, th.r { text-align: right; padding-right: 14px; }
.mono { font-family: var(--mono); font-size: 11.5px; }
.dim { color: var(--dim); }
.dim2 { color: var(--dim2); }

/* 缩略图 */
.thumb {
  width: 46px; height: 46px; object-fit: cover;
  background: var(--raise); border: 1px solid var(--line); display: block;
}
.thumb.big { width: 100%; height: auto; aspect-ratio: 1; }

/* 分类标记 */
.cat {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--dim); white-space: nowrap;
}
.cat::before { content: ''; width: 6px; height: 6px; background: var(--dim2); }
.cat.bracelet::before { background: var(--c-bracelet); }
.cat.static::before { background: var(--c-static); }
.cat.taxidermy::before { background: var(--c-taxidermy); }
.cat.bone_jewelry::before { background: var(--c-bone); }

/* 状态 */
.st { font-size: 11px; font-family: var(--mono); }
.st.publish, .st.on_sale { color: var(--ok); }
.st.draft, .st.off { color: var(--dim2); }
.st.sold { color: var(--bad); }
.st.pending { color: var(--warn); }

/* Tabs */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs button {
  padding: 9px 16px; font-size: 12.5px; color: var(--dim);
  border-bottom: 1px solid transparent; margin-bottom: -1px;
}
.tabs button:hover { color: var(--txt); }
.tabs button.on { color: var(--txt); border-bottom-color: var(--accent); }
.tabs button em { font-style: normal; font-family: var(--mono); font-size: 10.5px; color: var(--dim2); margin-left: 5px; }

/* 空态 */
.empty { padding: 52px 0; text-align: center; color: var(--dim2); font-size: 12.5px; line-height: 2; }
.empty b { display: block; color: var(--dim); font-weight: 400; margin-bottom: 4px; }

/* 抽屉 */
#drawer-wrap {
  position: fixed; inset: 0; z-index: 60; display: none;
}
#drawer-wrap.on { display: block; }
#drawer-bg { position: absolute; inset: 0; background: rgba(0,0,0,.62); }
#drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: 470px; max-width: 94vw;
  background: var(--panel); border-left: 1px solid var(--line2);
  display: flex; flex-direction: column;
  animation: slide .18s ease-out;
}
@keyframes slide { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.d-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.d-head b { font-size: 13px; font-weight: 500; }
.d-body { flex: 1; overflow-y: auto; padding: 20px; }
.d-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-shrink: 0; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 10px; letter-spacing: .14em; color: var(--dim2); text-transform: uppercase; margin-bottom: 7px; }
.field .hint { font-size: 10.5px; color: var(--dim2); margin-top: 5px; line-height: 1.5; }

/* 图片格 */
.imgs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.imgcell { position: relative; border: 1px solid var(--line); background: var(--raise); aspect-ratio: 1; overflow: hidden; }
.imgcell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.imgcell .del {
  position: absolute; top: 0; right: 0; width: 20px; height: 20px;
  background: rgba(0,0,0,.72); color: #fff; font-size: 13px; line-height: 20px; text-align: center;
  opacity: 0; transition: opacity .12s;
}
.imgcell:hover .del { opacity: 1; }
.imgcell .del:hover { background: var(--bad); }
.imgadd {
  border: 1px dashed var(--line2); aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  color: var(--dim2); font-size: 11px; text-align: center; cursor: pointer; padding: 6px; line-height: 1.5;
}
.imgadd:hover { border-color: var(--accent); color: var(--accent); }

/* toast */
#toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(12px);
  background: var(--raise); border: 1px solid var(--line2); padding: 9px 18px;
  font-size: 12px; opacity: 0; pointer-events: none; transition: all .2s; z-index: 99;
  max-width: 80vw;
}
#toast.on { opacity: 1; transform: translateX(-50%); }
#toast.err { border-color: rgba(172,82,82,.6); color: #E8A0A0; }

/* 两栏 */
.cols { display: grid; grid-template-columns: 1fr 340px; gap: 30px; }
@media (max-width: 1180px) { .cols { grid-template-columns: 1fr; } }

.sec-t { font-size: 10px; letter-spacing: .16em; color: var(--dim2); text-transform: uppercase; margin-bottom: 12px; }

/* 平台徽标 */
.plat { font-size: 10px; font-family: var(--mono); letter-spacing: .06em; padding: 1px 5px; border: 1px solid var(--line2); color: var(--dim); }
.plat.douyin { color: #C86B6B; border-color: rgba(200,107,107,.3); }
.plat.xianyu { color: #C8B06B; border-color: rgba(200,176,107,.3); }

/* 进度条 */
.bar { height: 2px; background: var(--line); margin-top: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); transition: width .3s; }

/* 两行单元格 */
.nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; line-height: 1.35; }
.sub2 { font-size: 11.5px; color: var(--dim2); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
select.f.mini { padding: 3px 5px; font-size: 11px; width: 100%; }

/* 通道状态 */
.chan {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.chan:first-child { border-top: 1px solid var(--line); }
.chan .dot { margin-top: 5px; flex-shrink: 0; }
.chan .cn { font-size: 12.5px; }
.chan .cd { font-size: 10.5px; color: var(--dim2); margin-top: 3px; line-height: 1.5; }

/* ---------- 登录遮罩 ---------- */
#login-wall {
  position: fixed; inset: 0; z-index: 200;
  background: #0A0A0B;
  display: grid; place-items: center;
}
#login-wall form { width: 264px; }
.lw-brand { font-size: 12px; letter-spacing: .22em; font-weight: 600; color: var(--txt); }
.lw-sub { font-size: 11px; color: var(--dim2); margin: 8px 0 22px; }
#login-wall input {
  width: 100%; box-sizing: border-box; padding: 9px 11px;
  background: var(--raise); border: 1px solid var(--line2); color: var(--txt); font-size: 13px;
}
#login-wall input:focus { border-color: var(--accent); }
#login-wall button {
  width: 100%; margin-top: 11px; padding: 9px;
  background: var(--accent); border: 0; color: #12100A; font-size: 13px; font-weight: 500; cursor: pointer;
}
.lw-err { margin-top: 10px; font-size: 11px; color: var(--bad); min-height: 14px; }


/* ---------- 分类页：大图模式（商品图放大到 96px，字放大到 16px） ---------- */
.cat-table { font-size: 15px; }
.cat-table .thumb {
  width: 96px; height: 96px;
  object-fit: cover;
}
.cat-table tbody td { padding: 14px 12px 14px 0; }
.cat-table .nm {
  font-size: 16px;
  line-height: 1.45;
  white-space: normal;
}
.cat-table .sub2 { font-size: 12.5px; margin-top: 6px; }
.cat-table .mono { font-size: 14px; }
.cat-table .st { font-size: 12.5px; }
.cat-table select.f.mini { padding: 6px 8px; font-size: 12.5px; }
.cat-table thead th { font-size: 11px; padding-bottom: 11px; }

/* 手机窄屏：图再放大一点，字号保底 */
@media (max-width: 820px) {
  .cat-table { font-size: 14px; }
  .cat-table .thumb { width: 76px; height: 76px; }
  .cat-table .nm { font-size: 15px; }
  .cat-table tbody td { padding: 12px 8px 12px 0; }
}


/* 看大图 */
#lightbox {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,.93);
  display: none; place-items: center;
  cursor: zoom-out;
}
#lightbox.on { display: grid; }
#lightbox img {
  max-width: 93vw; max-height: 89vh;
  object-fit: contain;
  box-shadow: 0 0 60px rgba(0,0,0,.8);
}


/* ---- 运营总控台扩展 ---- */
.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(148px,1fr));gap:10px}
.card{background:#15151A;border:1px solid rgba(255,255,255,.1);padding:14px 16px;min-width:0}
.card span{display:block;font-size:11px;color:#82807A;margin-bottom:6px}
.card b{font-size:22px;font-weight:500;color:#E6E4DF;display:block;overflow:hidden;text-overflow:ellipsis}
.box{background:#15151A;border:1px solid rgba(255,255,255,.1);padding:16px 18px}
.box h3{margin:0 0 12px;font-size:13px;color:#C8A96A;letter-spacing:.06em}
.st{display:inline-block;padding:2px 8px;font-size:11px;border:1px solid rgba(255,255,255,.18);border-radius:2px}
.st.ok{color:#7FC99B;border-color:rgba(127,201,155,.4)}
.st.wait{color:#C8A96A;border-color:rgba(200,169,106,.4)}
.st.warn{color:#E0A86A;border-color:rgba(224,168,106,.4)}
.st.bad{color:#E08A8A;border-color:rgba(224,138,138,.4)}
.bar input,.bar select,.d-body input{background:#15151A;border:1px solid rgba(255,255,255,.16);color:#E6E4DF;padding:8px 10px;font-size:12px;outline:none}
.bar input:focus,.bar select:focus,.d-body input:focus{border-color:#C8A96A}
