/* ============================================================
   我的小店 · 暗色科技风主题
   设计基调：近黑底 + 一种暖橙主色 + 克制的细线/微光
   非模板：编辑式横幅 + 杂志感货架格，不堆居中卡片
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0a0c0f;   /* 页面底 */
  --bg-2:      #0e1116;   /* 面板底 */
  --surface:   #12161c;   /* 卡片底 */
  --surface-2: #171c23;   /* 悬停/次级 */
  --line:      rgba(255,255,255,.08);
  --line-acc:  rgba(255,176,32,.45);
  --ink:       #e9eaec;   /* 主文字 */
  --ink-dim:   #9aa1ab;   /* 次要 */
  --ink-faint: #5c6470;   /* 弱 */
  --acc:       #ffb020;   /* 主色：暖橙 */
  --acc-soft:  rgba(255,176,32,.14);
  --danger:    #ff5c5c;
  --success:   #3ddc84;
  --topbar-bg:   rgba(10,12,15,.7);    /* 顶栏半透明底(深色) */
  --topbar-bg-2: rgba(10,12,15,.8);    /* 后台顶栏 */
  --mono: "SF Mono", "JetBrains Mono", Consolas, "Microsoft YaHei", monospace;
  --sans: -apple-system, "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
}

/* ===== 浅色(白)主题 ===== */
html[data-theme="light"] {
  --bg:        #f4f5f7;   /* 页面底 */
  --bg-2:      #ffffff;   /* 面板底 */
  --surface:   #ffffff;   /* 卡片底 */
  --surface-2: #eef0f3;   /* 悬停/次级 */
  --line:      rgba(0,0,0,.10);
  --line-acc:  rgba(217,142,0,.55);
  --ink:       #191c21;   /* 主文字 */
  --ink-dim:   #5b636e;   /* 次要 */
  --ink-faint: #8b929c;   /* 弱 */
  --acc:       #d98e00;   /* 主色(浅底上用深一点的橙,保证对比度) */
  --acc-soft:  rgba(217,142,0,.12);
  --danger:    #dd3d3d;
  --success:   #1c9d56;
  --topbar-bg:   rgba(255,255,255,.72);
  --topbar-bg-2: rgba(255,255,255,.88);
}
html[data-theme="light"] { color-scheme: light; }

html { color-scheme: dark; }
body {
  font-family: var(--sans);
  background:
    radial-gradient(900px 380px at 78% -60px, rgba(255,176,32,.10), transparent 60%),
    radial-gradient(700px 300px at 12% -40px, rgba(255,176,32,.05), transparent 55%),
    var(--bg);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.muted { color: var(--ink-dim); }
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; color: inherit; }
::selection { background: var(--acc-soft); color: var(--ink); }

/* ===== 顶部导航 ===== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo {
  font-size: 19px; font-weight: 800; letter-spacing: .5px;
  display: flex; align-items: center; gap: 10px;
}
.logo .mark {
  width: 30px; height: 30px; border: 1.5px solid var(--acc);
  border-radius: 7px; display: grid; place-items: center;
  color: var(--acc); font-size: 16px; background: var(--acc-soft);
}
.logo .sub { font-size: 11px; color: var(--ink-faint); font-weight: 500; letter-spacing: 2px; margin-top: 1px; }
.cart-btn {
  position: relative; background: var(--acc); color: #1a1406;
  border: none; padding: 9px 20px; border-radius: 8px;
  font-size: 14px; font-weight: 700; letter-spacing: .3px;
  box-shadow: 0 0 0 1px rgba(255,176,32,.3), 0 4px 20px rgba(255,176,32,.18);
  transition: box-shadow .2s, transform .15s;
}
.cart-btn:hover { box-shadow: 0 0 0 1px rgba(255,176,32,.5), 0 6px 26px rgba(255,176,32,.32); transform: translateY(-1px); }
.cart-btn .badge {
  position: absolute; top: -7px; right: -7px; background: #fff; color: #000;
  border: none; border-radius: 50%; min-width: 20px; height: 20px;
  font-size: 12px; line-height: 20px; text-align: center; font-weight: 800; font-family: var(--mono);
}

/* ===== 横幅（编辑式，非居中模板）===== */
.hero {
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 52px 52px;
  position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -120px; top: -140px;
  width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,176,32,.16), transparent 65%);
  pointer-events: none;
}
.hero-in {
  max-width: 1180px; margin: 0 auto; padding: 52px 24px 46px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 30px;
  position: relative; z-index: 1;
}
.hero-tag {
  font-family: var(--mono); font-size: 12px; letter-spacing: 3px;
  color: var(--acc); display: flex; align-items: center; gap: 10px;
}
.hero-tag::before { content: ""; width: 26px; height: 1px; background: var(--acc); }
.hero h1 {
  font-size: clamp(34px, 5vw, 56px); font-weight: 850; line-height: 1.06;
  letter-spacing: -1px; margin: 14px 0 14px;
}
.hero h1 em { font-style: normal; color: var(--acc); }
.hero-sub { color: var(--ink-dim); font-size: 15px; max-width: 560px; }
.hero-mono {
  font-family: var(--mono); font-size: 12px; color: var(--ink-faint);
  display: grid; gap: 6px; grid-template-columns: auto auto; column-gap: 18px;
  border-left: 1px solid var(--line); padding-left: 20px; white-space: nowrap;
}
.hero-mono b { color: var(--ink-dim); font-weight: 600; }

