﻿:root {
  color-scheme: dark;
  --black: #031510;
  --panel: #0b2924;
  --panel-2: #0e2c2c;
  --text: #f4fbf8;
  --muted: rgba(244, 251, 248, 0.64);
  --line: rgba(244, 251, 248, 0.13);
  --gold: #72c900;
  --wine: #0872bf;
  --jade: #00965c;
  --radius: 8px;
  font-family:
    "Inter", "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui,
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 0%, rgba(8, 123, 211, 0.2), transparent 28rem),
    radial-gradient(circle at 92% 10%, rgba(0, 150, 92, 0.18), transparent 26rem),
    linear-gradient(180deg, #031510, #06241f 54%, #031510);
  font-size: 15px;
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 26px;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: rgba(3, 21, 16, 0.78);
  backdrop-filter: blur(22px);
}

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

.admin-brand span,
.login-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 4px;
  border: 1px solid rgba(114, 201, 0, 0.56);
  border-radius: 50%;
  overflow: hidden;
  color: var(--gold);
  font-weight: 850;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(226, 247, 235, 0.78)),
    #ffffff;
  box-shadow:
    0 0 0 4px rgba(114, 201, 0, 0.08),
    0 16px 38px rgba(0, 0, 0, 0.28);
}

.admin-brand span img,
.login-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.admin-brand strong {
  font-size: 1.04rem;
}

.admin-menu {
  display: grid;
  align-content: start;
  gap: 8px;
}

.admin-menu button,
.admin-sidebar-foot a,
.admin-sidebar-foot button {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--muted);
  text-align: left;
  background: transparent;
}

.admin-menu button.active,
.admin-menu button:hover,
.admin-sidebar-foot a:hover,
.admin-sidebar-foot button:hover {
  color: var(--text);
  border-color: rgba(114, 201, 0, 0.28);
  background: rgba(255, 255, 255, 0.06);
}

.admin-sidebar-foot {
  display: grid;
  gap: 8px;
}

.admin-sidebar-foot button {
  width: 100%;
}

.admin-main {
  min-width: 0;
  padding: 28px;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  margin: -28px -28px 24px;
  padding: 24px 28px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 5, 5, 0.72);
  backdrop-filter: blur(22px);
}

.admin-kicker {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 850;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 2rem;
  line-height: 1.1;
}

h2 {
  margin-bottom: 0;
  font-size: 1rem;
}

.topbar-actions,
.form-actions,
.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.form-pair,
.banner-metric-editor {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.banner-metric-editor {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.primary-admin-button,
.ghost-admin-button,
.danger-button,
.panel-heading button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(244, 251, 248, 0.14);
  border-radius: 7px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
}

.primary-admin-button {
  color: #031510;
  border-color: rgba(114, 201, 0, 0.62);
  background: var(--gold);
}

.danger-button {
  border-color: rgba(8, 123, 211, 0.42);
  color: #ffd7dd;
  background: rgba(8, 123, 211, 0.14);
}

.admin-view {
  display: none;
}

.admin-view.active {
  display: block;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.stat-card,
.admin-panel,
.record-item,
.login-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    rgba(16, 17, 18, 0.88);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.26);
}

.stat-card {
  min-height: 126px;
  display: grid;
  align-content: end;
  gap: 10px;
  padding: 18px;
}

.stat-card span,
.panel-heading span,
.record-item small,
.login-card p,
.guide-list p,
.upload-note {
  color: var(--muted);
}

.stat-card strong {
  font-size: 2.35rem;
  line-height: 1;
}

.dashboard-grid,
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.78fr);
  gap: 16px;
}

.admin-panel {
  min-width: 0;
  padding: 16px;
}

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

.status-list,
.compact-list,
.record-list,
.banner-image-list {
  display: grid;
  gap: 10px;
}

