* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #3d3229;
  background: #fbf6ee;
  font-size: 14px;
}
.hidden { display: none !important; }

/* 登录 */
.login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  width: 340px;
  background: #fff;
  border-radius: 18px;
  padding: 32px;
  box-shadow: 0 12px 40px rgba(160, 120, 60, 0.15);
}
.login-card h1 { margin: 0 0 6px; font-size: 22px; }
.tip, .muted { color: #a89b8a; font-size: 12px; }
.login-card input {
  width: 100%;
  margin: 18px 0 12px;
  padding: 12px 14px;
  border: 1px solid #ece0cf;
  border-radius: 10px;
  font-size: 14px;
}
button {
  cursor: pointer;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 14px;
  background: #f2ece2;
  color: #6b5c49;
}
button.primary {
  background: linear-gradient(135deg, #f6c453, #ee9a2e);
  color: #fff;
  font-weight: 700;
}
button.ghost { background: #f2ece2; }
.err { color: #e5484d; font-size: 12px; margin-top: 10px; min-height: 16px; }

/* 布局 */
.app { display: flex; min-height: 100vh; }
.side {
  width: 200px;
  background: #fff;
  border-right: 1px solid #f0e7d9;
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
}
.brand { font-weight: 800; font-size: 16px; padding: 6px 10px 14px; }
.side nav { display: flex; flex-direction: column; gap: 4px; }
.side nav button {
  text-align: left;
  background: transparent;
  padding: 10px 12px;
  border-radius: 10px;
}
.side nav button.on {
  background: linear-gradient(135deg, #fff4e2, #ffe9cc);
  color: #b8730f;
  font-weight: 700;
}
.side-foot { margin-top: auto; padding-top: 12px; }

.main { flex: 1; padding: 18px 24px 60px; }
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.top h2 { margin: 0; font-size: 20px; }
.actions { display: flex; align-items: center; gap: 12px; }

/* 表单 */
.form { display: flex; flex-direction: column; gap: 16px; }
.panel {
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 6px 20px rgba(160, 120, 60, 0.08);
}
/* 不同分区块用左侧色条区分，避免一长条混在一起 */
.panel {
  border-left: 5px solid #ffd257;
}
.panel h3 {
  color: #6b4a12;
}
/* 跳转类字段：整块浅底虚线框，和纯文本字段明显区分 */
.link-wrap {
  background: #fdf9f2;
  border: 1px dashed #e6d5b8;
  border-radius: 10px;
  padding: 12px;
  grid-column: 1 / -1;
}
/* 图标/图片类字段：另一套浅色，和跳转类可区分 */
.field:has([data-icon-pick]) {
  background: #f7f5ff;
  border-radius: 10px;
  padding: 10px;
  grid-column: 1 / -1;
}
.panel h3 {
  margin: 0 0 14px;
  font-size: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 12px; color: #8d8172; }
.field input[type="text"],
.field textarea,
.field select {
  border: 1px solid #ece0cf;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  background: #fffdf8;
  width: 100%;
}
.field textarea { min-height: 60px; resize: vertical; }
.field .row { display: flex; gap: 8px; align-items: center; }
.field .row input { flex: 1; }
.multi { display: flex; flex-wrap: wrap; gap: 12rpx; padding: 4rpx 0; }
.chk {
  display: flex;
  align-items: center;
  gap: 4rpx;
  font-size: 13px;
  background: #fffdf8;
  border: 1px solid #ece0cf;
  border-radius: 8rpx;
  padding: 6rpx 12rpx;
}
.preview-img {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid #ece0cf;
  background: #faf6ee;
}
.preview-emoji {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  border: 1px solid #ece0cf;
  background: #faf6ee;
}
/* 卡通图标库选择器 */
.icon-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  padding: 10px;
  background: #faf6ee;
  border: 1px dashed #e3d6c2;
  border-radius: 12px;
}
.icon-pick {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #ece0cf;
  padding: 4px;
  cursor: pointer;
  object-fit: contain;
}
.icon-pick:hover {
  border-color: #ffb04d;
  transform: translateY(-2px);
}
/* 聚推客活动勾选列表 */
.acts-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 320px;
  overflow: auto;
  padding: 10px;
  background: #faf6ee;
  border: 1px dashed #e3d6c2;
  border-radius: 12px;
}
.act-check {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid #ece0cf;
  border-radius: 10px;
  padding: 6px 8px;
  cursor: pointer;
  font-size: 13px;
}
.act-check input {
  flex-shrink: 0;
}
.act-check img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: contain;
  flex-shrink: 0;
}
.act-check span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 列表项 */
.item {
  border: 1px solid #f0e7d9;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  background: #fffdf8;
}
.item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  cursor: pointer;
  user-select: none;
}
.item-head:hover .name { color: #b8730f; }
.item-head .arrow { color: #a89b8a; width: 14px; }
.item-body.hidden { display: none; }
.item.collapsed .item-head { margin-bottom: 0; }
.panel-ops { display: flex; gap: 6px; }

/* 嵌套子列表（活动平台 → 活动卡） */
.sub-list {
  margin-top: 14px;
  border-top: 1px dashed #e6d8c3;
  padding-top: 12px;
}
.sub-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #7a6a55;
  margin-bottom: 8px;
}
.sub-item {
  background: #fffdf7;
  border: 1px solid #f0e5d3;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.sub-head {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
}
.sub-head .arrow { color: #a89b8a; width: 14px; }
.sub-head .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 卡片内分组区块（详情页信息等，默认收起） */
.sub-group {
  margin-top: 12px;
  border: 1px solid #ece0cf;
  border-radius: 10px;
  overflow: hidden;
}
.group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #fdf7ec;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  color: #7a6a55;
}
.group-head:hover { background: #fbf0e0; }
.group-head .arrow { width: 14px; color: #a89b8a; }
.group-head .name { font-weight: 700; }
.group-head .hint { margin-left: auto; font-size: 12px; color: #b0a494; }
.group-body { padding: 12px; background: #fffdf8; }
.group-body.hidden { display: none; }

.sub-body { margin-top: 10px; }
.sub-body.hidden { display: none; }
.item-head .idx {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #f2ece2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #8d8172;
}
.item-head .name { font-weight: 700; flex: 1; }
.item-head button { padding: 5px 10px; font-size: 12px; }
.item-head .del { background: #ffe9e9; color: #d64b4b; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  background: rgba(61, 50, 41, 0.92);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 99;
}

/* 表单底部居中保存按钮 */
.bottom-save {
  display: flex;
  justify-content: center;
  padding: 18px 0 40px;
}
.bottom-save .primary {
  min-width: 200px;
  padding: 12px 34px;
  font-size: 15px;
  box-shadow: 0 6px 18px rgba(238, 95, 154, 0.25);
}
