* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: #f5f5f5;
}

.container {
  display: flex;
  flex-direction: row;
  height: 100vh;
}

.sidebar {
  width: 260px;
  padding: 20px;
  background: #e3e3e3;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.upload-box {
  background: #ffffff;
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  text-align: center;
}

.upload-box label {
  font-weight: bold;
  display: block;
  margin-bottom: 8px;
}

.upload-box input[type="file"] {
  display: block;
  margin: 0 auto;
}

.upload-box img {
  max-width: 100%;
  height: auto;
  margin-top: 10px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.editor {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  overflow: auto;
  padding: 20px;
}

canvas {
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  background: #fafafa;
}

.buttons {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

button {
  padding: 10px 24px;
  background: #00a2d4;
  color: white;
  font-size: 15px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
}

button:hover {
  background: #007bb1;
}

/* ✅ 手机端样式 */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
    height: auto;
  }

  .sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
  }

  .upload-box {
    width: 45%;
  }

  .editor {
    padding: 10px;
  }
}
button.active {
  background: #28a745; /* 绿色 */
}
