* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header h1 {
  font-size: 24px;
  margin-bottom: 15px;
}

.queue-status {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-item .label {
  opacity: 0.9;
  font-size: 14px;
}

.status-item .value {
  font-weight: bold;
  font-size: 16px;
  padding: 4px 12px;
  background: rgba(255,255,255,0.2);
  border-radius: 12px;
}

.status-item .value.running {
  background: rgba(76, 175, 80, 0.3);
}

.status-item .value.queued {
  background: rgba(255, 193, 7, 0.3);
}

.main-container {
  display: flex;
  height: calc(100vh - 120px);
  overflow: hidden;
}

/* 左侧菜谱列表 */
.recipe-list-panel {
  width: 350px;
  background: white;
  border-right: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  padding: 15px 20px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-header h2 {
  font-size: 18px;
  color: #333;
  margin: 0;
}

.recipe-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.recipe-item {
  padding: 15px;
  margin-bottom: 10px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
}

.recipe-item:hover {
  border-color: #667eea;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.recipe-item.active {
  border-color: #667eea;
  background: #f0f4ff;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.recipe-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.recipe-item-header h3 {
  font-size: 16px;
  color: #333;
  margin: 0;
  flex: 1;
  word-break: break-word;
}

.recipe-status-badges {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}

.badge {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: bold;
  white-space: nowrap;
}

.badge-active {
  background: #fff3e0;
  color: #f57c00;
}

.badge-approved {
  background: #e8f5e9;
  color: #388e3c;
}

/* 右侧详情面板 */
.recipe-detail-panel {
  flex: 1;
  background: #f5f5f5;
  overflow-y: auto;
  padding: 20px;
}

.detail-content {
  max-width: 800px;
  margin: 0 auto;
}

.detail-header {
  margin-bottom: 30px;
}

.detail-header h2 {
  font-size: 24px;
  color: #333;
  margin: 0;
}

/* 加载状态 */
.loading-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 20px;
  color: #666;
  font-size: 14px;
}

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 错误提示 */
.error-message {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 8px;
  padding: 15px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.error-message p {
  margin: 0;
  color: #856404;
  flex: 1;
}

.retry-btn {
  background: #667eea;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.3s;
}

.retry-btn:hover {
  background: #5568d3;
}

.retry-btn:active {
  background: #4457c2;
}

.detail-section {
  background: white;
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.detail-section h3 {
  font-size: 18px;
  color: #333;
  margin: 0 0 15px 0;
  padding-bottom: 10px;
  border-bottom: 2px solid #667eea;
}

.detail-section p {
  color: #666;
  line-height: 1.8;
  margin: 0;
}

.empty-text {
  color: #999;
  font-style: italic;
}

/* 食材列表 */
.ingredient-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ingredient-list li {
  padding: 10px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  gap: 15px;
}

.ingredient-list li:last-child {
  border-bottom: none;
}

.ingredient-name {
  font-weight: 500;
  color: #333;
  min-width: 100px;
}

.ingredient-amount {
  color: #666;
  flex: 1;
}

.ingredient-note {
  color: #999;
  font-size: 14px;
}

/* 封面图 */
.cover-image-container {
  text-align: center;
}

.cover-image {
  max-width: 100%;
  max-height: 400px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.cover-placeholder {
  width: 100%;
  height: 300px;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #999;
  border: 2px dashed #ddd;
}

/* 生成表单 */
.generation-form {
  margin-top: 15px;
}

.prompt-input-wrapper {
  position: relative;
  margin-bottom: 15px;
}

.prompt-input {
  width: 100%;
  padding: 12px;
  padding-right: 100px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}

.prompt-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.btn-generate-prompt {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 6px 12px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
  z-index: 1;
}

.btn-generate-prompt:hover:not(:disabled) {
  background: #5568d3;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.btn-generate-prompt:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

.generation-actions {
  display: flex;
  gap: 10px;
}

.btn-generate {
  padding: 10px 20px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.btn-generate:hover:not(:disabled) {
  background: #5568d3;
}

.btn-generate:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.btn-save {
  padding: 10px 20px;
  background: #4caf50;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.btn-save:hover:not(:disabled) {
  background: #45a049;
}

.btn-save:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* 生成的图片 */
.generated-image-container {
  text-align: center;
  margin-top: 15px;
}

.generated-image {
  max-width: 100%;
  max-height: 500px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.empty-detail {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #999;
  font-size: 16px;
}

.btn-refresh {
  padding: 6px 12px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.btn-refresh:hover {
  background: #5568d3;
}

.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: #999;
  font-size: 16px;
}

@media (max-width: 1024px) {
  .main-container {
    flex-direction: column;
    height: auto;
  }
  
  .recipe-list-panel {
    width: 100%;
    max-height: 300px;
  }
  
  .recipe-detail-panel {
    height: auto;
  }
}

