.admin-body {
  padding-top: 0;
  min-height: 100vh;
}

/* 覆盖商城全局 fixed header，避免挡住下方选项卡 */
.admin-body header,
.admin-body .admin-header {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  z-index: 1;
  background: transparent;
  border-bottom: none;
  backdrop-filter: none;
}

.admin-wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  position: relative;
  z-index: 1;
}

.admin-wrap-wide {
  max-width: 1100px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  backdrop-filter: blur(8px);
}

.admin-card h1 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}

.admin-tip {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 18px;
}

.admin-client-box {
  border: 1px solid rgba(46, 230, 255, 0.35);
  background: rgba(46, 230, 255, 0.08);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
}

.admin-client-box strong {
  display: block;
  margin-bottom: 6px;
  color: var(--primary);
  font-family: var(--font-ui);
}

.admin-client-box p {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.admin-client-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.admin-client-actions .btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.admin-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.admin-live-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #0d2a33;
  background: #2ee6ff;
  vertical-align: middle;
}

.admin-live-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #0a8a4a;
  box-shadow: 0 0 0 0 rgba(10, 138, 74, 0.7);
  animation: admin-live-pulse 1.6s infinite;
}

@keyframes admin-live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(10, 138, 74, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(10, 138, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(10, 138, 74, 0); }
}

.admin-inline-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  position: relative;
  z-index: 2;
}

.admin-tab {
  border: 1px solid var(--border);
  background: rgba(7, 11, 20, 0.55);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 8px 14px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.03em;
}

.admin-tab:hover {
  color: var(--primary);
  border-color: rgba(46, 230, 255, 0.4);
}

.admin-tab.active {
  color: var(--primary);
  background: rgba(46, 230, 255, 0.12);
  border-color: rgba(46, 230, 255, 0.45);
}

.admin-tab-panel {
  display: none;
}

.admin-tab-panel.active {
  display: block;
}

.admin-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 8px 0 24px;
}

.admin-chart-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 14px 8px;
  background: rgba(7, 11, 20, 0.45);
  min-height: 280px;
}

.admin-chart-card h3 {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-weight: 600;
}

.admin-chart-card canvas {
  width: 100% !important;
  height: 220px !important;
}

@media (max-width: 900px) {
  .admin-chart-grid {
    grid-template-columns: 1fr;
  }
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 24px;
}

.admin-stat-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  background: rgba(7, 11, 20, 0.45);
}

.admin-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.admin-stat-value {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--primary);
  letter-spacing: 0.03em;
}

.admin-stat-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.admin-upload {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 28px;
  background: rgba(7, 11, 20, 0.45);
}

.admin-upload .form-group {
  margin-bottom: 12px;
}

.admin-product-toolbar {
  margin: 0 0 12px;
}

.admin-check-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 13px;
}

.admin-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.admin-pill.on {
  color: #0d2a33;
  background: #2ee6ff;
}

.admin-pill.off {
  color: #f3d2d6;
  background: rgba(255, 92, 108, 0.28);
}

.admin-table tr.is-hidden-product td {
  opacity: 0.62;
}

.admin-gallery-box {
  margin-top: 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  background: rgba(7, 11, 20, 0.45);
}

.admin-gallery-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.admin-gallery-item {
  width: 110px;
}

.admin-gallery-item img {
  width: 110px;
  height: 82px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
  margin-bottom: 6px;
}

.admin-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0b1220;
  display: block;
}

.admin-img-preview {
  display: block;
  width: 160px;
  height: 120px;
  object-fit: cover;
  margin-top: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0b1220;
}

.admin-upload select,
.admin-upload input[type="text"],
.admin-upload input[type="number"],
.admin-upload input[type="password"],
.admin-upload input[type="file"],
.admin-upload textarea,
#loginCard input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(7, 11, 20, 0.75);
  color: var(--text);
  font-family: inherit;
}

.admin-upload textarea {
  resize: vertical;
  min-height: 72px;
}

.admin-upload label,
#loginCard label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.admin-form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
}

.admin-status {
  margin-top: 10px;
  font-size: 13px;
  color: var(--primary);
  min-height: 1.2em;
}

.admin-status.error {
  color: var(--danger);
}

.admin-sub {
  font-size: 1rem;
  margin-bottom: 12px;
  font-family: var(--font-ui);
  color: var(--primary);
}

.admin-file-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-product-block {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: rgba(7, 11, 20, 0.4);
}

.admin-product-block h3 {
  font-size: 14px;
  margin-bottom: 10px;
}

.admin-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid rgba(46, 230, 255, 0.08);
  font-size: 13px;
}

.admin-file-row:first-of-type {
  border-top: none;
}

.admin-file-actions,
.admin-row-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: center;
}

.admin-file-actions a,
.admin-file-actions button,
.admin-row-actions button {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--primary);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
}

.admin-file-actions button.danger,
.admin-row-actions button.danger,
.link-btn.danger {
  color: var(--danger);
  border-color: rgba(255, 92, 108, 0.4);
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 640px;
}

.admin-table th,
.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(46, 230, 255, 0.08);
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  background: rgba(7, 11, 20, 0.65);
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-click-row {
  cursor: pointer;
}

.admin-click-row:hover td {
  background: rgba(46, 230, 255, 0.05);
}

.admin-empty {
  color: var(--text-muted);
  text-align: center !important;
}

.admin-addr-cell {
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-detail {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  background: rgba(7, 11, 20, 0.4);
  font-size: 13px;
}

.admin-detail h3 {
  margin-bottom: 8px;
  font-size: 15px;
}

.admin-detail ul {
  margin: 8px 0;
  padding-left: 18px;
}

@media (max-width: 900px) {
  .admin-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .admin-stats {
    grid-template-columns: 1fr;
  }

  .admin-upload .form-row {
    flex-direction: column;
  }
}

.admin-advanced { margin-top: 16px; color: var(--text-muted); font-size: 13px; }
.admin-advanced summary { cursor: pointer; color: var(--primary); }

