:root {
  --admin-green-950: #102c27;
  --admin-green-900: #173f37;
  --admin-green-100: #dcefe9;
  --admin-canvas: #e9efec;
  --admin-border: #d3ded9;
}

body {
  background: var(--admin-canvas);
}

.login-card,
.admin-sidebar,
.admin-main,
.panel-card,
.broadcast-card,
.stat-card,
.timeline-item,
.table-wrap,
input,
textarea,
.primary-btn,
.ghost-btn,
.danger-btn,
.small-btn,
.nav-item {
  border-radius: 8px;
}

.brand-mark {
  width: 54px;
  height: 54px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--admin-green-900);
  font-size: 16px;
  line-height: 1;
  white-space: nowrap;
}

.password-control {
  position: relative;
  display: block;
}

.password-control input {
  padding-right: 66px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 5px;
  min-width: 50px;
  min-height: 32px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--accent-dark);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: var(--admin-green-100);
  outline: none;
}

.dashboard {
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
}

.admin-sidebar,
.admin-main {
  border-color: var(--admin-border);
  box-shadow: 0 10px 30px rgba(30, 50, 43, 0.1);
}

.admin-sidebar {
  padding: 16px;
}

.admin-main {
  padding: 20px;
}

.nav-item.is-active {
  background: var(--admin-green-100);
  color: var(--admin-green-950);
}

.stat-card,
.timeline-item,
.branding-preview {
  border-color: var(--admin-border);
  background: #f8faf9;
}

.toast {
  background: var(--admin-green-950);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(47, 111, 115, 0.28);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .dashboard {
    display: block;
    padding: 0;
  }

  .admin-sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 10px;
    padding: 10px 12px;
    border-width: 0 0 1px;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 8px 22px rgba(30, 50, 43, 0.1);
  }

  .admin-sidebar .brand-line {
    min-width: 0;
  }

  .admin-sidebar .brand-mark {
    width: 40px;
    height: 40px;
    font-size: 13px;
  }

  .admin-sidebar .brand-line strong,
  .admin-sidebar .brand-line span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .admin-sidebar nav {
    grid-column: 1 / -1;
    display: flex;
    gap: 5px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .admin-sidebar nav::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 13px;
    text-align: center;
  }

  .sidebar-actions {
    display: flex;
    align-self: center;
    gap: 5px;
  }

  .sidebar-actions .ghost-btn {
    min-height: 36px;
    padding: 0 10px;
  }

  .admin-main {
    min-height: calc(100vh - 112px);
    padding: 16px 14px 28px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
}

@media (max-width: 560px) {
  .admin-sidebar .brand-line > div:last-child span {
    display: none;
  }

  .sidebar-actions .ghost-btn {
    width: 38px;
    min-width: 38px;
    overflow: hidden;
    padding: 0;
    font-size: 0;
  }

  .sidebar-actions .ghost-btn:first-child::after {
    content: "聊";
    font-size: 14px;
  }

  .sidebar-actions .ghost-btn:last-child::after {
    content: "退";
    font-size: 14px;
  }

  .admin-header {
    align-items: end;
  }

  .admin-header h1 {
    font-size: 24px;
  }

  .admin-header .primary-btn {
    min-height: 38px;
    padding: 0 10px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .stat-card {
    padding: 12px;
  }

  .stat-card strong {
    margin-top: 5px;
    font-size: 24px;
  }

  .two-col,
  .toolbar {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
