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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f5f5;
  min-height: 100vh;
  color: #333;
}

#app {
  max-width: 600px;
  margin: 0 auto;
  background: #fff;
  min-height: 100vh;
  padding-bottom: 20px;
}

/* 顶部 */
.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 20px;
  text-align: center;
}

.header h1 {
  font-size: 20px;
  font-weight: 600;
}

/* 区块 */
.section {
  padding: 20px;
  border-bottom: 10px solid #f5f5f5;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 15px;
  color: #333;
}

/* 输入框 */
.input-box {
  display: flex;
  gap: 10px;
}

.url-input {
  flex: 1;
  padding: 12px 15px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}

.url-input:focus {
  border-color: #667eea;
}

.btn-parse {
  padding: 12px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-parse:disabled {
  opacity: 0.6;
}

/* 结果 */
.result-box {
  margin-top: 15px;
  padding: 15px;
  background: #f9f9f9;
  border-radius: 12px;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.result-tag {
  background: #e8f5e9;
  color: #4caf50;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
}

.result-count {
  color: #999;
  font-size: 12px;
}

/* 视频/图片 */
.media-box video {
  width: 100%;
  border-radius: 8px;
  background: #000;
}

.image-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.image-scroll img {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.action-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.btn-action {
  flex: 1;
  padding: 10px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  text-align: center;
  color: #333;
  text-decoration: none;
  display: block;
}

.btn-action.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
}

.btn-action.btn-full {
  width: 100%;
}

/* 文案 */
.text-box {
  margin-top: 10px;
}

.text-box label {
  display: block;
  color: #667eea;
  font-size: 12px;
  margin-bottom: 5px;
}

.text-box p {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 10px;
  word-break: break-all;
}

/* 上传 */
.upload-box {
  border: 2px dashed #ddd;
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
}

.upload-box:hover {
  border-color: #667eea;
}

.upload-icon {
  width: 60px;
  height: 60px;
  background: #f5f5f5;
  border-radius: 50%;
  line-height: 60px;
  font-size: 30px;
  color: #999;
  margin: 0 auto 10px;
}

.upload-box p {
  color: #999;
  font-size: 14px;
}

/* 图片编辑器 */
.image-editor {
  position: relative;
}

.image-preview {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

.image-preview img {
  width: 100%;
  display: block;
}

.draw-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

.tool-bar {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.btn-tool {
  flex: 1;
  padding: 12px;
  background: #f5f5f5;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}

.btn-tool.btn-sure {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

.btn-tool:disabled {
  opacity: 0.6;
}

/* 弹窗 */
.modal-mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: #fff;
  border-radius: 16px;
  width: 90%;
  max-width: 400px;
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #eee;
}

.modal-header span:first-child {
  font-size: 16px;
  font-weight: 600;
}

.modal-close {
  width: 28px;
  height: 28px;
  background: #f5f5f5;
  border-radius: 50%;
  text-align: center;
  line-height: 28px;
  cursor: pointer;
  color: #999;
}

.modal-body {
  padding: 20px;
}

.modal-body img {
  width: 100%;
  border-radius: 8px;
}

.modal-footer {
  display: flex;
  gap: 10px;
  padding: 15px 20px;
  border-top: 1px solid #eee;
}

.btn-cancel {
  flex: 1;
  padding: 12px;
  background: #f5f5f5;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}

.btn-save {
  flex: 1;
  padding: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}

/* Toast */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 15px 30px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 2000;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}