/*
 * 浪客授权 C 端体验层
 * 目标：统一首页与用户中心的视觉节奏、触控反馈和 GSAP 合成层。
 * 页面在没有 JavaScript / GSAP 时保持完整可见，动效仅作渐进增强。
 */

:root {
  --c-motion-fast: 160ms;
  --c-motion-base: 240ms;
  --c-motion-slow: 420ms;
  --c-ease-out: cubic-bezier(.16, 1, .3, 1);
  --c-ease-standard: cubic-bezier(.2, .72, .2, 1);
  --c-surface-shadow: 0 18px 48px -34px rgba(15, 23, 42, .34);
  --c-surface-shadow-hover: 0 24px 56px -34px rgba(30, 85, 242, .36);
  --c-focus-ring: 0 0 0 4px rgba(30, 85, 242, .14);
}

body[data-lk-page] :where(button, a, input, select, textarea) {
  -webkit-tap-highlight-color: transparent;
}

/* Keep legacy component transitions on composited/visual properties only. */
body[data-lk-page] *,
body[data-lk-page] *::before,
body[data-lk-page] *::after {
  transition-property: color, background-color, border-color, opacity, transform, box-shadow, filter, width, max-height, left;
}

body[data-lk-page] :where(button, a, [role="button"]):focus-visible {
  outline: 3px solid rgba(30, 85, 242, .28);
  outline-offset: 3px;
}

.lk-skip-link {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: max(10px, env(safe-area-inset-left));
  z-index: 10000;
  min-height: 44px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  border-radius: 10px;
  background: #0f172a;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .24);
  transform: translateY(calc(-100% - 24px));
  transition: transform var(--c-motion-base) var(--c-ease-out);
}

.lk-skip-link:focus-visible {
  transform: translateY(0);
}

body[data-lk-page="home"] section[id] {
  scroll-margin-top: 84px;
}

body[data-lk-page] [data-lk-press] {
  transform-origin: center;
}

/* ------------------------------
   首页：首页导航与首屏
   ------------------------------ */
body[data-lk-page="home"] .nav-wrap {
  background: rgba(255, 255, 255, .78);
  backdrop-filter: saturate(150%) blur(16px);
  -webkit-backdrop-filter: saturate(150%) blur(16px);
  transition:
    background-color var(--c-motion-base) ease,
    border-color var(--c-motion-base) ease,
    box-shadow var(--c-motion-base) ease;
}

body[data-lk-page="home"] .nav-wrap.is-scrolled {
  background: rgba(255, 255, 255, .94);
  border-bottom-color: rgba(148, 163, 184, .24);
  box-shadow: 0 12px 34px -28px rgba(15, 23, 42, .7);
}

body[data-lk-page="home"] .hero {
  isolation: isolate;
}

body[data-lk-page="home"] .hero-inner {
  position: relative;
  z-index: 2;
}

body[data-lk-page="home"] .hero-title {
  text-wrap: balance;
}

body[data-lk-page="home"] .hero-sub {
  max-width: 590px;
}

body[data-lk-page="home"] .hero-ctas .btn {
  min-height: 48px;
  box-shadow: none;
  transition:
    color var(--c-motion-base) ease,
    background-color var(--c-motion-base) ease,
    border-color var(--c-motion-base) ease,
    box-shadow var(--c-motion-base) ease;
}

body[data-lk-page="home"] .hero-ctas .btn-blue:hover {
  box-shadow: 0 14px 30px -18px rgba(30, 85, 242, .78);
}

body[data-lk-page="home"] .lic-card {
  --lk-spot-x: 76%;
  --lk-spot-y: 22%;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  transition: box-shadow var(--c-motion-slow) var(--c-ease-out);
}

body[data-lk-page="home"] .lic-card:hover {
  box-shadow: 0 34px 76px -34px rgba(7, 24, 72, .72);
}

body[data-lk-page="home"] .lic-card::before {
  inset: 0;
  width: auto;
  height: auto;
  border-radius: inherit;
  background: radial-gradient(
    circle at var(--lk-spot-x) var(--lk-spot-y),
    rgba(104, 151, 255, .42),
    rgba(75, 123, 255, .08) 34%,
    transparent 62%
  );
  transition: opacity var(--c-motion-base) ease;
}

body[data-lk-page="home"] .lic-card > * {
  transform: translateZ(1px);
}

