/* ============================================================
   GLOBAL RESET & VARIABLES — LIGHT THEME
   ============================================================ */

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

:root {
  --bg: #f5f5f7;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f0f5;
  --bg-input: #f5f5f7;
  --bg-sidebar: #ffffff;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-muted: #aeaeb2;
  --border: #e5e5ea;
  --border-light: #f2f2f7;
  --primary: #5856d6;
  --primary-hover: #4744c7;
  --primary-glow: rgba(88, 86, 214, 0.15);
  --primary-light: rgba(88, 86, 214, 0.06);
  --primary-50: rgba(88, 86, 214, 0.08);
  --accent: #ff2d55;
  --success: #34c759;
  --success-light: rgba(52, 199, 89, 0.08);
  --danger: #ff3b30;
  --danger-light: rgba(255, 59, 48, 0.08);
  --warn: #ff9500;
  --warn-light: rgba(255, 149, 0, 0.08);
  --sub: #6e6e73;
  --muted: #aeaeb2;
  --sidebar-bg: #ffffff;
  --sidebar-text: #3c3c43;
  --sidebar-hover: rgba(88, 86, 214, 0.06);
  --sidebar-active: rgba(88, 86, 214, 0.1);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.06);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   BASE & TYPOGRAPHY
   ============================================================ */

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.hidden {
  display: none !important;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent);
}

/* ============================================================
   LOGIN PAGE — LIGHT THEME
   ============================================================ */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
  padding: 20px;
}

.login-box {
  display: flex;
  width: 800px;
  max-width: 94vw;
  background: #ffffff;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  animation: loginSlideUp 0.4s ease-out;
}

@keyframes loginSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-brand {
  flex: 1.1;
  background: linear-gradient(160deg, #5856d6 0%, #4744c7 100%);
  color: #ffffff;
  padding: 60px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-logo {
  width: 64px;
  height: 64px;
  line-height: 64px;
  text-align: center;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
  color: #ffffff;
}

.login-brand h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.3;
}

.login-brand p {
  opacity: 0.85;
  line-height: 1.8;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
}

.login-form {
  flex: 1;
  padding: 60px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-form label {
  display: block;
  color: var(--text-secondary);
  margin: 20px 0 8px;
  font-size: 13px;
  font-weight: 500;
}

.login-form label:first-child {
  margin-top: 0;
}

.login-err {
  color: var(--danger);
  font-size: 13px;
  min-height: 20px;
  margin-top: 10px;
}

.login-tip {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 14px;
  line-height: 1.7;
}

/* ============================================================
   LAYOUT: APP SHELL
   ============================================================ */

.app {
  display: flex;
  min-height: 100vh;
}

/* ============================================================
   SIDEBAR — ULTRA DARK + PURPLE GLOW
   ============================================================ */

.sidebar {
  width: 220px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.side-brand {
  height: 56px;
  line-height: 56px;
  padding-left: 20px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.side-brand::before {
  content: '';
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #5856d6, #af52de);
  border-radius: 8px;
  flex-shrink: 0;
}

#side-nav {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

#side-nav::-webkit-scrollbar {
  width: 3px;
}

#side-nav::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.nav-group-title {
  padding: 14px 16px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  user-select: none;
  letter-spacing: 0.3px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  margin: 1px 8px;
  border-radius: 6px;
  color: var(--sidebar-text);
  cursor: pointer;
  font-size: 13px;
  transition: all var(--transition-fast);
  position: relative;
  text-decoration: none;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: var(--primary);
}

.nav-item.active {
  color: var(--primary);
  background: var(--sidebar-active);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
}

.nav-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */

.main {
  flex: 1;
  margin-left: 220px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
}

.topbar {
  height: 56px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.topbar .sub {
  font-size: 12px;
  color: var(--text-secondary);
}

.view {
  padding: 28px 32px;
  flex: 1;
}

/* ============================================================
   CARDS
   ============================================================ */

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: box-shadow var(--transition-normal), transform var(--transition-normal), border-color var(--transition-normal);
}

.card:hover {
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.08);
  border-color: rgba(124, 58, 237, 0.2);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text);
  letter-spacing: -0.1px;
}

.sub {
  color: var(--text-muted);
  font-size: 12px;
}

/* ============================================================
   STAT CARDS — GRADIENT PURPLE TO DARK
   ============================================================ */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: linear-gradient(135deg, #7c3aed 0%, #1e1040 100%);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  border: 1px solid rgba(124, 58, 237, 0.2);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -20%;
  width: 120px;
  height: 120px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 50%;
}

.stat-card::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -10%;
  width: 80px;
  height: 80px;
  background: rgba(236, 72, 153, 0.06);
  border-radius: 50%;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(124, 58, 237, 0.25);
}

.stat-num {
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  line-height: 1.1;
  position: relative;
  z-index: 1;
}

.stat-card.warn {
  background: linear-gradient(135deg, #ef4444 0%, #3b1010 100%);
}

.stat-card.warn .stat-num {
  color: #fff;
}

.stat-label {
  color: rgba(255, 255, 255, 0.7);
  margin-top: 8px;
  font-size: 13px;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

/* ============================================================
   TOOLBAR
   ============================================================ */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border);
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-fast);
  white-space: nowrap;
  gap: 6px;
}

.btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-50);
  background: var(--bg-card-hover);
}

.btn:active {
  transform: scale(0.97);
}

.btn.primary {
  background: linear-gradient(135deg, var(--primary) 0%, #6d28d9 100%);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 1px 3px rgba(124, 58, 237, 0.4);
}

.btn.primary:hover {
  background: linear-gradient(135deg, var(--primary-hover) 0%, #5b21b6 100%);
  border-color: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.45);
}

.btn.danger {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.3);
  background: var(--danger-light);
}

.btn.danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--danger);
  color: #f87171;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.btn.success {
  color: var(--success);
  border-color: rgba(34, 197, 94, 0.3);
  background: var(--success-light);
}

.btn.success:hover {
  background: rgba(34, 197, 94, 0.15);
  border-color: var(--success);
  color: #4ade80;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.btn.sm {
  height: 28px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn.block {
  width: 100%;
  height: 44px;
  font-size: 15px;
  font-weight: 600;
}

/* ============================================================
   FORM INPUTS — LIGHT THEME
   ============================================================ */

input,
select,
textarea {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 14px;
  height: 38px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  background: var(--bg-card);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  font-family: inherit;
}

textarea {
  height: auto;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.6;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-50);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236e6e73' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  background-color: var(--bg-card);
}

