:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #e0e7ff;
  --bg: #fafafa;
  --surface: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --success: #10b981;
  --danger: #ef4444;
  
  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
  --shadow-lg: 0 20px 40px -10px rgba(0,0,0,0.08), 0 10px 20px -5px rgba(0,0,0,0.04);
  --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.2);
  
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg);
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 动态背景 blobs */
.bg-blobs {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
}
.blob {
  position: absolute;
  filter: blur(80px);
  opacity: 0.4;
  border-radius: 50%;
  animation: float 20s infinite alternate ease-in-out;
}
.blob-1 {
  top: -10%; left: -10%;
  width: 50vw; height: 50vw;
  background: linear-gradient(135deg, #a5b4fc, #c084fc);
}
.blob-2 {
  top: 40%; right: -10%;
  width: 40vw; height: 40vw;
  background: linear-gradient(135deg, #93c5fd, #818cf8);
  animation-delay: -5s;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(10%, 15%) scale(1.1); }
}

/* 导航栏 */
.navbar {
  padding: 24px 0;
  background: var(--bg); /* 使用纯色背景替代半透明模糊 */
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50; /* 提高层级 */
  transition: padding 0.3s ease, box-shadow 0.3s ease;
}

/* 当页面滚动时，可以通过 JS 添加的类来增加阴影，使其更有层次感 */
.navbar.scrolled {
  padding: 16px 0;
  box-shadow: var(--shadow-sm);
}

.nav-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  background: linear-gradient(135deg, var(--primary), #818cf8);
  color: white;
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}
.brand-icon svg { width: 20px; height: 20px; }

.brand-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
}

/* 状态指示器 */
.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 12px;
  background: var(--surface);
  border-radius: 99px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

/* 语言切换按钮 */
.btn-lang {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
  font-family: inherit;
  outline: none;
}

.btn-lang:hover {
  color: var(--text-main);
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-lang:active {
  transform: scale(0.96);
}

.btn-lang:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.lang-icon {
  width: 16px;
  height: 16px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #cbd5e1;
}
.status-indicator.ok .status-dot { background: var(--success); box-shadow: 0 0 8px rgba(16, 185, 129, 0.4); }
.status-indicator.error .status-dot { background: var(--danger); }
.status-indicator.ok span { color: var(--text-main); }

/* 容器布局 */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Hero Section */
.hero {
  text-align: center;
  margin: 64px 0 48px;
  max-width: 700px;
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.badge {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(79, 70, 229, 0.1);
  color: var(--primary);
  border-radius: 99px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 24px;
}

.hero-title {
  font-size: clamp(40px, 5vw, 56px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #0f172a; /* Fallback */
}

.hero-subtitle {
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* 核心 App 容器 */
.app-widget {
  background: var(--surface);
  width: 100%;
  max-width: 600px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,0.8);
  position: relative;
  overflow: hidden;
  margin-bottom: 64px;
  min-height: 480px;
}

.widget-view {
  padding: 40px;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0; left: 0;
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  background: var(--surface);
  display: flex;
  flex-direction: column;
}

.widget-view.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.98);
  z-index: 0;
}

.widget-view.active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
  z-index: 2;
  position: relative; /* relative for flow calculation */
}

/* 拖拽区域 */
.drop-zone {
  flex: 1;
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-lg);
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 220px;
  margin-bottom: 24px;
}

.drop-zone:hover, .drop-zone.highlight {
  border-color: var(--primary);
  background: var(--primary-light);
}

.drop-zone input[type="file"] {
  position: absolute;
  width: 100%; height: 100%;
  opacity: 0; cursor: pointer;
}

.drop-zone-content {
  text-align: center;
  pointer-events: none;
}

.icon-pulse {
  width: 64px; height: 64px;
  background: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  box-shadow: var(--shadow-sm);
  color: var(--primary);
  transition: transform 0.3s;
}
.drop-zone:hover .icon-pulse { transform: scale(1.1); }
.icon-pulse svg { width: 32px; height: 32px; }

