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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8f9fa;
  position: relative;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

header {
  text-align: center;
  margin-bottom: 30px;
}

header h1 {
  color: #2c3e50;
  margin-bottom: 10px;
}

header p {
  color: #7f8c8d;
}

.main-content {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  margin-bottom: 30px;
}

.input-section, .preview-section {
  flex: 1;
  min-width: 300px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 20px;
}

.tabs {
  display: flex;
  margin-bottom: 15px;
  border-bottom: 1px solid #e0e0e0;
}

.tab-btn {
  padding: 10px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #7f8c8d;
  position: relative;
}

.tab-btn.active {
  color: #3498db;
  font-weight: 500;
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: #3498db;
  border-radius: 3px 3px 0 0;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

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

.upload-area:hover, .upload-area.dragover {
  border-color: #3498db;
  background-color: rgba(52, 152, 219, 0.05);
}

/* 语言选择器样式 */
.language-selector {
  position: relative;
  margin-left: auto;
  font-size: 14px;
  z-index: 100;
}

.current-language {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 4px;
  background-color: #f8f9fa;
  border: 1px solid #e0e0e0;
  transition: all 0.2s ease;
}

.current-language:hover {
  background-color: #e9ecef;
}

.dropdown-icon {
  margin-left: 5px;
  font-size: 10px;
  color: #7f8c8d;
}

.language-options {
  position: absolute;
  top: 100%;
  right: 0;
  width: 150px;
  max-height: 0;
  overflow: hidden;
  background-color: white;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: max-height 0.3s ease, padding 0.3s ease;
  z-index: 101;
  opacity: 0;
  visibility: hidden;
}

.language-options.show {
  max-height: 300px;
  padding: 5px 0;
  opacity: 1;
  visibility: visible;
}

.language-option {
  padding: 8px 15px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.language-option:hover {
  background-color: #f8f9fa;
}

.language-option.selected {
  background-color: #e3f2fd;
  color: #2196f3;
}

/* RTL语言支持 */
html[dir="rtl"] .language-selector {
  margin-right: auto;
  margin-left: 0;
}

html[dir="rtl"] .dropdown-icon {
  margin-right: 5px;
  margin-left: 0;
}

html[dir="rtl"] .language-options {
  left: 0;
  right: auto;
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

#upload-icon {
  width: 60px;
  height: 60px;
  color: #7f8c8d;
}

.browse-text {
  color: #3498db;
  text-decoration: underline;
  cursor: pointer;
}

#svg-code {
  width: 100%;
  height: 200px;
  padding: 10px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  resize: vertical;
  font-family: monospace;
  margin-bottom: 15px;
}

.paste-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.btn {
  padding: 10px 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
  background-color: #ecf0f1;
  color: #2c3e50;
}

.btn:hover {
  background-color: #dfe6e9;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.primary-btn {
  background-color: #3498db;
  color: white;
}

.primary-btn:hover {
  background-color: #2980b9;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.preview-header h2 {
  margin: 0;
  color: #2c3e50;
}

.preview-mode-toggle {
  display: flex;
  gap: 5px;
}

.mode-btn {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
  background: white;
  color: #666;
  transition: all 0.2s ease;
}

.mode-btn.active {
  background: #3498db;
  color: white;
  border-color: #3498db;
}

.mode-btn:hover:not(.active) {
  background: #f8f9fa;
  border-color: #3498db;
}

.mode-container {
  display: none;
}

.mode-container.active {
  display: block;
}

.preview-container {
  min-height: 200px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background-color: #f8f9fa;
}

.no-preview-placeholder {
  color: #95a5a6;
  text-align: center;
  padding: 20px;
}

.preview-container svg {
  max-width: 100%;
  max-height: 300px;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.zoom-controls {
  display: flex;
  gap: 5px;
  margin-right: 10px;
}

.zoom-btn {
  width: 36px;
  height: 36px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  font-weight: bold;
}

.zoom-icon {
  font-style: normal;
}

.format-options {
  flex-grow: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.format-option {
  display: flex;
  align-items: center;
  gap: 10px;
}

#compression-level, #image-format {
  padding: 8px;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
}

.result-section {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 20px;
  margin-bottom: 30px;
}

.result-section.hidden {
  display: none;
}

.result-section h2 {
  margin-bottom: 15px;
  color: #2c3e50;
}

.result-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.result-image-container {
  flex: 2;
  min-width: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #f8f9fa;
  border-radius: 4px;
  overflow: hidden;
}

#result-image {
  max-width: 100%;
  max-height: 400px;
}

.result-info {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  background-color: #f8f9fa;
  border-radius: 4px;
}

footer {
  text-align: center;
  padding: 20px;
  color: #7f8c8d;
  font-size: 14px;
  margin-top: 30px;
}

/* 全屏预览模态框样式 */
.fullscreen-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.fullscreen-modal-content {
  position: relative;
  width: 90%;
  height: 90%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: auto;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.fullscreen-modal-content svg {
  max-width: none;
  max-height: none;
  transition: transform 0.2s ease;
}

.fullscreen-controls {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
  background-color: rgba(0, 0, 0, 0.5);
  padding: 10px;
  border-radius: 30px;
}

.fullscreen-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background-color: #3498db;
  color: white;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
}

.fullscreen-btn:hover {
  background-color: #2980b9;
}

.fullscreen-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
}

.fullscreen-close-btn:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

@media (max-width: 768px) {
  .main-content {
    flex-direction: column;
  }
  
  .input-section, .preview-section {
    width: 100%;
  }
}