/* ============================================================
   TABLES — DARK ROWS + PURPLE HOVER
   ============================================================ */

table.grid {
  width: 100%;
  border-collapse: collapse;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

table.grid th {
  background: rgba(124, 58, 237, 0.06);
  color: var(--text-secondary);
  font-weight: 600;
  text-align: left;
  padding: 14px 16px;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

table.grid td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  font-size: 14px;
  transition: background var(--transition-fast);
}

table.grid tbody tr:nth-child(even) {
  background: rgba(124, 58, 237, 0.02);
}

table.grid tbody tr:hover td {
  background: rgba(124, 58, 237, 0.06);
}

/* ============================================================
   TAGS & BADGES — DARK BG + COLORED TEXT
   ============================================================ */

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

.tg-blue {
  background: rgba(124, 58, 237, 0.12);
  color: var(--primary);
}

.tg-green {
  background: var(--success-light);
  color: var(--success);
}

.tg-warn {
  background: var(--warn-light);
  color: var(--warn);
}

.tg-red {
  background: var(--danger-light);
  color: var(--danger);
}

.tg-gray {
  background: rgba(85, 85, 112, 0.15);
  color: var(--text-muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  text-align: center;
  background: var(--danger);
  color: #fff;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  padding: 0 6px;
  vertical-align: top;
  line-height: 1;
}

/* ============================================================
   PAGINATION
   ============================================================ */

.pager {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 18px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ============================================================
   MODAL — DARK BACKDROP + GLASS MORPHISM
   ============================================================ */

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: modalFadeIn 0.2s ease-out;
}

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

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  width: 560px;
  max-width: 92vw;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--border);
  animation: modalSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid var(--border);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal.wide {
  width: 780px;
}

.modal-hd {
  padding: 20px 24px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.2px;
}

.modal-bd {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-ft {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ============================================================
   FORM ROWS & LAYOUTS
   ============================================================ */

.form-row {
  margin-bottom: 16px;
}

.form-row > label {
  display: block;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
}

.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
}

.form-cols {
  display: flex;
  gap: 16px;
}

.form-cols .form-row {
  flex: 1;
}

.perm-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 20px;
}

.perm-item {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--text-secondary);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.perm-item:hover {
  background: rgba(124, 58, 237, 0.05);
}

.perm-item input {
  width: auto;
  accent-color: var(--primary);
}

.perm-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 16px;
}

/* ============================================================
   TOAST NOTIFICATION — DARK CARD, SLIDE FROM TOP-RIGHT
   ============================================================ */

.toast {
  position: fixed;
  top: 24px;
  right: 24px;
  left: auto;
  transform: none;
  background: var(--bg-card);
  color: var(--text);
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  z-index: 200;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--border);
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 400px;
  border: 1px solid var(--border);
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ============================================================
   EMPTY STATE & UTILITIES
   ============================================================ */

.empty {
  text-align: center;
  color: var(--text-muted);
  padding: 48px 0;
  font-size: 14px;
}

.kv {
  display: flex;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px dashed var(--border-light);
}

.kv .k {
  width: 120px;
  color: var(--text-muted);
  flex-shrink: 0;
  font-weight: 500;
}

.kv .v {
  word-break: break-all;
  color: var(--text);
}

.money {
  color: var(--accent);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.mt {
  margin-top: 16px;
}

/* ============================================================
   TABS — UNDERLINE STYLE, PURPLE ACTIVE
   ============================================================ */

.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border-light);
}

.tab {
  padding: 12px 20px;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  user-select: none;
  transition: all var(--transition-fast);
  font-weight: 500;
}

.tab:hover {
  color: var(--primary);
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* ============================================================
   SaaS CONFIGURATION TABS
   ============================================================ */

.saas-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 20px;
}

.saas-tab {
  padding: 12px 20px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  user-select: none;
  transition: all var(--transition-fast);
  font-weight: 500;
}

.saas-tab:hover {
  color: var(--primary);
}

.saas-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.saas-pane {
  max-height: 52vh;
  overflow: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(124, 58, 237, 0.2) transparent;
}

.saas-maintabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 4px 12px;
}

.saas-maintabs .saas-tab {
  padding: 8px 16px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.saas-plugin {
  display: flex;
  align-items: center;
  padding: 12px 8px;
  border-bottom: 1px dashed var(--border-light);
  cursor: pointer;
  transition: background var(--transition-fast);
  border-radius: var(--radius-sm);
}

.saas-plugin:hover {
  background: rgba(124, 58, 237, 0.05);
}

.saas-plugin input {
  width: auto;
  margin-right: 10px;
  accent-color: var(--primary);
}

/* ============================================================
   SHOP DECORATION EDITOR — LEGACY
   ============================================================ */

.dc-layout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 8px;
}

.dc-col {
  width: 240px;
  flex-shrink: 0;
}

.dc-col-h {
  font-weight: 700;
  font-size: 13px;
  padding: 8px 4px;
  color: var(--text);
}

.dc-mid {
  flex: 1;
  display: flex;
  justify-content: center;
}

.dc-palette {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 12px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.dc-palette-item {
  padding: 12px 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  margin: 6px 0;
  text-align: center;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.dc-palette-item:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.dc-palette-item.active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 600;
}

.dc-phone {
  width: 375px;
  background: #0a0a14;
  border-radius: 32px;
  padding: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border);
}

.dc-screen {
  background: var(--bg-card);
  border-radius: 24px;
  overflow: hidden;
  height: 640px;
  display: flex;
  flex-direction: column;
}

.dc-page {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
}

.dc-page::-webkit-scrollbar {
  display: none;
}

.dc-comp {
  position: relative;
  margin: 8px;
  border: 1px dashed transparent;
  border-radius: var(--radius-md);
  cursor: grab;
  background: var(--bg-card);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.dc-comp:hover {
  border-color: rgba(124, 58, 237, 0.3);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.06);
}

.dc-comp.dc-sel {
  border: 2px solid var(--primary);
  box-shadow: 0 0 0 3px var(--primary-50);
}

.dc-comp-tools {
  position: absolute;
  top: 6px;
  right: 8px;
  display: none;
  gap: 6px;
}

.dc-comp:hover .dc-comp-tools {
  display: flex;
}

.dc-drag {
  cursor: grab;
  color: var(--text-muted);
}

.dc-del {
  background: var(--danger);
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.dc-del:hover {
  transform: scale(1.15);
}

.dc-banner {
  display: flex;
  gap: 8px;
  overflow: hidden;
}

.dc-banner-item {
  flex: 1;
}

.dc-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-md);
}

