:root {
  --sider: #0f172a;
  --bg: #f1f5f9;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --indigo: #6366f1;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 14px/1.5 "PingFang SC", "Noto Sans SC", ui-sans-serif, system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
a { color: #4f46e5; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button:disabled { opacity: .6; cursor: not-allowed; }

/* —— Layout —— */
.admin-layout {
  display: flex;
  min-height: 100vh;
  background: #f1f5f9;
}
.sider {
  width: 232px;
  flex-shrink: 0;
  background: var(--sider);
  color: #94a3b8;
  box-shadow: 2px 0 12px rgba(0, 0, 0, .2);
  z-index: 20;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.logo-box {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.logo-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #6366f1, #ec4899);
  color: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(99, 102, 241, .5);
  flex-shrink: 0;
}
.logo-text {
  font-size: 1.15rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -.02em;
  white-space: nowrap;
}
.logo-text span {
  font-size: .72rem;
  color: #94a3b8;
  font-weight: 400;
  margin-left: 4px;
}
.menu {
  padding: 8px 8px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, .35) transparent;
}
.menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #94a3b8;
  padding: 8px 12px;
  margin: 1px 4px;
  border-radius: 8px;
}
.menu a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.menu a.on {
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(99, 102, 241, .4);
}
.menu .mi {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.menu-group {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #64748b;
  padding: 14px 16px 4px;
  white-space: nowrap;
}

.main-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #f8fafc;
}
.admin-header {
  min-height: 64px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .03);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 10px 24px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.2;
  min-width: 0;
}
.page-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.3;
}
.page-desc {
  font-size: .76rem;
  color: #64748b;
  margin-top: 3px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.preview-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border: 1px dashed #cbd5e1;
  color: #475569;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
}
.preview-btn:hover { color: #4f46e5; border-color: #6366f1; }
.preview-btn svg { width: 14px; height: 14px; }
.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 14px;
  border-left: 1px solid #e2e8f0;
}
.user-badge {
  background: #eff6ff;
  color: #2563eb;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.4;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-badge svg { width: 12px; height: 12px; }
.logout-form { display: inline-flex; margin: 0; }
.logout {
  color: #ef4444;
  font-size: .86rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.4;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}
.logout:hover { color: #dc2626; }
.logout svg { width: 14px; height: 14px; }

.content-wrap {
  margin: 20px 24px;
  flex: 1;
  min-width: 0;
}
.content-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .02);
  min-height: calc(100vh - 124px);
  min-width: 0;
}
.content-card.is-dashboard {
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
}

.flash, .err {
  padding: 10px 12px;
  border-radius: 8px;
  margin: 0 0 16px;
  border: 1px solid transparent;
}
.flash {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}
.err {
  background: #fff1f2;
  color: #be123c;
  border-color: #fecdd3;
}

