/* 网站后台样式 —— 与前台同一套圆润低饱和风格 */
:root {
  --primary: #2C7DA0; --primary-700: #22597A; --primary-soft: #E3F0F7;
  --ink: #22323E; --muted: #6B7E8C; --line: #E3EAF0; --line-2: #D5E0E9;
  --bg: #EEF3F7; --surface: #fff; --danger: #C0392B; --ok: #2E8B6B;
  --r: 14px; --r-lg: 18px;
  --shadow: 0 10px 30px rgba(34, 89, 122, .10);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font: 14px/1.7 "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 13.5px; color: var(--ink); }

.btn { border: 0; border-radius: 999px; padding: 9px 20px; font-size: 13.5px; font-weight: 600; transition: .2s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-700); }
.btn-ghost { background: #fff; color: var(--primary); border: 1px solid var(--line-2); }
.btn-ghost:hover { border-color: var(--primary); }
.btn-sm { padding: 5px 13px; font-size: 12.5px; }
.btn-danger { background: #FBEDEB; color: var(--danger); }
.btn-block { display: block; width: 100%; text-align: center; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------------- 登录 ---------------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { background: #fff; border-radius: 22px; box-shadow: var(--shadow); padding: 44px 40px 30px; width: 380px; text-align: center; }
/* 登录页：大号方形透明图标 + 公司名文字
   （原来用带白底的横版图；改成方形图标后无底纹且更清晰） */
.login-logo { width: 86px; height: 86px; object-fit: contain; margin-bottom: 14px; }
.login-name { font-size: 17px; font-weight: 700; color: var(--ink); letter-spacing: .4px; margin-bottom: 16px; }
.login-card h1 { font-size: 19px; margin: 0 0 4px; }
.login-sub { color: var(--muted); margin: 0 0 22px; font-size: 13px; }
.login-card input { width: 100%; border: 1.5px solid var(--line-2); border-radius: 12px; padding: 11px 14px; margin-bottom: 14px; outline: none; }
.login-card input:focus { border-color: var(--primary); }
.login-err { color: var(--danger); font-size: 12.5px; min-height: 18px; margin-top: 10px; }
.login-tip { color: var(--muted); font-size: 12px; margin: 4px 0 0; }

/* ---------------- 布局 ---------------- */
.app { display: flex; min-height: 100vh; }
.side { width: 232px; background: #fff; border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; }
.side-brand { display: flex; gap: 10px; align-items: center; padding: 0 6px; }
/* 后台左上角：方形透明图标（原来用带白底的横版图，
   在 46px 宽下会被压成细条、文字完全看不清） */
.side-brand img { width: 42px; height: 42px; object-fit: contain; flex: none; }
.side-brand b { display: block; font-size: 14.5px; }
.side-brand span { font-size: 12px; color: var(--muted); }
#tabs { display: flex; flex-direction: column; gap: 4px; }
.tab { text-align: left; border: 0; background: transparent; padding: 10px 14px; border-radius: 10px; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.tab:hover { background: var(--primary-soft); color: var(--primary-700); }
.tab.on { background: var(--primary); color: #fff; }
.side-foot { margin-top: auto; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 18px 28px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar h2 { margin: 0; font-size: 17px; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.dirty { color: #C77414; font-size: 12.5px; }
.content { padding: 24px 28px 60px; max-width: 1080px; width: 100%; }

/* ---------------- 卡片与表单 ---------------- */
.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: 0 4px 16px rgba(34,89,122,.06); padding: 22px 24px; margin-bottom: 18px; }
.card > h3 { margin: 0 0 14px; font-size: 15px; display: flex; align-items: center; justify-content: space-between; }
.card > h3 .hint { font-weight: 400; font-size: 12px; color: var(--muted); }
.frow { display: grid; grid-template-columns: 130px 1fr; gap: 10px 14px; align-items: center; margin-bottom: 12px; }
.frow > label { font-size: 13px; color: var(--muted); }
.frow input[type=text], .frow input[type=tel], .frow input[type=email], .frow input[type=password],
.frow select, .frow textarea, .cell input, .cell select, .cell textarea {
  width: 100%; border: 1.5px solid var(--line-2); border-radius: 10px; padding: 8px 12px; outline: none; background: #fff;
}
.frow textarea, .cell textarea { min-height: 90px; line-height: 1.7; }
.frow input:focus, .frow textarea:focus, .frow select:focus, .cell input:focus, .cell textarea:focus, .cell select:focus { border-color: var(--primary); }

/* 开关 */
.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch .track { width: 40px; height: 22px; border-radius: 999px; background: #C9D6DF; transition: .2s; position: relative; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + .track { background: var(--ok); }
.switch input:checked + .track::after { left: 21px; }
.switch .sw-label { font-size: 13px; color: var(--muted); }
.switch input:checked ~ .sw-label { color: var(--ok); font-weight: 600; }

/* 列表编辑器 */
.item { border: 1.5px solid var(--line); border-radius: var(--r); padding: 16px 18px; margin-bottom: 14px; background: #fff; }
.item.off { opacity: .55; background: #F6F8FA; }
.item-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.item-head .t { font-weight: 700; font-size: 14px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.cell { display: flex; flex-direction: column; gap: 5px; }
.cell > .cl { font-size: 12px; color: var(--muted); }
.cell.full { grid-column: 1 / -1; }
.item-actions { margin-top: 12px; display: flex; gap: 10px; }
.add-bar { display: flex; gap: 10px; margin-bottom: 16px; }

/* 图片选择器 */
.imgpick { display: flex; align-items: center; gap: 10px; }
.imgpick .prev { width: 58px; height: 42px; border-radius: 9px; object-fit: cover; background: var(--primary-soft); border: 1px solid var(--line); }
.imgpick input { flex: 1; min-width: 0; }
.imgpick select { flex: 1; min-width: 0; }

/* 开关组（区块显示/隐藏） */
.sec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.sec-box { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* 提示 */
.toast { position: fixed; right: 26px; bottom: 26px; background: var(--ink); color: #fff; border-radius: 12px; padding: 12px 20px; font-size: 13.5px; box-shadow: var(--shadow); opacity: 0; transform: translateY(14px); transition: .25s; pointer-events: none; z-index: 50; max-width: 420px; }
.toast.show { opacity: 1; transform: none; }
.toast.err { background: var(--danger); }
.empty-tip { color: var(--muted); text-align: center; padding: 26px 0; }

@media (max-width: 900px) {
  .app { flex-direction: column; }
  .side { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; }
  #tabs { flex-direction: row; flex-wrap: wrap; }
  .side-foot { margin: 0; }
  .item-grid { grid-template-columns: 1fr; }
  .content { padding: 18px 14px 60px; }
}
