/* ============================================================
 * JustAI 营销码 — 商家后台共享样式（照抄 JustAI 布局骨架）
 * 主视觉沿用三色渐变：深海蓝/明亮天蓝/梦幻紫
 * ============================================================ */
:root {
  --deep: #0045FF;
  --sky: #45CFFF;
  --purple: #A645FF;
  --grad-main: linear-gradient(90deg, #0045FF 0%, #45CFFF 50%, #A645FF 100%);
  --grad-chip: linear-gradient(135deg, #0045FF 0%, #A645FF 100%);
  --txt: #23232b;
  --txt2: #8a8a99;
  --line: #ececf2;
  --bg: #fbfbfd;
  --card: #ffffff;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--txt);
  background: var(--bg);
  font-size: 14px;
}
button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; outline: none; }

/* ===== 顶部渐变条 ===== */
.topbar {
  height: 40px;
  background: var(--grad-main);
  color: #fff;
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px;
  font-size: 12px;
  position: relative;
  overflow: hidden;
}
.topbar .pill {
  background: rgba(255,255,255,.22);
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 20px;
  padding: 2px 10px;
  font-weight: 600;
  white-space: nowrap;
}
.topbar .msg { opacity: .95; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .close { margin-left: auto; cursor: pointer; opacity: .85; font-size: 14px; }

/* ===== 布局：侧边栏 + 主区 ===== */
.layout { display: flex; min-height: calc(100vh - 40px); }
.sidebar {
  width: 208px; flex: none;
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 18px 12px;
}
.logo { display: flex; align-items: center; gap: 8px; padding: 0 8px 20px; }
.logo .logo-img { max-width: 100%; height: 44px; object-fit: contain; }
.icp { margin-top: 4px; padding: 8px 8px 2px; font-size: 10px; text-align: center; }
.icp a { color: #b3b7c6; text-decoration: none; }
.logo .mark {
  width: 26px; height: 26px; border-radius: 8px;
  background: var(--grad-chip);
  color: #fff; font-weight: 800; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
.logo .name { font-weight: 800; font-size: 16px; }
.menu { display: flex; flex-direction: column; gap: 4px; }
.menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  color: #55555f; text-decoration: none; font-size: 14px;
  cursor: pointer;
}
.menu a svg { width: 16px; height: 16px; stroke: currentColor; flex: none; }
.menu a.active { background: #eef2ff; color: var(--deep); font-weight: 600; }
.menu a:hover:not(.active) { background: #f6f6fa; }
.menu .divider { height: 1px; background: var(--line); margin: 8px 4px; }
.side-foot { margin-top: auto; padding: 10px 8px; display: flex; align-items: center; gap: 10px; }
.side-foot .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--grad-chip); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex: none;
}
.side-foot .who { min-width: 0; }
.side-foot .who .n { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .who .s { font-size: 11px; color: var(--txt2); cursor: pointer; }
.side-foot .who .s:hover { color: var(--deep); }

.main { flex: 1; min-width: 0; padding: 26px 32px 40px; }

/* ===== 通用组件 ===== */
.back-link {
  display: inline-flex; align-items: center; gap: 4px;
  color: #55555f; font-size: 14px; cursor: pointer; text-decoration: none;
  margin-bottom: 18px;
}
.back-link:hover { color: var(--deep); }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px;
}
.btn-dark {
  background: #17171c; color: #fff; border: none;
  height: 44px; padding: 0 46px; border-radius: 22px;
  font-size: 15px; font-weight: 600;
}
.btn-dark:hover { background: #2c2c34; }
.btn-dark[disabled] { opacity: .5; cursor: default; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 5px;
  background: #fff; border: 1px solid var(--line); color: #44444e;
  height: 32px; padding: 0 12px; border-radius: 9px; font-size: 13px;
}
.btn-ghost:hover { border-color: #c9c9d6; color: var(--deep); }
.btn-ghost svg { width: 14px; height: 14px; stroke: currentColor; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 10px;
  border: 1px solid #e5e5ee; background: #fff;
  font-size: 13.5px; color: #44444e; cursor: pointer;
  max-width: 100%;
}
.chip .v { color: #9a9aa8; }
.chip.on {
  background: #f1ebff; border-color: #d9c6ff; color: #7c3aed; font-weight: 600;
}
.chip.on .v { color: #a37ce8; }

.field-label { font-size: 13px; color: #66666f; margin: 18px 0 8px; }
.input, .textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; padding: 11px 14px; font-size: 14px; color: var(--txt);
  transition: border-color .15s;
}
.input:focus, .textarea:focus { border-color: var(--sky); }
.textarea { resize: vertical; min-height: 84px; line-height: 1.7; }

.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: #66666f; cursor: pointer; }
.switch .track {
  width: 38px; height: 21px; border-radius: 11px; background: #dcdce4; position: relative; transition: background .2s;
}
.switch .track::after {
  content: ""; position: absolute; top: 2.5px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  transition: left .2s; box-shadow: 0 1px 3px rgba(0,0,0,.18);
}
.switch.on .track { background: var(--deep); }
.switch.on .track::after { left: 19px; }

/* tabs（店铺页/图库页通用 pill 风格） */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs .tab {
  padding: 7px 16px; border-radius: 18px; font-size: 13.5px;
  color: #55555f; background: transparent; border: none;
}
.tabs .tab:hover { background: #f1f1f6; }
.tabs .tab.active { background: #f1f1f6; color: #17171c; font-weight: 700; }

/* 上传虚线框 */
.upload-box {
  border: 1.5px dashed #d8d8e2; border-radius: 12px; background: #fdfdfd;
  min-height: 56px; display: flex; align-items: center; justify-content: center;
  color: #9a9aa8; font-size: 13px; cursor: pointer; gap: 6px;
  transition: border-color .15s, color .15s;
}
.upload-box:hover { border-color: var(--sky); color: var(--deep); }
.upload-box svg { width: 15px; height: 15px; stroke: currentColor; }

/* 缩略图网格 */
.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, 92px); gap: 10px; margin-top: 12px; }
.thumb {
  width: 92px; height: 92px; border-radius: 10px; object-fit: cover;
  border: 1px solid var(--line); display: block; cursor: pointer; position: relative;
}
.thumb-wrap { position: relative; width: 92px; }
.thumb-wrap .del {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px;
  border-radius: 50%; background: #17171c; color: #fff; border: none;
  font-size: 11px; line-height: 20px; text-align: center; display: none;
}
.thumb-wrap:hover .del { display: block; }
.badge-src {
  position: absolute; left: 4px; bottom: 4px; font-size: 10px;
  background: rgba(0,0,0,.55); color: #fff; padding: 1px 6px; border-radius: 8px;
}

/* 空态 */
.empty { text-align: center; color: #b3b3c0; padding: 60px 0; }
.empty svg { width: 54px; height: 54px; stroke: #c9c9d6; margin-bottom: 12px; }

/* toast */
#toast {
  position: fixed; left: 50%; top: 56px; transform: translateX(-50%);
  background: rgba(23,23,28,.92); color: #fff; font-size: 13.5px;
  padding: 9px 20px; border-radius: 20px; z-index: 999; display: none;
  max-width: 80vw;
}

/* modal */
.mask {
  position: fixed; inset: 0; background: rgba(20,20,30,.45);
  display: none; align-items: center; justify-content: center; z-index: 100;
}
.mask.show { display: flex; }
.modal {
  background: #fff; border-radius: 16px; padding: 26px 28px;
  width: min(420px, 92vw); position: relative;
}
.modal h3 { font-size: 16px; margin-bottom: 16px; }
.modal .x {
  position: absolute; right: 16px; top: 14px; border: none; background: none;
  font-size: 18px; color: #9a9aa8;
}
