/* 鍥涚淮鍒涚晫 - 鍩虹鏍峰紡
 * Reset + 鎺掔増 + 閫氱敤宸ュ叿绫? */

/* ========== Reset ========== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--font-weight-regular);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background: linear-gradient(145deg, #08110f 0%, #0b1715 50%, #081210 100%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

/* 浜у搧宸ヤ綔鍙拌儗鏅?娣″ⅷ缁跨粏寰笎鍙?*/
body.page-gradient {
  background:
    radial-gradient(circle at 52% 18%, rgba(22, 199, 183, 0.09), transparent 32%),
    linear-gradient(145deg, #08110f 0%, #0b1715 50%, #081210 100%);
  background-attachment: fixed;
}

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

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-700);
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

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

ul,
ol {
  list-style: none;
}

/* ========== 鎺掔増鍩虹 ========== */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-semibold);
  line-height: var(--leading-tight);
  color: var(--text-primary);
  letter-spacing: 0;
}

h1 { font-size: var(--text-3xl); font-weight: var(--font-weight-bold); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-base); font-weight: var(--font-weight-semibold); }
h6 { font-size: var(--text-sm); font-weight: var(--font-weight-semibold); }

p {
  line-height: var(--leading-normal);
  color: var(--text-secondary);
}

code,
pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

code {
  background: var(--bg-subtle);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--primary-700);
}

pre {
  background: var(--bg-subtle);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

/* ========== 閫氱敤宸ュ叿绫?========== */

/* 鏂囧瓧棰滆壊 */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-disabled { color: var(--text-disabled); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-info { color: var(--info); }
.text-accent { color: var(--accent-600); }

/* 鏂囧瓧瀛楀彿 */
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }
.text-4xl { font-size: var(--text-4xl); }

/* 瀛楅噸 */
.font-regular { font-weight: var(--font-weight-regular); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold { font-weight: var(--font-weight-bold); }

/* 鏂囧瓧瀵归綈 */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* 鎴柇 */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.text-wrap-balance {
  text-wrap: balance;
}

/* 鏄剧ず */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.block { display: block; }
.inline-block { display: inline-block; }
.hidden { display: none; }

/* Flex 瀵归綈 */
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-1 { flex: 1; }
.flex-col { flex-direction: column; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* 灏哄 */
.w-full { width: 100%; }
.w-auto { width: auto; }
.h-full { height: 100%; }

/* 闂磋窛宸ュ叿(m-prefixed) */
.m-0 { margin: 0; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.p-0 { padding: 0; }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.py-6 { padding-top: var(--space-6); padding-bottom: var(--space-6); }

/* 鍦嗚 */
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

/* 闃村奖 */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

/* ========== 鍔ㄦ晥宸ュ叿绫?==========
 * Product register (Impeccable):
 * - 鍔ㄦ晥浼犺揪鐘舵€?涓嶈楗?150-250ms 澶у鏁拌繃娓? * - 鏃犵紪鎺掗〉闈㈠姞杞藉簭鍒?stagger 宸茬Щ闄?
 * - hover-spotlight / fade-in-up 宸茬Щ闄?product register: 鏃犺楗版€?hover 鍏夋檿涓庣紪鎺掑叆鍦?
 */
.fade-in {
  animation: fadeIn var(--transition-base) var(--ease-out);
}

.hover-lift {
  transition: transform var(--transition-fast) var(--ease-out),
              box-shadow var(--transition-fast),
              border-color var(--transition-fast);
}
.hover-lift:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 灞呬腑瀹氫綅鐨?ambient 鍏夋檿婕傜Щ(left:50% + translateX(-50%) 鍦烘櫙) */
@keyframes ambient-drift-centered {
  0%, 100% { transform: translateX(-50%) translateY(0) scale(1); }
  50% { transform: translateX(-50%) translateY(20px) scale(1.05); }
}

/* ========== 鐘舵€佸姩鏁?Product register: 浼犺揪鐘舵€?闈炶楗? ==========
 * 鏆楅潚鑹蹭富棰?鐢?teal/cyan 寰厜寮哄寲鐘舵€佹劅
 * - skeleton: 楠ㄦ灦灞忓姞杞藉崰浣?闈掕壊寰厜妯壂)
 * - status-pulse: 鍦ㄧ嚎/娲昏穬鐘舵€佺偣鍛煎惛(鐢ㄤ簬鐘舵€佸窘绔?
 * - loading-dots: 涓夌偣鍔犺浇鎸囩ず(鐢ㄤ簬鐘舵€佹枃鏈?
 */

/* Skeleton 楠ㄦ灦灞?鏆楄壊鑳屾櫙涓婄敤闈掕壊寰厜妯壂,浼犺揪"姝ｅ湪鍔犺浇" */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(201, 255, 247, 0.12),
    transparent
  );
  animation: skeleton-shimmer 1.6s var(--ease-in-out) infinite;
}
@keyframes skeleton-shimmer {
  100% { transform: translateX(100%); }
}

/* 鐘舵€佺偣鑴夊姩:鍦ㄧ嚎/娲昏穬鎸囩ず(閰嶅悎 .status-dot 浣跨敤,鐜鎵╂暎) */
.status-pulse {
  position: relative;
}
.status-pulse::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: currentColor;
  animation: status-pulse 2s var(--ease-in-out) infinite;
}
@keyframes status-pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50%      { opacity: 0;   transform: scale(2.2); }
}

/* 涓夌偣鍔犺浇鎸囩ず(inline,鐢ㄤ簬鐘舵€佹枃鏈熬閮? */
.loading-dots::after {
  content: "";
  display: inline-block;
  width: 1.5em;
  text-align: left;
  animation: loading-dots 1.4s steps(4, end) infinite;
}
@keyframes loading-dots {
  0%   { content: ""; }
  25%  { content: "."; }
  50%  { content: ".."; }
  75%, 100% { content: "..."; }
}

/* ========== 鏃犻殰纰?灏婇噸 reduced-motion 鍋忓ソ ========== */
@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;
  }

  .fade-in,
  .hover-lift:hover {
    animation: none !important;
    transform: none !important;
  }

  /* 鐘舵€佸姩鏁堝湪 reduce 妯″紡涓嬮潤鎬佸寲 */
  .skeleton::after,
  .status-pulse::before,
  .loading-dots::after {
    animation: none !important;
  }
}

/* ========== 瑙︽劅鍙嶉(鎸夐挳鎸変笅鎬? ========== */
button:not(:disabled):active,
.btn:not(:disabled):active,
a:active {
  transform: translateY(1px);
  transition-duration: 60ms;
}

/* ========== 婊氬姩鏉＄編鍖?========== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-base);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* ========== 鐒︾偣鐜?鍙闂€? ========== */
:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: var(--radius-sm);
}

/* ========== 閫夊尯(鏆楄壊涓婚閫傞厤) ========== */
::selection {
  background: rgba(22, 199, 183, 0.28);
  color: var(--text-primary);
}
