* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 17px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #eef1f4;
  color: #1f2937;
  line-height: 1.55;
  min-height: 100vh;
  font-size: 1rem;
}

:root {
  --color-primary: #16191c;
  --color-primary-light: #16191c;
  --color-accent: #f58220;
  --color-sidebar: #16191c;
  --color-sidebar-hover: rgba(255, 255, 255, 0.08);
  --color-sidebar-active: rgba(255, 255, 255, 0.14);
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.04);
  --radius-lg: 14px;
  --radius-md: 10px;
}

html, body {
  width: 100%;
  height: 100%;
}

code {
  background: #eef;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}

/* hidden 属性需强制隐藏，避免被 display:flex 等样式覆盖 */
[hidden] {
  display: none !important;
}

/* 登录 */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-box {
  background: #fff;
  padding: 40px 36px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  width: 380px;
  text-align: center;
}

.login-box__brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 16px;
}

.login-box h1 {
  font-size: 1.35rem;
  margin-bottom: 8px;
  color: #111827;
}

.login-tip {
  color: #888;
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.login-box input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 16px;
}

.login-box .btn,
.btn--block {
  width: 100%;
}

.login-box .btn {
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 13px;
  font-size: 1rem;
  cursor: pointer;
}

/* 主布局：左侧竖菜单 */
.admin-app {
  display: flex;
  width: 100%;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
}

.admin-sidebar {
  width: 280px;
  flex-shrink: 0;
  background: #16191c;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 20px;
}

.sidebar-brand__mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2d6b4f, #1a3d2e);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}

.sidebar-brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.sidebar-brand__text strong {
  font-size: 1.05rem;
  color: #fff;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 12px 20px;
  overflow-y: auto;
}

.sidebar-nav__label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
  padding: 8px 12px 10px;
}

.sidebar-nav__item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  margin-bottom: 4px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.05rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.sidebar-nav__item:hover {
  background: var(--color-sidebar-hover);
  color: #fff;
}

.sidebar-nav__item.active {
  background: var(--color-sidebar-active);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--color-accent);
}

.sidebar-nav__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.85;
  background: currentColor;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}

.sidebar-nav__icon--stats {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M4 19V5M10 19V9M16 19V13M22 19V7'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M4 19V5M10 19V9M16 19V13M22 19V7'/%3E%3C/svg%3E");
}

.sidebar-nav__icon--profile {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 20c0-4 4-6 8-6s8 2 8 6'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 20c0-4 4-6 8-6s8 2 8 6'/%3E%3C/svg%3E");
}

.sidebar-nav__icon--sites {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M2 12h20M12 3c2.5 2.8 4 6 4 9s-1.5 6.2-4 9c-2.5-2.8-4-6-4-9s1.5-6.2 4-9z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M2 12h20M12 3c2.5 2.8 4 6 4 9s-1.5 6.2-4 9c-2.5-2.8-4-6-4-9s1.5-6.2 4-9z'/%3E%3C/svg%3E");
}

.sidebar-nav__icon--users {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='9' cy='8' r='3'/%3E%3Ccircle cx='17' cy='10' r='2.5'/%3E%3Cpath d='M3 19c0-3 2.5-5 6-5M14 19c0-2 1.5-3.5 3.5-4'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='9' cy='8' r='3'/%3E%3Ccircle cx='17' cy='10' r='2.5'/%3E%3Cpath d='M3 19c0-3 2.5-5 6-5M14 19c0-2 1.5-3.5 3.5-4'/%3E%3C/svg%3E");
}

.admin-header {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 16px 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.admin-header h1 {
  font-size: 1.35rem;
  font-weight: 600;
  color: #111827;
  flex: 1;
  min-width: 0;
}

.admin-header__actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  position: relative;
}

.user-menu {
  position: relative;
}

.user-menu__trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px 6px 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.user-menu__trigger:hover,
.user-menu.open .user-menu__trigger {
  background: #f3f4f6;
  border-color: #e5e7eb;
}

.user-menu__arrow {
  width: 10px;
  height: 10px;
  margin-left: 2px;
  border-right: 2px solid #9ca3af;
  border-bottom: 2px solid #9ca3af;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.user-menu.open .user-menu__arrow {
  transform: rotate(-135deg) translateY(2px);
}

.user-menu__dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 140px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  padding: 6px;
  z-index: 100;
}