.status-row,
.compact-row,
.record-item,
.banner-image-item {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(244, 251, 248, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.status-row {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.banner-image-item {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.status-row strong,
.compact-row strong,
.record-item strong {
  line-height: 1.35;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  color: #031510;
  font-size: 0.76rem;
  background: var(--gold);
}

.admin-search {
  min-height: 48px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.admin-search span,
.admin-form label span,
.login-card label span {
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 780;
}

.admin-search input,
.admin-form input,
.admin-form textarea,
.admin-form select,
.login-card input,
.json-box {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(244, 251, 248, 0.12);
  border-radius: 7px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.22);
  outline: 0;
}

.admin-search input {
  border: 0;
  background: transparent;
}

.admin-form {
  display: grid;
  gap: 12px;
}

.admin-form label,
.login-card label {
  display: grid;
  gap: 7px;
}

.admin-form input,
.admin-form textarea,
.admin-form select,
.login-card input,
.json-box {
  padding: 11px 12px;
}

.admin-form textarea,
.json-box {
  resize: vertical;
  line-height: 1.6;
}

.record-item {
  cursor: pointer;
  transition:
    border-color 220ms ease,
    background 220ms ease,
    transform 220ms ease;
}

.record-item:hover,
.record-item.active {
  border-color: rgba(114, 201, 0, 0.42);
  background: rgba(114, 201, 0, 0.08);
  transform: translateY(-1px);
}

.record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.banner-image-item button {
  min-height: 34px;
  padding: 0 10px;
}

.upload-note {
  padding: 12px;
  border: 1px dashed rgba(114, 201, 0, 0.34);
  border-radius: var(--radius);
  line-height: 1.65;
  background: rgba(114, 201, 0, 0.07);
}

.settings-actions {
  margin-bottom: 12px;
}

.guide-list {
  display: grid;
  gap: 10px;
}

.guide-list p {
  margin-bottom: 0;
  line-height: 1.7;
}

.login-gate {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at 50% 20%, rgba(114, 201, 0, 0.16), transparent 26rem),
    rgba(5, 5, 5, 0.9);
  backdrop-filter: blur(14px);
}

.login-gate.visible {
  display: grid;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 24px;
}

.login-card h2 {
  font-size: 1.5rem;
}

.login-card p,
.login-card small {
  margin-bottom: 0;
}

.login-card small {
  min-height: 18px;
  color: #ffd7dd;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  max-width: min(360px, calc(100% - 40px));
  padding: 12px 14px;
  border: 1px solid rgba(114, 201, 0, 0.42);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(8, 8, 8, 0.86);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.36);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 220ms ease,
    transform 220ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

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

  .admin-sidebar {
    position: static;
    height: auto;
    grid-template-rows: auto auto auto;
    gap: 14px;
    padding: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .admin-menu {
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .admin-menu button {
    flex: 0 0 auto;
  }

  .admin-sidebar-foot {
    display: flex;
  }

  .admin-main {
    padding: 18px;
  }

  .admin-topbar {
    margin: -18px -18px 18px;
    padding: 18px;
  }

  .stat-grid,
  .dashboard-grid,
  .workspace-grid {
    grid-template-columns: 1fr 1fr;
  }
}

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

  .form-pair,
  .banner-metric-editor {
    grid-template-columns: 1fr;
  }

  .topbar-actions,
  .form-actions,
  .settings-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .stat-grid,
  .dashboard-grid,
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .stat-card {
    min-height: 104px;
  }

  h1 {
    font-size: 1.62rem;
  }
}

/* Apple-like light admin theme */
:root {
  color-scheme: light;
  --black: #f5f5f7;
  --panel: #ffffff;
  --panel-2: #f5f5f7;
  --text: #1d1d1f;
  --muted: rgba(29, 29, 31, 0.62);
  --line: rgba(29, 29, 31, 0.1);
  --gold: #68c900;
  --wine: #0071e3;
  --jade: #00965c;
}

body {
  color: var(--text);
  background:
    radial-gradient(circle at 12% 0%, rgba(0, 113, 227, 0.1), transparent 30rem),
    radial-gradient(circle at 92% 10%, rgba(104, 201, 0, 0.1), transparent 28rem),
    linear-gradient(180deg, #ffffff 0%, #f5f5f7 64%, #eef8f2 100%);
}

.admin-sidebar {
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 16px 0 48px rgba(0, 0, 0, 0.04);
}

.admin-brand span,
.login-mark {
  border-color: rgba(104, 201, 0, 0.34);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(238, 249, 242, 0.9)),
    #ffffff;
  box-shadow: 0 8px 24px rgba(0, 150, 92, 0.13);
}

.admin-menu button,
.admin-sidebar-foot a,
.admin-sidebar-foot button {
  color: var(--muted);
}

.admin-menu button.active,
.admin-menu button:hover,
.admin-sidebar-foot a:hover,
.admin-sidebar-foot button:hover {
  color: #1d1d1f;
  border-color: rgba(0, 113, 227, 0.14);
  background: rgba(0, 113, 227, 0.08);
}

.admin-topbar {
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.05);
}

.admin-kicker,
.admin-search span,
.admin-form label span,
.login-card label span {
  color: #46a800;
}

.primary-admin-button,
.ghost-admin-button,
.danger-button,
.panel-heading button {
  color: #1d1d1f;
  border-color: rgba(29, 29, 31, 0.11);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.04);
}

.primary-admin-button {
  color: #ffffff;
  border-color: rgba(0, 113, 227, 0.18);
  background: #0071e3;
  box-shadow: 0 12px 28px rgba(0, 113, 227, 0.18);
}

.danger-button {
  color: #bf1826;
  border-color: rgba(191, 24, 38, 0.18);
  background: rgba(191, 24, 38, 0.06);
}

.stat-card,
.admin-panel,
.record-item,
.login-card {
  border-color: var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 250, 252, 0.98)),
    #ffffff;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.07);
}

