/* convert.css - 图片格式转换工具专用样式 */

/* Editor Layout */
.editor-layout {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 24px;
  margin-top: 20px;
}

@media (max-width: 900px) {
  .editor-layout {
    grid-template-columns: 1fr;
  }
}

/* Preview Container */
.preview-container {
  background: #fff;
  border-radius: var(--border-radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.preview-wrapper {
  margin-top: 16px;
}

.preview-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .preview-compare {
    grid-template-columns: 1fr;
  }
}

.preview-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preview-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.preview-box canvas {
  max-width: 100%;
  max-height: 250px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background-image:
    linear-gradient(45deg, #e5e7eb 25%, transparent 25%),
    linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e5e7eb 75%),
    linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
}

.preview-info {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--gray-500);
}

.image-info {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--gray-500);
}

/* Controls Container */
.controls-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.control-section {
  background: #fff;
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.control-section h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gray-200);
}

.control-group {
  margin-bottom: 16px;
}

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

.control-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 8px;
}

/* Format Options */
.format-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.format-option {
  cursor: pointer;
}

.format-option input[type="radio"] {
  display: none;
}

.format-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  transition: all 0.2s;
}

.format-option input[type="radio"]:checked + .format-btn {
  border-color: var(--primary);
  background: #eef2ff;
}

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

.format-icon {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
}

.format-name {
  font-size: 0.75rem;
  color: var(--gray-600);
}

/* Range Slider */
.range-slider {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--gray-200);
  border-radius: 3px;
  outline: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.range-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.quality-hint {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--gray-400);
  margin-top: 4px;
}

/* Size Options */
.size-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.875rem;
}

.radio-option input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

/* Custom Size Inputs */
.custom-size-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.size-input {
  width: 80px;
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 0.875rem;
}

.size-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.size-separator {
  color: var(--gray-400);
  font-weight: 600;
}

.lock-ratio {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--gray-600);
}

.lock-ratio input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

/* Radio Group */
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Color Picker */
.color-picker {
  width: 100%;
  height: 40px;
  padding: 4px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  cursor: pointer;
  margin-top: 8px;
}

/* Download Section */
.download-section {
  background: #fff;
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Batch Section */
.batch-section {
  background: #fff;
  border-radius: var(--border-radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-top: 24px;
}

.batch-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.batch-item {
  position: relative;
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s;
  cursor: pointer;
}

.batch-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
}

.batch-item.selected {
  border-color: var(--primary);
  background: #eef2ff;
}

.batch-item-preview {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.batch-item-info {
  padding: 8px 12px;
  font-size: 0.8rem;
  color: var(--gray-600);
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
}

.batch-item-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.batch-item-format {
  display: inline-block;
  padding: 2px 6px;
  background: var(--primary);
  color: #fff;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-top: 4px;
}

.batch-item-select {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}

.batch-item-preview-hover {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.batch-item:hover .batch-item-preview-hover {
  opacity: 1;
}

.batch-item-preview-hover img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.batch-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #fff;
  border-radius: var(--border-radius);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.preview-modal-content {
  max-width: 800px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gray-800);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray-400);
  padding: 0;
  line-height: 1;
}

.modal-close:hover {
  color: var(--gray-600);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
}

/* Preview Modal */
.preview-modal-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .preview-modal-compare {
    grid-template-columns: 1fr;
  }
}

.preview-modal-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preview-modal-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.preview-modal-box img {
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background-image:
    linear-gradient(45deg, #e5e7eb 25%, transparent 25%),
    linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e5e7eb 75%),
    linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
}

.preview-modal-info {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-200);
  font-size: 0.875rem;
  color: var(--gray-600);
  text-align: center;
}

/* Info Section */
.info-section {
  background: #fff;
  border-radius: var(--border-radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-top: 24px;
}

.info-section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 16px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.info-item {
  padding: 16px;
  background: var(--gray-50);
  border-radius: 8px;
  border: 1px solid var(--gray-200);
}

.info-item h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 8px;
}

.info-item p {
  font-size: 0.875rem;
  color: var(--gray-600);
  line-height: 1.5;
}

/* Links Section */
.links-section {
  background: #fff;
  border-radius: var(--border-radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-top: 24px;
}

.links-section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 16px;
}

.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.links-grid a {
  display: block;
  padding: 12px 16px;
  background: var(--gray-50);
  border-radius: 8px;
  text-decoration: none;
  color: var(--gray-700);
  transition: all 0.2s;
  border: 1px solid var(--gray-200);
}

.links-grid a:hover {
  background: #eef2ff;
  border-color: var(--primary);
  color: var(--primary);
}

/* Footer */
footer {
  text-align: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--gray-200);
  color: var(--gray-500);
  font-size: 0.875rem;
}

footer p {
  margin-bottom: 8px;
}

footer a {
  color: var(--primary);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Hidden class */
.hidden {
  display: none !important;
}