:root {
  --adm-bg: #070d1c;
  --adm-side: #0a1230;
  --adm-card: #ffffff;
  --adm-accent: #3b82f6;
  --adm-accent2: #8b5cf6;
  --adm-text: #0f172a;
  --adm-muted: #64748b;
  --adm-line: rgba(120, 160, 255, 0.16);
}

* { box-sizing: border-box; }
html { height: 100%; }
body.adm-body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: "PingFang SC", "Segoe UI", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(ellipse 80% 45% at 0% -10%, rgba(59, 130, 246, 0.16), transparent 50%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(139, 92, 246, 0.12), transparent 48%),
    linear-gradient(165deg, #e8eefc, #eef2ff 40%, #f1f5f9);
  color: var(--adm-text);
}
body.adm-body:has(.adm-login) {
  height: auto;
  overflow: auto;
}

.adm-shell { display: flex; height: 100vh; max-height: 100vh; overflow: hidden; }

/* ===== 左侧导航 ===== */
.adm-sidebar {
  width: 248px;
  flex-shrink: 0;
  background:
    radial-gradient(ellipse 90% 40% at 0% 0%, rgba(59, 130, 246, 0.28), transparent 55%),
    linear-gradient(180deg, #070d1f 0%, #0c1530 50%, #050a16 100%);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(120, 170, 255, 0.22);
  box-shadow: 8px 0 28px rgba(0, 0, 0, 0.3);
  height: 100%;
  overflow: hidden;
  position: relative;
}
.adm-sidebar::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, #22d3ee, #6366f1 45%, #d946ef);
  opacity: .9;
  pointer-events: none;
}
.adm-logo {
  padding: 18px 16px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(120, 170, 255, 0.16);
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.2), rgba(139, 92, 246, 0.12));
}
.adm-logo-img {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 0 18px rgba(59, 130, 246, 0.45);
  flex-shrink: 0;
}
.adm-logo-text { min-width: 0; }
.adm-logo-text strong {
  display: block;
  font-size: 14px;
  font-weight: 750;
  letter-spacing: .02em;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 0 16px rgba(99, 102, 241, 0.45);
}
.adm-logo small {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: #7dd3fc;
  font-weight: 600;
  letter-spacing: .04em;
}
.adm-menu {
  list-style: none;
  margin: 0;
  padding: 12px 10px;
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, .4) transparent;
}
.adm-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  color: #a8b6d4;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  border: 1px solid transparent;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s, transform .12s;
  position: relative;
}
.adm-mi {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.14);
  color: #b6c4e0;
  font-size: 14px;
  flex-shrink: 0;
  transition: all .15s ease;
}
.adm-ml { min-width: 0; }
.adm-menu a:hover {
  color: #fff;
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(99, 140, 255, 0.28);
  transform: translateX(2px);
}
.adm-menu a:hover .adm-mi {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.4), rgba(139, 92, 246, 0.3));
  border-color: rgba(129, 140, 248, 0.45);
  color: #fff;
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.35);
}
.adm-menu a.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.34), rgba(139, 92, 246, 0.2));
  border-color: rgba(129, 140, 248, 0.42);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.25), inset 0 1px 0 rgba(255,255,255,.08);
}
.adm-menu a.active .adm-mi {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.55);
}
.adm-menu a.active::after {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #22d3ee, #8b5cf6);
}
.adm-side-foot {
  padding: 12px 16px 16px;
  font-size: 11px;
  color: #64748b;
  border-top: 1px solid rgba(120, 170, 255, 0.12);
  letter-spacing: .06em;
}

