/* ============================================================
   admin.css — 站点后台样式（独立于前台主题）
   ============================================================ */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font: 14px/1.6 -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  background: #0f1117; color: #e6e8ee;
}

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center;
  background:
    radial-gradient(700px 400px at 20% 0%, rgba(0,229,255,.10), transparent 60%),
    radial-gradient(700px 400px at 85% 100%, rgba(255,45,149,.10), transparent 60%),
    #0f1117;
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 380px; padding: 34px 32px 30px;
  background: #161923; border: 1px solid #262b3a; border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0,0,0,.45);
}
.login-card h1 { margin: 0 0 4px; font-size: 20px; letter-spacing: .02em; }
.login-card .sub { margin: 0 0 24px; color: #8b93a7; font-size: 12.5px; }
.login-card .err { color: #ff6b81; font-size: 12.5px; min-height: 18px; margin: 8px 0 2px; }
.login-tip { margin-top: 18px; font-size: 12px; color: #79809a; line-height: 1.7; border-top: 1px dashed #2a3040; padding-top: 14px; }
.login-tip b { color: #aab2c5; }

/* ---------- 输入控件 ---------- */
.inp, textarea.inp, select.inp {
  width: 100%; padding: 9px 11px; font: inherit; color: #e6e8ee;
  background: #0e1017; border: 1px solid #2a3040; border-radius: 8px;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.inp:focus { border-color: #00e5ff; box-shadow: 0 0 0 3px rgba(0,229,255,.12); }
textarea.inp { min-height: 84px; resize: vertical; line-height: 1.7; }
select.inp { cursor: pointer; }
.btn {
  padding: 8px 14px; font: inherit; font-size: 13px; cursor: pointer;
  border-radius: 8px; border: 1px solid #2a3040; background: #1b1f2b; color: #e6e8ee;
  transition: background .15s, border-color .15s, transform .06s;
}
.btn:hover { background: #222736; border-color: #3a4359; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(120deg, #00b8d4, #00e5ff); border-color: transparent; color: #04121a; font-weight: 700; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { border-color: #5c2a33; color: #ff8fa0; }
.btn.danger:hover { background: #2a1a1e; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.sm { padding: 4px 9px; font-size: 12px; border-radius: 6px; }

/* ---------- 布局 ---------- */
.admin { display: none; height: 100vh; }
.admin.on { display: grid; grid-template-columns: 226px 1fr; }
.side {
  border-right: 1px solid #1e2331; background: #12151d;
  display: flex; flex-direction: column; overflow: hidden;
}
.side-brand { padding: 18px 18px 14px; border-bottom: 1px solid #1e2331; }
.side-brand b { display: block; font-size: 15px; letter-spacing: .02em; }
.side-brand span { font-size: 11px; color: #79809a; letter-spacing: .16em; }
#sideNav { flex: 1; overflow-y: auto; padding: 10px 8px; }
#sideNav button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 11px; margin-bottom: 2px; font: inherit; font-size: 13.5px; cursor: pointer;
  background: none; border: 0; border-radius: 8px; color: #b9c0d0;
}
#sideNav button i { font-style: normal; color: #5f6880; width: 16px; text-align: center; font-size: 12px; }
#sideNav button:hover { background: #1a1f2b; color: #fff; }
#sideNav button.on { background: rgba(0,229,255,.10); color: #6fe9ff; }
#sideNav button.on i { color: #00e5ff; }
.side-foot { padding: 12px 16px 16px; border-top: 1px solid #1e2331; font-size: 11.5px; color: #79809a; }
.store-bar { height: 5px; border-radius: 4px; background: #1e2331; overflow: hidden; margin-bottom: 6px; }
.store-bar i { display: block; height: 100%; width: 0; background: #00e5ff; transition: width .3s; }

.main { display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 22px; border-bottom: 1px solid #1e2331; background: #12151d;
  flex-wrap: wrap;
}
.topbar h2 { margin: 0; font-size: 17px; }
.topbar .note { color: #79809a; font-size: 12px; }
.tb-r { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.badge { font-size: 11.5px; padding: 4px 10px; border-radius: 999px; border: 1px solid #2a3040; color: #8b93a7; }
.badge.dirty { border-color: #7a5c1e; color: #ffcc66; background: rgba(255,204,102,.08); }
.badge.ok { border-color: #1f5c46; color: #5fe0ae; background: rgba(95,224,174,.08); }

.content { flex: 1; overflow-y: auto; padding: 22px; }

/* ---------- 内容块 ---------- */
.blk {
  background: #14171f; border: 1px solid #222836; border-radius: 12px;
  padding: 18px 20px; margin-bottom: 18px;
}
.blk > header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.blk > header .hd { flex: 1; }
.blk h3 { margin: 0 0 3px; font-size: 15px; }
.blk .n { margin: 0; color: #79809a; font-size: 12px; line-height: 1.6; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px 18px; }
.f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.f > label { font-size: 12px; color: #9aa3b8; letter-spacing: .01em; }
.f > label b { color: #6fe9ff; font-weight: 600; }
.f-wide { grid-column: 1 / -1; }

/* 双语字段对 */
.bi { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bi .lang { position: relative; }
.bi .lang::after {
  content: attr(data-lang); position: absolute; top: -1px; right: 6px;
  font-size: 9.5px; letter-spacing: .08em; color: #59627a; pointer-events: none;
}

/* 图片字段 */
.f-img { display: flex; gap: 10px; align-items: flex-start; }
.f-img .col { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.f-img .row { display: flex; gap: 6px; }
.f-thumb {
  width: 74px; height: 74px; flex: 0 0 74px; object-fit: cover;
  border-radius: 8px; border: 1px solid #2a3040; background: #0e1017;
  display: grid; place-items: center; font-size: 10px; color: #59627a; overflow: hidden;
}

/* ---------- 列表 ---------- */
.items { display: flex; flex-direction: column; gap: 10px; }
.item {
  border: 1px solid #232939; border-radius: 10px; padding: 12px 14px; background: #10131b;
}
.item-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.item-head .no {
  font-size: 11px; color: #59627a; background: #1a1f2b; border: 1px solid #262c3c;
  padding: 2px 8px; border-radius: 999px; font-variant-numeric: tabular-nums;
}
.item-head .tt { flex: 1; font-size: 13px; color: #cfd6e4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-ops { display: flex; gap: 5px; }
.empty { color: #59627a; font-size: 12.5px; padding: 14px; text-align: center; border: 1px dashed #2a3040; border-radius: 10px; }
.chks { display: flex; align-items: center; gap: 8px; }
.chks input { width: 16px; height: 16px; accent-color: #00e5ff; }

/* ---------- 预览抽屉 ---------- */
.preview {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(52vw, 880px);
  background: #0b0d13; border-left: 1px solid #262c3c; box-shadow: -18px 0 50px rgba(0,0,0,.5);
  display: flex; flex-direction: column; z-index: 60;
}
.preview[hidden] { display: none; }
.preview header { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid #1e2331; }
.preview iframe { flex: 1; border: 0; width: 100%; background: #fff; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 20px);
  background: #1d2230; border: 1px solid #333b52; color: #e6e8ee;
  padding: 10px 18px; border-radius: 10px; font-size: 13px; opacity: 0;
  pointer-events: none; transition: opacity .2s, transform .2s; z-index: 99;
  max-width: 70vw;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: #6b2f3a; color: #ffb3c0; }
.toast.ok  { border-color: #1f5c46; color: #7ff0c0; }

/* ---------- 安全页 ---------- */
.warn-box { border: 1px solid #5c4a1e; background: rgba(255,204,102,.06); color: #ffcc66; padding: 12px 14px; border-radius: 10px; font-size: 12.5px; line-height: 1.8; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 13px; }
.kv dt { color: #79809a; } .kv dd { margin: 0; color: #e6e8ee; word-break: break-all; }
.pw-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; max-width: 620px; }

@media (max-width: 900px) {
  .admin.on { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: auto; min-height: 100vh; }
  .side { flex-direction: row; align-items: center; overflow-x: auto; }
  #sideNav { display: flex; padding: 6px; }
  #sideNav button { white-space: nowrap; width: auto; }
  .side-foot { display: none; }
  .content { padding: 14px; }
  .fgrid { grid-template-columns: 1fr; }
  .bi { grid-template-columns: 1fr; }
  .preview { width: 100vw; }
}