body[data-lk-page="home"] .lic-state,
body[data-lk-page="home"] .foot-status {
  contain: paint;
}

body[data-lk-page="home"] .tier.featured,
body[data-lk-page="home"] .step:hover .step-ico {
  animation: none;
}

body[data-lk-page="home"] .marquee-item .star svg {
  animation-duration: 18s;
}

body[data-lk-page="home"] .lic-foot .barcode::after {
  animation-duration: 5.4s;
}

/* 卡片用边框、阴影和颜色反馈，不用大幅位移制造“漂浮感”。 */
body[data-lk-page="home"] :where(.prod, .step, .tier, .bento .cell, .faq, .verify-box) {
  box-shadow: var(--c-surface-shadow);
  transition:
    border-color var(--c-motion-base) ease,
    box-shadow var(--c-motion-slow) var(--c-ease-out),
    background-color var(--c-motion-base) ease;
}

body[data-lk-page="home"] :where(.prod, .step, .tier, .bento .cell, .faq, .verify-box):hover,
body[data-lk-page="home"] :where(.prod, .step, .tier, .bento .cell, .faq, .verify-box):focus-within {
  border-color: rgba(30, 85, 242, .28);
  box-shadow: var(--c-surface-shadow-hover);
}

body[data-lk-page="home"] .prod-btn,
body[data-lk-page="home"] .faq-q,
body[data-lk-page="home"] .prod-tab {
  min-height: 44px;
}

body[data-lk-page="home"] .prod-tab {
  transition:
    color var(--c-motion-fast) ease,
    background-color var(--c-motion-fast) ease,
    border-color var(--c-motion-fast) ease,
    box-shadow var(--c-motion-fast) ease;
}

body[data-lk-page="home"] .prod-tab.on {
  box-shadow: 0 9px 22px -14px rgba(15, 23, 42, .72);
}

body[data-lk-page="home"] .faq-a {
  transition: max-height 320ms var(--c-ease-standard);
}

body[data-lk-page="home"] .faq-q .chev {
  transition: transform 260ms var(--c-ease-out), color var(--c-motion-fast) ease;
}

/* ------------------------------
   用户中心：C 端信息层级
   ------------------------------ */
body[data-lk-page="dashboard"] {
  background:
    radial-gradient(circle at 2% 2%, rgba(30, 85, 242, .07), transparent 34%),
    radial-gradient(circle at 98% 94%, rgba(56, 214, 255, .06), transparent 34%),
    #f7f9fd;
}

body[data-lk-page="dashboard"] .uc-sidebar {
  box-shadow: 18px 0 50px -46px rgba(15, 23, 42, .72);
}

body[data-lk-page="dashboard"] .uc-brand-mark {
  border-radius: 12px;
  box-shadow: 0 12px 25px -12px rgba(30, 85, 242, .7);
}

body[data-lk-page="dashboard"] .menu-group-title {
  margin-top: 10px;
  color: #7c899d;
  letter-spacing: .08em;
}

body[data-lk-page="dashboard"] .uc-menu button {
  min-height: 44px;
  transition:
    color var(--c-motion-fast) ease,
    background-color var(--c-motion-fast) ease,
    box-shadow var(--c-motion-base) ease;
}

body[data-lk-page="dashboard"] .uc-menu button.active {
  box-shadow: 0 12px 28px -18px rgba(30, 85, 242, .8);
}

body[data-lk-page="dashboard"] .uc-main {
  width: min(100%, 1540px);
  margin-inline: auto;
  padding: 26px clamp(20px, 2.5vw, 38px) 42px;
}

