/* ============ 管理后台样式 ============ */
body.admin-mode .site-nav,
body.admin-mode .site-footer,
body.admin-mode .bg-blobs { display: none; }
body.admin-mode { background: #f2f3f7; }

/* ---- 登录 ---- */
.admin-login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 40px 16px;
  background: #f2f3f7;
}
.admin-login {
  width: min(440px, 94vw); background: #fff; border-radius: 24px;
  padding: 40px 36px; box-shadow: 0 24px 60px -20px rgba(30,30,80,0.25);
}
.admin-login .al-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.admin-login h1 { font-size: 22px; font-weight: 800; margin: 6px 0 2px; }
.admin-login .al-sub { color: var(--ink-3); font-size: 14px; margin-bottom: 24px; }
.al-tabs { display: flex; gap: 6px; background: #f2f3f7; border-radius: 999px; padding: 5px; margin-bottom: 24px; }
.al-tabs button {
  flex: 1; border: none; background: transparent; border-radius: 999px;
  padding: 9px 0; font-size: 14px; font-weight: 700; color: var(--ink-3); transition: 0.15s;
}
.al-tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 4px 12px -4px rgba(0,0,0,0.12); }
.otp-row { display: flex; gap: 10px; }
.otp-row input { flex: 1; }
.otp-row button {
  white-space: nowrap; border: 1.5px solid var(--brand); background: #fff; color: var(--brand);
  border-radius: 12px; padding: 0 18px; font-weight: 700; font-size: 14px;
}
.otp-row button:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- 布局 ---- */
.admin-shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.admin-side {
  background: #10141a; color: #aeb6c2; padding: 26px 16px; position: sticky; top: 0;
  height: 100vh; display: flex; flex-direction: column;
}
.admin-side .brand { padding: 0 10px 20px; border-bottom: 1px solid rgba(255,255,255,0.08); margin-bottom: 18px; }
.admin-side .brand-name { color: #fff; font-size: 16px; }
.as-group { font-size: 11px; letter-spacing: 2px; opacity: 0.5; padding: 14px 12px 6px; }
.as-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px;
  font-size: 15px; font-weight: 600; cursor: pointer; transition: 0.15s; margin-bottom: 2px;
}
.as-item:hover { background: rgba(255,255,255,0.07); color: #fff; }
.as-item.on { background: #1f4e8c; color: #fff; }
.admin-main { padding: 30px 34px; max-width: 1200px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; gap: 14px; flex-wrap: wrap; }
.admin-topbar h2 { font-size: 24px; font-weight: 800; }
.admin-topbar .who { color: var(--ink-3); font-size: 14px; display: flex; align-items: center; gap: 12px; }

/* ---- 概览 ---- */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
.stat-card { background: #fff; border-radius: 18px; padding: 22px 24px; box-shadow: 0 6px 20px -10px rgba(30,30,80,0.12); }
.stat-card b { display: block; font-size: 32px; font-weight: 800; color: #1f4e8c; }
.stat-card span { font-size: 13.5px; color: var(--ink-3); }
.tip-card { background: #e9eef6; border-radius: 18px; padding: 22px 26px; font-size: 14.5px; color: #3c4450; }
.tip-card b { color: var(--brand); }

/* ---- 表格 ---- */
.a-panel { background: #fff; border-radius: 20px; padding: 24px; box-shadow: 0 6px 20px -10px rgba(30,30,80,0.12); margin-bottom: 20px; }
.a-panel h3 { font-size: 18px; font-weight: 800; margin-bottom: 16px; }
.a-toolbar { display: flex; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; align-items: center; }
.a-toolbar select, .a-toolbar input {
  border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 14px; font-size: 14px; background: #fff; outline: none;
}
.a-toolbar input { flex: 1; min-width: 160px; }
table.a-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.a-table th { text-align: left; color: var(--ink-3); font-size: 13px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.a-table td { padding: 12px; border-bottom: 1px solid #f1f1ee; vertical-align: middle; }
.a-table tr:hover td { background: #fafaff; }
.a-table img.cover { width: 64px; height: 48px; object-fit: cover; border-radius: 8px; }
.pill { display: inline-block; font-size: 12.5px; font-weight: 700; padding: 4px 13px; border-radius: 999px; }
.pill.up { background: #e6fbef; color: #15803d; }
.pill.down { background: #fdeaea; color: #be123c; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-mini {
  border: none; border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 700; transition: 0.15s;
}
.btn-mini:hover { transform: translateY(-1px); }
.btn-mini.b-blue { background: #eef0ff; color: #4f46e5; }
.btn-mini.b-green { background: #e6fbef; color: #15803d; }
.btn-mini.b-gray { background: #f1f1f4; color: #555; }
.btn-mini.b-red { background: #fdeaea; color: #be123c; }

/* ---- 编辑器弹窗 ---- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(14, 16, 26, 0.5); backdrop-filter: blur(4px);
  z-index: 300; display: grid; place-items: center; padding: 20px;
}
.modal {
  background: #fff; border-radius: 22px; width: min(760px, 96vw); max-height: 90vh;
  overflow-y: auto; padding: 30px 32px; box-shadow: 0 30px 80px -20px rgba(0,0,0,0.4);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-head h3 { font-size: 20px; font-weight: 800; }
.draft-tip { margin-left: auto; margin-right: 12px; font-size: 12.5px; font-weight: 600; color: #15803d; }
.modal-foot { display: flex; gap: 12px; margin-top: 8px; }
.modal-foot .btn { padding: 13px 28px; font-size: 15px; }
.modal-foot .btn-ghost { border: 2px solid var(--line); background: #fff; color: var(--ink); }
.modal-foot .btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.modal-close { border: none; background: #f1f1f4; width: 34px; height: 34px; border-radius: 50%; font-size: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.modal .field label { font-size: 13.5px; }
.img-manager { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.im-item { position: relative; width: 110px; }
.im-item img { width: 110px; height: 82px; object-fit: cover; border-radius: 12px; border: 2px solid var(--line); }
.im-item .im-ops { display: flex; gap: 4px; justify-content: center; margin-top: 6px; }
.im-item .im-ops button {
  border: none; background: #f1f1f4; border-radius: 8px; font-size: 13px; width: 30px; height: 26px;
}
.im-add {
  width: 110px; height: 82px; border: 2px dashed #cfd2e3; border-radius: 12px; background: #f8f9ff;
  color: var(--brand); font-size: 22px; display: grid; place-items: center; cursor: pointer;
}
.im-add:hover { background: #eef0ff; }

/* ---- 图片库 ---- */
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.img-cell { background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 6px 18px -10px rgba(30,30,80,0.15); }
.img-cell .ic-img { aspect-ratio: 4/3; background: #f2f3f7; position: relative; border-radius: 10px; overflow: hidden; }
.img-cell .ic-img img { width: 100%; height: 100%; object-fit: cover; }
.img-cell .ic-body { padding: 12px 14px; }
.img-cell .ic-key { font-size: 12px; color: var(--ink-3); font-family: monospace; word-break: break-all; }
.img-cell .ic-label { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.img-cell .ic-ops { display: flex; gap: 8px; margin-top: 10px; }
.img-cell.is-empty .ic-img { display: grid; place-items: center; color: #b6bcc9; font-size: 13px; }
.img-cell .ic-img .ic-thumb-pending { display: grid; place-items: center; height: 100%; color: #b6bcc9; font-size: 13px; }

/* ---- 询盘 ---- */
.inq-card { background: #fff; border-radius: 16px; padding: 20px 22px; box-shadow: 0 6px 18px -10px rgba(30,30,80,0.12); margin-bottom: 14px; }
.inq-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.inq-head b { font-size: 16px; }
.inq-head time { color: var(--ink-3); font-size: 13px; }
.inq-contact { font-size: 14px; color: var(--brand); font-weight: 700; margin-bottom: 8px; }
.inq-msg { font-size: 14.5px; color: var(--ink-2); white-space: pre-wrap; background: #f8f9fb; border-radius: 12px; padding: 12px 16px; }

.no-perm { text-align: center; padding: 80px 20px; }
.no-perm .big { font-size: 52px; margin-bottom: 14px; }
.no-perm p { color: var(--ink-3); margin: 8px 0 24px; }

@media (max-width: 860px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; gap: 6px; padding: 14px; }
  .admin-side .brand { border: none; padding: 0 8px 0 0; margin: 0; }
  .as-group { display: none; }
  .as-item { padding: 9px 13px; font-size: 14px; }
  .admin-main { padding: 20px 16px; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
}