.user-menu__item {
  display: block;
  width: 100%;
  padding: 11px 14px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 0.95rem;
  color: #374151;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}

.user-menu__item:hover {
  background: #f3f4f6;
}

.user-menu__item--logout {
  color: #dc2626;
}

.user-menu__item--logout:hover {
  background: #fef2f2;
}

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

.admin-header__avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f58220, #ff9f43);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.admin-header__userinfo {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.35;
}

.admin-header__name {
  font-size: 1.05rem;
  font-weight: 600;
  color: #111827;
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-header__role {
  font-size: 0.85rem;
  color: #6b7280;
}

.admin-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.admin-main {
  flex: 1;
  overflow: auto;
  /* padding: 24px 28px 32px; */
}

.panel {
  display: none;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
  border: 1px solid #eef0f3;
  width: 100%;
  min-height: auto;
}

.panel.active {
  display: block;
}

.login-box .btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

.login-error {
  color: #e02020;
  font-size: 14px;
  margin-top: 12px;
  line-height: 1.5;
}

.panel h2 {
  font-size: 1.15rem;
  margin: 24px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}

.panel h3 {
  font-size: 1.05rem;
  margin-bottom: 12px;
}

.panel-tip {
  color: #888;
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.stats-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 16px 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.stats-toolbar__group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stats-toolbar__group label {
  font-size: 0.9rem;
  color: #666;
  white-space: nowrap;
}

.stats-toolbar select {
  padding: 9px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.95rem;
  min-width: 200px;
}

.stats-toolbar__date {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
}

.stats-toolbar__presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.stats-toolbar__presets .btn--small {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.panel h2:first-child {
  margin-top: 0;
}

.stats-toolbar__name,
.stats-toolbar__promoter {
  font-size: 0.95rem;
  color: #666;
}

.stats-toolbar__promoter {
  word-break: break-all;
}

.form-inline {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.form-inline input {
  flex: 1;
  min-width: 160px;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
}

.code-block {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 16px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* 表单 */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.form-grid input,
.form-grid select {
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
}

.form-grid select option:disabled {
  color: #aaa;
}

.form-grid select option.option--disabled {
  color: #aaa;
}

.form-grid__wide {
  grid-column: 1 / -1;
}

.form-inline__wide {
  flex: 2;
  min-width: 220px;
}

.form-grid__hint {
  margin: -4px 0 0;
  font-size: 13px;
  color: #888;
  line-height: 1.5;
}

.form-grid__hint strong {
  color: #333;
  font-weight: 500;
}

.form-grid__btn {
  justify-self: start;
}

.edit-modal__link-preview {
  margin-top: 10px;
  padding: 10px 12px;
  background: #f9fafb;
  border: 1px solid #eee;
  border-radius: 8px;
  font-size: 13px;
  color: #555;
  line-height: 1.5;
  word-break: break-all;
}

.edit-modal__link-preview:empty {
  display: none;
}

.edit-modal__link-preview code {
  background: #eef2f7;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
}

.edit-modal__link-row--copy {
  margin-top: 10px;
}

.cell-url {
  max-width: 280px;
  word-break: break-all;
  font-size: 13px;
}

.cell-actions {
  white-space: nowrap;
}

.cell-actions .btn-edit,
.cell-actions .btn-reset-pwd,
.cell-actions .btn-remove {
  margin-right: 6px;
}

.btn-reset-pwd {
  background: none;
  border: 1px solid #1a3d2e;
  color: #1a3d2e;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}

.btn-reset-pwd:hover {
  background: #f0f7f4;
}

.btn-edit {
  background: none;
  border: 1px solid #2563eb;
  color: #2563eb;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}

.btn-edit:hover {
  background: #eff6ff;
}

.edit-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.edit-modal[hidden] {
  display: none;
}

body.edit-modal-open {
  overflow: hidden;
}

.edit-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  animation: editModalFadeIn 0.2s ease;
}

.edit-modal__panel {
  position: relative;
  background: #fff;
  border-radius: 14px;
  width: min(560px, 100%);
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: editModalSlideIn 0.22s ease;
}

@keyframes editModalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes editModalSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.edit-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 0;
  flex-shrink: 0;
}

.edit-modal__header-text {
  min-width: 0;
}

.edit-modal__header h2 {
  margin: 0 0 6px;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1a1a1a;
}

.edit-modal__meta {
  margin: 0;
  font-size: 13px;
  color: #888;
  line-height: 1.5;
}

.edit-modal__meta code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: #1a3d2e;
}

.edit-modal__meta-sep {
  margin: 0 4px;
  color: #ccc;
}

.edit-modal__close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: none;
  background: #f3f4f6;
  border-radius: 8px;
  font-size: 20px;
  line-height: 1;
  color: #666;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.edit-modal__close:hover {
  background: #e5e7eb;
  color: #333;
}

.edit-modal__body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.edit-modal__section {
  margin-bottom: 22px;
}

.edit-modal__section:last-child {
  margin-bottom: 0;
}

.edit-modal__section--optional {
  padding-top: 18px;
  border-top: 1px dashed #eee;
}

.edit-modal__section-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.edit-modal__optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: #aaa;
  font-size: 12px;
}

.edit-modal__hint {
  margin: -6px 0 10px;
  font-size: 13px;
  color: #888;
  line-height: 1.5;
}

.edit-modal__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.edit-modal__grid--single {
  grid-template-columns: 1fr;
}

.edit-modal__body .form-item label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: #555;
}

.edit-modal__body .form-item input,
.edit-modal__body .form-item select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.edit-modal__body .form-item input:focus,
.edit-modal__body .form-item select:focus {
  outline: none;
  border-color: var(--color-primary, #1a3d2e);
  box-shadow: 0 0 0 3px rgba(26, 61, 46, 0.12);
}

.edit-modal__link-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.edit-modal__link-row input {
  flex: 1;
  min-width: 0;
}

.edit-modal__link-row .btn {
  flex-shrink: 0;
  align-self: stretch;
  white-space: nowrap;
}

.edit-modal__footer {
  padding: 0 24px 22px;
  flex-shrink: 0;
  border-top: 1px solid #f0f0f0;
  padding-top: 16px;
}

.edit-modal__footer .save-msg {
  margin: 0 0 12px;
  min-height: 20px;
}

.edit-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.edit-modal__actions .btn--primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

@media (max-width: 520px) {
  .edit-modal__grid {
    grid-template-columns: 1fr;
  }

  .edit-modal__header {
    padding: 18px 18px 0;
  }

  .edit-modal__body {
    padding: 16px 18px;
  }

  .edit-modal__footer {
    padding: 16px 18px 18px;
  }

  .edit-modal__link-row {
    flex-direction: column;
  }

  .edit-modal__link-row .btn {
    align-self: flex-start;
  }
}

/* 推广员账号 */
.profile-card {
  background: #f9fafb;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 28px;
  max-width: 720px;
}

.profile-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
}

.profile-row:last-child {
  border-bottom: none;
}

.profile-label {
  flex: 0 0 88px;
  font-size: 14px;
  color: #888;
}

.profile-value {
  flex: 1;
  font-size: 14px;
  color: #333;
  word-break: break-all;
}

.profile-link-box {
  flex: 1;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.profile-link-input {
  flex: 1;
  min-width: 200px;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
  color: #333;
}

.profile-pwd-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-width: 520px;
  margin-bottom: 8px;
}

.profile-pwd-form input {
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
}

.profile-pwd-form .btn {
  grid-column: 1 / -1;
  justify-self: start;
}

@media (max-width: 768px) {
  .profile-row {
    flex-direction: column;
    gap: 6px;
  }

  .profile-pwd-form {
    grid-template-columns: 1fr;
  }
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-item label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: #555;
}

.form-item input,
.form-item textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}

