/* =========================================================
   星语礼 / StarGift — Luxury Atelier Design Tokens & Shared UI
   ========================================================= */
:root {
  --bg: #faf7f2;
  --bg-glow:
    radial-gradient(ellipse 70% 42% at 50% -6%, rgba(235, 206, 178, 0.34), transparent 72%),
    radial-gradient(circle at 88% 18%, rgba(236, 198, 214, 0.24), transparent 44%);
  --panel: #ffffff;
  --panel-solid: #ffffff;
  --soft: #f3ece4;
  --ink: #1e161d;
  --muted: #6e5e68;
  --accent: #c94473;
  --accent-deep: #a9325d;
  --accent-grad: linear-gradient(125deg, #d85a86 0%, #b83d6a 55%, #8b5cf6 100%);
  --champagne: #c49a52;
  --champagne-soft: rgba(196, 154, 82, 0.22);
  --butter: #f6d98c;
  --gold: #c49a52;
  --sale: #c9344c;
  --line: rgba(45, 28, 38, 0.1);
  --shadow-card: 0 22px 54px -32px rgba(28, 16, 26, 0.28), 0 1px 0 rgba(255, 255, 255, 0.8) inset;
  --shadow-dialog: 0 32px 90px rgba(18, 10, 24, 0.24);
  --nav-bg: rgba(250, 247, 242, 0.84);
  --ticker-bg: #17121b;
  --ticker-ink: #efe6da;
  --ticker-star: #dfc082;
  --radius-card: 20px;
  --radius-dialog: 20px;
  --radius-pill: 999px;
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --latin: "Cormorant Garamond", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --ease-bounce: cubic-bezier(0.3, 1.4, 0.5, 1);
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="dark"] {
  --bg: #0c0a15;
  --bg-glow:
    radial-gradient(ellipse 75% 45% at 50% -10%, rgba(155, 102, 230, 0.2), transparent 72%),
    radial-gradient(circle at 82% 20%, rgba(196, 154, 82, 0.12), transparent 42%);
  --panel: #151224;
  --panel-solid: #181529;
  --soft: #221c36;
  --ink: #f6f0e6;
  --muted: #aea3bd;
  --accent: #e87ea6;
  --accent-deep: #d45d8b;
  --champagne: #e2be78;
  --champagne-soft: rgba(226, 190, 120, 0.24);
  --line: rgba(235, 212, 178, 0.12);
  --shadow-card: 0 28px 60px -28px rgba(0, 0, 0, 0.78), inset 0 1px 0 rgba(255, 232, 195, 0.08);
  --shadow-dialog: 0 32px 90px rgba(0, 0, 0, 0.72);
  --nav-bg: rgba(12, 10, 21, 0.84);
  --ticker-bg: #07050d;
  --ticker-ink: #efe6da;
  --ticker-star: #e2be78;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image: var(--bg-glow);
  background-repeat: no-repeat;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.7;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, textarea, select {
  font-family: inherit;
  color: inherit;
}

img, svg, canvas {
  display: block;
  max-width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.container {
  width: min(1140px, 92vw);
  margin-inline: auto;
}

/* ---------- Preloader ---------- */
.sg-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: var(--bg);
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.sg-loader.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.sg-loader-seal {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe69a, #d69c38 65%, #9e6b1b);
  box-shadow: 0 12px 28px rgba(180, 120, 30, 0.35), inset 0 2px 4px rgba(255, 255, 255, 0.7);
  display: grid;
  place-items: center;
  color: #5b3306;
  font-size: 24px;
  animation: sgPulse 1.3s ease-in-out infinite;
}

.sg-loader-word {
  display: flex;
  gap: 5px;
  font-family: var(--latin);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink);
}

.sg-loader-word span {
  display: inline-block;
  animation: sgWave 1.2s ease-in-out infinite;
}

.sg-loader-word span:nth-child(2) { animation-delay: 0.08s; }
.sg-loader-word span:nth-child(3) { animation-delay: 0.16s; }
.sg-loader-word span:nth-child(4) { animation-delay: 0.24s; }
.sg-loader-word span:nth-child(5) { animation-delay: 0.32s; }
.sg-loader-word span:nth-child(6) { animation-delay: 0.40s; }
.sg-loader-word span:nth-child(7) { animation-delay: 0.48s; }
.sg-loader-word span:nth-child(8) { animation-delay: 0.56s; }

@keyframes sgWave {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); color: var(--accent); }
}

@keyframes sgPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

/* ---------- Announcement Ticker ---------- */
.ticker {
  background: var(--ticker-bg);
  color: var(--ticker-ink);
  font-family: var(--sans);
  font-size: 12.5px;
  height: 36px;
  overflow: hidden;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 120;
}

.ticker-track {
  display: flex;
  align-items: center;
  gap: 28px;
  white-space: nowrap;
  padding-left: 100%;
  animation: tickerScroll 36s linear infinite;
}