/* ===== 主区 ===== */
.adm-main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.adm-topbar {
  height: 58px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(120, 160, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}
.adm-top-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 750;
  color: #0f172a;
}
.adm-top-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  box-shadow: 0 0 10px rgba(99, 102, 241, .7);
}
.adm-topbar .who {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #475569;
  font-size: 13px;
}
.adm-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #c7d2fe;
  box-shadow: 0 2px 8px rgba(99, 102, 241, .25);
}
.adm-who-name {
  color: #0f172a;
  text-decoration: none;
  font-weight: 650;
}
.adm-who-name:hover { color: #4f46e5; }
.adm-logout {
  color: #6366f1;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid rgba(99, 102, 241, .25);
  font-weight: 600;
}
.adm-logout:hover {
  background: #eef2ff;
  color: #4338ca;
}
.adm-content { padding: 16px 18px 20px; flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.adm-alert { padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; font-size: 13px; }
.adm-alert.ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.adm-alert.err { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

.adm-page {
  background: linear-gradient(160deg, rgba(255,255,255,.98), rgba(241,245,255,.96));
  border: 1px solid rgba(140, 180, 255, 0.28);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255,255,255,.55);
  width: 100%;
  box-sizing: border-box;
}
.adm-title {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 750;
  background: linear-gradient(135deg, #1e293b, #4338ca);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.adm-page > .hint {
  margin: -4px 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: linear-gradient(90deg, #eef2ff, #f0f9ff);
  border: 1px solid #c7d2fe;
  color: #475569;
}
.adm-page > .hint a { color: #4f46e5; font-weight: 650; text-decoration: none; }
.adm-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.adm-page-desc {
  margin: 0 0 14px !important;
  line-height: 1.7;
}

.adm-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-bottom: 14px;
  align-items: flex-end;
  padding: 12px 14px;
  background: #f8faff;
  border: 1px solid rgba(140, 180, 255, 0.25);
  border-radius: 14px;
}
.adm-toolbar .hint {
  margin-bottom: 5px !important;
  color: #475569;
  font-weight: 650;
  font-size: 12px;
}
.adm-toolbar input, .adm-toolbar select {
  height: 36px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0 10px;
  min-width: 140px;
  background: #fff;
  font-size: 13px;
  transition: border-color .15s, box-shadow .15s;
}
.adm-toolbar input:focus, .adm-toolbar select:focus {
  outline: none;
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16);
}

.adm-table-wrap {
  overflow: auto;
  border: 1px solid rgba(140, 180, 255, 0.28);
  border-radius: 12px;
  background: #fff;
}
.adm-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: auto;
}
.adm-table th, .adm-table td {
  padding: 11px 10px;
  border-bottom: 1px solid #eef2f7;
  text-align: left;
  white-space: nowrap;
  vertical-align: middle;
}
.adm-table tbody tr:hover td { background: #f8faff; }
.adm-table tbody tr:last-child td { border-bottom: 0; }
.adm-table th.is-sort a { color: #4f46e5; }
.adm-table a.sort-link { color: inherit; text-decoration: none; white-space: nowrap; }
.adm-table a.sort-link:hover { color: #4f46e5; }
.adm-table th {
  background: linear-gradient(180deg, #eef2ff, #e0e7ff);
  color: #1e293b;
  font-weight: 750;
  font-size: 13px;
  letter-spacing: .02em;
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid rgba(99, 102, 241, 0.22);
}
.adm-table .empty { text-align: center; color: #94a3b8; padding: 28px !important; }
.adm-table .wrap { min-width: 180px; max-width: 260px; white-space: normal; }
.adm-pager {
  margin-top: 12px;
  padding: 10px 12px;
  color: #64748b;
  font-size: 12px;
  background: #f8faff;
  border-radius: 10px;
  border: 1px solid rgba(140, 180, 255, 0.2);
}

.adm-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 12px;
  margin-bottom: 14px;
}
@media (max-width: 1100px) { .adm-stats { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.adm-stat {
  border-radius: 14px;
  padding: 16px;
  color: #fff;
  min-height: 98px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  box-shadow: 0 10px 28px rgba(99, 102, 241, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.12);
  position: relative;
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
}
.adm-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(99, 102, 241, 0.35);
}
.adm-stat::after {
  content: "";
  position: absolute;
  right: -20px;
  top: -20px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
}
.adm-stat .l { opacity: .92; font-size: 13px; position: relative; z-index: 1; }
.adm-stat .v { font-size: 28px; font-weight: 750; margin-top: 8px; position: relative; z-index: 1; }
.adm-stat.g2 { background: linear-gradient(135deg, #059669, #22d3ee); }
.adm-stat.g3 { background: linear-gradient(135deg, #7c3aed, #d946ef); }
.adm-stat.g4 { background: linear-gradient(135deg, #ea580c, #f59e0b); }
.adm-stat.g5 { background: linear-gradient(135deg, #0f766e, #2dd4bf); }
.adm-stat.g6 { background: linear-gradient(135deg, #be123c, #fb7185); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
  background: #e2e8f0;
  color: #0f172a;
  transition: transform .12s ease, filter .12s ease;
}
.btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}
.btn-success { background: linear-gradient(135deg, #059669, #10b981); color: #fff; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-default { background: #fff; border-color: #e2e8f0; color: #334155; }
.btn-xs { height: 28px; padding: 0 10px; font-size: 12px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; }
.badge-done, .badge-normal, .badge-pub { background: #dcfce7; color: #166534; }
.badge-off { background: #f1f5f9; color: #64748b; }
.badge-wait { background: #ffedd5; color: #9a3412; }
.badge-reject, .badge-hidden { background: #fee2e2; color: #991b1b; }
.badge-after { background: #e0e7ff; color: #3730a3; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.form-row label { display: block; margin-bottom: 6px; font-size: 13px; color: #475569; font-weight: 600; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%;
  height: 38px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0 10px;
  transition: border-color .15s, box-shadow .15s;
}
.form-row textarea { height: auto; min-height: 90px; padding: 10px; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: none;
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16);
}
.hint { color: #64748b; font-size: 12px; }

.modal-mask {
  position: fixed; inset: 0; background: rgba(4, 7, 15, .58); z-index: 40;
  display: none; align-items: center; justify-content: center; padding: 16px;
  backdrop-filter: blur(4px);
}
.modal {
  background: #fff;
  width: min(520px, 100%);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(140, 180, 255, 0.3);
  box-shadow: 0 24px 60px rgba(0,0,0,.4);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  font-weight: 700;
  background: linear-gradient(135deg, #1e3a8a 0%, #4f46e5 48%, #7c3aed 100%);
  color: #fff;
}
.modal-header button {
  border: 0;
  background: rgba(255,255,255,.14);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  color: #e2e8f0;
}
.modal-header button:hover { background: rgba(255,255,255,.24); color: #fff; }
.modal-body { padding: 16px; background: linear-gradient(180deg, #f8faff, #fff); }
.modal-footer {
  padding: 12px 16px;
  border-top: 1px solid #eef2f7;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* login */
.adm-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(59, 130, 246, .4), transparent 45%),
    radial-gradient(ellipse at 85% 0%, rgba(217, 70, 239, .28), transparent 40%),
    radial-gradient(ellipse at 50% 100%, rgba(34, 211, 238, .12), transparent 50%),
    linear-gradient(160deg, #050816, #0a1024 55%, #101a36);
  padding: 24px;
}
.adm-login-card {
  width: min(420px, 100%);
  background: rgba(255, 255, 255, .97);
  border-radius: 16px;
  padding: 28px 24px;
  border: 1px solid rgba(140, 180, 255, 0.3);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 40px rgba(99, 102, 241, 0.22);
}
.adm-login-card h1 {
  margin: 0 0 6px;
  background: linear-gradient(135deg, #2563eb, #8b5cf6 50%, #d946ef);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.adm-login-card .sub { color: #64748b; margin-bottom: 18px; font-size: 13px; }
.adm-login-card p { margin: 0 0 18px; color: #64748b; font-size: 13px; }
.adm-login-card .form-row { margin-bottom: 12px; }
.adm-login-card .btn { width: 100%; height: 42px; margin-top: 8px; border: none; }
.errtips { background: #fef2f2; color: #b91c1c; padding: 8px 10px; border-radius: 8px; margin-bottom: 12px; font-size: 13px; }

/* 媒体价格页：价格输入更醒目 */
.adm-table input[type="number"],
.adm-table input[name^="price"] {
  height: 32px;
  width: 90px;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  padding: 0 8px;
  font-weight: 650;
  color: #4338ca;
  background: #f8faff;
}
.adm-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #6366f1;
}

@media (max-width: 900px) {
  .adm-shell { flex-direction: column; height: auto; max-height: none; overflow: visible; }
  body.adm-body { height: auto; overflow: auto; }
  .adm-sidebar {
    width: 100%;
    height: auto;
    max-height: none;
  }
  .adm-menu {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 8px;
  }
  .adm-menu li { flex-shrink: 0; }
  .adm-menu a { margin-bottom: 0; margin-right: 6px; }
  .adm-side-foot { display: none; }
  .adm-main { overflow: visible; }
  .adm-content { overflow: visible; }
}