.dc-ph {
  background: rgba(85, 85, 112, 0.1);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 12px;
  height: 90px;
}

.dc-ph.dc-sq {
  width: 40px;
  height: 40px;
}

.dc-nav {
  padding: 10px;
}

.dc-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.dc-rich {
  padding: 12px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text);
}

.dc-goods-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px;
}

.dc-goods-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 8px;
  transition: box-shadow var(--transition-fast);
}

.dc-goods-card:hover {
  box-shadow: var(--shadow-sm);
}

.dc-goods-line {
  height: 10px;
  background: rgba(85, 85, 112, 0.12);
  border-radius: 4px;
  margin-top: 8px;
}

.dc-goods-line.short {
  width: 60%;
}

.dc-tabbar {
  display: flex;
  border-top: 1px solid var(--border-light);
  padding: 8px 0 14px;
  background: var(--bg-card);
}

.dc-tb-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--text-muted);
}

.dc-props {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  min-height: 300px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.dc-props input,
.dc-props select,
.dc-props textarea {
  font-size: 13px;
}

/* ============================================================
   RULE TAGS
   ============================================================ */

.rule-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  align-items: center;
}

.rule-tag {
  background: var(--primary-light);
  border: 1px solid rgba(124, 58, 237, 0.25);
  color: var(--primary);
  border-radius: 100px;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 500;
  transition: background var(--transition-fast);
}

.rule-tag:hover {
  background: rgba(124, 58, 237, 0.15);
}

.rule-tag a {
  margin-left: 8px;
  color: var(--danger);
  cursor: pointer;
  font-weight: 700;
  transition: color var(--transition-fast);
}

.rule-tag a:hover {
  color: #f87171;
}

.rule-add {
  border: 1px dashed var(--border);
  border-radius: 100px;
  padding: 5px 14px;
  font-size: 13px;
  width: 150px;
  background: transparent;
  color: var(--text-muted);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.rule-add:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ============================================================
   VERSION MANAGEMENT — DARK GRADIENT HERO
   ============================================================ */

.ver-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  background: linear-gradient(135deg, #7c3aed 0%, #4c1d95 50%, #1e1040 100%);
  color: #fff;
  border-radius: var(--radius-xl);
  padding: 24px 28px;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.25);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(124, 58, 237, 0.2);
}

.ver-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 50%;
}

.ver-hero-ico {
  font-size: 44px;
  position: relative;
  z-index: 1;
}

.ver-hero-v {
  font-size: 15px;
  opacity: 0.95;
  position: relative;
  z-index: 1;
}

.ver-hero-v b {
  font-size: 20px;
  font-family: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
  letter-spacing: -0.3px;
}

.ver-hero-sub {
  font-size: 12px;
  opacity: 0.7;
  margin-top: 4px;
}

.ver-hero-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  border-radius: 100px;
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 500;
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.ver-hero-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
  animation: verpulse 1.8s ease-in-out infinite;
}

@keyframes verpulse {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
  }
  50% {
    opacity: 0.5;
    box-shadow: 0 0 4px rgba(34, 197, 94, 0.3);
  }
}

.ver-list-h {
  font-weight: 700;
  font-size: 13px;
  padding: 8px 4px 12px;
  color: var(--text);
  letter-spacing: 0.01em;
}

.ver-list {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.ver-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition-fast);
}

.ver-item:last-child {
  border-bottom: none;
}

.ver-item:hover {
  background: rgba(124, 58, 237, 0.04);
}

.ver-item.ver-cur {
  background: rgba(124, 58, 237, 0.08);
  border-left: 3px solid var(--primary);
}

.ver-item-ico {
  font-size: 28px;
}

.ver-item-main {
  flex: 1;
}

.ver-item-t {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.ver-item-t b {
  font-family: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.ver-item-act {
  flex-shrink: 0;
}

.ver-empty {
  padding: 48px;
  text-align: center;
  color: var(--text-muted);
}

.ver-tip {
  padding: 14px 6px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ============================================================
   3-PANEL SHOP DECORATION EDITOR — DARK THEME
   ============================================================ */

.deco-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 24px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.deco-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.deco-header-back {
  color: var(--primary);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.deco-header-back:hover {
  color: var(--accent);
}

.deco-header-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.deco-header-center {
  display: flex;
  align-items: center;
  gap: 10px;
}

.deco-header-select {
  height: 32px;
  padding: 0 32px 0 12px;
  font-size: 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
}

.deco-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.deco-editor {
  display: flex;
  height: calc(100vh - 56px);
  overflow: hidden;
}

/* ---- Left Panel ---- */
.deco-left {
  width: 200px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.deco-left-title {
  padding: 14px 16px 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border-light);
}

.deco-left-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(124, 58, 237, 0.2) transparent;
}

.deco-left-list::-webkit-scrollbar {
  width: 4px;
}

.deco-left-list::-webkit-scrollbar-thumb {
  background: rgba(124, 58, 237, 0.25);
  border-radius: 4px;
}

.deco-left-cat {
  padding: 10px 8px 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.deco-comp-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 13px;
  color: var(--text-secondary);
}

.deco-comp-card:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.deco-comp-card:active {
  transform: scale(0.97);
}

.deco-comp-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: rgba(124, 58, 237, 0.1);
  color: var(--text-muted);
  flex-shrink: 0;
}

.deco-comp-card:hover .deco-comp-card-icon {
  background: var(--primary);
  color: #fff;
}

.deco-comp-card-name {
  font-weight: 500;
  white-space: nowrap;
}

/* ---- Center Panel ---- */
.deco-center {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 28px 20px;
  background: var(--bg);
  overflow-y: auto;
}

.deco-phone-frame {
  width: 375px;
  height: 667px;
  background: #0d0d1a;
  border-radius: 40px;
  padding: 14px;
  box-shadow:
    0 0 0 2px var(--border),
    0 20px 60px rgba(0, 0, 0, 0.6),
    inset 0 0 0 1px rgba(124, 58, 237, 0.05);
  position: relative;
  flex-shrink: 0;
}

.deco-phone-notch {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 28px;
  background: #0d0d1a;
  border-radius: 0 0 18px 18px;
  z-index: 2;
}

.deco-phone-notch::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
}

.deco-phone-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 8px 4px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  position: relative;
  z-index: 1;
}

.deco-phone-time {
  font-size: 14px;
  font-weight: 700;
}

.deco-phone-signal,
.deco-phone-battery {
  display: flex;
  align-items: center;
  color: #fff;
}

