:root {
  --official-yellow: #ffe815;
  --official-yellow-soft: #fff9bf;
  --official-page: #f4f5f7;
  --official-input: #f7f8fa;
  --official-ink: #1f2329;
  --official-line: #e6e8eb;
  --official-success: #20a464;
  --official-warning: #d98218;
  --official-danger: #d64545;
  --official-info: #3b82c4;
  --official-radius: 8px;
  color-scheme: light;
}

html,
body {
  background: var(--official-page) !important;
  color: var(--official-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Noto Sans CJK SC", sans-serif !important;
}

body,
button,
input,
textarea,
select {
  letter-spacing: 0 !important;
}

body.desktop-preview,
body.desktop-preview .app-frame,
body.desktop-preview .mini-page,
body.desktop-preview .page-shell {
  background: var(--official-page) !important;
}

body.desktop-preview .desktop-sidebar {
  width: 240px;
  padding: 24px 14px 18px;
  background: #fff !important;
  border-right: 1px solid var(--official-line);
  box-shadow: 8px 0 22px rgba(31, 35, 41, 0.035);
}

body.desktop-preview .desktop-brand {
  margin: 2px 8px 34px;
  color: var(--official-ink);
  font-size: 16px;
  line-height: 1.25;
}

body.desktop-preview .desktop-brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--official-yellow);
  color: #1f2329;
  box-shadow: 0 4px 12px rgba(255, 232, 21, 0.25);
}

body.desktop-preview .desktop-brand small {
  color: #9aa1aa;
  letter-spacing: 0 !important;
  font-weight: 600;
}

body.desktop-preview .desktop-nav {
  gap: 4px;
}

body.desktop-preview .desktop-nav button,
body.desktop-preview .desktop-account-link {
  min-height: 42px;
  padding: 10px 12px;
  border-radius: var(--official-radius);
  color: #646c77;
  font-weight: 600;
}

body.desktop-preview .desktop-nav button:hover,
body.desktop-preview .desktop-account-link:hover {
  background: #fffbe0;
  color: #5e5500;
}

body.desktop-preview .desktop-nav button.active,
body.desktop-preview .desktop-account-link.active {
  background: var(--official-yellow);
  color: #1f2329;
  box-shadow: 0 3px 10px rgba(255, 232, 21, 0.2);
}

body.desktop-preview .desktop-nav-divider {
  margin: 16px 14px 6px;
  border-top-color: var(--official-line);
  color: #9aa1aa;
}

body.desktop-preview .desktop-header {
  height: 64px;
  padding: 0 clamp(22px, 3.5vw, 48px);
  border-bottom-color: var(--official-line);
  background: rgba(244, 245, 247, 0.92) !important;
  color: var(--official-ink);
  box-shadow: none;
}

body.desktop-preview .desktop-preview-badge {
  border-radius: 999px;
  background: var(--official-yellow-soft);
  color: #625900;
}

body.desktop-preview .page-shell,
body.desktop-preview .merchant-directory,
body.desktop-preview .business-dashboard,
body.desktop-preview .commission-page,
body.desktop-preview .operations-page,
body.desktop-preview .desktop-menu {
  max-width: 1480px;
  padding-top: 28px;
  padding-bottom: 64px;
}

.merchant-directory,
.business-dashboard,
.commission-page,
.operations-page,
.desktop-menu,
.toolbox-page,
.dashboard,
.inspiration {
  color: var(--official-ink) !important;
  background: var(--official-page) !important;
}

.merchant-directory h1,
.merchant-directory h2,
.business-dashboard h1,
.business-dashboard h2,
.commission-page h1,
.operations-page h1,
.desktop-menu h1,
.desktop-menu h2 {
  color: var(--official-ink) !important;
}

.merchant-panel,
.md-filters,
.md-table,
.md-row,
.bd-section,
.commission-panel,
.commission-metrics article,
.commission-metrics button,
.operations-panel,
.desktop-menu .dm-card,
.desktop-menu .dm-hero,
.desktop-menu .dm-steps,
.desktop-menu .dm-groups,
.desktop-menu .dm-table-card,
.toolbox-page .merchant-panel,
.dashboard .creation-studio,
.dashboard .prompt-card,
.h5-modal,
.h5-auth-card {
  border-radius: var(--official-radius) !important;
  border-color: var(--official-line) !important;
  box-shadow: 0 4px 16px rgba(31, 35, 41, 0.045) !important;
}

.md-filters,
.md-table,
.md-row,
.bd-section,
.commission-panel,
.operations-panel,
.desktop-menu .dm-card,
.desktop-menu .dm-hero,
.desktop-menu .dm-steps,
.desktop-menu .dm-groups,
.desktop-menu .dm-table-card,
.dashboard .creation-studio,
.dashboard .prompt-card,
.toolbox-page .merchant-panel,
.h5-modal,
.h5-auth-card {
  background: #fff !important;
}