body[data-lk-page="dashboard"] .uc-page-head {
  position: sticky;
  top: 0;
  z-index: 12;
  margin: -10px -8px 18px;
  padding: 12px 8px 14px;
  background: linear-gradient(180deg, rgba(247, 249, 253, .96) 72%, rgba(247, 249, 253, 0));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

body[data-lk-page="dashboard"] .pg-title {
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.2;
}

body[data-lk-page="dashboard"] .pg-sub {
  max-width: 660px;
  line-height: 1.55;
}

body[data-lk-page="dashboard"] .uc-btn {
  min-height: 44px;
  transition:
    color var(--c-motion-fast) ease,
    background-color var(--c-motion-fast) ease,
    border-color var(--c-motion-fast) ease,
    box-shadow var(--c-motion-base) ease;
}

body[data-lk-page="dashboard"] .uc-btn-primary:hover {
  box-shadow: 0 14px 30px -18px rgba(30, 85, 242, .75);
}

body[data-lk-page="dashboard"] .uc-card,
body[data-lk-page="dashboard"] .auth-card,
body[data-lk-page="dashboard"] .ip-card {
  border-color: rgba(203, 213, 225, .76);
  box-shadow: var(--c-surface-shadow);
}

body[data-lk-page="dashboard"] .uc-card {
  border-radius: 16px;
}

/* 首页欢迎区 */
.uc-welcome {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(250px, .65fr);
  gap: clamp(20px, 3vw, 42px);
  margin-bottom: 20px;
  padding: clamp(24px, 3.2vw, 40px);
  overflow: hidden;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 22px;
  background:
    radial-gradient(circle at 86% 12%, rgba(82, 147, 255, .42), transparent 34%),
    linear-gradient(135deg, #071736 0%, #0b2d83 54%, #1e55f2 132%);
  box-shadow: 0 30px 70px -38px rgba(14, 45, 128, .82);
  isolation: isolate;
}

.uc-welcome::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .55;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(90deg, #000, transparent 84%);
  -webkit-mask-image: linear-gradient(90deg, #000, transparent 84%);
}

.uc-welcome-copy {
  align-self: center;
  min-width: 0;
}

.uc-welcome-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 13px;
  color: #c9d8ff;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.uc-welcome-eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5be49e;
  box-shadow: 0 0 0 5px rgba(91, 228, 158, .13);
}

.uc-welcome h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(25px, 3vw, 38px);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -.025em;
  text-wrap: balance;
}

.uc-welcome-copy > p {
  max-width: 650px;
  margin: 12px 0 0;
  color: #b8c8ef;
  font-size: 14px;
  line-height: 1.7;
}

.uc-welcome-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 22px;
}

.uc-welcome-action {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  color: #eaf0ff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 10px;
  background: rgba(255, 255, 255, .07);
  transition:
    background-color var(--c-motion-fast) ease,
    border-color var(--c-motion-fast) ease,
    box-shadow var(--c-motion-base) ease;
}

.uc-welcome-action:hover,
.uc-welcome-action:focus-visible {
  color: #fff;
  border-color: rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .13);
}

.uc-welcome-action.primary {
  color: #12357f;
  border-color: #fff;
  background: #fff;
  box-shadow: 0 14px 26px -18px rgba(255, 255, 255, .7);
}

.uc-welcome-status {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 17px;
  background: rgba(255, 255, 255, .075);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.uc-welcome-status__head {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #c9d8ff;
  font-size: 12px;
  font-weight: 700;
}

.uc-welcome-status__head iconify-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 18px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .11);
}

.uc-welcome-status strong {
  display: block;
  margin-top: 14px;
  color: #fff;
  font-family: "Manrope", "Noto Sans SC", sans-serif;
  font-size: clamp(34px, 4.2vw, 52px);
  line-height: 1;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}

.uc-welcome-status small {
  display: block;
  margin-top: 8px;
  color: #b8c8ef;
  font-size: 12px;
  line-height: 1.55;
}

.uc-welcome-status__link {
  min-height: 44px;
  margin-top: 14px;
  padding: 0;
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  border: 0;
  background: transparent;
}

.uc-welcome-status__link iconify-icon {
  margin-left: 4px;
  transition: transform var(--c-motion-base) var(--c-ease-out);
}

.uc-welcome-status__link:hover iconify-icon,
.uc-welcome-status__link:focus-visible iconify-icon {
  transform: translateX(4px);
}

/* 数据卡改为真正可操作的 C 端入口。 */
body[data-lk-page="dashboard"] .kpi-card {
  width: 100%;
  min-height: 168px;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
  border-color: rgba(203, 213, 225, .82);
  box-shadow: var(--c-surface-shadow);
  transition:
    border-color var(--c-motion-base) ease,
    box-shadow var(--c-motion-slow) var(--c-ease-out),
    background-color var(--c-motion-base) ease;
}

body[data-lk-page="dashboard"] .kpi-card:hover,
body[data-lk-page="dashboard"] .kpi-card:focus-visible {
  border-color: rgba(30, 85, 242, .3);
  box-shadow: var(--c-surface-shadow-hover), var(--c-focus-ring);
}