.deco-phone-brand {
  text-align: center;
  padding: 4px 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  position: relative;
  z-index: 1;
}

.deco-phone-screen {
  background: var(--bg-card);
  border-radius: 0 0 28px 28px;
  height: calc(667px - 14px - 14px - 32px - 30px);
  overflow-y: auto;
  scrollbar-width: none;
  position: relative;
}

.deco-phone-screen::-webkit-scrollbar {
  display: none;
}

.deco-phone-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ---- Phone Component Items ---- */
.deco-phone-comp {
  position: relative;
  margin: 6px 8px;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.deco-phone-comp:hover {
  border-color: rgba(124, 58, 237, 0.3);
}

.deco-phone-comp.deco-comp-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-50);
}

.deco-comp-overlay {
  position: absolute;
  top: 4px;
  right: 4px;
  display: none;
  gap: 4px;
  z-index: 5;
}

.deco-phone-comp:hover .deco-comp-overlay {
  display: flex;
}

.deco-comp-btn {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: none;
  background: rgba(20, 20, 32, 0.95);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: all var(--transition-fast);
  border: 1px solid var(--border);
}

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

.deco-comp-btn-del:hover {
  background: var(--danger);
  color: #fff;
}

/* ---- Banner ---- */
.deco-phone-banner {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
}

.deco-phone-banner-item {
  width: 100%;
  height: 100%;
}

.deco-phone-banner-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.deco-phone-banner-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
}

.deco-phone-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
}

.deco-phone-dot.active {
  background: #fff;
  width: 14px;
  border-radius: 3px;
}

/* ---- Nav ---- */
.deco-phone-nav {
  display: grid;
  padding: 12px 8px;
  gap: 4px;
}

.deco-phone-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  font-size: 12px;
  color: var(--text);
}

.deco-phone-nav-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.deco-phone-ph-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(85, 85, 112, 0.12);
}

/* ---- Notice ---- */
.deco-phone-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(245, 158, 11, 0.08);
  border-radius: var(--radius-md);
  border: 1px solid rgba(245, 158, 11, 0.15);
}

.deco-phone-notice-icon {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--warn);
  background: rgba(245, 158, 11, 0.12);
  padding: 2px 8px;
  border-radius: 4px;
}

.deco-phone-notice-text {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  font-size: 13px;
  color: var(--text);
}

.deco-phone-notice-text span {
  display: inline-block;
}

/* ---- Rich Text ---- */
.deco-phone-rich {
  padding: 12px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text);
}

/* ---- Goods ---- */
.deco-phone-section-title {
  padding: 10px 12px 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.deco-phone-goods-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 8px 12px;
}

.deco-phone-goods-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.deco-phone-goods-name {
  padding: 6px 8px 2px;
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deco-phone-goods-price {
  padding: 0 8px 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

/* ---- Linkbtn ---- */
.deco-phone-linkbtn {
  display: flex;
  gap: 8px;
  padding: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.deco-phone-linkbtn::-webkit-scrollbar {
  display: none;
}

.deco-phone-linkbtn-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.deco-phone-linkbtn-icon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
}

/* ---- Title ---- */
.deco-phone-title {
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

/* ---- Tabbar ---- */
.deco-phone-tabbar {
  display: flex;
  border-top: 1px solid var(--border-light);
  padding: 6px 0 20px;
  background: var(--bg-card);
}

.deco-phone-tabbar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  color: var(--text-muted);
}

/* ---- Placeholder ---- */
.deco-phone-ph {
  background: rgba(85, 85, 112, 0.12);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 12px;
}

/* ---- Right Panel ---- */
.deco-right {
  width: 300px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-left: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.deco-right-title {
  padding: 14px 16px 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border-light);
}

.deco-props-body {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(124, 58, 237, 0.2) transparent;
}

.deco-props-body::-webkit-scrollbar {
  width: 4px;
}

.deco-props-body::-webkit-scrollbar-thumb {
  background: rgba(124, 58, 237, 0.25);
  border-radius: 4px;
}

.deco-props-body input,
.deco-props-body select,
.deco-props-body textarea {
  font-size: 13px;
}

/* ---- Property Section ---- */
.deco-prop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
}

.deco-prop-type-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
}

.deco-prop-idx {
  font-size: 12px;
  color: var(--text-muted);
}

.deco-prop-section {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
}

.deco-prop-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.deco-prop-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.deco-prop-item-block {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border-light);
}

.deco-prop-item-block:last-of-type {
  border-bottom: none;
}

.deco-prop-item-head {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
}

.deco-prop-img-item {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border-light);
}

.deco-prop-img-head {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  padding: 0 16px;
}

/* ============================================================
   THEME SWITCHER
   ============================================================ */

.side-foot-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-switcher-wrap {
  position: relative;
}

.theme-switcher-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  padding: 0;
}

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

.theme-dropdown {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 50;
  min-width: 110px;
  animation: themeDropIn 0.15s ease-out;
}

@keyframes themeDropIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.theme-option {
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  text-align: center;
}

.theme-option:hover {
  background: var(--sidebar-hover);
  color: var(--text);
}

.theme-option.active {
  color: var(--primary);
  font-weight: 600;
  background: var(--primary-light);
}

