* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Microsoft Yahei", sans-serif;
}

body {
  background-color: #f5f7fa;
  color: #333;
}

.navbar {
  width: 100%;
  height: 60px;
  background-color: #333;
  color: #fff;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 999;
}

.site-title {
  font-size: 18px;
  font-weight: bold;
}

.site-title a {
  color: #fff;
  text-decoration: none;
}

.menu-btn {
  font-size: 22px;
  cursor: pointer;
  user-select: none;
}

.nav-menu {
  position: absolute;
  top: 60px;
  right: 0;
  background-color: #444;
  min-width: 180px;
  display: none;
}

.nav-menu a {
  display: block;
  color: #fff;
  text-decoration: none;
  padding: 14px 20px;
  border-bottom: 1px solid #333;
}

.nav-menu a:hover,
.nav-menu a.active {
  background-color: #555;
}

.nav-menu.show {
  display: block;
}

.container {
  max-width: 1200px;
  margin: 90px auto 40px;
  padding: 0 15px;
}

.card {
  background-color: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
}

.page-title {
  font-size: 24px;
  text-align: center;
  margin-bottom: 10px;
}

.page-desc {
  text-align: center;
  color: #666;
  margin-bottom: 24px;
}

.tool-container {
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.upload-area {
  border: 2px dashed #409eff;
  border-radius: 8px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}

.upload-area:hover {
  background-color: #f5fafe;
}

.upload-area.secondary {
  padding: 20px;
}

.file-input {
  display: none;
}

.text-input-box {
  display: none;
}

.text-input-box.show {
  display: block;
}

.text-input-box textarea {
  width: 100%;
  min-height: 150px;
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  resize: vertical;
  outline: none;
  background: #fff;
}

.options {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: flex-end;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 110px;
}

.field-group.full {
  width: 100%;
}

.field-label {
  font-size: 13px;
  color: #666;
}

.field-input,
.field-select,
.field-textarea {
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  outline: none;
  background: #fff;
  font-size: 14px;
}

.field-input[type="color"] {
  padding: 4px;
  min-width: 56px;
  width: 56px;
  height: 38px;
}

.field-textarea {
  min-height: 96px;
  resize: vertical;
}

.field-inline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.range-value {
  min-width: 52px;
  font-size: 13px;
  color: #666;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  color: #666;
  font-size: 14px;
}

.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.tool-btn {
  background: #409eff;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
}

.tool-btn.secondary {
  background: #67c23a;
}

.tool-btn.ghost {
  background: #fff;
  color: #333;
  border: 1px solid #ddd;
}

.tool-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  border-color: #ccc;
  color: #fff;
}

.status {
  min-height: 20px;
  color: #666;
  font-size: 13px;
}

.status.error {
  color: #c45656;
}

.status.success {
  color: #67c23a;
}

.preview-row {
  display: none;
  flex-wrap: wrap;
  gap: 20px;
}

.preview-item {
  flex: 1 1 320px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 15px;
}

.preview-item h3 {
  margin-bottom: 12px;
  font-size: 16px;
}

.preview-item img,
.preview-item canvas {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border: 1px solid #eee;
  border-radius: 4px;
  background: #fff;
  display: block;
}

.preview-item canvas {
  height: auto;
}

.info-box {
  font-size: 13px;
  color: #666;
  line-height: 1.8;
  margin-top: 12px;
  white-space: pre-wrap;
  word-break: break-all;
}

.download-btn {
  display: inline-block;
  margin-top: 12px;
  background: #67c23a;
  color: #fff;
  padding: 8px 12px;
  border-radius: 4px;
  text-decoration: none;
}

.download-list {
  display: grid;
  gap: 10px;
}

.download-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #eee;
  border-radius: 8px;
  background: #fff;
}

.download-item a {
  color: #67c23a;
  text-decoration: none;
  font-weight: bold;
}

.hidden {
  display: none !important;
}

@media (max-width: 640px) {
  .container {
    padding: 0 12px;
  }

  .card {
    padding: 16px;
  }

  .options {
    gap: 12px;
  }

  .field-group,
  .field-group.full {
    width: 100%;
    min-width: 0;
  }
}

@media (min-width: 768px) {
  .menu-btn {
    display: none;
  }

  .nav-menu {
    position: static;
    display: flex;
    background: none;
    min-width: auto;
  }

  .nav-menu a {
    border: none;
    padding: 0 16px;
  }

  .nav-menu a.active,
  .nav-menu a:hover {
    background: transparent;
    color: #ddd;
  }
}