/* —— Dashboard —— */
.dashboard-wrap { padding: 4px; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.stat-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 22px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
  position: relative;
  overflow: hidden;
  transition: all .25s ease;
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, .08);
}
.stat-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}
.card-indigo::after { background: #6366f1; }
.card-sky::after { background: #0ea5e9; }
.card-purple::after { background: #a855f7; }
.card-pink::after { background: #ec4899; }
.card-amber::after { background: #f59e0b; }
.card-emerald::after { background: #059669; }
.stat-main { display: flex; flex-direction: column; min-width: 0; }
.stat-title { font-size: .88rem; color: #64748b; font-weight: 600; }
.stat-val {
  font-size: 2rem;
  font-weight: 900;
  color: #0f172a;
  margin: 6px 0 2px;
  letter-spacing: -.02em;
}
.stat-val.small { font-size: 1.05rem; font-weight: 800; word-break: break-all; }
.stat-tip { font-size: .75rem; color: #94a3b8; word-break: break-all; }
.stat-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon-wrap svg { width: 26px; height: 26px; }
.card-indigo .stat-icon-wrap { background: #eef2ff; color: #6366f1; }
.card-sky .stat-icon-wrap { background: #f0f9ff; color: #0ea5e9; }
.card-purple .stat-icon-wrap { background: #faf5ff; color: #a855f7; }
.card-pink .stat-icon-wrap { background: #fdf2f8; color: #ec4899; }
.card-amber .stat-icon-wrap { background: #fffbeb; color: #d97706; }

.visit-panel { margin-top: 24px; }
.visit-sum {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin: 0 0 14px;
  color: #64748b;
  font-size: 0.92rem;
}
.visit-sum strong {
  color: #0f172a;
  font-size: 1.15rem;
  margin-left: 6px;
}
.dash-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-top: 24px;
}
.panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .03);
  padding: 16px 20px 20px;
}
.panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
}
.panel-title svg { width: 18px; height: 18px; }
.icon-gold { color: #f59e0b; }
.icon-blue { color: #3b82f6; }
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.action-item {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  transition: all .2s;
}
.action-item:hover {
  border-color: #6366f1;
  box-shadow: 0 4px 12px rgba(99, 102, 241, .12);
  transform: translateY(-2px);
}
.action-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.action-icon-box svg { width: 20px; height: 20px; }
.box-indigo { background: #eef2ff; color: #6366f1; }
.box-purple { background: #faf5ff; color: #a855f7; }
.box-sky { background: #f0f9ff; color: #0284c7; }
.box-pink { background: #fdf2f8; color: #db2777; }
.box-amber { background: #fffbeb; color: #d97706; }
.box-emerald { background: #ecfdf5; color: #059669; }
.action-text h4 { margin: 0 0 2px; font-size: .95rem; font-weight: 700; color: #0f172a; }
.action-text p { margin: 0; font-size: .76rem; color: #64748b; }
.sys-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #e2e8f0;
  gap: 12px;
}
.sys-item:last-child { border-bottom: none; }
.sys-label { font-size: .88rem; color: #64748b; }
.sys-val { font-size: .88rem; font-weight: 600; color: #0f172a; text-align: right; }
.type-panel { margin-top: 20px; }

/* —— CRUD —— */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}
.filter-group, .toolbar-actions, .row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.filter-group input, .toolbar-actions input, .row input[name="term"] {
  width: 260px;
  max-width: 100%;
  height: 36px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 4px 11px;
  background: #fff;
}
.filter-group input:focus, .toolbar-actions input:focus,
.form input:focus, .form textarea:focus, .form select:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .18);
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.table th, .table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.table th {
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  background: #f8fafc;
  white-space: nowrap;
}
.table tbody tr:hover { background: #fafafa; }
.link-table input, .link-table select { width: 100%; min-width: 0; }
#ad-table td:first-child { width: auto; }
.pic-cell img { width: 128px; height: 48px; object-fit: contain; background: #f1f5f9; display: block; margin-bottom: 6px; border-radius: 4px; }
.pic-cell input[type=file] { width: 150px; font-size: 12px; }
.link-table td:first-child { width: 22%; }
.link-table td:nth-child(3) { width: 110px; }
.link-add-row { margin: 12px 0 4px; }
.table tbody tr:last-child td { border-bottom: 0; }
.table code { font-size: 12px; word-break: break-all; color: #475569; }
.name-cell { max-width: 420px; }
.name-cell a { color: #0f172a; font-weight: 600; }
.name-cell a:hover { color: #4f46e5; }
.ops { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; white-space: nowrap; }
.ops form { display: inline; }

.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  font-size: 12px;
  border-radius: 4px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.tag-blue { background: #e6f4ff; color: #1677ff; border-color: #91caff; }
.tag-green { background: #f6ffed; color: #389e0d; border-color: #b7eb8f; }
.tag-red { background: #fff1f0; color: #cf1322; border-color: #ffa39e; }
.tag-gold { background: #fffbe6; color: #d48806; border-color: #ffe58f; }
.tag-default { background: #fafafa; color: #8c8c8c; border-color: #d9d9d9; }

.form { display: flex; flex-direction: column; gap: 4px; }
.form.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}
.form.grid2 .full { grid-column: 1 / -1; }
.form label, .form .check {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #475569;
  font-size: 13px;
  font-weight: 500;
}
.form .check { flex-direction: row; align-items: center; margin-top: 18px; font-weight: 400; }
.form input, .form textarea, .form select {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 11px;
  background: #fff;
  color: #0f172a;
  min-height: 36px;
}
.form textarea.tall { min-height: 220px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.form-actions { margin: 8px 0 16px; }
.form .hint { font-weight: 400; }
.form-panel {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px 18px 8px;
  margin-bottom: 16px;
}
.content-card.is-dashboard .form-panel {
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.form-panel h2, .settings-content-card h2 { margin: 0 0 12px; font-size: 15px; font-weight: 700; }
.hint { color: var(--muted); font-size: 13px; margin: 0 0 12px; line-height: 1.55; }
.gap-top { margin-top: 12px; }
.empty { color: var(--muted); padding: 40px 0; text-align: center; }
.pager {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  margin-top: 18px;
  color: #64748b;
}
.pager a {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #334155;
  background: #fff;
}
.pager a:hover { border-color: #6366f1; color: #4f46e5; }

button, .ghost, .create-btn {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(99, 102, 241, .25);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
button:hover, .create-btn:hover { filter: brightness(1.05); }
.ghost {
  background: #fff;
  color: #334155;
  border: 1px solid #e2e8f0;
  box-shadow: none;
}
a.ghost, a.create-btn { text-decoration: none; height: 32px; padding: 0 12px; }
.danger { background: #ef4444; box-shadow: 0 4px 12px rgba(239, 68, 68, .25); }
.link { background: none; border: 0; color: #4f46e5; padding: 0; cursor: pointer; box-shadow: none; font-weight: 500; }
.danger-text { color: #ef4444; }

.table-scroll, .table-wrap { overflow-x: auto; }

.hot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.panel-head h2 { margin: 0; }
.meta { color: #64748b; font-size: 12px; white-space: nowrap; }
.chip-box {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
  min-height: 72px;
  max-height: 220px;
  overflow: auto;
  padding: 12px;
  margin: 0 0 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}
.chip-box .hint { margin: 0; }
.chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hot-card .form-actions { margin-bottom: 0; }
.toolbar > .hint { margin: 0; flex: 1; min-width: 0; }
.seg {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}
.seg a.ghost, .seg a.create-btn { box-shadow: none; }
.ad-list { display: flex; flex-direction: column; gap: 10px; }
.ad-row {
  display: grid;
  gap: 10px 12px;
  align-items: end;
  padding: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}
.ad-row.kind-text { grid-template-columns: minmax(110px, .8fr) minmax(160px, 1.4fr) minmax(100px, .8fr) 96px auto; }
.ad-row.kind-media { grid-template-columns: 160px minmax(100px, .7fr) minmax(160px, 1.4fr) 96px auto; }
.ad-row.kind-banner {
  grid-template-columns: 200px 120px 220px 96px minmax(max-content, 1fr);
  align-items: end;
}
.ad-row label { min-width: 0; font-size: 12px; }
.ad-row .ops { display: flex; gap: 6px; flex-wrap: nowrap; justify-content: flex-end; }
.ad-row .ghost { height: 36px; padding: 0 10px; box-shadow: none; }
.ad-row .pic-cell { display: flex; flex-direction: column; gap: 6px; }
.ad-row .pic-cell img { width: 160px; height: 64px; margin: 0; object-fit: contain; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; }
.ad-row.kind-banner .pic-cell img {
  width: 200px;
  height: 36px;
  object-fit: cover;
  object-position: center;
}
#ad-modal-body .pic-cell img { width: 100%; max-width: 432px; height: 72px; margin-bottom: 8px; }
.ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-swatch {
  display: inline-block;
  width: 48px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--line);
  vertical-align: middle;
}
.t-indigo { background: linear-gradient(135deg, #eef2ff, #4f46e5 90%); }
.t-night { background: linear-gradient(135deg, #0f1115, #818cf8 120%); }
.t-sea { background: linear-gradient(135deg, #f0fdfa, #0f766e 90%); }
.t-clay { background: linear-gradient(135deg, #faf6f1, #c2410c 90%); }
.t-rose { background: linear-gradient(135deg, #fff1f2, #e11d48 90%); }

.modal-mask {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: 1000;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 24px 24px;
  overflow: auto;
}
.modal-mask.is-open { display: flex; }
.modal {
  width: 720px;
  max-width: 100%;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .12), 0 9px 28px 8px rgba(0, 0, 0, .05);
  display: flex;
  flex-direction: column;
}
.modal.modal-sm { width: 480px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid #f0f0f0;
}
.modal-header h3 { margin: 0; font-size: 16px; font-weight: 600; }
.modal-x {
  background: none;
  border: 0;
  box-shadow: none;
  color: #8c8c8c;
  font-size: 20px;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
}
.modal-x:hover { color: #1f1f1f; }
.modal-body {
  padding: 20px 24px;
  max-height: calc(100vh - 240px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid #f0f0f0;
}
.modal-footer .ghost { box-shadow: none; }
.form input[readonly] { background: #f5f5f5; color: #64748b; }

.settings-header-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
  margin-bottom: 20px;
  gap: 16px;
}
.settings-info { display: flex; align-items: center; gap: 16px; }
.settings-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, .3);
  flex-shrink: 0;
}
.settings-icon svg { width: 24px; height: 24px; }
.settings-texts h3 { margin: 0 0 4px; font-size: 1.25rem; font-weight: 700; }
.settings-texts p { margin: 0; font-size: .88rem; color: #64748b; }
.settings-content-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .04);
  padding: 24px;
}
.term-list { list-style: none; padding: 0; margin: 12px 0 0; }
.term-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}

/* —— Login —— */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f172a;
  position: relative;
  overflow: hidden;
  padding: 20px;
}
.login-bg-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
}
.glow-1 { top: -150px; left: -150px; background: rgba(99, 102, 241, .25); }
.glow-2 { bottom: -150px; right: -150px; background: rgba(236, 72, 153, .2); }
.login-card {
  width: 100%;
  max-width: 420px;
  background: rgba(30, 41, 59, .85);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, .4);
  backdrop-filter: blur(16px);
  position: relative;
  z-index: 10;
}
.login-header { text-align: center; margin-bottom: 32px; }
.login-logo {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, #6366f1, #ec4899);
  color: #fff;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(99, 102, 241, .5);
}
.login-header h2 {
  margin: 0 0 6px;
  font-size: 1.45rem;
  font-weight: 800;
  color: #f8fafc;
}
.login-header p { margin: 0; font-size: .85rem; color: #94a3b8; }
.login-card .form label { color: #cbd5e1; font-weight: 500; }
.login-card .form { gap: 14px; }
.login-card input {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, .12);
  color: #fff;
  border-radius: 10px;
  height: 44px;
  min-height: 44px;
  padding: 0 12px 0 38px;
  width: 100%;
}
.login-card .field { position: relative; }
.login-card .field svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: rgba(255, 255, 255, .45);
}
.login-card input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .25);
}
.login-btn {
  height: 44px;
  border-radius: 10px;
  font-weight: 700;
  font-size: .95rem;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border: none;
  box-shadow: 0 4px 14px rgba(99, 102, 241, .4);
  margin-top: 12px;
  width: 100%;
  justify-content: center;
  color: #fff;
}
.login-btn:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  transform: translateY(-1px);
}
.login-back { margin: 18px 0 0; text-align: center; }
.login-back a { color: #94a3b8; font-size: 13px; }
.login-back a:hover { color: #e2e8f0; }
.login-card .err {
  background: rgba(239, 68, 68, .12);
  color: #fda4af;
  border-color: transparent;
  padding: 8px 12px;
  border-radius: 8px;
}

@media (max-width: 1200px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-row, .hot-grid { grid-template-columns: 1fr; }
  .ad-row.kind-text, .ad-row.kind-media { grid-template-columns: 1fr 1fr; }
  .ad-row.kind-text .ops, .ad-row.kind-media .ops, .ad-row.kind-media .pic-cell { grid-column: 1 / -1; }
  .ad-row.kind-media .pic-cell img { width: 100%; max-width: 280px; }
  .ad-row.kind-banner { grid-template-columns: 160px 96px 180px 84px minmax(max-content, 1fr); }
  .ad-row.kind-banner .pic-cell img { width: 160px; }
}
@media (max-width: 860px) {
  .sider { width: 72px; }
  .logo-text, .menu-group, .menu a span { display: none; }
  .menu a { justify-content: center; padding: 10px 6px; margin: 2px 8px; }
  .stat-grid, .quick-actions-grid, .form.grid2 { grid-template-columns: 1fr; }
  .admin-header { flex-wrap: wrap; padding: 12px 16px; }
  .page-desc { white-space: normal; }
  .content-wrap { margin: 12px; }
  .content-card { padding: 16px; }
  .user-profile { padding-left: 0; border-left: 0; }
}

html { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
input[type="checkbox"] { accent-color: #4f46e5; width: 16px; height: 16px; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path fill='%2364758b' d='M5.2 7.4a.9.9 0 0 1 1.3 0L10 10.9l3.5-3.5a.9.9 0 1 1 1.3 1.3l-4.2 4.1a.9.9 0 0 1-1.2 0L5.2 8.7a.9.9 0 0 1 0-1.3z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  padding-right: 32px;
}
.form select {
  background-color: #fff;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path fill='%2364758b' d='M5.2 7.4a.9.9 0 0 1 1.3 0L10 10.9l3.5-3.5a.9.9 0 1 1 1.3 1.3l-4.2 4.1a.9.9 0 0 1-1.2 0L5.2 8.7a.9.9 0 0 1 0-1.3z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
}
input[type="file"]::file-selector-button {
  margin-right: 10px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  background: #fff;
  padding: 6px 10px;
  font: inherit;
  color: #334155;
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover { border-color: #6366f1; color: #4f46e5; }