.drop-zone h3 { font-size: 18px; font-weight: 700; color: #1e293b; margin-bottom: 4px;}
.drop-zone p { font-size: 14px; color: var(--text-muted); }
.text-primary { color: var(--primary); font-weight: 600; }

.selected-file-info {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: white;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.selected-file-info svg { width: 16px; height: 16px; }

/* 选项组 */
.settings-group { margin-bottom: 24px; }
.settings-group > label {
  display: block; font-size: 14px; font-weight: 700;
  margin-bottom: 12px; color: #1e293b;
}

.preset-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.preset-option {
  position: relative;
  cursor: pointer;
}

.preset-option input {
  position: absolute; opacity: 0;
}

.preset-option span {
  display: block;
  text-align: center;
  padding: 10px 0;
  background: #f1f5f9;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.2s;
}

.preset-option:hover span { background: #e2e8f0; }

.preset-option input:checked + span {
  background: white;
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.1);
}

/* 主按钮 */
.btn-mega {
  width: 100%;
  padding: 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
  font-family: inherit;
  outline: none;
}
.btn-mega:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}
.btn-mega:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}
.btn-mega:focus-visible {
  outline: 3px solid var(--primary-light);
  outline-offset: 2px;
}
.btn-mega:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
}
.btn-mega svg { width: 20px; height: 20px; }

/* 进度视图 */
.progress-state {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
}

