:root {
  --color-ink: #102033;
  --color-muted: #4b5f73;
  --color-white: #ffffff;
  --color-skybrand: #007fd0;
  --color-skybrand-strong: #073b91;
  --color-skybrand-soft: #c9f4ff;
  --color-pink: #ff8294;
  --color-focus: #073b91;
  --color-focus-ring: #ffb000;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
  --space-page-x: clamp(24px, 4.6vw, 88px);
  --shadow-soft: 0 12px 32px rgba(7, 59, 145, 0.12);
  --shadow-strong: 0 18px 48px rgba(7, 59, 145, 0.18);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--color-white);
  color: var(--color-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::-webkit-scrollbar {
  width: 12px;
}

body::-webkit-scrollbar-track {
  background: #eef9ff;
}

body::-webkit-scrollbar-thumb {
  background: #8bd8f7;
  border: 3px solid #eef9ff;
  border-radius: var(--radius-full);
}

body::-webkit-scrollbar-thumb:hover {
  background: var(--color-skybrand);
}

* {
  scrollbar-width: thin;
  scrollbar-color: #8bd8f7 #eef9ff;
}

::selection {
  background: var(--color-skybrand-strong);
  color: #ffffff;
}

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--color-focus-ring);
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
span,
a,
label,
li,
button,
input,
textarea,
select {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

img,
video,
canvas,
iframe,
svg {
  max-width: 100%;
  height: auto;
}

img,
video {
  display: block;
}

iframe {
  border: 0;
}

:where(main, section, article, aside, header, footer, nav, div, ul, ol, li) {
  min-width: 0;
}

/* 胶囊药丸按钮：长条自适应，两头半圆，绝不能是 1:1 正圆 */
button.rounded-full,
a.rounded-full,
.btn,
.btn-pill,
.btn-primary,
button[class*="rounded-full"],
a[class*="rounded-full"] {
  aspect-ratio: auto !important;
  height: auto !important;
  min-height: 42px !important;
  padding: 8px 24px !important;
  border-radius: 9999px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  width: fit-content !important;
  max-width: fit-content !important;
}

/* 仅针对无文字的独立小图标底座锁死 1:1 正圆 */
.icon-circle,
.feature-icon,
.feature-icon-wrapper,
.avatar-circle {
  aspect-ratio: 1 / 1 !important;
  flex-shrink: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 48px !important;
  height: 48px !important;
  max-width: 48px !important;
  max-height: 48px !important;
  border-radius: 50% !important;
}

[hidden],
.is-hidden {
  display: none !important;
}

/* === Components, Animations & UX Defenses === */

.site-header {
  z-index: 20;
}

.site-header::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(8, 156, 237, .55), transparent);
  pointer-events: none;
}

.nav-link {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.nav-link::after {
  content: "" !important;
  position: absolute !important;
  left: 50% !important;
  right: auto !important;
  bottom: 12px !important;
  width: 0 !important;
  height: 3.5px !important;
  border-radius: 9999px !important;
  background: #089ced !important;
  transform: translateX(-50%) !important;
  transition: width .22s ease !important;
  pointer-events: none !important;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 28px !important;
}

.page-section {
  animation: fade-in .45s ease both;
}

.page-section[hidden],
[hidden],
.hidden {
  pointer-events: none !important;
}

.page-section:not([hidden]) {
  pointer-events: auto;
}

[data-page-section="home"] > .relative:first-child::before {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 72% 18%, rgba(255, 130, 148, .22), transparent 22%),
    radial-gradient(circle at 88% 74%, rgba(255, 255, 255, .72), transparent 18%),
    radial-gradient(circle at 18% 82%, rgba(8, 156, 237, .16), transparent 26%);
  pointer-events: none;
}

[data-page-section="home"] img {
  transition: transform .36s cubic-bezier(.2, .8, .2, 1), box-shadow .36s ease, filter .36s ease;
  will-change: transform;
}

[data-page-section="home"] img:hover {
  transform: translateY(-8px) scale(1.025) rotate(0deg);
  box-shadow: 0 26px 62px rgba(7, 59, 145, .24);
  filter: saturate(1.06);
}

.rounded-2xl.shadow-2xl,
.rounded-xl.shadow-lg {
  position: relative;
}

.rounded-2xl.shadow-2xl::after,
.rounded-xl.shadow-lg::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,.42), transparent 38%);
  pointer-events: none;
}

button,
[role="button"],
a,
summary,
label[for],
select {
  cursor: pointer;
}

button,
[role="button"],
a {
  transition-property: transform, box-shadow, background-color, color, border-color, opacity, filter;
  transition-duration: .22s;
  transition-timing-function: ease;
}

button:hover,
[role="button"]:hover,
a:hover {
  transform: translateY(-2px);
}