.ticker:hover .ticker-track,
.ticker:focus-within .ticker-track {
  animation-play-state: paused;
}

.ticker-item {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 4px 6px;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.2s;
}

.ticker-item:hover {
  opacity: 0.82;
  text-decoration: underline;
}

.ticker-star {
  color: var(--ticker-star);
  font-size: 11px;
}

@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* ---------- Sticky Header ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 76px;
  background: var(--nav-bg);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  width: min(1240px, 94vw);
  height: 100%;
  margin-inline: auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #2e203d, #150e20 78%);
  border: 1px solid var(--champagne);
  box-shadow: 0 8px 20px -8px rgba(30, 16, 40, 0.48), inset 0 0 0 3px rgba(226, 190, 120, 0.14);
  display: grid;
  place-items: center;
  color: #f3d79b;
  flex-shrink: 0;
}

.icon-btn svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-cn {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.brand-en {
  font-family: var(--latin);
  font-size: 12px;
  font-style: italic;
  letter-spacing: 0.14em;
  color: var(--accent);
  font-weight: 600;
}

.nav-mid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
}

.nav-link {
  position: relative;
  font-size: 14.5px;
  padding: 8px 2px;
  color: var(--ink);
  background: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.28s var(--ease-smooth);
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}

.nav-dropdown {
  position: relative;
}

.mega-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 240px;
  padding: 12px;
  border-radius: 18px;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-dialog);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, transform 0.22s var(--ease-smooth), visibility 0.22s;
  display: grid;
  gap: 4px;
  z-index: 120;
}

.nav-dropdown:hover .mega-menu,
.nav-dropdown:focus-within .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.mega-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 14px;
  transition: background 0.18s;
}

.mega-item:hover {
  background: var(--soft);
  color: var(--accent);
}

.nav-r {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  font-size: 14px;
  transition: transform 0.2s var(--ease-bounce), border-color 0.2s, background 0.2s;
  position: relative;
}

.icon-btn:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  color: var(--accent);
}

.lang-btn {
  width: auto;
  padding: 0 12px;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
}

.badge-count {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.badge-count:empty {
  display: none;
}

.hamburger-btn {
  display: none;
}

/* ---------- Mobile Drawer ---------- */
.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 10, 24, 0.48);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
}

.mobile-drawer-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(310px, 84vw);
  z-index: 210;
  background: var(--panel-solid);
  padding: 20px 20px 28px;
  transform: translateX(-104%);
  transition: transform 0.3s var(--ease-smooth);
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.mobile-drawer.open {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}

.drawer-link {
  padding: 12px 10px;
  border-radius: 12px;
  font-size: 15.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.drawer-link:hover {
  background: var(--soft);
  color: var(--accent);
}

/* ---------- Buttons ---------- */
.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.24s var(--ease-bounce), box-shadow 0.24s ease, background 0.2s, border-color 0.2s;
}

.btn-pill:hover {
  transform: translateY(-2px) scale(1.02);
}

.btn-pill:active {
  transform: translateY(0) scale(0.98);
}

.btn-primary {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 12px 26px -10px rgba(226, 70, 126, 0.65);
}

.btn-white {
  background: #ffffff;
  color: #3b1c2c;
  box-shadow: 0 12px 26px -10px rgba(0, 0, 0, 0.32);
}

.btn-ghost {
  background: var(--panel);
  border-color: var(--line);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- Shared Modals ---------- */
.sg-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(16, 10, 26, 0.56);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 18px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s;
}

.sg-modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.sg-modal {
  width: min(460px, 94vw);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-dialog);
  box-shadow: var(--shadow-dialog);
  padding: 26px 24px 24px;
  position: relative;
  transform: translateY(12px) scale(0.97);
  transition: transform 0.26s var(--ease-smooth);
}

.sg-modal-backdrop.open .sg-modal {
  transform: translateY(0) scale(1);
}

.sg-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 16px;
}

.sg-modal h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.sg-modal p.modal-sub {
  margin: 0 0 18px;
  font-size: 13.5px;
  color: var(--muted);
}

.field-group {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.field-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.field-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(226, 70, 126, 0.16);
}

/* ---------- Toast ---------- */
.sg-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  z-index: 600;
  background: rgba(34, 22, 42, 0.94);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 13.5px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s var(--ease-smooth);
}

.sg-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 72px;
  border-top: 1px solid var(--line);
  padding: 36px 0 44px;
  font-size: 13.5px;
  color: var(--muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 28px;
  margin-bottom: 28px;
}

.footer-col h4 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 14.5px;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

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

.footer-bottom {
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav-inner {
    grid-template-columns: auto 1fr auto;
    gap: 10px;
  }
  .nav-mid {
    display: none;
  }
  .hamburger-btn {
    display: inline-grid;
  }
  .nav-search-btn {
    display: none;
  }
  .brand-link {
    justify-self: center;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .site-nav {
    height: 66px;
  }
  .brand-cn {
    font-size: 16px;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

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