* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  background: linear-gradient(135deg, #e8eef4 0%, #f5f7fa 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.container {
  width: 100%;
  max-width: 560px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 48, 96, 0.12);
  overflow: hidden;
}

.header {
  background: #1e3a5f;
  color: #fff;
  padding: 20px 24px;
  text-align: center;
}

.header h1 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.main {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field > label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #333;
}

.length-control {
  display: flex;
  align-items: center;
  width: fit-content;
}

.length-control button {
  width: 40px;
  height: 38px;
  border: 1px solid #ccc;
  background: #f9f9f9;
  font-size: 1.25rem;
  cursor: pointer;
  color: #444;
}

.length-control button:hover {
  background: #eee;
}

.length-control button:first-child {
  border-radius: 6px 0 0 6px;
}

.length-control input {
  width: 70px;
  height: 38px;
  padding: 0;
  border: 1px solid #ccc;
  border-left: none;
  border-right: none;
  border-radius: 0;
  text-align: center;
  font-size: 1rem;
  font-weight: 500;
  -moz-appearance: textfield;
  appearance: textfield;
}

.length-control input::-webkit-outer-spin-button,
.length-control input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.length-control button:last-child {
  border-radius: 0 6px 6px 0;
}

input[type="text"] {
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: "Consolas", "Monaco", monospace;
}

input[type="text"]:focus,
input[type="number"]:focus {
  outline: none;
  border-color: #1e3a5f;
  box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.15);
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: #444;
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #1e3a5f;
}

.generate-btn {
  width: 100%;
  padding: 14px 24px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 8px;
}

.generate-btn:hover {
  background: #1d4ed8;
}

.generate-btn:active {
  background: #1e40af;
}

.result-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid #eee;
}

.history {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.result-row {
  display: flex;
  gap: 8px;
}

.result-row input {
  flex: 1;
  font-family: "Consolas", "Monaco", monospace;
  letter-spacing: 1px;
}

.copy-btn {
  padding: 10px 20px;
  background: #1e3a5f;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.copy-btn:hover {
  background: #2c5282;
}

.copy-btn.copied {
  background: #059669;
}