button:active,
[role="button"]:active,
a:active {
  transform: translateY(0) scale(.975);
}

button:disabled,
[aria-disabled="true"] {
  cursor: not-allowed !important;
  pointer-events: none !important;
  opacity: .48;
  filter: grayscale(.15);
}

.glass,
.glass-card,
.floating-panel {
  background: linear-gradient(135deg, rgba(255,255,255,.78), rgba(255,255,255,.46));
  border: 1px solid rgba(255,255,255,.72);
  box-shadow: 0 22px 60px rgba(7,59,145,.16), inset 0 1px 0 rgba(255,255,255,.85);
  backdrop-filter: blur(18px) saturate(1.35);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
}

.product-card,
.category-card,
.detail-card {
  isolation: isolate;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}

.product-card::before,
.category-card::before,
.detail-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(8,156,237,.28), rgba(255,130,148,.22), rgba(255,255,255,0));
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}

.product-card:hover,
.category-card:hover,
.detail-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 54px rgba(7,59,145,.16);
}

.product-card:hover::before,
.category-card:hover::before,
.detail-card:hover::before {
  opacity: 1;
}

.modal-backdrop,
.overlay,
.drawer-backdrop,
.popup-mask,
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: rgba(7, 25, 48, .42);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: opacity .25s ease, visibility .25s ease;
}

.modal,
.dialog,
.drawer,
.popup {
  z-index: 45;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(18px) scale(.98);
  transition: opacity .25s ease, visibility .25s ease, transform .25s ease;
}

.modal-backdrop.active,
.modal-backdrop.is-active,
.overlay.active,
.overlay.is-active,
.drawer-backdrop.active,
.drawer-backdrop.is-active,
.popup-mask.active,
.popup-mask.is-active,
.loading-overlay.active,
.loading-overlay.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal.active,
.modal.is-active,
.dialog.active,
.dialog.is-active,
.drawer.active,
.drawer.is-active,
.popup.active,
.popup.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.toast,
.toast-container,
[role="status"],
[aria-live] {
  z-index: 9999 !important;
  pointer-events: auto;
}

.floating-action,
.float-button,
.chat-widget {
  z-index: 35;
}

.skeleton {
  position: relative;
  overflow: hidden;
  color: transparent !important;
  background: #eaf7ff;
  border-radius: inherit;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.72), transparent);
  animation: skeleton-loading 1.35s infinite;
  pointer-events: none;
}

.animate-fade-in {
  animation: fade-in .45s ease both;
}

.animate-slide-up {
  animation: slide-up .48s cubic-bezier(.2,.8,.2,1) both;
}

.animate-scale-bounce {
  animation: scale-bounce .5s cubic-bezier(.2,.9,.25,1.25) both;
}

.animate-float {
  animation: float-soft 4.6s ease-in-out infinite;
}

@keyframes skeleton-loading {
  to {
    transform: translateX(100%);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scale-bounce {
  0% {
    opacity: 0;
    transform: scale(.88);
  }
  70% {
    opacity: 1;
    transform: scale(1.035);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes float-soft {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.dark .site-header {
  background: rgba(7, 18, 32, .9);
  border-color: rgba(76, 201, 255, .18);
  box-shadow: 0 10px 30px rgba(0,0,0,.28);
}

.dark .site-header::after {
  background: linear-gradient(90deg, transparent, rgba(76,201,255,.42), transparent);
}

.dark .nav-link::after {
  background: linear-gradient(90deg, #ff8294, #4cc9ff);
}

.dark [data-page-section="home"] > .relative:first-child {
  background: linear-gradient(115deg, #08213d, #073b5d 52%, #0b4f72);
}

.dark [data-page-section="home"] > .relative:first-child::before {
  background:
    radial-gradient(circle at 72% 18%, rgba(255,130,148,.16), transparent 24%),
    radial-gradient(circle at 22% 80%, rgba(76,201,255,.14), transparent 28%);
}

.dark .glass,
.dark .glass-card,
.dark .floating-panel {
  background: linear-gradient(135deg, rgba(18,39,62,.78), rgba(10,24,40,.52));
  border-color: rgba(139,216,247,.2);
  box-shadow: 0 22px 60px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.08);
}

.dark .product-card:hover,
.dark .category-card:hover,
.dark .detail-card:hover {
  box-shadow: 0 22px 54px rgba(0,0,0,.36);
}

.dark .modal-backdrop,
.dark .overlay,
.dark .drawer-backdrop,
.dark .popup-mask,
.dark .loading-overlay {
  background: rgba(0, 8, 18, .68);
}

.dark .skeleton {
  background: #12304a;
}

.dark .skeleton::after {
  background: linear-gradient(90deg, transparent, rgba(139,216,247,.16), transparent);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}