/* ========================================================================
 * 阿里淘科技 — 组件样式 (玻璃态 / 按钮 / 卡片 / 表单 / 导航 / 光标)
 * ====================================================================== */

/* ------------------------------ 玻璃态 ------------------------------ */
.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.glass::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, transparent 50%);
  pointer-events: none;
  border-radius: inherit;
}

.glass-strong {
  background: var(--glass-bg-strong);
}

/* ------------------------------ 按钮 ------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all var(--duration-base) var(--ease-out);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn i {
  font-size: 0.9em;
  transition: transform var(--duration-base) var(--ease-out);
}

.btn:hover i {
  transform: translateX(4px);
}

.btn-primary {
  background: var(--gradient-primary);
  background-size: 200% 200%;
  color: #fff;
  box-shadow: 0 4px 20px rgba(0, 245, 255, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  animation: gradient-shift 6s ease infinite;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 245, 255, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-cyan);
  box-shadow: var(--neon-glow-cyan);
}

.btn-outline {
  background: transparent;
  color: var(--accent-cyan);
  border: 1px solid var(--accent-cyan);
}

.btn-outline:hover {
  background: rgba(0, 245, 255, 0.1);
  box-shadow: var(--neon-glow-cyan);
  color: #fff;
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--fs-xs);
}

/* ------------------------------ 自定义光标 ------------------------------ */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: var(--z-cursor);
  mix-blend-mode: difference;
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .cursor { display: block; }
}

.cursor-dot,
.cursor-ring {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.cursor-dot {
  width: 6px;
  height: 6px;
  background: #fff;
  transition: width 200ms, height 200ms;
}

.cursor-ring {
  width: 32px;
  height: 32px;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  transition: width 300ms, height 300ms, border-color 300ms;
}

.cursor.hover .cursor-ring {
  width: 60px;
  height: 60px;
  border-color: var(--accent-cyan);
  background: rgba(0, 245, 255, 0.08);
}

.cursor.hover .cursor-dot {
  width: 4px;
  height: 4px;
}

/* 磁性按钮过渡 */
.magnetic {
  transition: transform 400ms var(--ease-out);
}

/* ------------------------------ 导航 ------------------------------ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  padding: var(--space-4) 0;
  transition: padding var(--duration-base) var(--ease-out),
              background var(--duration-base) var(--ease-out);
}

.nav.scrolled {
  padding: var(--space-2) 0;
  background: rgba(5, 6, 15, 0.7);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-md);
  color: var(--text-primary);
}

.nav-logo svg {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 0 6px rgba(0, 245, 255, 0.5));
  transition: transform var(--duration-base) var(--ease-out);
}

.nav-logo:hover svg {
  transform: rotate(60deg);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  transition: all var(--duration-fast) var(--ease-out);
  position: relative;
}

.nav-link span {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent-cyan);
  opacity: 0.6;
}

.nav-link:hover {
  color: var(--accent-cyan);
  background: rgba(0, 245, 255, 0.05);
}

.nav-link.active {
  color: var(--accent-cyan);
  background: rgba(0, 245, 255, 0.08);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  background: var(--gradient-primary);
  color: #fff;
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0, 245, 255, 0.3);
  transition: transform var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out);
}

.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 245, 255, 0.5);
}

.nav-toggle {
  display: none;
  width: 36px;
  height: 36px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--duration-base) var(--ease-out);
}

.nav-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ------------------------------ 加载动画 ------------------------------ */
.loader {
  position: fixed;
  inset: 0;
  z-index: var(--z-loader);
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s;
}

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

.loader-bg {
  position: absolute;
  inset: 0;
}

#loader-canvas {
  width: 100%;
  height: 100%;
}

.loader-content {
  position: relative;
  z-index: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

.loader-logo {
  width: 120px;
  height: 120px;
  animation: loader-rotate 8s linear infinite;
}

.loader-logo svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 24px rgba(0, 245, 255, 0.5));
}

.loader-text {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--accent-cyan);
  letter-spacing: 0.4em;
  text-transform: uppercase;
  animation: blink 1.2s infinite;
}

.loader-progress {
  width: 240px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.loader-progress-bar {
  height: 100%;
  background: var(--gradient-primary);
  width: 0%;
  transition: width 200ms ease-out;
  box-shadow: 0 0 12px var(--accent-cyan);
}

.loader-percent {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  letter-spacing: 0.2em;
}

/* ------------------------------ 表单 ------------------------------ */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.form-group label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.form-group input,
.form-group textarea,
.form-group select {
  padding: var(--space-3) var(--space-4);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  transition: all var(--duration-fast) var(--ease-out);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 4 L6 8 L10 4' fill='none' stroke='%2300f5ff' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 12px;
  padding-right: 40px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 245, 255, 0.15), var(--neon-glow-cyan);
  background: rgba(0, 0, 0, 0.5);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
  font-family: var(--font-body);
}

/* ------------------------------ 卡片通用 ------------------------------ */
.card-hover-glow {
  transition: transform var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out),
              border-color var(--duration-base) var(--ease-out);
}

.card-hover-glow:hover {
  transform: translateY(-4px);
  border-color: var(--accent-cyan);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3), var(--neon-glow-cyan);
}

/* ------------------------------ chip 标签 ------------------------------ */
.chip {
  padding: var(--space-2) var(--space-3);
  background: rgba(0, 245, 255, 0.08);
  border: 1px solid rgba(0, 245, 255, 0.2);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--accent-cyan);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.chip:hover {
  background: rgba(0, 245, 255, 0.15);
  border-color: var(--accent-cyan);
  box-shadow: var(--neon-glow-cyan);
  transform: translateY(-1px);
}