.settings-grid .card { margin-bottom: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.form-row .input, .form-row select { width: 100%; box-sizing: border-box; }
.clause-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.clause-row .input { flex: 1; }
.btn-icon { width: 28px; height: 28px; border: none; background: transparent; color: var(--text-muted); cursor: pointer; border-radius: 6px; font-size: 14px; }
.btn-icon:hover { background: rgba(239,68,68,0.1); color: #ef4444; }
.btn.sm { padding: 6px 14px; font-size: 13px; height: auto; border-radius: 6px; }
.btn.outline { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); }
.btn.outline:hover { border-color: var(--primary); color: var(--primary); }
.btn.danger { background: #ef4444; color: #fff; }
.btn.danger:hover { background: #dc2626; }
.row.gap { display: flex; gap: 10px; flex-wrap: wrap; }

/* ========== 数据大屏 ========== */
.dbscreen { display: flex; flex-direction: column; gap: 20px; }
.dbs-top { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.dbs-mid { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; }
.dbs-btm { background: var(--card-bg); border-radius: 12px; padding: 20px; border: 1px solid var(--border-light); }

.dbs-big-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.2s;
}
.dbs-big-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(124,58,237,0.1); }
.dbs-big-card.warn { border-color: #f59e0b; }
.dbs-big-icon { font-size: 32px; width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; background: var(--primary-light); border-radius: 14px; }
.dbs-big-card.warn .dbs-big-icon { background: rgba(245,158,11,0.1); }
.dbs-big-body { flex: 1; min-width: 0; }
.dbs-big-title { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.dbs-big-num { font-size: 26px; font-weight: 800; color: var(--text); line-height: 1.2; }
.dbs-big-card.warn .dbs-big-num { color: #f59e0b; }
.dbs-big-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.dbs-chart-card, .dbs-pie-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--border-light);
}
.dbs-card-hd { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border-light); }

.dbs-bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 200px; padding-top: 10px; }
.dbs-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.dbs-bar { width: 100%; max-width: 40px; background: linear-gradient(180deg, var(--primary) 0%, rgba(124,58,237,0.4) 100%); border-radius: 6px 6px 0 0; transition: height 0.3s; min-height: 4px; }
.dbs-bar-val { font-size: 11px; color: var(--text-secondary); white-space: nowrap; }
.dbs-bar-day { font-size: 11px; color: var(--text-muted); }

.dbs-pie-list { display: flex; flex-direction: column; gap: 12px; }
.dbs-pie-row { display: flex; align-items: center; gap: 12px; }
.dbs-pie-name { font-size: 13px; color: var(--text-secondary); width: 100px; flex-shrink: 0; text-align: right; }
.dbs-pie-bar-wrap { flex: 1; height: 20px; background: var(--bg-secondary, rgba(124,58,237,0.06)); border-radius: 10px; overflow: hidden; }
.dbs-pie-bar { height: 100%; background: linear-gradient(90deg, var(--primary), rgba(124,58,237,0.6)); border-radius: 10px; transition: width 0.4s; }
.dbs-pie-num { font-size: 12px; color: var(--text-muted); width: 140px; flex-shrink: 0; }

.dbs-order-list { display: flex; flex-direction: column; }
.dbs-order-row { display: flex; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border-light); font-size: 13px; gap: 16px; }
.dbs-order-row:last-child { border-bottom: none; }
.dbs-o-no { color: var(--primary); font-weight: 600; width: 160px; flex-shrink: 0; }
.dbs-o-cust { width: 140px; flex-shrink: 0; color: var(--text-secondary); }
.dbs-o-vehicle { flex: 1; color: var(--text-muted); }
.dbs-o-amt { font-weight: 700; color: var(--accent-green, #10b981); width: 100px; text-align: right; }
.dbs-o-time { color: var(--text-muted); width: 140px; text-align: right; }
.dbs-empty { text-align: center; padding: 40px; color: var(--text-muted); font-size: 13px; }

@media (max-width: 1200px) {
  .dbs-top { grid-template-columns: repeat(2, 1fr); }
  .dbs-mid { grid-template-columns: 1fr; }
}

/* ========== 装修预览弹窗 ========== */
.deco-preview-phone {
  width: 375px;
  max-height: 600px;
  margin: 0 auto;
  background: #f5f5f5;
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid var(--border);
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}
.deco-preview-statusbar {
  display: flex;
  justify-content: space-between;
  padding: 8px 16px;
  font-size: 12px;
  color: #333;
  background: #fff;
  border-bottom: 1px solid #eee;
}
.deco-preview-content {
  height: 480px;
  overflow-y: auto;
  background: #f5f5f5;
}
.deco-preview-tabbar {
  display: flex;
  background: #fff;
  border-top: 1px solid #eee;
  padding: 6px 0;
}
.deco-preview-tab {
  flex: 1;
  text-align: center;
  font-size: 10px;
  color: #999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.deco-preview-tab.active { color: var(--primary); }
.deco-preview-tab-icon { font-size: 18px; }

/* ========== 装修预览样式 ========== */
.deco-preview-phone {
  width: 375px;
  max-height: 600px;
  margin: 0 auto;
  background: #f5f5f5;
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid var(--border);
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.deco-preview-statusbar {
  display: flex;
  justify-content: space-between;
  padding: 8px 16px;
  font-size: 12px;
  color: #333;
  background: #fff;
  border-bottom: 1px solid #eee;
}

.deco-preview-time {
  font-weight: 600;
}

.deco-preview-brand {
  font-weight: 600;
}

.deco-preview-content {
  height: 480px;
  overflow-y: auto;
  background: #f5f5f5;
}

.deco-preview-tabbar {
  display: flex;
  background: #fff;
  border-top: 1px solid #eee;
  padding: 6px 0;
}

.deco-preview-tab {
  flex: 1;
  text-align: center;
  font-size: 10px;
  color: #999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.deco-preview-tab.active {
  color: var(--primary);
}

.deco-preview-tab-icon {
  font-size: 18px;
}

/* ========== 导航栏样式（light theme） ========== */
#side-nav {
  padding: 16px 0;
}

.nav-group {
  margin-bottom: 24px;
}

.nav-group-title {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0 16px 8px;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 8px;
  margin: 0 8px;
  transition: all 0.2s;
  font-size: 13px;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: var(--text);
}

.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ========== 视觉统一整治 ========== */

/* 表格紧凑化 */
table.grid th {
  padding: 10px 14px;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
}
table.grid td {
  padding: 11px 14px;
  font-size: 13px;
}

/* 报表页：双列网格 */
.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 16px;
}
.report-grid .card { margin-bottom: 0; }

/* 报表页：KPI 指标条 */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.kpi-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
}
.kpi-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.kpi-val { font-size: 22px; font-weight: 700; color: var(--text); }

/* 分润页：双链路对称布局 */
.profit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.profit-chain {
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 14px 16px;
  background: var(--bg-card);
}
.profit-chain-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* SaaS 插件迷你标签 */
.tag-mini {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(124, 58, 237, 0.08);
  color: var(--primary);
  margin: 1px 2px 1px 0;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .profit-grid { grid-template-columns: 1fr; }
  .kpi-strip { grid-template-columns: 1fr; }
  .report-grid { grid-template-columns: 1fr; }
}


/* ========== 视觉整治第二轮 ========== */

/* 全局字体统一 */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* 顶栏：用户信息右移成胶囊 */
.topbar .sub {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-secondary);
  background: rgba(124, 58, 237, 0.07);
  padding: 5px 14px;
  border-radius: 999px;
  white-space: nowrap;
}
.topbar.no-bar { display: none; }

/* 内容区留白收紧 */
.view { padding: 20px 24px; }

