/* Reset and base styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #f5f5f5;
}

/* App container */
.App {
  text-align: center;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
  min-height: 100vh;
  background-color: #f5f5f5;
}

/* Header styles */
.App-header {
  margin-bottom: 30px;
  padding: 20px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.App-header h1 {
  color: #2c3e50;
  margin: 0;
}

.App-header p {
  color: #7f8c8d;
  margin: 10px 0 0;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  padding: 0 20px;
}

.title-section {
  text-align: left;
}

/* Language selector */
.language-selector {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
}

.language-switcher {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.language-select {
  padding: 0.5rem 1rem;
  font-size: 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1em;
  padding-right: 2.5rem;
}

.language-select:hover {
  border-color: #666;
}

.language-select:focus {
  outline: none;
  border-color: #0070f3;
  box-shadow: 0 0 0 2px rgba(0, 112, 243, 0.2);
}

.language-select option {
  padding: 0.5rem;
}

/* File upload section */
.file-upload {
  margin: 20px 0;
  padding: 20px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.file-upload input[type="file"] {
  display: none;
}

.upload-button {
  display: inline-block;
  padding: 12px 24px;
  background-color: #3498db;
  color: white;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.upload-button:hover {
  background-color: #2980b9;
}

/* Output section */
.output-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 20px;
}

.output-panel {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  transition: all 0.3s ease;
}

.output-panel:hover {
  box-shadow: 0 6px 8px -1px rgba(0, 0, 0, 0.1), 0 4px 6px -1px rgba(0, 0, 0, 0.06);
}

.output-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.output-header h3 {
  margin: 0;
  font-size: 1.1em;
  color: #1e293b;
  font-weight: 600;
  flex-grow: 1;
}

.copy-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  color: #4a5568;
  font-size: 0.9em;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-button:hover {
  background: #f8fafc;
  border-color: #cbd5e0;
  color: #2d3748;
}

.copy-button.copied {
  background: #10b981;
  border-color: #10b981;
  color: white;
}

.copy-button svg {
  width: 16px;
  height: 16px;
}

/* Convert buttons group */
.convert-buttons {
  display: flex;
  gap: 12px;
  margin: 20px 0;
}

.convert-button {
  flex: 1 1;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 0.95em;
  font-weight: 500;
  color: #fff;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(99, 102, 241, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.convert-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(99, 102, 241, 0.2);
  background: linear-gradient(135deg, #4338ca, #4f46e5);
}

.convert-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(99, 102, 241, 0.15);
}

.convert-button svg {
  width: 18px;
  height: 18px;
  opacity: 0.9;
}

/* Syntax highlighter customization */
.output-content :global(.prism-code) {
  background: #f8f9fa !important;
  padding: 16px !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  font-family: 'Fira Code', 'Consolas', monospace !important;
}

/* Toast customization */
:global(.Toastify__toast) {
  border-radius: 8px;
  font-size: 14px;
}

:global(.Toastify__toast--success) {
  background: #48bb78;
}

:global(.Toastify__toast--error) {
  background: #f56565;
}

/* Responsive design */
@media (max-width: 768px) {
  .output-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .copy-button {
    width: 100%;
    justify-content: center;
  }

  .convert-buttons {
    flex-direction: column;
  }

  .convert-button {
    width: 100%;
  }

  .output-header {
    flex-direction: row;
    align-items: center;
  }

  .copy-button {
    padding: 8px 12px;
  }
}

/* Preview section */
.preview-section {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}

.table-info {
  display: flex;
  justify-content: space-between;
  margin: 10px 0;
  color: #666;
}

.table-container {
  overflow-x: auto;
  margin: 20px 0;
  border-radius: 4px;
  border: 1px solid #eee;
}

/* JSON and Markdown outputs */
.json-output,
.markdown-output {
  margin-top: 20px;
  padding: 20px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.json-output h3,
.markdown-output h3 {
  margin-bottom: 15px;
  color: #2c3e50;
}

/* JSON output styles */
.json-output {
  margin: 20px 0;
  width: 100%;
}

.output-header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 15px;
  margin-bottom: 10px;
}

.output-header h3 {
  margin: 0;
  color: #2c3e50;
  font-size: 1.2em;
}

.output-controls {
  display: flex;
  gap: 10px;
}

.view-toggle-button,
.copy-button {
  padding: 4px 12px;
  background-color: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 4px;
  color: #2c3e50;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;
}

.view-toggle-button:hover,
.copy-button:hover {
  background-color: #e9ecef;
  border-color: #ced4da;
}

.output-content {
  background-color: #fff;
  border: 1px solid #eee;
  border-radius: 4px;
}

/* JSON viewer customization */
.output-content .react-json-view {
  background-color: #f8f9fa !important;
  padding: 15px !important;
  border-radius: 4px !important;
  font-family: 'Fira Code', 'Consolas', monospace !important;
  font-size: 14px !important;
}

.output-content pre {
  background-color: #f8f9fa;
  padding: 15px;
  border-radius: 4px;
  overflow-x: auto;
  margin: 0;
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Custom JSON viewer styles */
.custom-json-view {
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 14px;
  line-height: 1.5;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 4px;
  color: #2c3e50;
}

.json-toggle {
  color: #666;
  margin-right: 5px;
  font-size: 12px;
  display: inline-block;
  width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  background-color: #f1f3f5;
  border-radius: 3px;
  position: absolute;
  left: -25px;
  top: 2px;
}

.json-toggle:hover {
  background-color: #e9ecef;
}

.json-key {
  color: #2c5282;
  font-weight: 500;
}

.json-value {
  color: #38a169;
}

.json-value:not(:last-child) {
  margin-right: 5px;
}

.custom-json-view > div {
  position: relative;
  padding-left: 25px;
}

.custom-json-view div div {
  position: relative;
}

/* 调整输出内容的样式 */
.output-content {
  position: relative;
  background-color: #fff;
  border: 1px solid #eee;
  border-radius: 4px;
  margin-top: 10px;
}

.output-content pre {
  background-color: #f8f9fa;
  padding: 15px;
  border-radius: 4px;
  overflow-x: auto;
  margin: 0;
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Table styles */
table {
  width: 100%;
  border-collapse: collapse;
  background-color: white;
}

th, td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

th {
  background-color: #f8f9fa;
  font-weight: 600;
  color: #2c3e50;
}

tr:hover {
  background-color: #f5f5f5;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
}

.pagination button {
  padding: 8px 16px;
  margin: 0 5px;
  border: none;
  background-color: #3498db;
  color: white;
  border-radius: 4px;
  cursor: pointer;
}

.pagination button:disabled {
  background-color: #bdc3c7;
  cursor: not-allowed;
}

.pagination span {
  margin: 0 10px;
  color: #7f8c8d;
}

/* Error message */
.error {
  color: #e74c3c;
  padding: 10px;
  margin: 10px 0;
  background-color: #fadbd8;
  border-radius: 4px;
}

/* Responsive design */
@media (max-width: 768px) {
  .App {
    padding: 10px;
  }
  
  .header-content {
    flex-direction: column;
    padding: 0 10px;
  }
  
  .title-section {
    text-align: center;
    margin-bottom: 10px;
  }
  
  .output-controls {
    flex-direction: column;
    gap: 10px;
  }
  
  .language-selector {
    position: static;
    margin-top: 10px;
  }
  
  .table-info {
    flex-direction: column;
    gap: 5px;
  }
  
  .output-content pre {
    font-size: 12px;
  }
  
  .copy-button {
    position: static;
    width: 100%;
    margin-top: 10px;
  }
  
  .output-header {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .output-controls {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
  }

  .view-toggle-button,
  .copy-button {
    flex: 1 1;
    text-align: center;
  }
}

/* Tab styles */
.output-section {
  margin-top: 2rem;
  width: 100%;
}

.output-panel {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.output-tabs {
  display: flex;
  background: #f3f4f6;
  border-bottom: 1px solid #e5e7eb;
  padding: 0.5rem 1rem 0;
}

.tab-button {
  padding: 0.75rem 1.5rem;
  border: none;
  background: none;
  color: #6b7280;
  font-weight: 500;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  transition: all 0.2s;
  margin-right: 0.5rem;
  border: 1px solid transparent;
  border-bottom: none;
}

.tab-button:hover:not(:disabled) {
  color: #4b5563;
  background: rgba(255, 255, 255, 0.5);
}

.tab-button.active {
  color: #1a56db;
  background: white;
  border-color: #e5e7eb;
  border-bottom: 1px solid white;
  margin-bottom: -1px;
}

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

.output-content {
  padding: 1rem;
}

.tab-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.output-header {
  display: flex;
  justify-content: flex-end;
  padding: 0.5rem;
}