.status-row,
.compact-row,
.record-item,
.banner-image-item,
.admin-search,
.banner-metric-editor {
  border-color: rgba(29, 29, 31, 0.08);
  background: rgba(245, 245, 247, 0.72);
}

.badge {
  color: #ffffff;
  background: #0071e3;
}

.admin-search input,
.admin-form input,
.admin-form textarea,
.admin-form select,
.login-card input,
.json-box {
  color: #1d1d1f;
  border-color: rgba(29, 29, 31, 0.12);
  background: rgba(255, 255, 255, 0.9);
}

.record-item:hover,
.record-item.active {
  border-color: rgba(0, 113, 227, 0.18);
  background: rgba(0, 113, 227, 0.07);
}

.upload-note {
  border-color: rgba(104, 201, 0, 0.28);
  background: rgba(104, 201, 0, 0.07);
}

.login-gate {
  background:
    radial-gradient(circle at 50% 20%, rgba(104, 201, 0, 0.13), transparent 26rem),
    rgba(245, 245, 247, 0.9);
  width: 100vw;
  max-width: 100vw;
  overflow-x: hidden;
}

.login-card small {
  color: #bf1826;
}

.toast {
  color: #1d1d1f;
  border-color: rgba(0, 113, 227, 0.16);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.12);
}

@media (max-width: 720px) {
  .login-gate {
    padding: 16px;
    place-items: center;
  }

  .login-card {
    width: min(358px, calc(100vw - 32px));
    justify-self: start;
    padding: 22px;
  }
}

.admin-brand-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.admin-brand-copy strong {
  display: block;
  font-size: 1.04rem;
  line-height: 1.08;
}

.admin-brand-copy small {
  display: block;
  max-width: 168px;
  color: var(--muted);
  font-size: 0.56rem;
  line-height: 1.18;
  letter-spacing: 0.02em;
}

@media (max-width: 1020px) {
  .admin-brand-copy small {
    max-width: min(320px, calc(100vw - 96px));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
