/* 首页专属：动效 + 精致卡片 */

@property --hero-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@keyframes indexHomeScan {
  0% { transform: translateY(-120%); opacity: 0; }
  18% { opacity: 0.45; }
  100% { transform: translateY(220%); opacity: 0; }
}

@keyframes indexHomeSpark {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.45; }
  50% { transform: translate(12px, -18px) scale(1.12); opacity: 0.75; }
}

@keyframes indexHeroBorder {
  to { --hero-angle: 360deg; }
}

@keyframes indexCardIn {
  from { opacity: 0; transform: translateY(16px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes indexShimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.index-home-fx {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.index-home-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(color-mix(in srgb, var(--brand-indigo) 16%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--brand-cyan) 12%, transparent) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 28%, black 8%, transparent 72%);
  opacity: 0.18;
}

.index-home-scan {
  position: absolute;
  left: 0;
  right: 0;
  height: 160px;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--brand-cyan) 16%, transparent), transparent);
  animation: indexHomeScan 9s ease-in-out infinite;
}

.index-home-spark,
.index-home-spark-a,
.index-home-spark-b {
  display: none !important;
}

.index-home-spark {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
}

.index-home-spark-a {
  width: 220px;
  height: 220px;
  top: 12%;
  right: 8%;
  background: color-mix(in srgb, var(--brand-cyan) 40%, transparent);
  animation: indexHomeSpark 11s ease-in-out infinite;
}

.index-home-spark-b {
  width: 260px;
  height: 260px;
  bottom: 10%;
  left: 6%;
  background: color-mix(in srgb, var(--brand-indigo) 36%, transparent);
  animation: indexHomeSpark 14s ease-in-out infinite reverse;
}

.index-home .container.index-page,
.index-home .index-hero-card {
  position: relative;
  z-index: 1;
}

.index-home .index-hero-card {
  overflow: hidden;
  max-width: 640px;
  padding: 28px 32px 24px;
  border-radius: var(--page-card-radius, 30px 20px 26px 18px);
  border: 1px solid var(--glass-border-bright);
  background: linear-gradient(var(--card-bg-1), var(--card-bg-2));
  animation: indexCardIn 0.7s var(--fx-ease, cubic-bezier(0.22, 1, 0.36, 1)) both;
  box-shadow:
    0 1px 0 var(--glass-highlight) inset,
    0 16px 40px var(--shadow-2);
}

.index-home .index-hero-card::before {
  opacity: 0.55;
  background:
    radial-gradient(ellipse 80% 50% at 12% -10%, color-mix(in srgb, var(--brand-indigo) 18%, transparent), transparent 60%),
    radial-gradient(ellipse 70% 40% at 100% 0%, color-mix(in srgb, var(--brand-cyan) 16%, transparent), transparent 55%),
    linear-gradient(135deg, var(--glass-highlight) 0%, transparent 42%);
  animation: none !important;
}

.index-home .index-hero-card .app-header h1 {
  font-size: clamp(20px, 2.8vw, 26px);
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  animation: none;
}

.index-home .index-hero-card.page-main-card:hover,
.index-home .index-hero-card:hover {
  transform: none;
}

.index-home .index-hero-header {
  margin-bottom: 12px !important;
}

.index-home .index-hero-header::after {
  width: 40px;
  height: 2px;
  margin-top: 14px;
  opacity: 0.55;
}

.index-home .index-hero-eyebrow {
  backdrop-filter: blur(12px);
}

.index-home .index-hero-main {
  margin-top: 16px;
}

.index-home .hero-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 18px;
  margin-right: 8px;
  padding: 0 6px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--brand-cyan);
  background: color-mix(in srgb, var(--brand-cyan) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand-cyan) 22%, transparent);
  vertical-align: middle;
}

.index-home .hero-flow-label,
.index-home .hero-flow-result-title {
  display: flex;
  align-items: center;
  max-width: none;
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: none;
  color: var(--text-secondary);
}

.index-home .hero-flow-result-head {
  padding-bottom: 10px;
}

.index-home .index-hero-workflow {
  max-width: 560px;
  gap: 20px;
}

.index-home .hero-flow-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.index-home .hero-panel {
  padding: 12px 14px 12px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--brand-live-teal, var(--brand-indigo)) 12%, var(--glass-border-bright));
  background: linear-gradient(
    180deg,
    color-mix(in srgb, #fff 7%, transparent),
    color-mix(in srgb, var(--brand-live-teal, var(--brand-indigo)) 4%, rgba(0, 0, 0, 0.06))
  );
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 18%, transparent),
    0 6px 18px color-mix(in srgb, var(--brand-live-teal, var(--brand-indigo)) 6%, transparent);
  backdrop-filter: blur(14px) saturate(1.15);
}

.index-home .hero-flow-input.hero-panel {
  padding-bottom: 14px;
}

.index-home .hero-flow-result.hero-panel {
  padding-top: 12px;
}

.index-home .hero-flow-divider {
  display: none;
}

.index-home .hero-flow-codebox {
  border-radius: 12px;
  padding: 12px 10px 10px;
  min-height: 72px;
  border: 1px solid color-mix(in srgb, var(--brand-cyan) 18%, transparent);
  background:
    radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--brand-cyan) 10%, transparent), transparent 55%),
    color-mix(in srgb, var(--bg-secondary, #0b1020) 55%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 10%, transparent);
}

.index-home .hero-flow-codebox.code-display-idle {
  border-style: dashed;
  opacity: 0.92;
}

.index-home .hero-flow-codebox.code-display-live {
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 14%, transparent),
    0 0 16px color-mix(in srgb, var(--brand-cyan) 10%, transparent);
}

