@import url("../fonts/inter.css");

:root {
  --frame-bg: #000;
  --frame-ring: #1f2937;
  --screen-bg: #0a0a0a;
  --text-color: #ffffff;
  --brand: #d9ff00;
  --brand-muted: rgba(217, 255, 0, 0.1);
  --brand-glow: rgba(217, 255, 0, 0.2);
  --surface-card: #1a1a1a;
  --surface-section: #121212;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --text-on-primary: #000000;
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-default: rgba(255, 255, 255, 0.1);
  --font-family-base: "Inter", "PingFang SC", "Microsoft YaHei", "Noto Serif SC", "Helvetica Neue", Arial, sans-serif;
  --font-size-base: 14px;
  --control-height-base: 44px;
  --radius-card: 24px;
  --radius-cta: 18px;
  --shadow-card: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-cta: 0 8px 30px rgba(217, 255, 0, 0.2);
  --shadow-fab: 0 12px 24px rgba(217, 255, 0, 0.3);
  --screen-radius: 48px;
  --radius-dock: 40px;
  --text-tab-inactive: #9aa3b2;
  --status-bar-image: url("../images/status-bar-white.svg");
  --dock-height: 64px;
  --dock-fab-size: 58px;
  --dock-fab-lift: 14px;
  --tab-bar-bottom: 24px;
  --screen-dock-offset: calc(var(--tab-bar-bottom) + var(--dock-height) + var(--dock-fab-lift) + 10px);
  --van-primary-color: var(--brand);
  --van-text-color: #ffffff;
  --van-text-color-2: var(--text-secondary);
  --van-text-color-3: var(--text-muted);
  --van-active-color: rgba(255, 255, 255, 0.08);
  --van-background: var(--surface-section);
  --van-background-2: var(--surface-card);
  --van-background-3: var(--surface-card);
  --van-border-color: var(--border-subtle);
  --van-font-family: var(--font-family-base);
  --van-font-size-md: 15px;
  --van-picker-background: var(--surface-card);
  --van-picker-toolbar-height: 48px;
  --van-picker-option-font-size: 16px;
  --van-picker-mask-color: linear-gradient(
      180deg,
      rgba(26, 26, 26, 0.95),
      rgba(26, 26, 26, 0.2)
    ),
    linear-gradient(0deg, rgba(26, 26, 26, 0.95), rgba(26, 26, 26, 0.2));
  --motion-fast: 0.14s;
  --motion-base: 0.26s;
  --motion-slow: 0.42s;
  --motion-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --motion-ease-spring: cubic-bezier(0.34, 1.22, 0.64, 1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a0a;
  font-family: var(--font-family-base);
  -webkit-font-smoothing: antialiased;
}

/* script 标签不参与布局，避免把原型机架挤到页面顶部 */
body > script {
  display: none;
}
body::before,
body::after {
  content: "";
  position: fixed;
  width: 42vw;
  height: 42vw;
  max-width: 520px;
  max-height: 520px;
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
}

body::before {
  top: -14vw;
  right: -10vw;
  background: var(--brand-muted);
}

body::after {
  bottom: -16vw;
  left: -12vw;
  background: var(--brand-muted);
}

.ios-frame-wrapper {
  position: relative;
  z-index: 1;
  display: inline-block;
  padding: 12px;
  background: var(--frame-bg);
  border-radius: 60px;
  box-shadow: 0 0 0 2px var(--frame-ring), 0 20px 60px rgba(0, 0, 0, 0.45);
}

.ios-screen {
  position: relative;
  width: 393px;
  height: 852px;
  border-radius: var(--screen-radius);
  overflow: hidden;
  overflow: clip;
  background: var(--screen-bg);
  color: var(--text-color);
  isolation: isolate;
}

.ios-screen.has-sheet-open .screen-content {
  overflow: hidden;
}

.ios-screen.has-sheet-open > .sheet-overlay.is-open {
  transform: translateZ(0);
}

.status-bar {
  position: absolute;
  padding-top: 6px;
  left: 0;
  width: 100%;
  height: 54px;
  z-index: 20;
  pointer-events: none;
  background-image: var(--status-bar-image);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.dynamic-island {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 124px;
  height: 36px;
  background: #000;
  border-radius: 999px;
  z-index: 30;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.screen-content {
  position: absolute;
  left: 0;
  right: 0;
  border-radius: var(--screen-radius);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translate3d(0, 0, 0);
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.screen-content::-webkit-scrollbar {
  display: none;
}

.top-header-shell {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: auto;
  background: transparent;
  border-bottom: none;
  z-index: 18;
}

.top-header-shell ~ .screen-content {
  top: 0;
  bottom: 0;
  padding-top: 54px;
  padding-bottom: var(--screen-dock-offset);
}

.screen-content--no-dock {
  padding-bottom: 28px !important;
}

.app-shell {
  position: relative;
  min-height: 100%;
  padding: 16px 16px 24px;
}

.tab-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--tab-bar-bottom);
  z-index: 16;
  display: flex;
  justify-content: center;
  padding: 0 12px;
  pointer-events: none;
}

.dock-inner {
  pointer-events: auto;
  position: relative;
  width: 100%;
  max-width: 369px;
  height: var(--dock-height);
  padding: 0 16px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  background: rgba(26, 26, 26, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: var(--radius-dock);
  border: 1px solid var(--border-default);
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

.tab-bar-group {
  display: flex;
  align-items: stretch;
  flex: 1;
  min-width: 0;
  height: 100%;
}

.tab-bar-group--start {
  justify-content: space-evenly;
  padding-right: 36px;
}

.tab-bar-group--end {
  justify-content: space-evenly;
  padding-left: 36px;
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1;
  min-width: 48px;
  max-width: 80px;
  height: 100%;
  padding: 0 4px;
  border: none;
  background: transparent;
  color: var(--text-tab-inactive);
  font-family: var(--font-family-base);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: color 0.15s ease;
}

.tab-item > span:not(.tab-icon) {
  display: block;
  line-height: 1.4;
}

.tab-item.active {
  color: var(--brand);
  font-weight: 700;
}

.tab-item.active .tab-icon i {
  transform: scale(1.05);
  opacity: 1;
}

.dock-fab-wrap {
  position: absolute;
  left: 50%;
  top: calc(-1 * var(--dock-fab-lift));
  transform: translateX(-50%);
  pointer-events: auto;
}

.dock-fab {
  width: var(--dock-fab-size);
  height: var(--dock-fab-size);
  border-radius: 50%;
  border: 4px solid #1a1a1a;
  background: var(--brand);
  color: var(--text-on-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-fab);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.dock-fab .dock-fab__logo {
  width: 26px;
  height: 26px;
  display: block;
  flex-shrink: 0;
}

.dock-fab:active,
.dock-fab.is-busy {
  transform: scale(0.95);
}

.dock-fab.is-busy {
  opacity: 0.85;
  pointer-events: none;
}

.dock-fab:focus-visible {
  outline: none;
  box-shadow: var(--shadow-fab), 0 0 0 2px rgba(217, 255, 0, 0.5), 0 0 0 4px #0a0a0a;
}

.tab-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tab-icon i {
  font-size: 18px;
  line-height: 1;
  color: inherit;
  opacity: 0.92;
  transition: transform 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.tab-item.active .tab-icon i {
  opacity: 1;
}

.home-indicator {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 5px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  bottom: 8px;
  z-index: 17;
}

/* —— 全局微动效（移动端 + PC 原型框内均生效） —— */
html {
  height: 100%;
  -webkit-tap-highlight-color: transparent;
}

.ios-screen .screen-content {
  scroll-behavior: smooth;
  overscroll-behavior-y: contain;
}

@keyframes motion-fade-up {
  from {
    opacity: 0;
    transform: translate3d(0, 10px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes motion-dock-in {
  from {
    opacity: 0;
    transform: translate3d(-50%, 12px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(-50%, 0, 0);
  }
}

@keyframes motion-fab-breathe {
  0%,
  100% {
    box-shadow: var(--shadow-fab);
  }
  50% {
    box-shadow: 0 14px 32px rgba(217, 255, 0, 0.38);
  }
}

.ios-screen .app-shell > * {
  animation: motion-fade-up var(--motion-base) var(--motion-ease-out) both;
}

.ios-screen .app-shell > *:nth-child(1) {
  animation-delay: 0.02s;
}

.ios-screen .app-shell > *:nth-child(2) {
  animation-delay: 0.06s;
}

.ios-screen .app-shell > *:nth-child(3) {
  animation-delay: 0.1s;
}

.ios-screen .app-shell > *:nth-child(4) {
  animation-delay: 0.14s;
}

.ios-screen .app-shell > *:nth-child(5) {
  animation-delay: 0.18s;
}

.ios-screen .app-shell > *:nth-child(n + 6) {
  animation-delay: 0.22s;
}

.ios-screen .tab-bar .dock-inner {
  animation: motion-fade-up var(--motion-base) var(--motion-ease-out) 0.08s both;
}

.ios-screen .dock-fab-wrap {
  animation: motion-dock-in var(--motion-slow) var(--motion-ease-out) 0.1s both;
}

.ios-screen .dock-fab:not(.is-busy):not(:active) {
  animation: motion-fab-breathe 2.8s ease-in-out infinite;
}

.ios-screen .tab-item,
.ios-screen .dock-fab,
.ios-screen button:not(:disabled),
.ios-screen [role="button"]:not([aria-disabled="true"]),
.ios-screen a.btn-primary-block,
.ios-screen a.btn-ghost-block,
.ios-screen a.btn-accent-sm,
.ios-screen .btn-ghost,
.ios-screen .icon-btn,
.ios-screen .plan-card,
.ios-screen .action-row,
.ios-screen .segment-item {
  -webkit-touch-callout: none;
  transition:
    transform var(--motion-fast) var(--motion-ease-spring),
    opacity var(--motion-fast) ease,
    box-shadow var(--motion-fast) ease,
    border-color var(--motion-fast) ease,
    background-color var(--motion-fast) ease,
    color var(--motion-fast) ease;
}

.ios-screen .tab-item {
  transition:
    transform var(--motion-fast) var(--motion-ease-spring),
    color var(--motion-fast) ease;
}

.ios-screen .tab-item:active {
  transform: scale(0.94);
}

.ios-screen .icon-btn:active,
.ios-screen button:not(:disabled):active,
.ios-screen [role="button"]:not([aria-disabled="true"]):active {
  transform: scale(0.96);
  opacity: 0.9;
}

.ios-screen .dock-fab:active {
  animation: none;
}

@media (hover: hover) and (pointer: fine) {
  .ios-screen .tab-item:not(.active):hover {
    color: #b8c0cc;
  }

  .ios-screen .tab-item:not(.active):hover .tab-icon i {
    transform: scale(1.06);
  }

  .ios-screen .dock-fab:hover:not(:active):not(.is-busy) {
    transform: scale(1.05);
  }

  .ios-screen .plan-card:hover,
  .ios-screen .action-row:hover {
    transform: translateY(-2px);
  }

  .ios-screen .icon-btn:hover,
  .ios-screen .btn-ghost:hover,
  .ios-screen a.btn-ghost-block:hover {
    border-color: rgba(255, 255, 255, 0.18);
  }
}

@media (max-width: 768px) {
  body {
    display: block;
    background: var(--screen-bg);
  }

  .ios-frame-wrapper {
    display: block;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
  }

  :root {
    --screen-radius: 0px;
  }

  .ios-screen {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }

  .status-bar,
  .dynamic-island,
  .home-indicator,
  .top-header-shell {
    display: none;
  }

  .app-shell {
    padding-top: max(12px, calc(env(safe-area-inset-top, 0px) + 8px));
  }

  .top-header-shell ~ .screen-content {
    padding-top: 0;
    padding-bottom: calc(var(--screen-dock-offset) + env(safe-area-inset-bottom, 0px));
  }

  .tab-bar {
    bottom: calc(var(--tab-bar-bottom) + env(safe-area-inset-bottom, 0px));
  }
}

@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;
  }
}
