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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0f172a;
  color: #f8fafc;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

.container {
  max-width: 100%;
  margin: 0 auto;
  padding: 20px 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  margin-bottom: 24px;
  text-align: center;
}

.brand {
  font-size: 1.3rem;
  font-weight: 700;
  color: #2563eb;
  margin-bottom: 8px;
}

.title {
  margin: 0 0 12px 0;
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #2563eb, #10b981);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.subtitle {
  font-size: 1.1rem;
  color: #94a3b8;
  margin-bottom: 8px;
  font-weight: 400;
}

.features {
  display: flex;
  gap: 12px;
  margin: 24px 0;
  overflow-x: auto;
  padding: 8px 0;
  -webkit-overflow-scrolling: touch;
  justify-content: center;
}

.feature-card {
  flex: 0 0 auto;
  background: #1e293b;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid #334155;
  width: 140px;
  text-align: center;
}

.feature-icon {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.feature-title {
  font-size: 0.9rem;
  margin: 0 0 4px 0;
  font-weight: 600;
}

.feature-desc {
  font-size: 0.8rem;
  color: #94a3b8;
  margin: 0;
}

/* 主输入区域 - 修复移动端 */
.main-card {
  background: #1e293b;
  padding: 24px 20px;
  border-radius: 16px;
  border: 1px solid #334155;
  margin: 16px 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.input-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 20px 0;
  width: 100%;
  max-width: 400px;
}

.stock-input {
  width: 100%;
  height: 56px;
  padding: 0 20px;
  font-size: 16px;
  border-radius: 12px;
  border: 2px solid #334155;
  background: #0f172a;
  color: #f8fafc;
  outline: none;
  transition: all 0.3s ease;
  text-align: center;
}

.stock-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.stock-input::placeholder {
  color: #64748b;
  font-size: 16px;
  text-align: center;
}

.analyze-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  font-size: 18px;
  font-weight: 600;
  padding: 18px 24px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.3);
  width: 100%;
  min-height: 60px;
}

.analyze-btn:active {
  transform: scale(0.98);
  box-shadow: 0 2px 8px 0 rgba(16, 185, 129, 0.4);
}

.progress-section {
  margin: 24px 0;
  width: 100%;
  max-width: 400px;
}

.progress-bar {
  height: 6px;
  background: #334155;
  border-radius: 8px;
  overflow: hidden;
  margin: 12px 0;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #2563eb, #10b981);
  transition: width 0.4s ease;
}

.status-text {
  margin-top: 8px;
  font-size: 14px;
  color: #94a3b8;
  font-weight: 500;
  text-align: center;
}

.disclaimer {
  margin-top: 24px;
  font-size: 11px;
  color: #64748b;
  line-height: 1.4;
  text-align: center;
  width: 100%;
}

/* 模态框样式 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.98);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  backdrop-filter: blur(10px);
}

.modal-content {
  width: 100%;
  max-width: 400px;
  background: #1e293b;
  border-radius: 20px;
  padding: 24px;
  border: 1px solid #334155;
  color: #f8fafc;
  text-align: left;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  max-height: 90vh;
  overflow-y: auto;
}

.close-btn {
  position: absolute;
  right: 16px;
  top: 16px;
  font-size: 24px;
  color: #64748b;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.2s ease;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:active {
  background: #334155;
}

.analysis-step {
  margin-top: 20px;
  font-size: 14px;
  color: #94a3b8;
  font-weight: 500;
  margin-bottom: 8px;
}

.cta-section {
  text-align: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #334155;
}

.whatsapp-btn {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  font-size: 16px;
  font-weight: 600;
  padding: 16px 24px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  min-height: 54px;
}

.whatsapp-btn:active {
  transform: scale(0.98);
}

/* 移动端优化 */
@media (max-width: 768px) {
  .container {
    padding: 16px 12px;
  }
  
  .title {
    font-size: 1.8rem;
  }
  
  .subtitle {
    font-size: 1rem;
  }
  
  .main-card {
    padding: 20px 16px;
    margin: 12px 0;
  }
  
  .feature-card {
    width: 130px;
    padding: 14px;
  }
  
  .features {
    justify-content: flex-start;
  }
  
  .stock-input {
    font-size: 16px;
    height: 52px;
  }
  
  .analyze-btn {
    min-height: 56px;
    font-size: 17px;
  }
  
  .modal {
    padding: 16px;
  }
  
  .modal-content {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .title {
    font-size: 1.6rem;
  }
  
  .subtitle {
    font-size: 0.9rem;
  }
  
  .feature-card {
    width: 120px;
    padding: 12px;
  }
  
  .feature-title {
    font-size: 0.85rem;
  }
  
  .feature-desc {
    font-size: 0.75rem;
  }
  
  .main-card {
    padding: 16px 12px;
  }
  
  .input-section,
  .progress-section {
    max-width: 100%;
  }
}

/* 安全区域支持 */
@supports(padding: max(0px)) {
  .container {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
}