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

  body {
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
      line-height: 1.5;
      color: #333;
      background-color: #f8f9fa;
  }

  .container {
      max-width: 1000px;
      margin: 0 auto;
      padding: 1rem;
  }

  header {
      text-align: center;
      margin-bottom: 1rem;
  }

  h1 {
      color: #2c3e50;
      margin-bottom: 0.25rem;
      font-size: 1.3rem;
  }

  h2 {
      color: #2c3e50;
      margin-bottom: 0.75rem;
      font-size: 1.0rem;
  }

  .tip-text {
      color:rgb(240, 83, 83);
      font-size: 0.85rem;
      text-align: center;
  }

  main {
      display: grid;
      gap: 1rem;
  }

  section {
      background: white;
      border-radius: 6px;
      padding: 1rem;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }

  .upload-area {
      text-align: center;
      padding: 0.75rem;
      border: 2px dashed #cbd5e1;
      border-radius: 6px;
      background-color: #f8fafc;
      transition: all 0.2s ease;
  }

  .upload-area:hover {
      border-color: #94a3b8;
      background-color: #f1f5f9;
  }

  .file-upload {
      position: relative;
      display: inline-block;
      width: 100%;
      max-width: 300px;
  }

  .file-upload input[type="file"] {
      position: absolute;
      top: 0;
      left: 0;
      opacity: 0;
      width: 100%;
      height: 100%;
      cursor: pointer;
  }

  .file-upload label {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 0.5rem;
      cursor: pointer;
  }

  .upload-icon {
      margin-bottom: 0.25rem;
  }

  .upload-icon svg {
      width: 24px;
      height: 24px;
      fill: #64748b;
  }

  .file-list {
      background-color: #f8f9fa;
      border-radius: 6px;
      margin-top: 0.5rem;
      text-align: left;
      max-height: 150px;
      overflow-y: auto;
      border: 1px solid #e2e8f0;
  }

  .file-list-header {
      background-color: #e2e8f0;
      padding: 0.5rem 0.75rem;
      font-weight: 600;
      border-top-left-radius: 6px;
      border-top-right-radius: 6px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 0.85rem;
  }

  .file-list-container {
      padding: 0.25rem 0.75rem;
  }

  .file-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0.25rem 0;
      border-bottom: 1px solid #e2e8f0;
      font-size: 0.85rem;
  }

  .file-item:last-child {
      border-bottom: none;
  }

  .file-item-name {
      flex: 1;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      margin-right: 0.5rem;
  }

  .file-item-actions {
      margin-left: 0.5rem;
  }

  .remove-file {
      background-color: #ef4444;
      color: white;
      border: none;
      border-radius: 4px;
      padding: 0.15rem 0.4rem;
      font-size: 0.75rem;
      cursor: pointer;
  }

  .remove-file:hover {
      background-color: #dc2626;
  }

  .watermark-options {
      display: grid;
      gap: 0.75rem;
  }

  .option-group {
      display: grid;
      grid-template-columns: 100px 1fr;
      align-items: center;
      gap: 0.75rem;
  }

  .option-group label {
      font-weight: 500;
      color: #4a5568;
      font-size: 0.9rem;
  }

  .text-input-wrapper {
      width: 100%;
  }

  .text-input-wrapper input[type="text"] {
      width: 100%;
      padding: 0.4rem;
      border: 1px solid #cbd5e1;
      border-radius: 4px;
      font-size: 0.9rem;
  }

  .input-with-slider {
      display: flex;
      align-items: center;
      gap: 8px;
      width: 100%;
  }

  .input-with-slider input[type="range"] {
      flex: 1;
      min-width: 150px;
      margin-right: 8px;
  }

  .input-with-slider input[type="number"] {
      width: 45px;
      padding: 3px;
      border: 1px solid #cbd5e1;
      border-radius: 4px;
      text-align: center;
      font-size: 0.85rem;
  }

  .color-input-wrapper {
      display: flex;
      align-items: center;
      gap: 0.75rem;
  }

  .color-input-wrapper input[type="color"] {
      width: 32px;
      height: 32px;
      padding: 2px;
      border: 1px solid #cbd5e1;
      border-radius: 4px;
      cursor: pointer;
  }

  .color-presets {
      display: flex;
      gap: 0.4rem;
  }

  .color-preset {
      width: 20px;
      height: 20px;
      border: none;
      border-radius: 4px;
      cursor: pointer;
      transition: transform 0.2s ease;
  }

  .color-preset:hover {
      transform: scale(1.1);
  }

  .color-preset.active {
      transform: scale(1.1);
      box-shadow: 0 0 0 2px #3b82f6;
  }

  .watermark-button-container {
      display: flex;
      gap: 0.75rem;
      margin-top: 0.75rem;
      justify-content: flex-end;
  }

  .action-button {
      padding: 0.5rem 1rem;
      border: none;
      border-radius: 4px;
      font-size: 0.85rem;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.2s ease;
  }

  .primary-button {
      background-color: #3b82f6;
      color: white;
  }

  .primary-button:hover {
      background-color: #2563eb;
  }

  .download-options {
      display: flex;
      gap: 0.5rem;
  }

  .download-option {
      display: flex;
      align-items: center;
      gap: 0.3rem;
      padding: 0.4rem 0.6rem;
      background-color: #f8fafc;
      border: 1px solid #cbd5e1;
      border-radius: 4px;
      font-size: 0.8rem;
      color: #4a5568;
      cursor: pointer;
      transition: all 0.2s ease;
  }

  .download-option:hover {
      background-color: #e2e8f0;
      border-color: #94a3b8;
  }

  .download-option.active {
      background-color: #3b82f6;
      color: white;
      border-color: #3b82f6;
  }

  .danger-button {
      background-color: #dc3545;
      color: white;
  }

  .danger-button:hover {
      background-color: #c82333;
  }

  .gallery-container {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
      gap: 0.75rem;
      margin-top: 0.75rem;
  }

  .gallery-item {
      border: 1px solid #e2e8f0;
      border-radius: 6px;
      overflow: hidden;
      background: white;
  }

  .gallery-item-content {
      position: relative;
  }

  .gallery-canvas {
      width: 100%;
      height: auto;
      display: block;
  }

  .gallery-item-info {
      padding: 0.5rem;
      background-color: #f8fafc;
      border-top: 1px solid #e2e8f0;
      display: flex;
      justify-content: space-between;
      align-items: center;
  }

  .item-download {
      background-color: #3b82f6;
      color: white;
      border: none;
      border-radius: 4px;
      padding: 0.3rem 0.5rem;
      font-size: 0.75rem;
      cursor: pointer;
      transition: background-color 0.2s ease;
      display: flex;
      align-items: center;
      gap: 0.2rem;
      min-width: 30px;
      justify-content: center;
  }

  .item-download:hover {
      background-color: #2563eb;
  }

  .item-remove {
      background-color: #dc3545;
      color: white;
      border: none;
      border-radius: 4px;
      padding: 0.3rem 0.5rem;
      font-size: 0.75rem;
      cursor: pointer;
      transition: background-color 0.2s ease;
      display: flex;
      align-items: center;
      gap: 0.2rem;
      min-width: 30px;
      justify-content: center;
  }

  .item-remove:hover {
      background-color: #c82333;
  }

  .gallery-item-actions {
      display: flex;
      gap: 0.4rem;
      align-items: center;
  }

  .gallery-item-name {
      flex: 1;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      font-size: 0.85rem;
      color: #4a5568;
      margin-right: 0.5rem;
  }

  .button-icon {
      width: 12px;
      height: 12px;
      fill: currentColor;
  }

  @media (max-width: 768px) {
      .container {
          padding: 0.75rem;
      }

      .option-group {
          grid-template-columns: 1fr;
          gap: 0.4rem;
      }

      .watermark-button-container {
          flex-direction: column;
      }

      .action-button {
          width: 100%;
      }

      .gallery-container {
          grid-template-columns: 1fr;
      }
  }

  .preset-buttons {
      display: flex;
      gap: 0.5rem;
      margin-bottom: 1rem;
      flex-wrap: wrap;
  }

  .config-save-container {
      margin-top: 0;
      padding-top: 0;
      border-top: none;
  }

  .config-input-group {
      display: flex;
      gap: 0.5rem;
      margin-bottom: 0.5rem;
  }

  .config-name-input {
      flex: 1;
      padding: 0.4rem;
      border: 1px solid #cbd5e1;
      border-radius: 4px;
      font-size: 0.85rem;
  }

  .saved-configs {
      display: flex;
      flex-wrap: wrap;
      gap: 0.5rem;
  }

  .config-button {
      padding: 0.3rem 0.6rem;
      border: 1px solid #cbd5e1;
      border-radius: 4px;
      background-color: #f8fafc;
      color: #4a5568;
      font-size: 0.8rem;
      cursor: pointer;
      transition: all 0.2s ease;
      display: flex;
      align-items: center;
      gap: 0.3rem;
  }

  .config-button:hover {
      background-color: #e2e8f0;
      border-color: #94a3b8;
  }

  .config-button.active {
      background-color: #3b82f6;
      color: white;
      border-color: #3b82f6;
  }

  .config-button .delete-icon {
      width: 12px;
      height: 12px;
      fill: currentColor;
      opacity: 0;
      transition: opacity 0.2s ease;
  }

  .config-button.show-delete .delete-icon {
      opacity: 0.7;
  }

  .config-button.show-delete:hover .delete-icon {
      opacity: 1;
  }

  .config-actions {
      display: flex;
      gap: 0.5rem;
      margin-top: 0.5rem;
  }

  .save-config-button {
      background-color: #10b981;
      color: white;
      border: none;
      border-radius: 4px;
      padding: 0.3rem 0.6rem;
      font-size: 0.8rem;
      cursor: pointer;
      transition: background-color 0.2s ease;
  }

  .save-config-button:hover {
      background-color: #059669;
  }

  .edit-config-button {
      background-color: #f05353;
      color: white;
      border: none;
      border-radius: 4px;
      padding: 0.3rem 0.6rem;
      font-size: 0.8rem;
      cursor: pointer;
      transition: all 0.2s ease;
  }

  .edit-config-button:hover {
      background-color: #e03e3e;
  }

  .edit-config-button.active {
      background-color: #d32f2f;
  }

  /* 添加模态框样式 */
  .modal {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(0, 0, 0, 0.9);
      z-index: 1000;
      cursor: pointer;
  }

  .modal-content {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      max-width: 90%;
      max-height: 90%;
      object-fit: contain;
      transition: transform 0.1s ease;
  }

  .modal-zoom-info {
      position: absolute;
      bottom: 20px;
      left: 50%;
      transform: translateX(-50%);
      background-color: rgba(0, 0, 0, 0.7);
      color: white;
      padding: 8px 16px;
      border-radius: 4px;
      font-size: 14px;
      opacity: 0;
      transition: opacity 0.3s ease;
  }

  .modal-zoom-info.visible {
      opacity: 1;
  }

  .modal-close {
      position: absolute;
      top: 15px;
      right: 35px;
      color: #f1f1f1;
      font-size: 40px;
      font-weight: bold;
      cursor: pointer;
  }