/* 卡片：窄屏防溢出（表格横向滚动不出框） */
.card { overflow-x: auto; }
.report-grid .card,
.profit-chain { overflow: visible; }

/* 表格：操作列不换行、数字/金额列右对齐辅助 */
table.grid td:last-child { white-space: nowrap; }
table.grid td .btn { margin: 1px 2px 1px 0; }

/* 相邻按钮间距 */
.btn + .btn { margin-left: 6px; }

/* 卡片内 h3 标题统一 */
.card h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 14px 0 10px;
}
.card h3:first-child { margin-top: 0; }

/* 空状态统一样式 */
.empty {
  text-align: center;
  padding: 28px 16px;
  color: var(--text-muted);
  font-size: 13px;
}

/* 侧栏激活项左侧指示条 */
.nav-item.active {
  box-shadow: inset 3px 0 0 var(--primary);
}


/* ========== 账号权限：角色卡片 ========== */
.role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 16px;
}
.role-card {
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 16px;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.role-card-hd {
  display: flex;
  align-items: center;
  gap: 8px;
}
.role-card-name { font-size: 15px; font-weight: 600; color: var(--text); }
.role-card-count { margin-left: auto; font-size: 12px; color: var(--text-muted); }
.role-card-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.role-card-perms {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.role-card-perms .tag { font-size: 11px; padding: 2px 9px; }
.role-card-ft {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-light);
  padding-top: 10px;
  margin-top: 4px;
}

/* ========== 店铺装修：顶栏一条化 ========== */
.deco-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.deco-topbar-left { display: flex; align-items: center; gap: 10px; }
.deco-topbar-back { font-size: 13px; color: var(--primary); text-decoration: none; }
.deco-topbar-divider { color: var(--border); }
.deco-topbar-title { font-size: 14px; font-weight: 600; color: var(--text); }
.deco-topbar-center { display: flex; align-items: center; gap: 8px; }
.deco-topbar-select {
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 8px;
  font-size: 13px;
  background: var(--bg-card);
  color: var(--text);
}
.deco-topbar-edit-badge {
  font-size: 11px;
  color: var(--primary);
  background: rgba(124,58,237,0.08);
  padding: 3px 10px;
  border-radius: 999px;
}
.deco-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.deco-topbar-status { font-size: 12px; color: var(--text-muted); }

/* 装修编辑器三栏 */
.deco-editor { display: flex; gap: 14px; align-items: flex-start; }
.deco-left {
  width: 230px;
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 12px;
  max-height: calc(100vh - 130px);
  overflow-y: auto;
}
.deco-left-header { font-size: 13px; font-weight: 600; margin-bottom: 10px; color: var(--text); }
.deco-center { flex: 1; display: flex; justify-content: center; min-width: 0; }
.deco-right {
  width: 300px;
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 14px;
  max-height: calc(100vh - 130px);
  overflow-y: auto;
}
.deco-right-header { font-size: 13px; font-weight: 600; margin-bottom: 10px; color: var(--text); }

/* SaaS 表格插件列宽一点 */
table.grid td:nth-child(5) { min-width: 220px; }


/* ========== 首页装修配置器 ========== */
.dc-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 16px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}
.dc-block {
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}
.dc-block-title { font-size: 13px; font-weight: 600; margin-bottom: 10px; color: var(--text); }
.dc-switch-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); cursor: pointer; }
.dc-item-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.dc-item-ico {
  width: 26px; height: 26px; border-radius: 7px; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; flex-shrink: 0;
}
.dc-item-label { height: 28px; border: 1px solid var(--border); border-radius: 6px; padding: 0 8px; font-size: 13px; }

