/* 逸柯商城 / 租号 — 全局视觉、移动端与安全区（不改业务与库表） */
:root {
  --tt-amber: #f59e0b;
  --tt-amber-hover: #fbbf24;
  --tt-surface: rgba(14, 18, 34, 0.88);
  --tt-border: rgba(255, 255, 255, 0.08);
  --tt-glow: 0 0 0 1px rgba(245, 158, 11, 0.12), 0 24px 48px -28px rgba(0, 0, 0, 0.65);
  --tt-radius-lg: 1.25rem;
  --tt-ring: 0 0 0 2px rgba(245, 158, 11, 0.35);
  --tt-touch: 44px;
  --tt-safe-t: env(safe-area-inset-top, 0px);
  --tt-safe-b: env(safe-area-inset-bottom, 0px);
  --tt-safe-x: env(safe-area-inset-left, 0px) env(safe-area-inset-right, 0px);
}

/* 防止窄屏横向挤出滚动条 */
html {
  overflow-x: clip;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body.tt-body {
  overflow-x: clip;
  -webkit-tap-highlight-color: rgba(245, 158, 11, 0.12);
  font-family:
    "SF Pro SC",
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    system-ui,
    -apple-system,
    sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.tt-body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1000px 480px at 12% -12%, rgba(245, 158, 11, 0.13), transparent),
    radial-gradient(800px 440px at 88% 18%, rgba(99, 102, 241, 0.075), transparent),
    radial-gradient(600px 380px at 50% 105%, rgba(14, 165, 233, 0.06), transparent),
    #070a12;
}

/* 玻璃与卡片层次 */
.tt-glass {
  background: var(--tt-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--tt-border);
  box-shadow: var(--tt-glow);
}

.tt-card-mall {
  border-radius: var(--tt-radius-lg);
  transition:
    transform 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease;
}
@media (hover: hover) and (pointer: fine) {
  .tt-card-mall:hover {
    transform: translateY(-3px);
    border-color: rgba(245, 158, 11, 0.28);
    box-shadow:
      0 0 0 1px rgba(245, 158, 11, 0.15),
      0 28px 56px -24px rgba(0, 0, 0, 0.55);
  }
}
@media (hover: none) {
  .tt-card-mall:active {
    transform: scale(0.985);
    border-color: rgba(245, 158, 11, 0.25);
  }
}
.tt-card-mall:focus-visible {
  outline: none;
  box-shadow: var(--tt-ring), var(--tt-glow);
}

/* 商品卡片（列表性能：长列表略省绘制） */
.tt-product-card {
  content-visibility: auto;
  contain-intrinsic-size: 320px 260px;
}

.tt-product-cover {
  aspect-ratio: 16 / 11;
  border-radius: 1rem;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(7, 10, 18, 0.95), rgba(18, 24, 44, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.tt-product-cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tt-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: rgba(245, 158, 11, 0.12);
  color: rgb(251 191 36);
  border: 1px solid rgba(245, 158, 11, 0.28);
}

.tt-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: 0.9rem;
  font-weight: 700;
  background: linear-gradient(135deg, #fbbf24, var(--tt-amber));
  color: #0a0c14;
  box-shadow: 0 12px 28px -12px rgba(245, 158, 11, 0.55);
  transition: transform 0.15s ease, filter 0.15s ease;
}
.tt-btn-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}
.tt-btn-primary:active {
  transform: translateY(0);
}
@media (hover: none) {
  .tt-btn-primary:active,
  .tt-btn-ghost:active {
    transform: scale(0.97);
    filter: brightness(0.96);
  }
}

.tt-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem;
  border-radius: 0.85rem;
  font-weight: 600;
  color: rgb(226 232 240);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.tt-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.12);
}

/* 导航 */
.tt-nav-link {
  border-radius: 0.65rem;
  transition: background 0.15s ease, color 0.15s ease;
}
.tt-nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
}
.tt-nav-link--accent {
  color: rgb(251 191 36);
}

@keyframes tt-fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.tt-reveal {
  animation: tt-fade-up 0.5s ease both;
}

.tt-crumb {
  font-size: 0.8125rem;
  color: rgb(148 163 184);
}
.tt-crumb a:hover {
  color: rgb(251 191 36);
}

/* 表单：大屏可略紧凑；手机端≥16px 避免 iOS 聚焦时强制缩放页面 */
@media (max-width: 639px) {
  .tt-body main input:not([type="hidden"]),
  .tt-body main select,
  .tt-body main textarea {
    font-size: 16px !important;
    min-height: var(--tt-touch);
  }
  .tt-body main button:not([disabled]),
  .tt-body main [role="button"] {
    min-height: var(--tt-touch);
  }
}
@media (min-width: 640px) {
  .tt-body main input:not([type="hidden"]),
  .tt-body main select,
  .tt-body main textarea {
    font-size: 0.9375rem;
  }
}

/* 表单控件焦点 */
main input:not([type="hidden"]):focus,
main select:focus,
main textarea:focus,
main button:focus-visible {
  outline: none;
  box-shadow: var(--tt-ring);
  border-color: rgba(245, 158, 11, 0.45);
}

/* 首页大标题流体字号 */
.tt-hero-title {
  font-size: clamp(1.625rem, 5.2vw + 0.6rem, 3.15rem);
  line-height: 1.08;
}

/* 顶栏横向滚动导航：隐藏滚动条、保留滑动 */
.tt-nav-scroller {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 2px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  padding-bottom: 2px;
  margin-bottom: -2px;
}
.tt-nav-scroller::-webkit-scrollbar {
  display: none;
  height: 0;
}

.tt-nav-item {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tt-touch);
  padding: 0 0.7rem;
  border-radius: 0.7rem;
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  scroll-snap-align: start;
  transition: background 0.15s ease, color 0.15s ease;
}
@media (min-width: 640px) {
  .tt-nav-item {
    padding: 0 0.85rem;
    font-size: 0.875rem;
  }
}
.tt-nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
}
.tt-nav-item--pulse {
  background: linear-gradient(135deg, #fbbf24, var(--tt-amber));
  color: #0a0c14;
  font-weight: 700;
  box-shadow: 0 10px 24px -10px rgba(245, 158, 11, 0.5);
}

/* 主内容区内边距 + 刘海底部留白 */
.tt-shell {
  padding-inline: max(0.75rem, env(safe-area-inset-left, 0px)) max(0.75rem, env(safe-area-inset-right, 0px));
}
@media (min-width: 640px) {
  .tt-shell {
    padding-inline: max(1rem, env(safe-area-inset-left, 0px)) max(1rem, env(safe-area-inset-right, 0px));
  }
}

.tt-header-safe {
  padding-top: max(0.5rem, env(safe-area-inset-top, 0px));
}

.tt-footer-safe {
  padding-bottom: max(1.75rem, env(safe-area-inset-bottom, 0px));
}
