/* ==========================================================
   创盛云网 · 后台管理系统样式（独立于官网样式）
   ========================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --p: #2563eb; --p-dark: #1d4ed8;
  --bg: #f1f5f9; --card: #fff; --border: #e2e8f0;
  --text: #0f172a; --muted: #64748b;
  --ok: #16a34a; --warn: #d97706; --danger: #dc2626;
}
body {
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px 16px; box-sizing: border-box;
  background: linear-gradient(160deg, #1e3a8a, #0ea5e9);
}
.login-box {
  width: 360px; max-width: 100%; background: #fff; border-radius: 16px; padding: 36px 32px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .3); box-sizing: border-box;
}
.login-box .logo-mark {
  width: 44px; height: 44px; border-radius: 10px; background: linear-gradient(135deg, var(--p), #0ea5e9);
  color: #fff; font-size: 20px; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px;
}
.login-box h1 { font-size: 18px; text-align: center; margin-bottom: 4px; }
.login-box .sub { font-size: 12.5px; color: var(--muted); text-align: center; margin-bottom: 24px; }
.login-err { color: var(--danger); font-size: 12.5px; margin: 8px 0 0; text-align: center; min-height: 16px; }

/* ---------- 布局 ---------- */
.layout { display: none; min-height: 100vh; }
.layout.show { display: flex; }
.sidebar {
  width: 208px; flex: none; background: #0f172a; color: #cbd5e1;
  display: flex; flex-direction: column; padding: 18px 12px;
  position: sticky; top: 0; height: 100vh;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.side-brand .logo-mark {
  width: 34px; height: 34px; border-radius: 8px; background: linear-gradient(135deg, var(--p), #0ea5e9);
  color: #fff; font-size: 15px; display: flex; align-items: center; justify-content: center;
}
.side-brand b { color: #fff; font-size: 14.5px; }
.side-brand span { font-size: 11px; color: #64748b; display: block; }
.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.side-nav button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: none; color: #cbd5e1; font-size: 13.5px;
  padding: 11px 12px; border-radius: 9px; text-align: left; transition: background .15s;
}
.side-nav button:hover { background: rgba(255, 255, 255, .07); }
.side-nav button.active { background: var(--p); color: #fff; }
.side-nav .badge {
  margin-left: auto; background: var(--danger); color: #fff; font-size: 11px;
  min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px;
  display: flex; align-items: center; justify-content: center;
}
.side-foot { border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 10px; }
.side-foot button { width: 100%; background: none; border: none; color: #94a3b8; padding: 9px 12px; border-radius: 9px; font-size: 13px; text-align: left; }
.side-foot button:hover { background: rgba(255, 255, 255, .07); color: #fff; }

.main { flex: 1; padding: 24px 28px; min-width: 0; }
.panel { display: none; }
.panel.show { display: block; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; gap: 12px; }
.panel-head h2 { font-size: 19px; }
.panel-head .desc { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

/* ---------- 按钮 ---------- */
.btn {
  border: none; border-radius: 9px; padding: 9px 18px; font-size: 13.5px; font-weight: 500;
  background: var(--p); color: #fff; transition: all .15s; display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { background: var(--p-dark); }
.btn.ghost { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn.ghost:hover { border-color: var(--p); color: var(--p); background: #eff6ff; }
.btn.danger { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.btn.danger:hover { background: var(--danger); color: #fff; }
.btn.sm { padding: 6px 12px; font-size: 12.5px; border-radius: 7px; }

/* ---------- 卡片与表单 ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 20px; margin-bottom: 16px; }
.editor { border-color: #bfdbfe; box-shadow: 0 8px 24px rgba(37, 99, 235, .08); }
.editor h3 { font-size: 15.5px; margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.fg label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; }
.fg input, .fg select, .fg textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 11px; font-size: 13.5px; color: var(--text); background: #fff; transition: border .15s;
}
.fg input:focus, .fg select:focus, .fg textarea:focus { outline: none; border-color: var(--p); }
.fg textarea { resize: vertical; min-height: 70px; }
.fg-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.editor-acts { display: flex; gap: 10px; margin-top: 18px; }

/* ---------- 列表 ---------- */
.list-item {
  display: flex; align-items: center; gap: 14px; background: var(--card);
  border: 1px solid var(--border); border-radius: 12px; padding: 13px 16px; margin-bottom: 10px;
}
.list-item .li-ico {
  width: 42px; height: 42px; flex: none; border-radius: 10px; font-size: 20px;
  background: linear-gradient(135deg, #dbeafe, #cffafe);
  display: flex; align-items: center; justify-content: center;
}
.list-item .li-ico.li-img { overflow: hidden; }
.list-item .li-ico.li-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.li-main { flex: 1; min-width: 0; }
.li-main b { font-size: 14px; display: block; }
.li-main span { font-size: 12.5px; color: var(--muted); display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-acts { display: flex; gap: 8px; flex: none; }
.li-tag {
  font-size: 11px; padding: 3px 9px; border-radius: 999px; flex: none;
  background: #eff6ff; color: var(--p);
}
.empty { text-align: center; color: var(--muted); padding: 40px 0; font-size: 13.5px; }

/* ---------- 留言 ---------- */
.msg-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; margin-bottom: 12px; }
.msg-card.unread { border-left: 4px solid var(--p); background: #f8faff; }
.msg-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.msg-head b { font-size: 14px; }
.msg-head .time { font-size: 12px; color: var(--muted); }
.msg-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.msg-meta span {
  font-size: 12px; background: var(--bg); border: 1px solid var(--border);
  padding: 3px 10px; border-radius: 999px; color: var(--muted);
}
.msg-body { font-size: 13.5px; line-height: 1.7; color: var(--text); background: var(--bg); border-radius: 8px; padding: 10px 12px; }
.msg-acts { display: flex; gap: 8px; margin-top: 10px; }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--p); flex: none; }

/* ---------- 提示条 ---------- */
.toast {
  position: fixed; top: 22px; left: 50%; transform: translateX(-50%) translateY(-80px);
  background: #0f172a; color: #fff; font-size: 13.5px; padding: 11px 22px; border-radius: 999px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .3); transition: transform .3s; z-index: 999;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.ok { background: var(--ok); }
.toast.err { background: var(--danger); }

.notice {
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
  border-radius: 12px; padding: 12px 16px; font-size: 12.5px; line-height: 1.7; margin-bottom: 18px;
}
.notice b { color: #78350f; }

.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-cards .sc { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.stat-cards .sc b { font-size: 24px; display: block; color: var(--p); }
.stat-cards .sc span { font-size: 12.5px; color: var(--muted); }

@media (max-width: 860px) {
  .layout.show { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; overflow-x: auto; }
  .side-brand { padding: 0 8px 0 2px; }
  .side-brand span { display: none; }
  .side-nav { flex-direction: row; }
  .side-nav button { white-space: nowrap; }
  .side-foot { border: none; padding: 0; }
  .side-foot button { white-space: nowrap; }
  .form-grid { grid-template-columns: 1fr; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
}

/* ===== 图片上传组件 ===== */
.img-up { display: flex; align-items: flex-start; gap: 14px; }
.img-prev {
  width: 76px; height: 76px; flex: none; border-radius: 12px; overflow: hidden;
  border: 1.5px dashed #cbd5e1; background: #f8fafc;
  display: flex; align-items: center; justify-content: center;
}
.img-prev img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-ph { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 20px; }
.img-ph i { font-style: normal; font-size: 10.5px; color: #94a3b8; }
.img-acts { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.img-pick { cursor: pointer; display: inline-flex; align-items: center; }
.img-tip { width: 100%; font-size: 12px; color: var(--muted); margin: 0; }
.list-item .li-ico img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }

/* ===== 富文本编辑预览 ===== */
.rich-prev {
  margin-top: 12px; border: 1px solid var(--border); border-radius: 10px;
  background: #fbfcfe; overflow: hidden;
}
.rich-prev-head {
  font-size: 11.5px; color: var(--muted); padding: 7px 12px;
  border-bottom: 1px solid var(--border); background: #f1f5f9; letter-spacing: .5px;
}
.rich-prev-body { padding: 12px 14px; font-size: 13.5px; color: #475569; line-height: 1.75; max-height: 260px; overflow: auto; }
.rich-prev-body p { margin: 0 0 10px; }
.rich-prev-body h4 { font-size: 13.5px; color: var(--text); margin: 12px 0 6px; }
.rich-prev-body ul { margin: 0 0 8px; padding-left: 18px; }
.rich-prev-body li { margin-bottom: 4px; }
.rich-prev-body img { max-width: 100%; border-radius: 8px; }
.btn[disabled] { opacity: .4; cursor: not-allowed; }

/* ===== 合作伙伴 logo ===== */
.pt-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.pt-row:last-child { border-bottom: none; }
.pt-thumb {
  width: 40px; height: 40px; border-radius: 8px; flex: none; overflow: hidden;
  display: flex; align-items: center; justify-content: center; background: #f1f5f9;
}
.pt-thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.pt-thumb i {
  width: 40px; height: 40px; border-radius: 8px; font-style: normal;
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 16px;
}
.pt-name { flex: 1; min-width: 0; }

/* ===== 登录模式提示 / 数据存储状态 ===== */
.login-mode {
  font-size: 12px; line-height: 1.6; color: #92400e; background: #fffbeb;
  border: 1px solid #fde68a; border-radius: 8px; padding: 8px 10px; margin: 10px 0 0;
}
.store-mode { border-radius: 10px; padding: 12px 14px; font-size: 13px; line-height: 1.7; }
.store-mode b { display: block; font-size: 13.5px; margin-bottom: 4px; }
.store-mode.ok { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.store-mode.warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