/* 手机预览（仿小程序首页） */
.dc-phone {
  width: 375px; background: #f0f2f5; border-radius: 24px; overflow: hidden;
  border: 8px solid #1a1a1a; box-shadow: 0 12px 40px rgba(0,0,0,0.18);
}
.dc-p-status {
  display: flex; justify-content: space-between; padding: 6px 14px;
  background: #fff; font-size: 11px; color: #333;
}
.dc-p-nav {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; padding: 8px 14px; border-bottom: 1px solid #eee;
}
.dc-p-brand { font-size: 11px; color: #999; }
.dc-p-nav b { font-size: 15px; color: #222; }
.dc-p-nav span { font-size: 11px; color: #999; }
.dc-p-notice {
  margin: 8px 12px 0; padding: 7px 10px; background: #fff;
  border-radius: 8px; font-size: 12px; color: #666;
}
.dc-p-body { padding: 10px 12px 20px; }
.dc-p-hello { display: flex; justify-content: space-between; align-items: flex-start; }
.dc-p-hi { font-size: 19px; font-weight: 700; color: #222; }
.dc-p-org { font-size: 11px; color: #999; margin-top: 3px; }
.dc-p-role {
  font-size: 10px; color: #4f7cf0; background: #eaf1ff;
  padding: 3px 8px; border-radius: 4px; white-space: nowrap;
}
.dc-p-date { font-size: 11px; color: #bbb; margin: 5px 0 10px; }
.dc-p-remind {
  display: flex; justify-content: space-between; align-items: center;
  background: #fff8e6; border: 1px solid #ffe7ad; border-radius: 8px;
  padding: 8px 10px; font-size: 12px; color: #8a6116; margin-bottom: 10px;
}
.dc-p-stats { display: flex; gap: 8px; margin-bottom: 10px; }
.dc-p-stat {
  flex: 1; background: #fff; border-radius: 10px; padding: 12px 0; text-align: center;
}
.dc-p-num { font-size: 17px; font-weight: 700; color: #222; }
.dc-p-lab { font-size: 10px; color: #999; margin-top: 3px; }
.dc-p-card { background: #fff; border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.dc-p-ct { font-size: 13px; font-weight: 700; color: #222; margin-bottom: 10px; }
.dc-p-grid { display: flex; flex-wrap: wrap; }
.dc-p-gitem { width: 25%; text-align: center; margin-bottom: 12px; }
.dc-p-gico {
  width: 42px; height: 42px; border-radius: 12px; margin: 0 auto 5px;
  color: #fff; font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.dc-p-gtxt { font-size: 11px; color: #444; }
.dc-p-rrow { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 12px; }
.dc-p-rank {
  width: 20px; height: 20px; border-radius: 50%; background: #e5e7eb;
  color: #666; font-size: 11px; display: flex; align-items: center; justify-content: center;
}
.dc-p-rank1 { background: #fbbf24; color: #fff; }
.dc-p-rank2 { background: #9ca3af; color: #fff; }
.dc-p-rank3 { background: #d97706; color: #fff; }
.dc-p-rname { flex: 1; color: #333; }
.dc-p-rcount { color: #999; }
.dc-p-ramt { color: #e02020; font-weight: 700; }


/* ========== 库存商品卡片 ========== */
.iv-sku-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 12px 16px;
  min-width: 150px;
}
.iv-sku-card.low { border-color: #fca5a5; background: rgba(239,68,68,0.04); }
.iv-sku-name { font-size: 13px; font-weight: 600; color: var(--text); }
.iv-sku-qty { font-size: 20px; font-weight: 700; color: var(--primary); margin: 4px 0 2px; }
.iv-sku-qty span { font-size: 12px; font-weight: 400; color: var(--text-muted); }
.iv-sku-code { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }


/* ========== 装修：角色配置标签 ========== */
.dc-roletabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.dc-roletab {
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
}
.dc-roletab:hover { border-color: var(--primary); color: var(--primary); }
.dc-roletab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}
.dc-roledot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f59e0b;
  display: inline-block;
}
.dc-roletab.active .dc-roledot { background: #fff; }


.tag.tg-purple { background: rgba(139,92,246,0.12); color: #8b5cf6; }


/* ========== 规则配置：双列网格 + 标签美化 ========== */
.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.rule-block { margin-bottom: 0; }
.rule-block-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.rule-block-hd b { font-size: 14px; }
.rule-block-tip { margin-bottom: 10px; }
.rule-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(79, 124, 240, 0.08);
  border: 1px solid rgba(79, 124, 240, 0.2);
  color: #3b6cd4;
  border-radius: 999px;
  font-size: 12.5px;
  margin: 0 6px 6px 0;
}
.rule-tag a {
  color: #b0b8c8;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: color 0.15s;
}
.rule-tag a:hover { color: #e02020; }
.rule-add {
  border: 1px dashed var(--border);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 12.5px;
  width: 130px;
  background: transparent;
  color: var(--text-secondary);
  outline: none;
}
.rule-add:focus { border-color: var(--primary); color: var(--text); }


/* ========== 数据大屏专业版 ========== */
.dbs-rank-list { display: flex; flex-direction: column; gap: 10px; }
.dbs-rank-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.dbs-rank-idx {
  width: 22px; height: 22px; border-radius: 50%; background: #e5e7eb; color: #666;
  font-size: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.dbs-rank-idx1 { background: #fbbf24; color: #fff; }
.dbs-rank-idx2 { background: #9ca3af; color: #fff; }
.dbs-rank-idx3 { background: #d97706; color: #fff; }
.dbs-rank-name { width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); flex-shrink: 0; }
.dbs-rank-amt { font-weight: 700; color: var(--text); white-space: nowrap; }
.dbs-todo-item { text-align: center; background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 10px; padding: 14px 8px; }
.dbs-todo-num { font-size: 26px; font-weight: 800; }
.dbs-todo-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* 订单中心汇总 */
.oc-stat {
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: #fff; border-radius: 12px; padding: 18px 22px;
}
.oc-num { font-size: 26px; font-weight: 800; }
.oc-label { font-size: 12px; opacity: .85; margin-top: 4px; }

/* ========== 库存树 ========== */
.inv-tree { max-height: 420px; overflow-y: auto; border: 1px solid var(--border-light); border-radius: 8px; padding: 10px 14px; }
.tree-node summary {
  cursor: pointer; padding: 6px 8px; border-radius: 6px; font-size: 13px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; list-style: none;
}
.tree-node summary::-webkit-details-marker { display: none; }
.tree-node summary::before { content: '▸'; color: var(--text-muted); transition: transform .15s; }
.tree-node[open] > summary::before { transform: rotate(90deg); }
.tree-node summary:hover { background: rgba(124,58,237,.05); }
.tree-chip {
  display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 4px;
  background: rgba(79,124,240,.08); color: #3b6cd4; margin-left: 4px;
}
.tree-chip.warn { background: rgba(224,32,32,.08); color: #e02020; }

/* ========== 侧边导航收合 ========== */
.nav-collapse-btn {
  margin-left: auto; margin-right: 10px; width: 22px; height: 22px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--bg-card);
  color: var(--text-muted); cursor: pointer; font-size: 13px; line-height: 1;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.nav-collapse-btn:hover { color: var(--primary); border-color: var(--primary); }
.side-brand { padding-right: 8px; }
body.nav-collapsed .sidebar { width: 64px; }
body.nav-collapsed .main { margin-left: 64px; }
body.nav-collapsed .side-brand-text,
body.nav-collapsed .nav-label,
body.nav-collapsed .nav-group-title,
body.nav-collapsed .side-foot span#whoami { display: none; }
body.nav-collapsed .nav-item { justify-content: center; padding: 10px 0; margin: 0 10px; }
body.nav-collapsed .side-brand { justify-content: center; padding-left: 0; gap: 0; }
body.nav-collapsed .side-foot { padding: 10px 8px; }
body.nav-collapsed .side-foot-actions { flex-direction: column; }

/* 导航分组收合 */
.nav-group-title { display: flex; align-items: center; gap: 4px; }
.nav-fold-arrow { font-size: 10px; color: var(--text-muted); width: 10px; display: inline-block; }
.nav-group.folded .nav-group-title { opacity: .7; }

/* ========== 素材库 ========== */
.mat-cat { padding: 8px 12px; border-radius: 6px; font-size: 13px; color: var(--text-secondary); cursor: pointer; }
.mat-cat:hover { background: rgba(124,58,237,.05); }
.mat-cat.active { background: rgba(124,58,237,.1); color: var(--primary); font-weight: 600; }
.mat-cell { border: 1px solid var(--border-light); border-radius: 6px; padding: 6px; position: relative; }
.mat-cell:hover { border-color: var(--primary); }
.mat-name { font-size: 11px; color: var(--text-secondary); margin: 4px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mat-copy, .mat-del { padding: 2px 8px; font-size: 11px; margin-right: 4px; }


/* ========== 平台 SaaS：事业部卡片 + 完整配置页 ========== */
.tc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.tc-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow-xs); display: flex; flex-direction: column; gap: 12px; cursor: pointer; transition: box-shadow var(--transition-normal), transform var(--transition-normal), border-color var(--transition-normal); }
.tc-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: rgba(88,86,214,.35); }
.tc-card.tc-off { opacity: .6; }
.tc-card.tc-off:hover { transform: none; }
.tc-head { display: flex; align-items: center; gap: 12px; }
.tc-avatar { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 19px; font-weight: 700; color: #fff; flex-shrink: 0; }
.tc-avatar.av0 { background: linear-gradient(135deg, #5856d6, #8e8bff); }
.tc-avatar.av1 { background: linear-gradient(135deg, #0f9d58, #4cd08a); }
.tc-avatar.av2 { background: linear-gradient(135deg, #ff9500, #ffc061); }
.tc-avatar.av3 { background: linear-gradient(135deg, #3478f6, #74aeff); }
.tc-title { min-width: 0; }
.tc-name { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tc-code { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.tc-rows { display: flex; flex-direction: column; gap: 7px; padding: 10px 0; border-top: 1px dashed var(--border); border-bottom: 1px dashed var(--border); }
.tc-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12.5px; }
.tc-row > span { color: var(--text-secondary); flex-shrink: 0; }
.tc-row > b { font-weight: 600; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-miss { color: var(--warn); font-weight: 600; }
.tc-plugs { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.tc-ft { display: flex; gap: 8px; margin-top: auto; }
.tc-ft .btn { flex: 1; }

.cfg-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.cfg-head-t { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cfg-head-t b { font-size: 16px; }
.cfg-head-t .sub { margin-left: 6px; }
.cfg-pane { animation: cfgFade var(--transition-normal); }
@keyframes cfgFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.cfg-sec { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow-xs); }
.cfg-sec-h { display: flex; gap: 11px; align-items: flex-start; margin-bottom: 14px; }
.cfg-ico { width: 34px; height: 34px; border-radius: 9px; background: var(--primary-light); display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; }
.cfg-sec-h b { font-size: 14px; display: block; }
.cfg-sec-h .sub { font-size: 12px; }
.cfg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
@media (max-width: 760px) { .cfg-grid { grid-template-columns: 1fr; } }
.cfg-field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 5px; color: var(--text-secondary); }
.cfg-field .input { width: 100%; }
.cfg-help { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; line-height: 1.55; }
.cfg-span2 { grid-column: 1 / -1; }
.cfg-proto { display: inline-block; padding: 0 5px; border-radius: 4px; font-size: 10px; font-weight: 700; letter-spacing: .4px; background: rgba(52,120,246,.1); color: #3478f6; vertical-align: 1px; }
.cfg-note { border-radius: var(--radius-md); padding: 11px 13px; font-size: 12.5px; line-height: 1.8; margin-top: 12px; }
.cfg-note.ok { background: var(--success-light); color: #1d7a3e; }
.cfg-note.info { background: var(--bg-input); color: var(--text-secondary); }
.cfg-copy { display: flex; gap: 8px; align-items: center; }
.cfg-copy .input { flex: 1; background: var(--bg-input); }
/* ========== 业务域名 + 验证文件 ========== */
.cfg-sec-sub { font-size: 13px; font-weight: 700; margin: 14px 0 8px; }
.cfg-biz-bar { display: flex; align-items: center; gap: 10px; background: linear-gradient(90deg, #6366f1, #8b5cf6); border-radius: 10px; padding: 14px 16px; }
.cfg-biz-val { flex: 1; color: #fff; font-family: Consolas, Menlo, monospace; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cfg-biz-copy { background: rgba(255,255,255,.18) !important; color: #fff !important; border: none !important; }
.cfg-biz-copy:hover { background: rgba(255,255,255,.3) !important; }
.cfg-note.warn { background: #fff7ec; color: #a86808; }
.vf-drop { border: 2px dashed var(--border); border-radius: var(--radius-lg); padding: 22px; text-align: center; cursor: pointer; transition: border-color var(--transition-fast), background var(--transition-fast); margin-top: 4px; }
.vf-drop:hover, .vf-drop.dragging { border-color: var(--primary); background: var(--primary-light); }
.vf-drop-ico { font-size: 26px; color: var(--primary); }
.vf-drop b { font-size: 13px; }
.vf-drop .sub { font-size: 12px; }
.vf-item { display: flex; align-items: center; gap: 12px; background: #f4f8ff; border: 1px solid #dbe7ff; border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; }
.vf-ico { width: 36px; height: 36px; border-radius: 9px; background: #e3edff; display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; }
.vf-main { flex: 1; min-width: 0; }
.vf-main b { font-size: 13px; }
.vf-main .sub { font-size: 11.5px; }
.vf-del { color: var(--danger) !important; border-color: var(--danger-light) !important; background: transparent !important; }
/* =====   רҵ棨οʽ ===== */
.ch-head { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 22px; margin-bottom: 16px; box-shadow: var(--shadow-xs); display: flex; align-items: center; gap: 14px; }
.ch-head-ico { width: 46px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, #7c3aed, #5856d6); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 20px; flex-shrink: 0; }
.ch-head-t b { font-size: 17px; display: block; }
.ch-head-t .sub { font-size: 12px; margin-top: 2px; }
.ch-tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--border-light); margin-bottom: 18px; }
.ch-tabs > div { padding: 11px 18px; font-size: 13px; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; user-select: none; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.ch-tabs > .on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.ch-subtabs { display: flex; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.ch-subtab { padding: 7px 16px; border-radius: 8px; font-size: 12.5px; color: var(--text-secondary); background: var(--bg-input); cursor: pointer; user-select: none; font-weight: 500; display: flex; align-items: center; gap: 5px; }
.ch-subtab.on { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.ch-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow-xs); }
.ch-card-h { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.ch-card-h b { font-size: 13.5px; }
.ch-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
@media (max-width: 760px) { .ch-2col { grid-template-columns: 1fr; } }
.ch-ft { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.ch-ft-note { font-size: 11.5px; color: var(--text-muted); margin-top: 10px; line-height: 1.7; }
.ch-tip { background: var(--bg-input); border-radius: var(--radius-md); padding: 10px 13px; font-size: 12px; line-height: 1.8; margin-top: 12px; color: var(--text-secondary); }
.ch-row-table { width: 100%; border-collapse: collapse; }
.ch-row-table th { background: var(--bg-input); font-size: 11.5px; font-weight: 600; color: var(--text-secondary); padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); }
.ch-row-table td { padding: 7px 10px; font-size: 12px; border-bottom: 1px solid var(--border-light); }
.ch-url { font-family: Consolas, monospace; font-size: 11.5px; color: var(--primary); word-break: break-all; }
.ch-ok { color: #0f9d58; font-weight: 600; font-size: 11.5px; }
.ch-miss { color: #a86808; font-weight: 600; font-size: 11.5px; }