.spinner {
  width: 48px; height: 48px;
  border: 4px solid var(--primary-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 24px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.progress-state h3 { font-size: 20px; color: #1e293b; margin-bottom: 16px; }

.progress-track {
  width: 100%; max-width: 300px;
  height: 8px;
  background: #f1f5f9;
  border-radius: 99px; overflow: hidden;
}
.progress-fill {
  width: 0%; height: 100%;
  background: var(--primary);
  transition: width 0.3s ease;
}

/* 结果视图 */
#viewResult { justify-content: center; }

.success-header { text-align: center; margin-bottom: 32px; }
.success-icon {
  width: 64px; height: 64px;
  background: var(--success); color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 10px 20px rgba(16, 185, 129, 0.2);
}
.success-icon svg { width: 32px; height: 32px; }
.success-header h2 { font-size: 28px; font-weight: 800; color: #0f172a; margin-bottom: 8px;}
.success-header p { color: var(--text-muted); }

.link-box {
  display: flex; gap: 8px; margin-bottom: 24px;
  padding: 8px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.link-box input {
  flex: 1;
  background: transparent; border: none; outline: none;
  padding: 0 16px;
  font-size: 16px; font-weight: 600; color: var(--primary);
  font-family: inherit;
}
.btn-copy {
  padding: 12px 24px;
  background: white; color: #1e293b;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-weight: 700; cursor: pointer; transition: all 0.2s;
  outline: none;
}
.btn-copy:hover { background: #f1f5f9; }
.btn-copy:active { transform: scale(0.96); }
.btn-copy:focus-visible { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }

.action-row {
  display: flex; gap: 16px; justify-content: center;
  margin-bottom: 32px;
}
.btn-outline {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px;
  border: 2px solid var(--border); border-radius: var(--radius-md);
  font-weight: 700; color: #0f172a; text-decoration: none;
  transition: all 0.2s;
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-outline svg { width: 18px; height: 18px; }

.btn-text {
  padding: 12px 24px;
  background: transparent; border: none;
  font-weight: 600; color: var(--text-muted); cursor: pointer;
  transition: color 0.2s; font-family: inherit;
}
.btn-text:hover { color: #0f172a; }

.api-response-details {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.api-response-details summary {
  cursor: pointer; color: var(--text-muted); font-size: 14px; font-weight: 600;
  outline: none;
}
.api-response-details pre {
  margin-top: 12px;
  padding: 16px; background: #1e293b; color: #e2e8f0;
  border-radius: var(--radius-sm); font-family: 'JetBrains Mono', monospace; font-size: 12px;
  overflow-x: auto;
}

/* 特性说明 */
.features {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px;
  width: 100%; max-width: 1000px;
  margin-bottom: 64px;
}
.feature-item { text-align: center; }
.f-icon { font-size: 32px; margin-bottom: 16px; }
.feature-item h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.feature-item p { font-size: 14px; color: var(--text-muted); text-wrap: balance; }

/* 开发者 API 演示终端 */
.api-showcase { width: 100%; max-width: 800px; margin-bottom: 64px; }
.terminal-window {
  background: #0f172a; border-radius: var(--radius-md);
  overflow: hidden; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}
.term-header {
  background: #1e293b; padding: 12px 16px;
  display: flex; align-items: center; position: relative;
}
.term-dots { display: flex; gap: 8px; }
.term-dots span { width: 12px; height: 12px; border-radius: 50%; }
.term-dots span:nth-child(1) { background: #ff5f56; }
.term-dots span:nth-child(2) { background: #ffbd2e; }
.term-dots span:nth-child(3) { background: #27c93f; }
.term-title {
  position: absolute; left: 50%; transform: translateX(-50%);
  color: #94a3b8; font-size: 13px; font-weight: 500; font-family: sans-serif;
}
.term-body { padding: 24px; font-family: 'JetBrains Mono', monospace; font-size: 14px; color: #e2e8f0; line-height: 1.6; }
.term-line { position: relative; padding-right: 40px; margin-bottom: 8px; word-break: break-all;}
.term-line.output { color: #818cf8; opacity: 0.9; }
.prompt { color: #10b981; margin-right: 12px; user-select: none; }
.command { color: #f8fafc; }
.term-copy {
  position: absolute; right: 0; top: 0;
  background: transparent; border: none; color: #64748b; cursor: pointer;
  padding: 4px; border-radius: 4px; transition: all 0.2s;
}
.term-copy:hover { color: white; background: rgba(255,255,255,0.1); }
.term-copy svg { width: 16px; height: 16px; }
.hidden { display: none !important; }

/* 底部 */
.footer {
  text-align: center; padding: 32px 0;
  color: var(--text-muted); font-size: 14px;
}

/* 响应式 */
@media (max-width: 768px) {
  .navbar { padding: 16px 0; }
  .nav-content { padding: 0 16px; gap: 8px; }
  .brand-name { font-size: 18px; }
  
  .nav-actions { gap: 8px; }
  .btn-lang span { display: none; }
  .btn-lang { padding: 6px 10px; }
  .status-indicator { padding: 6px 10px; font-size: 13px; }
  
  .container { padding: 0 16px; }
  .hero { margin: 40px 0 32px; }
  .hero-title { font-size: 32px; }
  .hero-subtitle { font-size: 16px; }

  .app-widget { 
    margin-bottom: 40px; 
    min-height: auto; /* 让高度随内容自适应 */
  }
  .widget-view { 
    padding: 24px 20px;
    position: relative; /* 在移动端取消绝对定位，避免高度坍塌 */
  }
  .widget-view.hidden {
    display: none; /* 移动端直接隐藏 */
  }

  .drop-zone { min-height: 180px; }
  
  .preset-selector { grid-template-columns: repeat(2, 1fr); }
  
  .link-box { 
    flex-direction: column; 
    padding: 12px;
    gap: 12px;
  }
  .link-box input {
    padding: 8px 4px;
    font-size: 14px;
    text-align: center;
  }
  
  .action-row { 
    flex-direction: column; 
    gap: 12px;
  }
  .btn-outline, .btn-text { 
    width: 100%; 
    justify-content: center; 
    padding: 14px;
  }

  .features { 
    grid-template-columns: 1fr; 
    gap: 32px; 
    margin-bottom: 48px;
  }
  
  .term-body { padding: 16px; font-size: 12px; }
  .term-line { padding-right: 32px; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 28px; }
  .preset-selector { grid-template-columns: 1fr; }
  .success-header h2 { font-size: 24px; }
}: 16px; font-size: 12px; }
  .term-line { padding-right: 32px; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 28px; }
  .preset-selector { grid-template-columns: 1fr; }
  .success-header h2 { font-size: 24px; }
}