.index-home .hero-flow-code {
  font-size: clamp(24px, 5.2vw, 32px);
  letter-spacing: 0.1em;
}

.index-home .hero-flow-chunk + .hero-flow-chunk {
  border-left: 1px solid color-mix(in srgb, var(--text-primary) 10%, transparent);
  padding-left: 0.22em;
  margin-left: 0.08em;
}

.index-home .hero-flow-timer {
  padding-top: 12px;
}

.index-home .hero-flow-timer-track {
  height: 4px;
  background: color-mix(in srgb, var(--text-primary) 9%, transparent);
}

.index-home .hero-flow-timer-text {
  min-width: 3.2em;
  font-size: 11px;
}

.index-home .index-hero-help {
  margin-top: 18px;
  justify-content: center;
}

.index-home .hero-tutorial-link {
  border-radius: 999px;
  padding: 7px 14px 7px 10px;
}

.index-home .hero-flow-field input {
  min-height: 44px;
  font-size: 13.5px;
}

.index-home .index-hero-card .hero-flow .hero-flow-field-box.input-group:focus-within {
  border-color: color-mix(in srgb, var(--brand-cyan) 50%, transparent);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 24%, transparent),
    0 0 0 4px color-mix(in srgb, var(--brand-cyan) 14%, transparent);
}

@media (min-width: 769px) {
  .index-home .hero-flow-stack {
    flex-direction: row;
    align-items: stretch;
    max-width: none;
    gap: 10px;
  }
  .index-home .index-hero-card .hero-flow .hero-flow-field-box.input-group {
    flex: 1;
  }
  .index-home .hero-flow-action,
  .index-home .index-hero-card .hero-flow .hero-flow-stack .button-wrapper {
    flex: 0 0 150px;
    width: 150px;
  }
  .index-home .index-hero-card .hero-flow-action .primary-btn {
    min-height: 44px;
    border-radius: 12px;
  }
}

[data-theme="light"] .index-home .hero-panel,
.theme-light .index-home .hero-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(248, 250, 252, 0.36));
}

[data-theme="light"] .index-home .hero-step,
.theme-light .index-home .hero-step {
  color: #4F5EE8;
  background: color-mix(in srgb, #5B6CFF 12%, #fff);
  border-color: color-mix(in srgb, #5B6CFF 28%, transparent);
}

[data-theme="light"] .index-home .hero-flow-codebox,
.theme-light .index-home .hero-flow-codebox {
  background:
    radial-gradient(ellipse at 50% 0%, color-mix(in srgb, #5B6CFF 10%, transparent), transparent 55%),
    rgba(255, 255, 255, 0.42);
}

[data-theme="light"] .index-home .index-hero-card .app-header h1,
.theme-light .index-home .index-hero-card .app-header h1 {
  background: none;
  color: var(--text-primary);
  -webkit-background-clip: unset;
  background-clip: unset;
}

.index-home .hero-flow-action .hero-generate-btn,
.index-home .hero-flow-action .primary-btn.hero-generate-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  min-height: 44px;
  padding: 0 22px !important;
  border-radius: 12px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  letter-spacing: 0.08em !important;
  color: #f8fafc !important;
  border: 1px solid color-mix(in srgb, #c7d2fe 28%, transparent) !important;
  background: var(--btn-gradient, linear-gradient(180deg, #6D7CFF 0%, #5B6CFF 48%, #4F5EE8 100%)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 8px 18px rgba(91, 108, 255, 0.28) !important;
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}

.index-home .hero-flow-action .hero-generate-btn::before {
  display: block !important;
  content: '' !important;
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 36%,
    rgba(255, 255, 255, 0.22) 50%,
    transparent 64%
  );
  transform: translateX(-120%);
  animation: indexHomeBtnSheen 5.5s ease-in-out infinite;
  pointer-events: none;
}

.index-home .hero-flow-action .hero-generate-btn::after {
  display: none !important;
}

.index-home .hero-flow-action .hero-generate-btn:hover {
  opacity: 1 !important;
  transform: translateY(-1px) !important;
  background: var(--btn-gradient-hover, linear-gradient(180deg, #8B97FF 0%, #6D7CFF 52%, #5B6CFF 100%)) !important;
  border-color: color-mix(in srgb, #e0e7ff 40%, transparent) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 10px 22px rgba(91, 108, 255, 0.32) !important;
  filter: none !important;
}

.index-home .hero-flow-action .hero-generate-btn:active {
  transform: translateY(0) !important;
  opacity: 0.94 !important;
}

.index-home .hero-generate-btn-icon {
  position: relative;
  z-index: 1;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  filter: brightness(1.15);
}

.index-home .hero-flow-action .hero-generate-btn #generateBtnText {
  position: relative;
  z-index: 1;
}

@keyframes indexHomeBtnSheen {
  0%, 70%, 100% { transform: translateX(-120%); }
  78% { transform: translateX(120%); }
}

@media (prefers-reduced-motion: reduce) {
  .index-home .hero-flow-action .hero-generate-btn::before {
    animation: none !important;
  }
}

@media (max-width: 720px) {
  .index-home .index-hero-card {
    padding: 22px 16px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .index-home-scan,
  .index-home-spark,
  .index-home .index-hero-card,
  .index-home .index-hero-card .app-header h1 {
    animation: none !important;
  }
}