body[data-lk-page="dashboard"] .kpi-card::after {
  content: "查看";
  position: absolute;
  top: 17px;
  right: 17px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  opacity: 0;
  transform: translateX(-3px);
  transition: opacity var(--c-motion-fast) ease, transform var(--c-motion-base) var(--c-ease-out);
}

body[data-lk-page="dashboard"] .kpi-card:hover::after,
body[data-lk-page="dashboard"] .kpi-card:focus-visible::after {
  opacity: 1;
  transform: translateX(0);
}

body[data-lk-page="dashboard"] .kpi-value {
  font-variant-numeric: tabular-nums;
}

body[data-lk-page="dashboard"] .onboard h3 {
  letter-spacing: -.01em;
}

body[data-lk-page="dashboard"] .ob-step {
  min-height: 84px;
  transition:
    border-color var(--c-motion-fast) ease,
    background-color var(--c-motion-fast) ease,
    box-shadow var(--c-motion-base) ease;
}

body[data-lk-page="dashboard"] .ob-step:hover,
body[data-lk-page="dashboard"] .ob-step:focus-visible {
  box-shadow: 0 14px 30px -24px rgba(30, 85, 242, .55);
}

/* GSAP 只在活跃时申请合成层，避免长期占用显存。 */
.lk-motion-active {
  will-change: transform, opacity;
  transition-property: none !important;
  transition-duration: 0s !important;
}

@media (max-width: 900px) {
  .uc-welcome {
    grid-template-columns: minmax(0, 1fr);
  }

  .uc-welcome-status {
    min-height: 164px;
  }
}

@media (max-width: 768px) {
  body[data-lk-page="home"] .hero-inner {
    gap: 30px !important;
  }

  body[data-lk-page="home"] .lic-card {
    transform-style: flat;
  }

  body[data-lk-page="home"] .lic-card > * {
    transform: none;
  }

  body[data-lk-page="dashboard"] .uc-main {
    padding-right: max(14px, var(--mobile-safe-right)) !important;
    padding-left: max(14px, var(--mobile-safe-left)) !important;
  }

  body[data-lk-page="dashboard"] .uc-page-head {
    position: relative;
    margin: 0 0 16px;
    padding: 0;
    background: transparent;
    backdrop-filter: none;
  }

  body[data-lk-page="dashboard"] :where(
    .al-btn,
    .ap2-cta-btn,
    .of-btn,
    .empty-cta,
    .prod-btn,
    .copy-btn,
    .bm-close,
    .qty-input,
    .qty-input button,
    .qty-input input,
    .uc-input,
    .uc-select,
    .uc-burger,
    .uc-btn
  ) {
    min-height: 44px;
  }

  body[data-lk-page="dashboard"] :where(
    .copy-btn,
    .bm-close,
    .qty-input button
  ) {
    min-width: 44px;
  }

  .uc-welcome {
    padding: 24px 20px;
    border-radius: 19px;
  }

  .uc-welcome-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .uc-welcome-action {
    width: 100%;
  }
}

@media (max-width: 480px) {
  body[data-lk-page="dashboard"] .bm-actions > * {
    flex: 0 0 auto;
    width: 100%;
    min-height: 44px;
  }

  body[data-lk-page="dashboard"] .uc-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px;
  }

  body[data-lk-page="dashboard"] .kpi-card {
    min-height: 148px;
    padding: 15px;
  }

  body[data-lk-page="dashboard"] .kpi-icon {
    width: 39px;
    height: 39px;
    margin-bottom: 10px;
  }

  body[data-lk-page="dashboard"] .kpi-value {
    font-size: clamp(20px, 6.5vw, 25px);
    overflow-wrap: anywhere;
  }

  body[data-lk-page="dashboard"] .kpi-card::after {
    display: none;
  }

  .uc-welcome {
    padding: 22px 18px;
  }

  .uc-welcome-copy > p {
    font-size: 13px;
  }

  .uc-welcome-actions {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-lk-page] *,
  body[data-lk-page] *::before,
  body[data-lk-page] *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

  body[data-lk-page="home"] .lic-card,
  body[data-lk-page="home"] .lic-card > *,
  .lk-motion-active {
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    will-change: auto !important;
  }
}