.form-item textarea {
  resize: vertical;
}

.image-field {
  display: flex;
  gap: 8px;
  align-items: center;
}

.image-field input[type="text"] {
  flex: 1;
}

.file-input {
  display: none;
}

.preview {
  margin-top: 8px;
  max-width: 120px;
  max-height: 80px;
  border-radius: 6px;
  border: 1px solid #eee;
  object-fit: cover;
}

.form-actions {
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.save-msg {
  font-size: 14px;
  color: #07c160;
}

.save-msg--error {
  color: #e53935;
}

/* 按钮 */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
}

.btn--primary:hover {
  background: var(--color-primary-light);
}

.btn--ghost {
  background: #f8fafc;
  color: #374151;
  border: 1px solid #e5e7eb;
}

.panel .btn--ghost {
  background: #f8fafc;
  color: #374151;
  border: 1px solid #e5e7eb;
}

.btn--danger {
  background: #e02020;
  color: #fff;
}

.btn--small {
  padding: 6px 12px;
  font-size: 13px;
}

/* 按钮列表编辑 */
.button-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.button-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.button-row input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
}

.button-row label.checkbox-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  white-space: nowrap;
  margin: 0;
}

.btn-remove {
  background: #fee;
  color: #e02020;
  border: 1px solid #fcc;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

/* 统计 */
.stats-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: linear-gradient(180deg, #f8faf9 0%, #fff 100%);
  border: 1px solid #e8eee9;
  border-radius: var(--radius-md);
  padding: 22px 20px;
  text-align: center;
  transition: box-shadow 0.2s, transform 0.2s;
}

.stat-card:hover {
  box-shadow: 0 4px 16px rgba(26, 61, 46, 0.08);
  transform: translateY(-1px);
}

.stat-card__num {
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--color-primary);
}

