/* ============ 浅时光数码银盐冲印 - 后台管理样式 ============ */
:root {
  --primary: #1677ff;
  --bg: #f2f5f9;
  --card: #fff;
  --text: #1f2937;
  --muted: #8a94a6;
  --border: #e3e8ef;
  --danger: #e5484d;
  --radius: 12px;
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", -apple-system, system-ui, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.55; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 12px; }

/* 按钮 */
.btn {
  border: none; border-radius: 10px; padding: 9px 16px; font-size: 14px;
  font-family: var(--font); cursor: pointer; transition: filter .15s, transform .1s;
  background: var(--border); color: var(--text);
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: #fff; border: 1.5px solid var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: #fdecec; color: var(--danger); }
.btn-danger:hover { background: #fbdcdc; }
.btn-sm { padding: 5px 12px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-lg { padding: 12px 16px; font-weight: 600; }

/* 输入 */
.field {
  width: 100%; border: 1.5px solid var(--border); border-radius: 10px;
  padding: 9px 12px; font-size: 14px; font-family: var(--font);
  background: #fff; margin-bottom: 12px;
}
.field:focus { outline: none; border-color: var(--primary); }
.field-label { display: block; font-size: 12px; color: var(--muted); margin: 8px 0 4px; }
.field-row { display: flex; gap: 10px; }
.field-row > div { flex: 1; }
.file-field { padding: 7px 10px; cursor: pointer; }

/* ---------- 登录 ---------- */
.login-view {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0e5fd8 0%, #1677ff 60%, #38a0ff 100%); padding: 20px;
}
.login-card {
  background: #fff; border-radius: 18px; padding: 34px 30px; width: 100%; max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,.28); text-align: center;
}
.login-card h1 { font-size: 22px; color: var(--primary); }
.login-sub { color: var(--muted); font-size: 13px; margin: 6px 0 22px; }
.login-card .btn { margin-top: 6px; }
.login-error { color: var(--danger); font-size: 13px; margin-top: 12px; }
.back-link { display: inline-block; margin-top: 18px; color: var(--muted); font-size: 13px; text-decoration: none; }
.back-link:hover { color: var(--primary); }

/* ---------- 主界面 ---------- */
.admin-topbar {
  background: linear-gradient(135deg, #0e5fd8 0%, #1677ff 60%, #38a0ff 100%);
  color: #fff; padding: 14px 20px; position: sticky; top: 0; z-index: 50;
}
.topbar-inner { max-width: 1080px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.admin-topbar h1 { font-size: 18px; }

.tabs {
  max-width: 1080px; margin: 0 auto; padding: 16px 16px 0;
  display: flex; gap: 8px; flex-wrap: wrap;
}
.tab {
  border: none; background: transparent; padding: 9px 18px; font-size: 14px;
  font-family: var(--font); cursor: pointer; color: var(--muted);
  border-radius: 20px; transition: all .15s;
}
.tab:hover { background: #e8edf5; }
.tab.active { background: var(--primary); color: #fff; font-weight: 600; }

.admin-main { max-width: 1080px; margin: 0 auto; padding: 16px 16px 60px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.panel-card {
  background: var(--card); border-radius: var(--radius); padding: 22px;
  box-shadow: 0 2px 12px rgba(20,40,80,.06); margin-bottom: 16px;
}
.panel-card h2 { font-size: 16px; margin-bottom: 4px; }
.panel-narrow { max-width: 520px; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.panel-head h2 { font-size: 17px; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 14px;
}
.table th { color: var(--muted); font-weight: 600; font-size: 12px; background: #f8fafc; }
.table tr:hover td { background: #fafcff; }
.table .ops { display: flex; gap: 6px; flex-wrap: wrap; }
.empty { color: var(--muted); text-align: center; padding: 30px 0; }

/* 开关 */
.switch-row {
  display: flex; align-items: center; gap: 10px; font-size: 14px;
  margin: 14px 0; cursor: pointer; user-select: none;
}
.switch-row input { display: none; }
.switch-row .switch {
  width: 42px; height: 24px; border-radius: 12px; background: #ccd3dd;
  position: relative; transition: background .2s; flex: none;
}
.switch-row .switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.switch-row input:checked + .switch { background: var(--primary); }
.switch-row input:checked + .switch::after { left: 21px; }

/* 弹窗 */
.modal {
  position: fixed; inset: 0; background: rgba(10,14,20,.6); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.modal-box {
  background: #fff; border-radius: 16px; width: 100%; max-width: 560px;
  max-height: 92vh; overflow: auto; box-shadow: 0 18px 60px rgba(0,0,0,.3);
}
.modal-sm { max-width: 460px; }
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--border); font-weight: 700;
  position: sticky; top: 0; background: #fff; z-index: 2;
}
.modal-close { border: none; background: none; font-size: 16px; cursor: pointer; color: var(--muted); padding: 4px 8px; }
.modal-body { padding: 18px; }
.modal-btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

.save-msg { margin-top: 12px; font-size: 13px; color: #16a34a; }
.save-msg.error { color: var(--danger); }
.tag-builtin {
  display: inline-block; background: #eef5ff; color: var(--primary);
  font-size: 12px; padding: 2px 10px; border-radius: 20px;
}
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.upload-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; margin-top: 10px; }
.upload-form .field { margin-bottom: 0; }

@media (max-width: 720px) {
  .upload-form { grid-template-columns: 1fr; }
  .field-row { flex-direction: column; gap: 0; }
}
