/* 基礎樣式 */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f7fa;
  margin: 0;
  padding: 20px;
  color: #333;
}

.app-container {
  max-width: 1000px;
  margin: 0 auto;
}

/* 說明區塊 */
.instructions {
  background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  color: white;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 25px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.instructions h2 {
  margin-top: 0;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.instructions p {
  margin: 10px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 工具列容器 */
.toolbar-container {
  position: sticky;
  top: 10px;
  z-index: 100;
  background: white;
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  margin-bottom: 15px;
}

/* 工具列 */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.toolbar button {
  background: #4a6cf7;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  transition: all 0.2s;
}

.toolbar button:hover {
  background: #3a5ce5;
  transform: translateY(-2px);
}

.toolbar button:active {
  transform: translateY(1px);
}

.toolbar select {
  padding: 8px 12px;
  border-radius: 5px;
  border: 1px solid #ddd;
  background: white;
  font-size: 14px;
}

/* 編輯區 */
#editor {
  border: 1px solid #ddd;
  min-height: 400px;
  padding: 20px;
  border-radius: 8px;
  background: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  outline: none;
}

#editor:focus {
  border-color: #4a6cf7;
}

/* 圖片樣式 */
.editor-image {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 15px 0;
  border-radius: 5px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  position: relative;
}

/* 刪除按鈕 */
.image-container {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

.remove-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  background: rgba(255,0,0,0.8);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  font-size: 16px;
  transition: all 0.2s;
}

.remove-btn:hover {
  transform: scale(1.1);
  background: #ff0000;
}

/* YouTube嵌入 */
.youtube-embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  margin: 20px 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.youtube-embed iframe {
  position: absolute;
  width: 100%;
  height: 100%;
  border: none;
}

/* HTML預覽區 */
.html-preview {
  margin-top: 25px;
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.html-preview h3 {
  margin-top: 0;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #4a6cf7;
}

#htmlOutput {
  width: 100%;
  height: 150px;
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  resize: vertical;
  background: #f8f9fa;
}

/* 響應式設計 */
@media (max-width: 768px) {
  .toolbar {
    gap: 6px;
  }
  
  .toolbar button {
    padding: 6px 10px;
    font-size: 12px;
  }
  
  .toolbar select {
    padding: 6px 10px;
    font-size: 12px;
  }
  
  #editor {
    padding: 15px;
  }
  
  .html-preview {
    padding: 15px;
  }
}

@media (max-width: 480px) {
  .instructions {
    padding: 15px;
  }
  
  .toolbar {
    justify-content: center;
  }
}