* {
  margin: 0;
  padding: 0;

}

body {
  background-color: #f1f2f3;
}

.container {
  box-sizing: border-box;
  max-width: 1600px;
  min-width: 1240px;
  width: 100%;
  margin: 20px auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  color: #333;
}

.container *{
  box-sizing: border-box;
}

header {
  width: 100%;
  max-width: 1600px;
  min-width: 1240px;
  width: 100%;
  margin: auto;
  margin-top: 30px;
  padding-bottom: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

header div{
  font-size: 14px;
  color: #666;
  margin-top: 5px;
}

.description {
  padding: 20px;
  padding-top: 0;
  background: #f8f9fa;
  border-bottom: 1px solid #eaeaea;
  line-height: 1.6;
}

.description h2 {
  margin-bottom: 6px;
  color: #2c3e50;
  font-size: 22px;
}

.description p {
  margin-bottom: 2px;
  color: #555;
}

.content {
  display: flex;
  min-height: 600px;
}

.controls {
  width: 350px;
  background: #f8f9fa;
  padding: 20px;
  border-right: 1px solid #eaeaea;
  overflow-y: auto;
}

.control-group {
  margin-bottom: 20px;
}

.control-group .cli{
  width: 100%;
  display: flex;
  margin-bottom: 20px;
}

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

.control-group .cli .option{
  width: 50%;
  margin-bottom: 0;
}

.control-group h3 {
  font-size: 18px;
  margin-bottom: 15px;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 10px;
}

.option {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.option label {
  margin-left: 8px;
  cursor: pointer;
}

.input-group {
  margin-bottom: 15px;
}

.input-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
}

.input-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 16px;
}

.buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}

button {
  padding: 12px 15px;
  background: #4b6cb7;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

button:hover {
  background: #3a5795;
  transform: translateY(-2px);
}

button.secondary {
  background: #6c757d;
}

button.secondary:hover {
  background: #5a6268;
}

button.warning {
  background: #e74c3c;
}

button.warning:hover {
  background: #c0392b;
}

.editor-container {
  flex: 1;
  padding: 20px;
  background: #fff;
  display: flex;
  flex-direction: column;
  min-width: 0;
  /* 修复弹性容器溢出问题 */
}

.grid-container {
  flex: 1;
  overflow: auto;
  margin-bottom: 20px;
  border: 1px solid #eaeaea;
  border-radius: 8px;
  background: white;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: center;
  align-items: center;
  //align-items: flex-start;
}

.pixel-grid {
  display: inline-grid;
  gap: 1px;
  margin: 20px;
  background: #ddd;
  border: 1px solid #ccc;
}

.pixel {
  background: white;
  cursor: pointer;
  transition: background 0.1s;
}

.pixel.active {
  background: #182848;
}

.output {
  width: 100%;
}

.output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.output-header h3 {
  font-size: 18px;
  color: #2c3e50;
}

.output-content {
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 15px;
  font-family: monospace;
  font-size: 14px;
  min-height: 120px;
  max-height: 200px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.status {
  padding: 15px 20px;
  background: #f8f9fa;
  border-top: 1px solid #eaeaea;
  font-size: 14px;
  color: #6c757d;
  display: flex;
  justify-content: space-between;
}

.warning {
  background: #fff3cd;
  color: #856404;
  padding: 12px;
  border-radius: 6px;
  margin-top: 15px;
  font-size: 14px;
}

.size-warning {
  color: #e74c3c;
  font-weight: 500;
  margin-top: 8px;
  display: none;
}

.file-input {
  display: none;
}

.grid-controls {
  display: flex;
  gap: 20px;
  margin-bottom: 15px;
}

.grid-controls button {
  flex: 1;
  padding: 12px;
  font-size: 14px;
  background: #4ba0b7;
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: #4CAF50;
  color: white;
  padding: 15px 25px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 1000;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

footer {
  color: #8a8a8a;
  text-align: center;
  padding: 20px;
  font-size: 14px;
}