.stat-card__label {
  font-size: 0.95rem;
  color: #888;
  margin-top: 4px;
}

.stats-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.chart-block {
  background: #fafbfc;
  border: 1px solid #eef0f3;
  border-radius: var(--radius-md);
  padding: 18px;
}

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bar-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bar-item__label {
  width: 140px;
  font-size: 13px;
  text-align: right;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-item__track {
  flex: 1;
  height: 24px;
  background: #eee;
  border-radius: 4px;
  overflow: hidden;
}

.bar-item__fill {
  height: 100%;
  background: linear-gradient(90deg, #f58220, #ff9f43);
  border-radius: 4px;
  min-width: 2px;
  transition: width 0.3s;
}

.bar-item__count {
  width: 36px;
  font-size: 14px;
  font-weight: 600;
  color: #f58220;
}

.bar-empty {
  color: #aaa;
  font-size: 14px;
  text-align: center;
  padding: 20px;
}

.stats-records__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 16px;
}

.stats-records__title {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.stats-records__title h3 {
  margin: 0;
}

.auto-refresh-tip {
  font-size: 12px;
  color: #999;
}

.stats-records__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.panel .stats-records__actions .btn--ghost {
  background: #f8fafc;
  color: #374151;
  border: 1px solid #e5e7eb;
}

.panel .stats-records__actions .btn--ghost:disabled {
  opacity: 0.6;
  cursor: wait;
}

.table-wrap {
  overflow-x: auto;
  max-height: calc(100vh - 380px);
  overflow-y: auto;
  border: 1px solid #eef0f3;
  border-radius: var(--radius-md);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.data-table th {
  background: #f8fafc;
  font-weight: 600;
  color: #475569;
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table td {
  color: #444;
}

.data-table--user th,
.data-table--user td {
  text-align: center;
  white-space: nowrap;
}

.data-table--user td:first-child,
.data-table--user th:first-child {
  text-align: left;
}

.wechat-yes {
  color: #07c160;
  font-weight: 600;
}

.wechat-no {
  color: #999;
}

.step-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.step-tag--visit { background: #e8f4fd; color: #1890ff; }
.step-tag--category { background: #fff3e0; color: #f58220; }
.step-tag--budget { background: #fce4ec; color: #e91e63; }
.step-tag--wechat { background: #e8f5e9; color: #07c160; }
.step-tag--modal { background: #f3e5f5; color: #9c27b0; }

@media (max-width: 768px) {
  .admin-app {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  .admin-sidebar {
    width: 100%;
    flex-direction: column;
  }

  .sidebar-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 12px 12px;
  }

  .sidebar-nav__label,
  .sidebar-brand__text span {
    display: none;
  }

  .sidebar-nav__item {
    width: auto;
    flex: 1 1 calc(50% - 6px);
    min-width: 120px;
    justify-content: center;
    margin-bottom: 0;
    font-size: 0.95rem;
  }

  .admin-body {
    min-height: 60vh;
  }

  .admin-header {
    flex-wrap: wrap;
    padding: 14px 16px;
  }

  .admin-header h1 {
    font-size: 1.15rem;
    width: 100%;
    margin-bottom: 4px;
  }

  .admin-header__actions {
    width: 100%;
    justify-content: flex-end;
  }

  .admin-header__name {
    max-width: 120px;
  }

  .form-grid,
  .stats-summary,
  .stats-charts {
    grid-template-columns: 1fr;
  }

  .bar-item__label {
    width: 100px;
  }

  .table-wrap {
    max-height: 420px;
  }
}