/* ===== 货架 ===== */
.container { max-width: 1180px; margin: 0 auto; padding: 34px 24px 70px; }
.sect-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.sect-head h2 { font-size: 20px; font-weight: 800; letter-spacing: .5px; }
.sect-head .count { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); }
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; display: flex; flex-direction: column; position: relative;
  transition: border-color .2s, transform .18s, box-shadow .2s;
}
.card:hover { border-color: var(--line-acc); transform: translateY(-3px); box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.card .thumb {
  aspect-ratio: 1/1; background: var(--bg-2); display: flex; align-items: center;
  justify-content: center; overflow: hidden; border-bottom: 1px solid var(--line);
}
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .thumb .ph { color: var(--ink-faint); font-size: 13px; font-family: var(--mono); letter-spacing: 1px; }
.card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.card .title { font-size: 15px; font-weight: 600; letter-spacing: .2px; flex: 1; }
.card .desc {
  font-size: 12.5px; color: var(--ink-dim); margin: 6px 0 14px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card .foot { display: flex; align-items: center; justify-content: space-between; }
.price { color: var(--acc); font-weight: 800; font-family: var(--mono); font-size: 18px; }
.price .cur { font-size: 12px; margin-right: 2px; }
.add-btn {
  background: transparent; color: var(--ink); border: 1px solid var(--line); border-radius: 6px;
  padding: 7px 14px; font-size: 13px; font-weight: 600; transition: all .18s;
}
.add-btn:hover { background: var(--acc); color: #1a1406; border-color: var(--acc); box-shadow: 0 0 16px rgba(255,176,32,.3); }
.empty { text-align: center; color: var(--ink-faint); padding: 80px 20px; font-family: var(--mono); }

/* ===== 购物车抽屉 ===== */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 100;
  display: none; align-items: flex-end; justify-content: flex-end;
  backdrop-filter: blur(3px);
}
.overlay.show { display: flex; }
.drawer {
  background: var(--bg-2); border-left: 1px solid var(--line); width: 100%; max-width: 420px;
  height: 100%; display: flex; flex-direction: column; animation: slidein .22s;
}
@keyframes slidein { from { transform: translateX(100%); } to { transform: none; } }
.drawer-head {
  padding: 18px 22px; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.drawer-head h2 { font-size: 18px; font-weight: 800; letter-spacing: .5px; }
.close-x { background: none; border: 1px solid var(--line); border-radius: 6px; width: 32px; height: 32px; font-size: 18px; color: var(--ink-dim); }
.close-x:hover { color: var(--ink); border-color: var(--ink-faint); }
.drawer-items { flex: 1; overflow-y: auto; padding: 8px 22px; }
.citem { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.citem .info { flex: 1; }
.citem .iname { font-size: 14px; font-weight: 600; }
.citem .iprice { color: var(--acc); font-family: var(--mono); font-size: 14px; margin-top: 3px; }
.qty-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.qty-row button {
  width: 26px; height: 26px; border: 1px solid var(--line); background: var(--surface);
  border-radius: 5px; font-size: 15px; color: var(--ink);
}
.qty-row button:hover { border-color: var(--acc); color: var(--acc); }
.qty-row .qn { width: 34px; text-align: center; font-family: var(--mono); }
.drawer-foot { padding: 18px 22px; border-top: 1px solid var(--line); }
.total-line { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.total-line span { color: var(--ink-dim); font-size: 14px; }
.total-line b { color: var(--acc); font-size: 24px; font-family: var(--mono); }
.primary-btn {
  width: 100%; background: var(--acc); color: #1a1406; border: none;
  padding: 13px; border-radius: 8px; font-size: 15px; font-weight: 800; letter-spacing: .5px;
  box-shadow: 0 0 0 1px rgba(255,176,32,.3), 0 6px 22px rgba(255,176,32,.18);
  transition: box-shadow .2s, transform .15s;
}
.primary-btn:hover { box-shadow: 0 0 0 1px rgba(255,176,32,.5), 0 8px 28px rgba(255,176,32,.32); transform: translateY(-1px); }

/* ===== 下单弹窗 ===== */
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,.62); z-index: 200;
  display: none; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(4px);
}
.modal-bg.show { display: flex; }
.modal {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px;
  width: 100%; max-width: 470px; max-height: 92vh; overflow-y: auto; padding: 26px;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
}
.modal h2 { margin-bottom: 20px; font-size: 20px; font-weight: 800; letter-spacing: .5px; }
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 12.5px; margin-bottom: 6px; color: var(--ink-dim); letter-spacing: .3px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 11px 13px; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; font-size: 14px; font-family: inherit;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--acc);
  box-shadow: 0 0 0 3px rgba(255,176,32,.12);
}
.captcha-row { display: flex; gap: 10px; align-items: center; }
.captcha-row input { flex: 1; }
.qst { font-family: var(--mono); font-weight: 700; color: var(--acc); padding: 9px 12px; border: 1px solid var(--line-acc); border-radius: 8px; background: var(--acc-soft); white-space: nowrap; }
.error-msg { color: var(--danger); font-size: 13px; min-height: 18px; margin-bottom: 12px; }
.ok-tip { text-align: center; padding: 26px 8px; }
.ok-tip .big { font-size: 44px; }
.ok-tip .txt { font-size: 18px; margin-top: 12px; color: var(--success); font-weight: 800; }
.ok-tip .sub { color: var(--ink-dim); margin-top: 8px; font-size: 14px; }

/* ===== 后台（暗色） ===== */
.admin-body { background: var(--bg); }
.admin-top {
  position: sticky; top: 0; background: var(--topbar-bg-2); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line); padding: 14px 26px;
  display: flex; justify-content: space-between; align-items: center;
}
.admin-top .logo { font-size: 17px; }
.tabs { display: flex; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.tabs button { padding: 8px 18px; background: none; border: none; font-size: 14px; border-radius: 6px; color: var(--ink-dim); font-weight: 600; }
.tabs button.active { background: var(--acc); color: #1a1406; }
.logout { background: none; border: 1px solid var(--line); padding: 7px 14px; border-radius: 7px; color: var(--ink-dim); }
.logout:hover { border-color: var(--ink-faint); color: var(--ink); }
.admin-main { max-width: 1040px; margin: 0 auto; padding: 28px 24px; }
.panel { display: none; }
.panel.active { display: block; }
.login-wrap {
  max-width: 400px; margin: 90px auto; background: var(--bg-2); padding: 34px;
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0,0,0,.5);
}
table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; }
th { background: var(--bg-2); color: var(--ink-dim); font-size: 12.5px; letter-spacing: .5px; text-transform: uppercase; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,.02); }
/* 表格里的标签: 分类/状态 统一用小胶囊 */
.cat-chip, .st-chip {
  display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; white-space: nowrap;
  vertical-align: middle; max-width: 240px; overflow: hidden; text-overflow: ellipsis;
}
.cat-chip { border: 1px solid var(--line); color: var(--ink-dim); background: var(--bg-2); }
.st-chip { font-weight: 600; }
.st-on  { color: var(--success); border: 1px solid rgba(61,220,132,.35); background: rgba(61,220,132,.08); }
.st-off { color: var(--ink-faint); border: 1px solid var(--line); background: var(--bg-2); }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.toolbar h3 { font-size: 18px; font-weight: 800; letter-spacing: .5px; }
.btn {
  padding: 8px 15px; border-radius: 7px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 600;
  transition: all .15s;
}
.btn:hover { border-color: var(--ink-faint); }
.btn.primary { background: var(--acc); color: #1a1406; border: none; font-weight: 800; }
.btn.small { padding: 5px 11px; font-size: 13px; }
.btn.danger { color: var(--danger); border-color: rgba(255,92,92,.4); }
.btn.danger:hover { background: rgba(255,92,92,.12); }
.badge-seen { font-size: 12px; padding: 3px 10px; border-radius: 20px; font-weight: 700; }
.badge-seen.no { background: var(--acc-soft); color: var(--acc); }
.badge-seen.yes { background: var(--surface-2); color: var(--ink-faint); }
.thumb-sm { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.orders-note { font-size: 13px; color: var(--ink-dim); margin-bottom: 14px; }

/* ===== 滚动条 ===== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 20px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); }

/* ===== 响应式 ===== */
@media (max-width: 720px) {
  .hero-in { flex-direction: column; align-items: flex-start; padding: 40px 20px; }
  .hero-mono { border-left: none; border-top: 1px solid var(--line); padding: 14px 0 0; margin-top: 6px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); };
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ===== 搜索框 ===== */
.search { position: relative; flex: 1; max-width: 480px; margin: 0 28px; }
.search input {
  width: 100%; background: var(--surface); border: 1px solid var(--line);
  border-radius: 9px; padding: 10px 16px; color: var(--ink); font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.search input:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px rgba(255,176,32,.12); }
.search input::placeholder { color: var(--ink-faint); }
.sug {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; box-shadow: 0 16px 46px rgba(0,0,0,.55); z-index: 60; display: none;
}
.sug.show { display: block; }
.sug .item {
  display: flex; gap: 12px; padding: 10px 14px; cursor: pointer; align-items: center;
  border-bottom: 1px solid var(--line); background: var(--bg-2);
}
.sug .item:last-child { border-bottom: none; }
.sug .item:hover { background: var(--surface-2); }
.sug .item img { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; background: var(--bg-2); }
.sug .item .nm { font-size: 13.5px; font-weight: 600; }
.sug .item .mt { font-size: 11px; color: var(--ink-faint); font-family: var(--mono); }
.sug .item .pr { margin-left: auto; color: var(--acc); font-family: var(--mono); font-size: 13px; font-weight: 700; }
.sug .nohit { padding: 16px; color: var(--ink-faint); font-size: 13px; text-align: center; font-family: var(--mono); }

/* ===== 商品卡片编码 ===== */
.card .code { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); letter-spacing: 1.5px; margin-bottom: 4px; }
.card .title { cursor: pointer; }
.card .title:hover { color: var(--acc); }

/* ===== 商品详情页 ===== */
.detail {
  max-width: 1080px; margin: 0 auto; padding: 42px 24px 80px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: start;
}
.detail .dimg {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px;
  aspect-ratio: 1/1; display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.detail .dimg img { width: 100%; height: 100%; object-fit: cover; }
.detail .dimg .ph { color: var(--ink-faint); font-family: var(--mono); letter-spacing: 1px; }
.dcrumb { font-size: 13px; color: var(--ink-faint); margin-bottom: 16px; }
.dcrumb a:hover { color: var(--acc); }
.detail h1 { font-size: clamp(24px,3vw,34px); font-weight: 850; letter-spacing: -.5px; line-height: 1.2; }
.dcode {
  display: inline-block; font-family: var(--mono); font-size: 12px; color: var(--acc);
  border: 1px solid var(--line-acc); background: var(--acc-soft);
  padding: 4px 12px; border-radius: 6px; margin: 14px 0;
}
.ddesc { color: var(--ink-dim); font-size: 15px; margin-bottom: 20px; }
.dprice { color: var(--acc); font-family: var(--mono); font-weight: 800; font-size: 34px; }
.dprice .cur { font-size: 16px; margin-right: 3px; }
.buy-row { display: flex; align-items: center; gap: 14px; margin-top: 26px; flex-wrap: wrap; }
.stepper { display: flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 8px; padding: 4px; }
.stepper button { width: 32px; height: 32px; background: none; border: none; color: var(--ink); font-size: 18px; line-height: 1; }
.stepper button:hover { color: var(--acc); }
.stepper .v { width: 42px; text-align: center; font-family: var(--mono); font-weight: 700; }
.btn.buy { background: var(--acc); color: #1a1406; border: none; font-weight: 800; padding: 12px 26px; border-radius: 8px; font-size: 15px; letter-spacing: .5px; box-shadow: 0 0 0 1px rgba(255,176,32,.3); }
.btn.buy:hover { box-shadow: 0 0 0 1px rgba(255,176,32,.5), 0 6px 22px rgba(255,176,32,.25); }
.btn.go-cart { background: var(--surface); border: 1px solid var(--line); font-weight: 600; }
.added-msg { color: var(--success); font-size: 13.5px; margin-top: 12px; min-height: 18px; }
.notfound { text-align: center; color: var(--ink-faint); padding: 120px 20px; }
.notfound a { color: var(--acc); }

@media (max-width: 720px) {
  .detail { grid-template-columns: 1fr; gap: 24px; }
  .detail .dimg { position: static; }
  .search { order: 3; margin: 10px 0 0; max-width: none; flex-basis: 100%; }
}

/* ===== 分类筛选栏 ===== */
.shop-layout { display: grid; grid-template-columns: 150px 1fr; gap: 20px; align-items: start; }
.filter-rail {
  position: sticky; top: 84px; padding: 4px 2px;
  /* 平铺目录式: 无卡片框, 与杂志/编辑式风格统一 */
}
.rail-title {
  font-family: var(--mono); font-size: 11px; letter-spacing: 3px; color: var(--acc);
  padding: 0 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px;
}
.cat-tree { max-height: 64vh; overflow-y: auto; }
.cat-item {
  position: relative;
  display: flex; align-items: center; gap: 4px; padding: 5px 7px; border-radius: 6px;
  cursor: pointer; font-size: 12.5px; color: var(--ink-dim); transition: background .12s, color .12s;
}
/* 主分类(一级): 加粗提亮, 与子分类明显区分 */
.cat-item.depth-0 { font-weight: 700; color: var(--ink); }
.cat-item:hover { background: var(--surface-2); color: var(--ink); }
.cat-item.active { background: var(--acc-soft); color: var(--acc); font-weight: 700; }
/* 子分类归属引导线: 左侧竖线+短横线, 像文件树一样连到上级分类 */
.cat-item.depth-1 { padding-left: 14px; }
.cat-item.depth-2 { padding-left: 22px; }
.cat-item.depth-3 { padding-left: 30px; }
.cat-item.depth-4 { padding-left: 38px; }
.cat-item.depth-5 { padding-left: 46px; }
.cat-item.depth-1::before { content: ""; position: absolute; left: 5px;  top: -3px; bottom: -3px; width: 1px; background: var(--line); }
.cat-item.depth-2::before { content: ""; position: absolute; left: 13px; top: -3px; bottom: -3px; width: 1px; background: var(--line); }
.cat-item.depth-3::before { content: ""; position: absolute; left: 21px; top: -3px; bottom: -3px; width: 1px; background: var(--line); }
.cat-item.depth-4::before { content: ""; position: absolute; left: 29px; top: -3px; bottom: -3px; width: 1px; background: var(--line); }
.cat-item.depth-5::before { content: ""; position: absolute; left: 37px; top: -3px; bottom: -3px; width: 1px; background: var(--line); }
.cat-item.depth-1::after, .cat-item.depth-2::after, .cat-item.depth-3::after,
.cat-item.depth-4::after, .cat-item.depth-5::after {
  content: ""; position: absolute; top: 50%; width: 4px; height: 1px; background: var(--line);
}
.cat-item.depth-1::after { left: 5px; }
.cat-item.depth-2::after { left: 13px; }
.cat-item.depth-3::after { left: 21px; }
.cat-item.depth-4::after { left: 29px; }
.cat-item.depth-5::after { left: 37px; }
.cat-item .caret { width: 16px; font-size: 11px; color: var(--ink-faint); flex: none; }
.cat-item .caret:hover { color: var(--acc); }
.cat-item .caret.empty { visibility: hidden; }
.cat-item .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-item .cn { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }

@media (max-width: 760px) {
  .shop-layout { grid-template-columns: 1fr; gap: 14px; }
  .filter-rail { position: static; }
  .cat-tree { max-height: none; display: flex; flex-wrap: wrap; gap: 4px; }
  .cat-item.depth-1, .cat-item.depth-2, .cat-item.depth-3 { padding-left: 8px; }
}

/* ===== 后台分类树行 ===== */
.ctree-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  margin: 0 0 6px;
}
.ctree-row.pad-1 { margin-left: 24px; }
.ctree-row.pad-2 { margin-left: 48px; }
.ctree-row.pad-3 { margin-left: 72px; }
.ctree-row.pad-4 { margin-left: 96px; }
.ctree-row.pad-5 { margin-left: 120px; }
.ctree-row.pad-6 { margin-left: 144px; }
.ctree-row .ct-name { flex: 1; font-weight: 600; font-size: 14px; }
.ctree-row .ct-meta { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); white-space: nowrap; }
.ctree-row .ct-actions { display: flex; gap: 6px; }

/* ===== 语言切换按钮 ===== */
.lang-btn {
  background: var(--surface); color: var(--ink-dim); border: 1px solid var(--line);
  padding: 8px 13px; border-radius: 8px; font-size: 13px; font-weight: 700;
  font-family: var(--mono); transition: all .15s;
}
.lang-btn:hover { border-color: var(--acc); color: var(--acc); }

/* ===== 后台图片上传/预览 ===== */
.img-preview { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.img-preview .ip { position: relative; width: 74px; height: 74px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); }
.img-preview .ip img { width: 100%; height: 100%; object-fit: cover; }
.img-preview .ip .rm { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; background: rgba(0,0,0,.7); color: #fff; border: none; border-radius: 50%; font-size: 12px; line-height: 20px; cursor: pointer; }
.img-preview .ip .rm:hover { background: var(--danger); }
input[type=file] { color: var(--ink-dim); font-size: 13px; }
input[type=file]::file-selector-button { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 7px; padding: 8px 16px; cursor: pointer; font-weight: 600; }
input[type=file]::file-selector-button:hover { border-color: var(--acc); color: var(--acc); }

/* ===== 卡片图片可点击 + 详情画廊 ===== */
.card .thumb { cursor: pointer; }
.gthumb { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.gthumb img { width: 70px; height: 70px; object-fit: cover; border-radius: 8px; border: 2px solid transparent; cursor: pointer; opacity: .7; transition: all .15s; }
.gthumb img:hover { opacity: 1; }
.gthumb img.on { border-color: var(--acc); opacity: 1; }

/* ===== 后台订单管理(卡片式) ===== */
.ord-tabs { display: flex; gap: 8px; }
.ordtab { display: flex; align-items: center; gap: 7px; }
.ordtab.active { background: var(--acc); color: #1a1406; border-color: var(--acc); font-weight: 700; }
.ordtab .oft { font-family: var(--mono); font-size: 11px; background: var(--bg-2); padding: 1px 7px; border-radius: 10px; }
.ordtab.active .oft { background: #fff; color: #1a1406; }
.order-list { display: flex; flex-direction: column; gap: 12px; }
.order-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; }
.order-card .oc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.order-card .oc-left { display: flex; align-items: center; gap: 12px; }
.order-card .oc-id { font-weight: 800; font-family: var(--mono); font-size: 15px; }
.order-card .oc-time { color: var(--ink-faint); font-size: 12px; }
.order-card .oc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; margin-bottom: 12px; font-size: 14px; }
.order-card .oc-grid .cell .lbl { color: var(--ink-faint); font-size: 11.5px; letter-spacing: .5px; margin-bottom: 2px; }
.order-card .oc-grid .cell.full { grid-column: 1 / -1; }
.order-card .oc-items { background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 11px 14px; font-size: 14px; margin-bottom: 12px; }
.order-card .oc-total { text-align: right; font-size: 18px; font-weight: 800; color: var(--acc); font-family: var(--mono); margin-bottom: 12px; }
.order-card .oc-actions { display: flex; justify-content: flex-end; gap: 10px; }
.order-empty { color: var(--ink-faint); text-align: center; padding: 50px 20px; font-family: var(--mono); }
@media (max-width: 720px){ .order-card .oc-grid { grid-template-columns: 1fr; } }

/* ===== Logo 返回首页 ===== */
a.logo { cursor: pointer; transition: opacity .15s; }
a.logo:hover { opacity: .75; }
a.logo .mark { transition: box-shadow .2s, background .2s; }
a.logo:hover .mark { box-shadow: 0 0 0 1px var(--acc), 0 0 14px rgba(255,176,32,.35); background: var(--acc-soft); }