input,
textarea,
select {
  border-color: #dfe2e6 !important;
  border-radius: 6px !important;
  background: var(--official-input) !important;
  color: var(--official-ink) !important;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #d1bf00 !important;
  box-shadow: 0 0 0 3px rgba(255, 232, 21, 0.28) !important;
}

button.primary,
.desktop-menu button.primary,
.md-heading button,
.md-actions button.primary,
.bd-head-actions button,
.commission-head-actions button.primary,
.prompt-submit,
.h5-auth-primary {
  border-color: var(--official-yellow) !important;
  background: var(--official-yellow) !important;
  color: #1f2329 !important;
  box-shadow: 0 3px 10px rgba(255, 232, 21, 0.2) !important;
}

button:hover,
.desktop-menu button:hover,
.md-actions button:hover,
.commission-head-actions button:hover {
  transition: background-color 140ms ease, border-color 140ms ease,
    color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

button:active {
  transform: translateY(1px);
}

.h5-auth-mask,
.h5-modal-mask {
  background: rgba(31, 35, 41, 0.56) !important;
}

@media (max-width: 959px) {
  body,
  body .app-frame,
  body .mini-page {
    background: var(--official-page) !important;
  }

  .merchant-directory,
  .business-dashboard,
  .commission-page,
  .operations-page,
  .desktop-menu,
  .toolbox-page {
    padding-right: 14px !important;
    padding-left: 14px !important;
  }

  .h5-topbar {
    background: #fff !important;
    border-bottom: 1px solid var(--official-line);
  }

  .h5-bottom-nav {
    border-top: 1px solid var(--official-line) !important;
    background: rgba(255, 255, 255, 0.96) !important;
  }
}

body.shell-dark,
body.theme-dark,
body[data-theme="dark"],
body.dark {
  color-scheme: dark;
  --official-page: #17191c;
  --official-input: #22262b;
  --official-ink: #f2f3f5;
  --official-line: #343941;
}

body.shell-dark .app-frame,
body.theme-dark .app-frame,
body[data-theme="dark"] .app-frame,
body.dark .app-frame,
body.shell-dark .mini-page,
body.theme-dark .mini-page,
body[data-theme="dark"] .mini-page,
body.dark .mini-page,
body.shell-dark .desktop-header,
body.theme-dark .desktop-header,
body[data-theme="dark"] .desktop-header,
body.dark .desktop-header {
  background: var(--official-page) !important;
  color: var(--official-ink) !important;
}

body.shell-dark .desktop-sidebar,
body.theme-dark .desktop-sidebar,
body[data-theme="dark"] .desktop-sidebar,
body.dark .desktop-sidebar,
body.shell-dark .merchant-panel,
body.theme-dark .merchant-panel,
body[data-theme="dark"] .merchant-panel,
body.dark .merchant-panel,
body.shell-dark .md-filters,
body.theme-dark .md-filters,
body[data-theme="dark"] .md-filters,
body.dark .md-filters,
body.shell-dark .md-table,
body.theme-dark .md-table,
body[data-theme="dark"] .md-table,
body.dark .md-table,
body.shell-dark .md-row,
body.theme-dark .md-row,
body[data-theme="dark"] .md-row,
body.dark .md-row,
body.shell-dark .bd-section,
body.theme-dark .bd-section,
body[data-theme="dark"] .bd-section,
body.dark .bd-section,
body.shell-dark .commission-panel,
body.theme-dark .commission-panel,
body[data-theme="dark"] .commission-panel,
body.dark .commission-panel,
body.shell-dark .h5-auth-card,
body.theme-dark .h5-auth-card,
body[data-theme="dark"] .h5-auth-card,
body.dark .h5-auth-card {
  background: #202328 !important;
  border-color: var(--official-line) !important;
  color: var(--official-ink) !important;
}

body.shell-dark .desktop-brand,
body.theme-dark .desktop-brand,
body[data-theme="dark"] .desktop-brand,
body.dark .desktop-brand,
body.shell-dark h1,
body.theme-dark h1,
body[data-theme="dark"] h1,
body.dark h1,
body.shell-dark h2,
body.theme-dark h2,
body[data-theme="dark"] h2,
body.dark h2,
body.shell-dark strong,
body.theme-dark strong,
body[data-theme="dark"] strong,
body.dark strong {
  color: var(--official-ink) !important;
}

body.shell-dark input,
body.theme-dark input,
body[data-theme="dark"] input,
body.dark input,
body.shell-dark textarea,
body.theme-dark textarea,
body[data-theme="dark"] textarea,
body.dark textarea,
body.shell-dark select,
body.theme-dark select,
body[data-theme="dark"] select,
body.dark select {
  background: var(--official-input) !important;
  color: var(--official-ink) !important;
  border-color: #424852 !important;
}
