* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #0f0f1a;
  color: #e0e0e0;
  min-height: 100vh;
}
.header {
  background: #1a1a2e;
  padding: 16px 20px;
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  border-bottom: 1px solid #333;
}
.tabs {
  display: flex;
  margin: 16px;
  background: #1a1a2e;
  border-radius: 8px;
  overflow: hidden;
}
.tab {
  flex: 1;
  padding: 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
  background: none;
  font-size: 14px;
  color: #888;
}
.tab.active {
  background: linear-gradient(135deg, rgba(102,126,234,0.2), rgba(118,75,162,0.2));
  color: #fff;
}
.card {
  background: #1a1a2e;
  border-radius: 12px;
  padding: 16px;
  margin: 16px;
}
.drop-zone {
  border: 2px dashed #444;
  border-radius: 12px;
  padding: 60px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.3s;
}
.drop-zone:hover, .drop-zone.dragover { border-color: #667eea; }
.drop-zone .icon { font-size: 48px; margin-bottom: 12px; }
.drop-zone .hint { color: #666; font-size: 13px; margin-top: 8px; }
.canvas-wrap {
  position: relative;
  background: #0a0a14;
  border-radius: 8px;
  overflow: hidden;
  margin: 0 16px;
}
canvas { display: block; width: 100%; cursor: crosshair; }
.toolbar label { font-size: 13px; color: #aaa; display: block; margin-bottom: 8px; }
.toolbar select, .toolbar input[type=range] {
  width: 100%;
  margin-bottom: 12px;
  padding: 10px;
  background: #2a2a4a;
  border: 1px solid #444;
  border-radius: 6px;
  color: #fff;
  font-size: 14px;
}
.tool-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.tool-btns button {
  padding: 8px 16px;
  background: #2a2a4a;
  border: 1px solid #444;
  border-radius: 6px;
  color: #ccc;
  cursor: pointer;
  font-size: 13px;
}
.tool-btns button.active { background: #667eea; color: #fff; border-color: #667eea; }
.colors { display: flex; gap: 10px; }
.color-dot {
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent;
}
.color-dot.active { border-color: #667eea; transform: scale(1.15); }
.btn-primary {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff; border: none; border-radius: 8px;
  padding: 12px 24px; font-size: 14px; cursor: pointer; width: 100%;
}
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-secondary {
  background: #2a2a4a; color: #ccc; border: 1px solid #444;
  border-radius: 8px; padding: 10px 20px; font-size: 13px; cursor: pointer;
}
.action-bar { display: flex; gap: 10px; flex-wrap: wrap; }
.action-bar button { flex: 1; min-width: 120px; }
.loading-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: none; align-items: center; justify-content: center; z-index: 999;
}
.loading-mask.show { display: flex; }
.loading-box {
  background: #1a1a2e; padding: 30px 50px; border-radius: 12px; font-size: 15px;
}
.admin-fab {
  position: fixed; right: 20px; bottom: 30px;
  width: 48px; height: 48px; background: #2a2a4a; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; cursor: pointer; box-shadow: 0 4px 15px rgba(0,0,0,0.4);
  text-decoration: none; color: inherit;
}
.hidden { display: none !important; }
