/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
  color: #333;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* 头部样式 */
.header {
  text-align: center;
  color: white;
  margin-bottom: 40px;
  padding: 30px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.header h1 {
  font-size: 2.5em;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
  font-size: 1.1em;
  opacity: 0.9;
}

/* 区域样式 */
.section {
  margin-bottom: 30px;
}

.section h2 {
  color: white;
  font-size: 1.8em;
  margin-bottom: 20px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* 卡片样式 */
.card {
  background: white;
  border-radius: 15px;
  padding: 25px;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.card h3 {
  color: #667eea;
  font-size: 1.4em;
  margin-bottom: 20px;
  border-bottom: 2px solid #667eea;
  padding-bottom: 10px;
}

/* 表单样式 */
.form-group {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  align-items: center;
  flex-wrap: wrap;
}

.form-group label {
  font-weight: 600;
  color: #555;
  min-width: 100px;
}

.input {
  flex: 1;
  padding: 12px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1em;
  transition: border-color 0.3s ease;
  min-width: 150px;
}

.input:focus {
  outline: none;
  border-color: #667eea;
}

.input.small {
  flex: 0 0 80px;
  min-width: 80px;
}

.input-color {
  flex: 0 0 60px;
  height: 45px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
}

/* 按钮样式 */
.btn {
  padding: 12px 25px;
  border: none;
  border-radius: 8px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(245, 87, 108, 0.4);
}

.btn-success {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: white;
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(79, 172, 254, 0.4);
}

.btn-large {
  width: 100%;
  padding: 15px;
  font-size: 1.1em;
  margin-top: 10px;
}

/* 用户信息显示 */
.user-info {
  margin-top: 20px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 10px;
  border-left: 4px solid #667eea;
}

.user-info p {
  margin: 8px 0;
  font-size: 1em;
}

.user-info strong {
  color: #667eea;
  margin-right: 10px;
}

.quota-bar {
  margin-top: 15px;
}

.quota-bar-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.9em;
  color: #666;
}

.quota-bar-container {
  height: 25px;
  background: #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.quota-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.85em;
}

/* 选项组样式 */
.options-group {
  padding: 15px;
  background: #f8f9fa;
  border-radius: 10px;
  margin: 15px 0;
}

.hint {
  color: #666;
  font-style: italic;
  text-align: center;
}

/* 信息框样式 */
.info-box {
  background: #e3f2fd;
  border-left: 4px solid #2196f3;
  padding: 15px;
  border-radius: 8px;
  margin: 15px 0;
}

.info-box p {
  margin: 0 0 10px 0;
  color: #1976d2;
  font-weight: 600;
}

.info-box ul {
  margin: 0;
  padding-left: 20px;
}

.info-box li {
  color: #555;
  margin: 5px 0;
  line-height: 1.6;
}

/* 生成结果样式 */
.result-card {
  border: 3px solid #667eea;
}

.generated-image {
  text-align: center;
  margin: 20px 0;
}

.generated-image img {
  max-width: 100%;
  border-radius: 10px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

/* 历史记录样式 */
.history-list {
  margin-top: 20px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 10px;
  margin-bottom: 10px;
  transition: background 0.3s ease;
}

.history-item:hover {
  background: #e9ecef;
}

.history-item img {
  width: 100px;
  height: 75px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.history-info {
  flex: 1;
}

.history-info p {
  margin: 5px 0;
  color: #666;
}

.history-info strong {
  color: #333;
}

/* 消息提示样式 */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 25px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
  transform: translateX(400px);
  transition: transform 0.3s ease;
  z-index: 1000;
  max-width: 350px;
  font-weight: 500;
}

.toast.show {
  transform: translateX(0);
}

.toast.success {
  border-left: 4px solid #28a745;
  color: #28a745;
}

.toast.error {
  border-left: 4px solid #dc3545;
  color: #dc3545;
}

.toast.info {
  border-left: 4px solid #17a2b8;
  color: #17a2b8;
}

/* 页脚样式 */
.footer {
  text-align: center;
  color: white;
  padding: 20px;
  margin-top: 40px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 15px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .header h1 {
    font-size: 1.8em;
  }

  .form-group {
    flex-direction: column;
    align-items: stretch;
  }

  .form-group label {
    min-width: auto;
  }

  .input {
    min-width: auto;
  }

  .history-item {
    flex-direction: column;
  }

  .history-item img {
    width: 100%;
    height: auto;
  }
}

/* 加载动画 */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}


/* 前端体验增强 */
.toast.toast-success { border-left:4px solid #28a745; color: #28a745; }
.toast.toast-error { border-left:4px solid #dc3545; color: #dc3545; }
.toast.toast-info { border-left:4px solid #17a2b8; color: #17a2b8; }
.toast.warning, .toast.toast-warning { border-left:4px solid #ffc107; color: #856404; }
.empty-state { text-align: center; padding:36px20px; color: #8a8f98; background: #f8f9fa; border:1px dashed #d9dee7; border-radius:12px; }
.mini-hint { color: #777; font-size:12px; line-height:1.6; margin-top:6px; }
.password-strength { height:6px; background: #edf0f5; border-radius:999px; overflow: hidden; margin-top:8px; }
.password-strength span { display: block; height:100%; width:0; border-radius: inherit; transition: width0.25s ease, background0.25s ease; }
.password-strength.weak span { width:33%; background: #dc3545; }
.password-strength.medium span { width:66%; background: #ffc107; }
.password-strength.strong span { width:100%; background: #28a745; }
.btn:disabled, button:disabled { opacity:0.65; cursor: not-allowed; transform: none !important; }
