/* 导入Tailwind CSS */
@import url('https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css');

/* 全局样式 */
:root {
  --primary-color: #4361ee;
  --secondary-color: #7209b7;
  --accent-color: #f72585;
  --bg-color: #f8f9fa;
  --card-bg: #ffffff;
  --text-primary: #2b2d42;
  --text-secondary: #6c757d;
  --border-color: #e9ecef;
  --success-color: #2ecc71;
  --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  --gradient-accent: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --border-radius: 8px;
  --transition: all 0.3s ease;
}

/* 深色模式 */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #1a1a2e;
    --card-bg: #16213e;
    --text-primary: #e9ecef;
    --text-secondary: #adb5bd;
    --border-color: #2b2d42;
  }
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  padding: 0;
  margin: 0;
  min-height: 100vh;
  background-image: var(--gradient-primary);
  background-attachment: fixed;
  background-size: cover;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.9);
  z-index: -1;
}

@media (prefers-color-scheme: dark) {
  body::before {
    background-color: rgba(26, 26, 46, 0.95);
  }
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* 顶部导航 */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding: 20px;
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
}

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

.logo i {
  font-size: 28px;
  color: var(--primary-color);
}

.logo h1 {
  font-size: 24px;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.help-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background-color: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
}

.help-btn:hover {
  background-color: var(--primary-color);
  color: white;
}

/* 主内容区 */
.main-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 40px;
}

/* 面板通用样式 */
.config-panel,
.result-panel {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panel-header {
  padding: 20px;
  background: var(--gradient-primary);
  color: white;
}

.panel-header h2 {
  font-size: 18px;
  font-weight: 600;
}

/* 配置面板 */
.config-panel {
  max-height: 90vh;
  overflow-y: auto;
}

.config-group {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
}

.config-group:last-child {
  border-bottom: none;
}

.config-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-primary);
}

.config-select,
.config-input,
.config-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background-color: var(--card-bg);
  color: var(--text-primary);
  font-size: 14px;
  transition: var(--transition);
}

.config-select:focus,
.config-input:focus,
.config-textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.config-textarea {
  min-height: 80px;
  resize: vertical;
}

.additional-params {
  background-color: rgba(67, 97, 238, 0.05);
}

.scene-specific-params.hidden {
  display: none;
}

/* 结果面板 */
.result-panel {
  display: flex;
  flex-direction: column;
}

.result-content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.prompt-result {
  min-height: 200px;
  padding: 15px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background-color: rgba(67, 97, 238, 0.02);
  white-space: pre-wrap;
  word-break: break-word;
}

.prompt-result .placeholder {
  color: var(--text-secondary);
  font-style: italic;
  text-align: center;
  margin-top: 80px;
}

.result-actions {
  padding: 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 10px;
}

/* 按钮样式 */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  border-radius: var(--border-radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--border-color);
}

/* 示例展示区 */
.examples-section {
  margin-bottom: 40px;
}

.examples-section h2 {
  margin-bottom: 20px;
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 600;
}

.examples-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.example-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.example-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.example-card h3 {
  margin-bottom: 10px;
  color: var(--primary-color);
  font-size: 16px;
  font-weight: 600;
}

.example-card p {
  margin-bottom: 15px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

.example-btn {
  padding: 6px 12px;
  background-color: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
  border-radius: var(--border-radius);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.example-btn:hover {
  background-color: var(--primary-color);
  color: white;
}

/* 弹窗样式 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.modal.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-content {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.close-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.close-btn:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 20px;
}

.modal-body h3 {
  margin-top: 20px;
  margin-bottom: 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-color);
}

.modal-body h3:first-child {
  margin-top: 0;
}

.modal-body p,
.modal-body li {
  margin-bottom: 10px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.modal-body ul,
.modal-body ol {
  margin-left: 20px;
  margin-bottom: 15px;
}

/* 提示消息 */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--success-color);
  color: white;
  padding: 12px 20px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1001;
  opacity: 1;
  transform: translateY(0);
  transition: var(--transition);
}

.toast.hidden {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .main-content {
    grid-template-columns: 1fr;
  }
  
  .config-panel {
    max-height: none;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 15px;
  }
  
  .header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  .logo h1 {
    font-size: 20px;
  }
  
  .result-actions {
    flex-direction: column;
  }
  
  .examples-container {
    grid-template-columns: 1fr;
  }
  
  .modal-content {
    width: 95%;
    margin: 20px;
  }
}

@media (max-width: 480px) {
  .header {
    padding: 15px;
  }
  
  .panel-header,
  .config-group,
  .result-content,
  .result-actions {
    padding: 15px;
  }
  
  .btn {
    width: 100%;
  }
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.example-card {
  animation: fadeIn 0.5s ease;
}

.prompt-result {
  animation: fadeIn 0.3s ease;
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}