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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  background: #f0f2f5;
  color: #1a1a1a;
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

.container {
  width: 100%;
  max-width: 960px;
  padding: 40px 24px 60px;
}

header {
  text-align: center;
  margin-bottom: 36px;
}

header h1 {
  font-size: 28px;
  font-weight: 700;
  color: #111;
  letter-spacing: -0.5px;
}

header .subtitle {
  margin-top: 6px;
  font-size: 14px;
  color: #888;
}

.main-row {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

.panel {
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
}

.controls {
  flex: 1;
  min-width: 0;
}

.preview-panel {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.control-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
}

.control-group {
  margin-bottom: 24px;
}

.control-group:last-child {
  margin-bottom: 0;
}

.size-inputs {
  display: flex;
  align-items: center;
  gap: 10px;
}

.size-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.size-hint {
  font-size: 13px;
  color: #888;
  width: 16px;
}

.size-field input {
  width: 90px;
  padding: 8px 10px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 15px;
  text-align: center;
  outline: none;
  transition: border-color 0.15s;
}

.size-field input:focus {
  border-color: #4a6cf7;
}

.size-sep {
  font-size: 18px;
  color: #bbb;
  font-weight: 300;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-outline {
  background: #f5f5f5;
  color: #333;
  border: 1px solid #e0e0e0;
  margin-top: 10px;
  width: 100%;
}

.btn-outline:hover {
  background: #ebebeb;
}

.btn-primary {
  background: #4a6cf7;
  color: #fff;
  flex-shrink: 0;
}

.btn-primary:hover {
  background: #3b5de7;
}

.theme-toggle {
  display: flex;
  gap: 10px;
}

.theme-option {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 2px solid #e8e8e8;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #555;
  transition: all 0.15s;
}

.theme-option.active {
  border-color: #4a6cf7;
  color: #4a6cf7;
  background: #f5f7ff;
}

.theme-swatch {
  display: inline-block;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid #ddd;
  flex-shrink: 0;
}

.theme-swatch.dark {
  background: #1a1a1a;
}

.theme-swatch.light {
  background: #fafafa;
}

textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #ddd;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  line-height: 1.7;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
}

textarea:focus {
  border-color: #4a6cf7;
}

textarea::placeholder {
  color: #bbb;
}

.export-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

select {
  flex: 1;
  padding: 10px 12px;
  border: 1.5px solid #ddd;
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
  outline: none;
  cursor: pointer;
}

select:focus {
  border-color: #4a6cf7;
}

.preview-wrapper {
  display: flex;
  justify-content: center;
  flex: 1;
}

.watch-frame {
  position: relative;
  border-radius: 32px;
  background: #1a1a1a;
  padding: 12px;
  box-shadow:
    0 0 0 3px #222,
    0 0 0 6px #444,
    0 8px 32px rgba(0,0,0,0.25);
  display: inline-flex;
  line-height: 0;
}

.watch-frame canvas {
  border-radius: 16px;
  display: block;
  max-width: 200px;
  height: auto;
}

.preview-note {
  margin-top: 8px;
  font-size: 12px;
  color: #aaa;
  text-align: center;
}

.product-show {
  display: block;
  max-width: 100%;
  width: 360px;
  margin: 20px auto 0;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.product-gallery {
  display: flex;
  gap: 20px;
  margin-top: 20px;
  justify-content: center;
}

.product-figure {
  flex: 1;
  max-width: 360px;
  margin: 0;
  text-align: center;
}

.product-figure img {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  display: block;
}

.product-figure figcaption {
  margin-top: 8px;
  font-size: 13px;
  color: #888;
}

@media (max-width: 750px) {
  .product-gallery {
    flex-direction: column;
    align-items: center;
  }

  .product-figure {
    max-width: 360px;
    width: 100%;
  }
}

.usage-guide {
  margin-top: 28px;
  padding: 28px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
}

.usage-title {
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 10px;
}

.usage-guide ol {
  padding-left: 20px;
  font-size: 13px;
  color: #666;
  line-height: 1.8;
}

.usage-guide ol li {
  margin-bottom: 2px;
}

.usage-guide ol li code {
  background: #e8eaed;
  color: #d63384;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
}

.usage-guide ol li strong {
  color: #333;
}

@media (max-width: 750px) {
  .main-row {
    flex-direction: column;
    gap: 24px;
  }

  .watch-frame canvas {
    max-width: 180px;
  }

  .container {
    padding: 20px 16px 40px;
  }

  header h1 {
    font-size: 22px;
  }
}
