/* luxe 主题：左下角客服 / 布局切换浮层（与 portal site-chrome.js 配套） */
:root {
  --bg-primary: #0a0a0c;
  --bg-secondary: #121214;
  --bg-tertiary: #1c1c1f;
  --border-color: rgba(255, 255, 255, 0.1);
  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --accent-primary: #3b82f6;
  --accent-secondary: #60a5fa;
  --accent-danger: #ef4444;
  --gradient-start: #3b82f6;
  --gradient-end: #2563eb;
  --btn-primary-fg: #0d1117;
  --modal-backdrop: rgba(0, 0, 0, 0.72);
}

html[data-theme="light"] {
  --bg-primary: #fafafa;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --border-color: #e2e8f0;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --accent-primary: #2563eb;
  --accent-secondary: #3b82f6;
  --accent-danger: #dc2626;
  --gradient-start: #3b82f6;
  --gradient-end: #2563eb;
  --btn-primary-fg: #ffffff;
  --modal-backdrop: rgba(15, 23, 42, 0.45);
}

.site-chrome-stack {
  position: fixed;
  left: 14px;
  bottom: 14px;
  left: calc(14px + env(safe-area-inset-left, 0px));
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  z-index: 100100;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
}

.site-chrome-stack__toolbar {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  width: 80px;
  box-sizing: border-box;
}

.site-chrome-stack__drag {
  flex: 1;
  min-width: 0;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  letter-spacing: 1px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.site-chrome-stack__drag::after {
  content: "⋮⋮";
  opacity: 0.85;
}

.site-chrome-stack--dragging .site-chrome-stack__drag {
  cursor: grabbing;
}

.site-chrome-stack--dragging .site-chrome-fab {
  pointer-events: none;
}

.site-chrome-stack__close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  margin: 0;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.site-chrome-stack__close:hover {
  background: var(--accent-danger);
  color: #fff;
  border-color: transparent;
}

.site-chrome-fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.45);
  background: linear-gradient(145deg, var(--accent-primary), var(--gradient-end));
  color: #ffffff;
  box-shadow:
    0 6px 22px rgba(0, 0, 0, 0.28),
    0 2px 6px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

.site-chrome-fab:hover {
  transform: scale(1.08);
  filter: brightness(1.1);
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.32),
    0 2px 8px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.site-chrome-fab:active {
  transform: scale(1.02);
}

html[data-theme="light"] .site-chrome-fab {
  border-color: rgba(255, 255, 255, 0.65);
  box-shadow:
    0 6px 24px color-mix(in srgb, var(--accent-primary) 38%, transparent),
    0 2px 8px rgba(15, 23, 42, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

html[data-theme="light"] .site-chrome-stack {
  filter: drop-shadow(0 2px 10px rgba(15, 23, 42, 0.12));
}

@media (max-width: 768px) {
  .site-chrome-stack {
    filter: none;
    left: 12px;
    bottom: 18px;
    left: calc(12px + env(safe-area-inset-left, 0px));
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  }

  html[data-theme="light"] .site-chrome-stack {
    filter: none;
  }
}

@media (max-width: 480px) {
  .site-chrome-fab {
    width: 52px;
    height: 52px;
  }
}

.site-chrome-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100200;
  background: rgba(15, 23, 42, 0.58);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.site-chrome-modal__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: none;
  border-radius: 16px;
  max-width: 400px;
  width: 100%;
  max-height: min(85vh, 560px);
  overflow: hidden;
  padding: 0;
  box-shadow:
    0 24px 64px rgba(15, 23, 42, 0.38),
    0 8px 28px rgba(37, 99, 235, 0.22);
  animation: siteChromeModalPanelIn 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes siteChromeModalPanelIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.site-chrome-modal__header {
  flex-shrink: 0;
  padding: 28px 24px 22px;
  text-align: center;
  color: #fff;
  background: linear-gradient(180deg, #5ba3f5 0%, #3b82f6 48%, #2563eb 100%);
}

.site-chrome-modal__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.site-chrome-modal__title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  padding: 0;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.site-chrome-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.site-chrome-modal__close:hover {
  background: rgba(255, 255, 255, 0.38);
  color: #fff;
}

.site-chrome-modal__body {
  flex: 1;
  overflow: auto;
  padding: 24px 22px 12px;
  text-align: center;
  background: #ffffff;
}

.site-chrome-modal__pre {
  margin: 0 0 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  color: #0f172a;
  text-align: center;
}

.site-chrome-modal__pre + .site-chrome-modal__pre {
  font-weight: 400;
  font-size: 14px;
  color: #64748b;
}

.site-chrome-modal__inline-link {
  color: #2563eb;
  text-decoration: underline;
  word-break: break-all;
}

.site-chrome-modal__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  margin: 10px 0 0;
  padding: 14px 16px;
  border-radius: 10px;
  background: #2563eb;
  color: #ffffff !important;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: filter 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.28);
}

.site-chrome-modal__cta:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.34);
}

.site-chrome-modal__cta--alt {
  background: #f8fafc;
  color: #e11d48 !important;
  border: 1px solid #e2e8f0;
  box-shadow: none;
}

.site-chrome-modal__cta--alt:hover {
  filter: none;
  background: #f1f5f9;
  box-shadow: none;
}

.site-chrome-modal__empty {
  margin: 8px 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.6;
}

.site-chrome-modal__footer {
  flex-shrink: 0;
  padding: 14px 22px 18px;
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
  color: #94a3b8;
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
}
