/* ⚠️ 这个文件是从 dduniao-clone/assets/css/admin.css 复制过来的，请不要直接改这里。
   要改请改源文件，然后执行：node cloud/build-public.mjs */
/**
 * ============================================================================
 *  admin.css —— 可视化后台（admin.html）专属样式
 * ============================================================================
 *  只在后台页面加载；前台（index.html）不使用这个文件。
 *  配色沿用 base.css 里的设计变量，改配色请改 base.css。
 * ============================================================================
 */

/* ==========================================================================
   1. 页面外壳（覆盖 base.css 给前台定的底部按钮留白）
   ========================================================================== */
body.admin {
  padding-bottom: 40px;
  background: linear-gradient(180deg, #fce7f3 0%, #fdf2f8 30%, #f3e8ff 100%);
  background-attachment: fixed;
}

.admin-shell {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
}

/* ==========================================================================
   2. 左侧导航
   ========================================================================== */
.admin-nav {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  padding: 18px 12px;
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-brand {
  padding: 4px 10px 14px;
  font-size: 16px;
  font-weight: 900;
  color: var(--tx);
  line-height: 1.3;
}
.admin-brand small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--tx2);
  margin-top: 2px;
}

.admin-nav button {
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  color: var(--tx);
  transition: all .15s ease;
}
.admin-nav button:hover { background: var(--bg); }
.admin-nav button.on {
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: 0 4px 12px rgba(236, 72, 153, .28);
}

.admin-nav .spacer { flex: 1; }

.admin-nav a.preview-link {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  color: var(--purple);
  border: 2px solid var(--purple-l);
  text-align: center;
}
.admin-nav a.preview-link:hover { background: var(--purple-l); }

/* ==========================================================================
   3. 主区域
   ========================================================================== */
.admin-main {
  padding: 22px 24px 90px;
  max-width: 1040px;
  width: 100%;
}

.panel { display: none; }
.panel.on { display: block; }

.panel-title {
  font-size: 21px;
  font-weight: 900;
  color: var(--tx);
  margin-bottom: 4px;
}
.panel-desc {
  font-size: 12px;
  color: var(--tx2);
  margin-bottom: 16px;
  line-height: 1.7;
}

.card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-card);
  margin-bottom: 16px;
}
.card > h3 {
  font-size: 15px;
  font-weight: 900;
  color: var(--tx);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--line);
}
.card > h3 .tip {
  font-size: 11px;
  font-weight: 500;
  color: var(--tx2);
  margin-left: 6px;
}

/* ==========================================================================
   4. 表单控件
   ========================================================================== */
.field { display: block; margin-bottom: 13px; }

.fld-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--tx2);
  margin-bottom: 4px;
}

.fld {
  width: 100%;
  padding: 9px 12px;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 14px;
  color: var(--tx);
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.fld:focus {
  outline: none;
  border-color: var(--pink-l);
  box-shadow: 0 0 0 3px rgba(236, 72, 153, .12);
}
textarea.fld { min-height: 92px; resize: vertical; line-height: 1.7; }

.fld-hint {
  display: block;
  font-size: 11px;
  color: var(--tx2);
  margin-top: 4px;
  line-height: 1.6;
}
.fld-hint.warn { color: #c2410c; }

.check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  color: var(--tx);
  margin-bottom: 12px;
  cursor: pointer;
}
.check input { width: 17px; height: 17px; accent-color: var(--pink); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 13px; }

/* ==========================================================================
   5. 按钮
   ========================================================================== */
.btn {
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  background: var(--gradient-brand);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  transition: all .16s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-cta); }
.btn:active { transform: scale(.97); }

.btn.sec {
  background: #fff;
  color: var(--tx);
  border: 2px solid var(--pink-l);
}
.btn.sec:hover { background: var(--bg); box-shadow: none; }

.btn.danger {
  background: #fff;
  color: #d23b3b;
  border: 2px solid #ffd9d9;
}
.btn.danger:hover { background: #fff5f5; box-shadow: none; }

.btn.tiny { padding: 5px 11px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }

/* ==========================================================================
   6. 重复项（轮播 / 分类 / 玩法 / 价格 / 联系方式）
   ========================================================================== */
.sub-card {
  border: 2px dashed var(--line);
  border-radius: var(--radius-md);
  padding: 13px;
  margin-bottom: 12px;
  background: #fffdfe;
}
.sub-card > .sub-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.sub-card > .sub-head .sub-name {
  font-size: 13px;
  font-weight: 900;
  color: var(--tx);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   7. 图片字段
   ========================================================================== */
.img-field {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 13px;
}
.img-prev {
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: var(--bg);
  object-fit: cover;
}
.img-field .img-main { flex: 1; min-width: 0; }

.hide { display: none !important; }

/* ==========================================================================
   8. 保存面板
   ========================================================================== */
.save-step {
  border-left: 4px solid var(--pink-l);
  padding: 4px 0 4px 14px;
  margin-bottom: 18px;
}
.save-step h4 {
  font-size: 14px;
  font-weight: 900;
  color: var(--tx);
  margin-bottom: 6px;
}
.save-step p {
  font-size: 12.5px;
  color: var(--tx2);
  line-height: 1.8;
  margin-bottom: 10px;
}
code.path {
  display: inline-block;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 12px;
  color: var(--pink);
  word-break: break-all;
}
code.path.big { font-size: 13px; padding: 5px 9px; }

.dirty-list {
  font-size: 12px;
  color: var(--tx2);
  line-height: 1.9;
}
.dirty-list b { color: var(--pink); }

.banner {
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 14px;
}
.banner.err { background: #fff5f5; border: 2px solid #ffd9d9; color: #b91c1c; }
.banner.info { background: var(--bg); border: 2px solid var(--pink-l); color: var(--tx); }

/* ==========================================================================
   9. 轻提示
   ========================================================================== */
.admin-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  z-index: 99;
  padding: 11px 20px;
  border-radius: var(--radius-pill);
  background: rgba(74, 25, 66, .92);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: all .2s ease;
  max-width: 84vw;
  text-align: center;
}
.admin-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ==========================================================================
   10. 响应式
   ========================================================================== */
@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }

  .admin-nav {
    position: sticky;
    height: auto;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    padding: 10px 12px;
    border-right: none;
    border-bottom: 1px solid var(--line);
    z-index: 30;
  }
  .admin-brand { display: none; }
  .admin-nav button { white-space: nowrap; flex: 0 0 auto; }
  .admin-nav .spacer { display: none; }
  .admin-nav a.preview-link { flex: 0 0 auto; white-space: nowrap; }

  .admin-main { padding: 16px 14px 70px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
}
