:root {
  --primary: #2d3436;
  --accent: #636e72;
  --bg: #f5f5f5;
  --card-bg: #ffffff;
  --border: #e0e0e0;
  --text: #2d3436;
  --text-light: #636e72;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

header {
  text-align: center;
  margin-bottom: 24px;
  padding: 20px 0;
}

header h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.subtitle {
  color: var(--text-light);
  font-size: 14px;
  margin-top: 4px;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.card h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-light);
  margin-bottom: 4px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row .form-group {
  flex: 1;
}

input[type="text"],
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fafafa;
  transition: border-color 0.2s;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
}

textarea {
  resize: vertical;
  min-height: 80px;
}

.char-count {
  font-size: 12px;
  color: var(--text-light);
  float: right;
  margin-top: 2px;
}

input[type="range"] {
  width: 100%;
  margin-top: 6px;
  -webkit-appearance: slider-horizontal;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  width: 100%;
  padding: 12px;
  font-size: 15px;
}

.btn-primary:hover { background: #1a1a1a; }

.btn-secondary {
  background: #dfe6e9;
  color: var(--text);
}

.btn-secondary:hover { background: #c8d6e5; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-light);
}

.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.card .btn:not(.btn-primary) {
  margin-right: 8px;
  margin-top: 8px;
}

.preview-box {
  margin: 16px 0;
  padding: 16px;
  background: #fafafa;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.preview-box h3 {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 10px;
}

.preview-area {
  width: 100%;
  min-height: 120px;
  background: #fff;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  transition: all 0.3s;
}

.preview-area.white-bg { background: #fff; }
.preview-area.black-bg { background: #000; }

#previewText {
  word-break: break-all;
  white-space: pre-wrap;
}

.color-picker {
  display: flex;
  gap: 20px;
  margin-top: 4px;
}

.color-option {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 14px;
}

.color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-block;
  border: 2px solid var(--border);
}

.color-swatch.white { background: #fff; }
.color-swatch.black { background: #000; }

.status-placeholder {
  padding: 20px;
  text-align: center;
  color: var(--text-light);
  font-size: 14px;
  background: #fafafa;
  border-radius: 8px;
}

.status-ok {
  color: #00b894;
  font-weight: 500;
}

.status-error {
  color: #d63031;
  font-weight: 500;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.template-btn {
  padding: 12px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fafafa;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.template-btn:hover {
  border-color: var(--primary);
  background: #fff;
}

footer {
  text-align: center;
  margin-top: 30px;
  padding: 16px;
  font-size: 12px;
  color: var(--text-light);
}

/* Toast 通知 */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  z-index: 1000;
  animation: slideDown 0.3s ease;
  max-width: 90%;
}

.toast-success { background: #00b894; color: #fff; }
.toast-error { background: #d63031; color: #fff; }
.toast-info { background: #0984e3; color: #fff; }

@keyframes slideDown {
  from { top: -50px; opacity: 0; }
  to { top: 20px; opacity: 1; }
}
