:root {
  --bg: #f6f6f3;
  --panel: #ffffff;
  --line: #e3e3dc;
  --ink: #1b1b18;
  --muted: #7d7d74;
  --faint: #a9a9a0;
  --accent: #1b1b18;
  --ok: #2f7d4f;
  --bad: #b03a2e;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

/* ---------- 顶栏 ---------- */
.top {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.top .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand h1 {
  font-size: 17px;
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.3px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--faint);
  display: inline-block;
  flex: none;
}

.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(47, 125, 79, 0.12); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 3px rgba(176, 58, 46, 0.12); }

.tag {
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 2px 9px;
  white-space: nowrap;
}

.status {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- 标签页 ---------- */
.tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.tabs .wrap {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 8px 0;
}

.tabs button {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 99px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.tabs button:hover { background: #ecece6; color: var(--ink); }

.tabs button.on {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ---------- 主体 ---------- */
main { padding: 28px 0 60px; }

.loading {
  color: var(--muted);
  padding: 40px 0;
  text-align: center;
}

h2 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 4px;
}

.hint {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 12.5px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

/* ---------- 概览的数字 ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.stat .n {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.stat .k {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.kv {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 6px 14px;
  font-size: 13px;
}

.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; }

/* ---------- 商品卡片 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}

.card:hover { border-color: #bdbdb4; transform: translateY(-1px); }

.card .shot {
  aspect-ratio: 3 / 4;
  background: #efefe9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.no-cover {
  color: var(--faint);
  font-size: 12px;
}

.badge {
  display: inline-block;
  margin: 6px 0 0;
  font-size: 10.5px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 0 8px;
}

.warnlist {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 12.5px;
}

.warnlist li { margin: 3px 0; }

/* ---------- 归类 ---------- */
table.classify {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.classify th,
table.classify td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

table.classify th {
  font-weight: 600;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.thumb-cell { width: 56px; }

.mini-cover {
  width: 40px;
  height: 53px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--line);
  display: block;
}

.no-cover-mini {
  display: block;
  width: 40px;
  font-size: 9px;
  color: var(--faint);
  line-height: 1.25;
}

.muted-line {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.cat-pick {
  font: inherit;
  font-size: 12.5px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  max-width: 220px;
}

.state-cell { white-space: nowrap; }

.state {
  font-size: 11px;
  color: var(--faint);
  margin-left: 6px;
}

.state.on { color: var(--ok); }

.card .shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card .meta { padding: 10px 12px 12px; }

.card .name {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card .desc {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 分类树 ---------- */
.tree, .tree ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tree ul {
  margin-left: 18px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.tree li { padding: 3px 0; }

.node {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.node .nm { font-size: 13.5px; }

.node .pill {
  font-size: 10.5px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 0 7px;
}

.tree .lvl1 > .cat-row .nm { font-weight: 600; font-size: 14px; }

/* ---------- 分类编辑器 ---------- */
.cat-tree { max-width: 760px; }
/* 分类页：左边分类树，右边品牌表（2026-10-31 把品牌页并进来） */
.cat-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.cat-layout > .panel { margin-bottom: 0; }
@media (max-width: 1000px) { .cat-layout { grid-template-columns: 1fr; } }

.cat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 3px 8px;
  border-radius: 6px;
  min-height: 34px;
}

.cat-row:hover { background: #f7f7f2; }

.cat-row .nm { font-size: 13.5px; }

.cat-row .pill {
  font-size: 10.5px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 0 7px;
}

.cat-row .ops {
  margin-left: auto;
  display: flex;
  gap: 4px;
  flex: none;
}

.mini {
  font: inherit;
  font-size: 12px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}

.mini:hover { border-color: #bdbdb4; color: var(--ink); }
.mini:disabled { opacity: .3; cursor: not-allowed; }
.mini:disabled:hover { border-color: var(--accent); color: #fff; }
.mini.ok { background: var(--accent); border-color: var(--accent); color: #fff; }
.mini.danger:hover { border-color: var(--bad); color: var(--bad); }

.cat-input {
  flex: 1;
  font: inherit;
  font-size: 13.5px;
  padding: 5px 10px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  outline: none;
  background: #fff;
  min-width: 120px;
}

.cat-row.editing {
  background: #fbfbf7;
  border: 1px dashed var(--line);
}

/* ---------- 品牌 ---------- */
.letters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px 28px;
}

.letter .lg {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.letter ul { list-style: none; margin: 0; padding: 0; }
.letter li { font-size: 13px; padding: 2px 0; }

/* ---------- 日期流 ---------- */
.feedhead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

/* ---------- 日期流顶上那排：同产品的其他规格 ---------- */
.thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 12px;
}

.specs-row { align-items: flex-end; }

.thumb-item {
  margin: 0;
  flex: none;
  cursor: pointer;
  text-align: center;
  opacity: .55;
  transition: opacity .15s;
}

.thumb-item:hover { opacity: .85; }
.thumb-item.on { opacity: 1; }

.thumb-item img,
.thumb-item .thumb-empty {
  width: 56px;
  height: 74px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  display: block;
}

.thumb-item.on img,
.thumb-item.on .thumb-empty {
  border: 2px solid var(--ink);
}

.thumb-item .thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--faint);
  background: #efefe9;
}

.thumb-item figcaption {
  font-size: 9px;
  color: var(--muted);
  margin-top: 3px;
  font-family: "Cascadia Mono", Consolas, monospace;
  white-space: nowrap;
}

/* ---------- 布局切换 ---------- */
.layout-toggle { display: flex; gap: 6px; }

.count { color: var(--muted); font-weight: 400; }

/* ---------- 产品卡片（封面能切规格） ---------- */
.product-card .carousel {
  position: relative;
  aspect-ratio: 3 / 4;
  background: #efefe9;
  cursor: pointer;
  overflow: hidden;
}

.product-card .carousel .slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .18s;
}

.product-card .carousel .slide.on { opacity: 1; }

.product-card .carousel .slide-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
  font-size: 12px;
}

.spec-thumbs {
  display: flex;
  gap: 4px;
  padding: 6px 8px 0;
  overflow-x: auto;
}

.spec-thumb {
  width: 28px;
  height: 37px;
  flex: none;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #f2f2ec;
  cursor: pointer;
  overflow: hidden;
}

.spec-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.spec-thumb.on { border: 2px solid var(--ink); }
.spec-thumb .thumb-empty {
  display: block;
  font-size: 9px;
  color: var(--faint);
  line-height: 37px;
}

.year { margin-top: 22px; }
.year > .yh {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
}

.month {
  display: flex;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 10px;
}

.month .num {
  font-size: 20px;
  font-weight: 600;
  color: var(--muted);
  min-width: 42px;
  font-variant-numeric: tabular-nums;
}

.posts { flex: 1; display: flex; flex-direction: column; gap: 14px; }

.post .cap {
  background: #efefe9;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12.5px;
  color: #4a4a44;
  margin-bottom: 8px;
}

.post .shots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  max-width: 430px;
}

.post .shots img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--line);
  display: block;
}

.post .note {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 6px;
  max-width: 430px;
}

/* ---------- 接口表 ---------- */
table.api {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.api th, table.api td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

table.api th {
  font-weight: 600;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

code, .mono {
  font-family: "Cascadia Mono", Consolas, "Courier New", monospace;
  font-size: 12.5px;
}

code {
  background: #efefe9;
  border-radius: 4px;
  padding: 1px 6px;
}

a { color: var(--ink); text-decoration: none; border-bottom: 1px solid #c9c9c0; }
a:hover { border-bottom-color: var(--ink); }

/* ---------- 页脚 ---------- */
.foot {
  border-top: 1px solid var(--line);
  padding: 16px 0 40px;
  color: var(--faint);
  font-size: 12px;
}

/* ---------- 详情 ---------- */
.back {
  background: none;
  border: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 0 0 14px;
}
.back:hover { color: var(--ink); }

.detail {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  align-items: start;
}

.detail .cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #efefe9;
}

.detail .imgs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.detail .imgs img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid var(--line);
}

@media (max-width: 720px) {
  .detail { grid-template-columns: 1fr; }
  .detail .cover { max-width: 240px; }
  .kv { grid-template-columns: 100px 1fr; }
}
