/* vibedesign/web 公共层：控件与组件 —— 卡面基类 / Spotlight / 弹窗 / Toast
   （对齐 lite 模式：卡组件表面与细节同居本文件，基组在前、细节在后，无跨文件顺序依赖；
    template/theme-studio/value-card 营销卡面基组归页级 assets/css/shared.css（@import 引入）） */
.card.top-nav {
  background: var(--surface-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: visible;
}

/* 顶栏玻璃特例（自 chrome.css 归拢，紧随表面基组；滚动态覆写见 chrome.css .card.top-nav.is-scrolled）：
   须 visible：品牌皮 wa-combo 列表挂在 field 内，hidden 会裁切下拉；
   半透明底 + 毛玻璃，不被下方 home→brand 映射的偏实 surface 盖住 */
.card.top-nav {
  overflow: visible;
  background: rgba(255, 255, 255, 0.52);
  border-color: rgba(18, 16, 26, 0.06);
  backdrop-filter: saturate(140%) blur(16px);
  -webkit-backdrop-filter: saturate(140%) blur(16px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.45) inset,
    0 4px 16px rgba(48, 36, 120, 0.06);
}
[data-theme="dark"] .card.top-nav {
  background: rgba(26, 22, 42, 0.55);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 8px 28px rgba(0, 0, 0, 0.28);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card.top-nav {
    background: rgba(255, 255, 255, 0.92);
  }
  [data-theme="dark"] .card.top-nav {
    background: rgba(26, 22, 42, 0.92);
  }
}

.spotlight-host {
  --mouse-x: 50%;
  --mouse-y: 50%;
  --spotlight-size: 400px;
  --spotlight-alpha: 0.11;
  --spotlight-mid: 0.04;
  position: relative;
  overflow: visible;
}
.spotlight-glow {
  position: absolute !important;
  inset: 0;
  border-radius: inherit;
  z-index: 3 !important;
  opacity: 0;
  transition: opacity 0.28s ease;
  pointer-events: none;
  background: radial-gradient(
    var(--spotlight-size) circle at var(--mouse-x) var(--mouse-y),
    rgba(var(--brand-primary-rgb), var(--spotlight-alpha)),
    rgba(var(--brand-primary-rgb), var(--spotlight-mid)) 42%,
    transparent 72%
  );
}
.spotlight-host:hover > .spotlight-glow { opacity: 1; }
.spotlight-host:has(.spotlight-host:hover) > .spotlight-glow { opacity: 0; }
.spotlight-host > *:not(.spotlight-glow) {
  position: relative;
  z-index: 1;
}
[data-theme="dark"] .spotlight-host {
  --spotlight-alpha: 0.18;
  --spotlight-mid: 0.07;
}


.modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: none;
}
.modal.is-open { display: block; }
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
}
[data-theme="dark"] .modal-overlay { background: rgba(0, 0, 0, 0.62); }
.modal-dialog {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: min(360px, calc(100vw - 40px));
  z-index: 1;
}
.modal-panel {
  position: relative;
  width: 100%;
  border-radius: var(--radius-card);
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.10);
  text-align: center;
  overflow: visible;
}
[data-theme="dark"] .modal-panel {
  background: #161322;
  border-color: rgba(255, 255, 255, 0.12);
}
.modal.is-open .modal-dialog { animation: modal-in 220ms var(--ease) both; }
@keyframes modal-in {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 8px)) scale(0.99); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.modal-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.88);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}
.modal-close:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.78);
  color: #ffffff;
}
.modal-close:active {
  transform: scale(0.96);
}
.modal-wechat-body { padding: 36px 22px 40px; }
.modal-wechat-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
}
.modal-wechat-desc {
  margin: 0 0 22px;
  padding:0 12px;
  font-size: 14px;
  color: var(--text-secondary);
}
.modal-wechat-qr {
  margin: 0 auto;
  display: inline-block;
  padding: 4px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  line-height: 0;
}
[data-theme="dark"] .modal-wechat-qr {
  border-color: rgba(255, 255, 255, 0.12);
}
.modal-wechat-qr img {
  display: block;
  width: 200px;
  height: 200px;
  border-radius: 0;
  object-fit: contain;
}
body.modal-open { overflow: hidden; }

.toast-stack {
  position: fixed;
  top: 16px;
  right: 0;
  left: 0;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 0 20px;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  max-width: min(420px, calc(100vw - 40px));
  padding: 10px 14px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(18, 16, 26, 0.04);
  box-shadow: 0 10px 28px rgba(48, 36, 120, 0.1);
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.45;
  pointer-events: auto;
  opacity: 0;
  transform: translateX(calc(100% + 28px));
  transition:
    transform 380ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 300ms var(--ease);
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.toast.is-leaving {
  opacity: 0;
  transform: translateX(calc(100% + 28px));
  transition-duration: 260ms;
}

.toast__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--brand-primary-muted);
  color: var(--brand-primary);
  flex-shrink: 0;
  font-size: 13px;
}

.toast__text {
  flex: 1;
  min-width: 0;
}

[data-theme="dark"] .toast {
  background: #232324;
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.34);
}

