@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;700&display=swap');

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Background */
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

  --bg-primary: #0f172a;
  --bg-secondary: #c7d2fe;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-disabled: rgba(255, 255, 255, 0.05);
  --bg-edit: #141e2e;
  --bg-focus: rgba(99, 102, 241, 0.1);

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.2);
  --border-highlight: #3b4f74;

  /* Text */
  --text-primary: #f8fafc;
  --text-muted: #94a3b8;
  --success: #10b981;
  --thumb: white;

  /* Accents */
  --accent: #667eea;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;

  /* Header Controls */
  --control-height: 2.4rem;
  --control-height-sm: 1.78rem;
  --control-height-xs: 1.64rem;

  /* Shadows */
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3), 0 1px 4px rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.08);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', monospace;

  /* Transitions */
  --transition: 0.2s ease;
}

/* ===== Light Theme Overrides ===== */
.light-theme {
  --bg-primary: #f1f5f9;
  --bg-secondary: #764ba2;
  --bg-card: rgba(255, 255, 255, 0.7);
  --bg-disabled: rgba(0, 0, 0, 0.05);
  --bg-edit: white;
  --border-subtle: rgba(148, 163, 184, 0.5);
  --border-highlight: #9ca3af;
  --text-primary: #111827;
  --text-muted: #60738f;
  --thumb: #4f46e5;

  --shadow-card: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 25px rgba(59, 130, 246, 0.1);

  background-image:
    radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(168, 85, 247, 0.1) 0%, transparent 50%);
}

body {
  background-color: var(--bg-primary);
  background-image:
    radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(168, 85, 247, 0.15) 0%, transparent 50%);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem;
  overflow-x: hidden;
}

body.is-loading {
  visibility: hidden;
}

body::selection {
  background: var(--bg-secondary);
  color: white;
}

/* ============================================
   HEADER
   ============================================ */
.header {
  width: 100%;
  max-width: 960px;
  margin-bottom: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.header-main {
  display: flex;
  align-items: center;
  gap: 16px;
}

.title {
  font-family: 'Outfit', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  text-align: center;
  margin: 0 1rem 0.5rem;
  background: var(--gradient-primary);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.subtitle {
  font-size: 0.9rem;
  text-align: center;
  color: var(--text-muted);
  margin: 0 1rem 1rem;
}

.title-icon {
  height: 2rem;
  width: auto;
  vertical-align: middle;
  margin-right: 1rem;
  filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.3));
  transition: transform 0.3s ease;
  animation: float 3s ease-in-out infinite;
}

.title:hover .title-icon {
  transform: scale(1.1) rotate(15deg);
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

/* ============================================
   THEME AND LANGUAGE SWITCHER
   ============================================ */
.theme-lang-switcher {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  display: flex;
  gap: 0.5rem;
  z-index: 100;
}

/* ===== THEME TOGGLE GROUP ===== */
.theme-toggle-group {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.theme-toggle-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--gradient-primary);
  border: 1px solid var(--border-subtle);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transform: translateY(0) scale(0.94);
  opacity: 0.50;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.theme-toggle-btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
}

.theme-toggle-btn:hover {
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  opacity: 0.95;
}

.theme-toggle-btn:hover svg {
  transform: translateY(-1px);
}

.theme-toggle-btn:active {
  transform: scale(0.95);
}

.theme-toggle-btn:focus-visible {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35), 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.theme-toggle-btn.is-active {
  opacity: 1;
  transform: translateY(-1px) scale(1);
}

.light-theme .theme-toggle-btn {
  box-shadow: 0 8px 22px rgba(59, 130, 246, 0.24);
}

.version-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 2px 10px;
  border-radius: 100px;
}

/* ===== LANGUAGE SELECTOR ===== */
.lang-select {
  box-sizing: border-box;
  background: transparent;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  height: var(--control-height);
  padding: 0 2.5rem 0 1rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.3s ease;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' 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.75rem center;
  background-size: 14px 14px;
  outline: none;
}

.lang-select:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  transform_: translateY(-2px);
}

.lang-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--shadow-glow);
}

.lang-select option {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  padding: 10px;
}

.light-theme .lang-select {
  box-shadow: 0 1px 1px rgba(59, 130, 246, 0.06);
}

/* ============================================
   MAIN
   ============================================ */
#app-main {
  width: 100%;
  max-width: 1200px;
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1rem 2rem 1.5rem;
  box-shadow: var(--shadow-card);
  gap: 1rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.glass-card:hover {
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

body.is-loading .glass-card {
  animation: fadeIn 0.6s ease-out both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.form-group {
  margin-bottom: 1rem;
}

label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
  /* text-transform: uppercase; */
  letter-spacing: 0.05em;
}

.label-with-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.label-with-action label {
  margin-bottom: 0;
}

.trash-button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.trash-button:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #ef4444;
}

.trash-button:disabled {
  opacity: 0.5;
  cursor: default;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border-color: transparent;
}

/* File Upload */
.file-upload-wrapper {
  position: relative;
  width: 100%;
  height: 120px;
  cursor: pointer;
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.file-input {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.file-upload-design {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  background: var(--bg-primary);
}

.file-upload-wrapper:hover .file-upload-design {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
}

.upload-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.upload-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Text Input */
.text-input {
  width: 100%;
  padding: 0.5rem 2.5rem 0.5rem 1rem;
  background: var(--bg-edit);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  transition: all 0.3s ease;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
}

.text-input:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.text-input:focus {
  background: var(--bg-focus);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--shadow-glow);
}

.light-theme .file-upload-design {
  background: rgba(255, 255, 255, 0.5);
}

/* Range Input */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: linear-gradient(to right, var(--accent) 0%, rgba(255, 255, 255, 0.1) 0%);
  border-radius: 3px;
  outline: none;
  margin: 1rem 0;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: var(--thumb);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 10px var(--shadow-glow);
  transition: all 0.2s ease;
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--thumb);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 10px var(--shadow-glow);
  transition: all 0.2s ease;
}

.range-value {
  text-align: center;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Checkboxes */
.exclude-options,
.sort-options {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.sort-options {
  margin-bottom: 0.75rem;
}

.checkbox-container,
.radio-container {
  display: flex;
  align-items: center;
  position: relative;
  padding-left: 35px;
  cursor: pointer;
  font-size: 0.85rem;
  user-select: none;
  text-transform: none;
  color: var(--text-primary);
}

.checkbox-container input,
.radio-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark,
.radio-button {
  position: absolute;
  top: 0;
  left: 0;
  height: 22px;
  width: 22px;
  background-color: var(--bg-edit);
  border: 1px solid var(--border-subtle);
  transition: all 0.3s ease;
}

.checkmark {
  border-radius: var(--radius-sm);
}

.radio-button {
  border-radius: 50%;
}

.checkbox-container:hover input~.checkmark,
.radio-container:hover input~.radio-button {
  background-color: var(--bg-focus);
}

.checkbox-container input:checked~.checkmark,
.radio-container input:checked~.radio-button {
  background-color: var(--accent);
}

.checkmark:after,
.radio-button:after {
  content: "";
  position: absolute;
  display: none;
}

.checkbox-container input:checked~.checkmark:after,
.radio-container input:checked~.radio-button:after {
  display: block;
}

.checkbox-container .checkmark:after {
  left: 8px;
  top: 4px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.radio-container .radio-button:after {
  left: 7px;
  top: 7px;
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
}

/* Results */
.placeholder-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
}

/* Old switch styles removed */

.palette-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.color-swatch {
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  border: 1px solid var(--border-subtle);
  transition: transform 0.3s ease;
  animation: scaleIn 0.5s ease-out forwards;
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.color-swatch:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.08);
}

.swatch-box {
  width: 70%;
  aspect-ratio: 1.5;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  box-shadow: 0 4px 12px var(--shadow-glow);
  position: relative;
  background: repeating-conic-gradient(#CCCCCC 0 25%, #FFFFFF 0 50%) 50% / 20px 20px;
  background-size: 10px 10px;
  overflow: hidden;
}

.swatch-box.opaque {
  background: none;
}

.swatch-box::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--swatch-color);
  border-radius: inherit;
}

.swatch-footer {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
}

.swatch-info {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.color-name-editor {
  margin-top: 4px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  line-height: 1.2;
  outline: none;
  border: 1px solid rgba(128, 128, 128, 0.3);
  border-radius: 3px;
  padding: 1px 3px;
  display: block;
  width: 100%;
  box-sizing: border-box;
  cursor: text;
  background: var(--bg-edit);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.color-name-editor:focus {
  border-color: var(--accent);
  background: var(--bg-focus);
}

.success-text {
  color: var(--success) !important;
  font-weight: 600;
}

.copy-button,
.delete-button {
  position: absolute;
  right: 0.75rem;
  display: flex;
  flex-direction: column;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s ease;
}

.copy-button {
  top: 0.75rem;
}

.delete-button {
  top: 2.25rem;
}

.copy-button:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent);
  color: var(--accent);
}

.delete-button:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #ef4444;
}

.copy-button.copied {
  color: var(--success);
  border-color: var(--success);
  transform: scale(1.1);
}

.copy-icon {
  pointer-events: none;
}

.export-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  padding-top: 0.5rem;
  align-content: start;
}

.export-button {
  width: 100%;
  padding: 0.5rem 0.5rem;
  background: var(--gradient-primary);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.json-button {
  background: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.ase-button {
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.svg-button {
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.aco-button {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  box-shadow: 0 4px 15px rgba(30, 58, 138, 0.3);
}

.css-button {
  background: linear-gradient(135deg, #9e9cfa 0%, #6deffe 100%);
  box-shadow: 0 4px 15px rgba(158, 156, 250, 0.3);
}

.export-button.success-btn {
  background: var(--success) !important;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.5);
}

.export-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
  filter: brightness(1.1);
}

.export-button:active:not(:disabled) {
  transform: translateY(0);
}

.export-button:disabled {
  background: var(--bg-disabled);
  color: var(--text-muted);
  cursor: default;
  box-shadow: none;
  border: 1px solid var(--border-subtle);
}

/* ============================================
   FOOTER
   ============================================ */
.app-footer {
  width: 100%;
  max-width: 1100px;
  margin-top: auto;
  padding: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: center;
  position: relative;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 0 1rem;
  color: var(--text-muted);
}

.footer-title {
  font-weight: 500;
  font-size: 0.85rem;
}

.footer-separator {
  color: var(--border-subtle);
  user-select: none;
}

.footer-content a {
  color: #a78bfa;
  text-decoration: none;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.footer-content a:hover {
  color: #764ba2;
  filter: brightness(1.2);
}

/* ============================================
   TOAST
   ============================================ */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 10px 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-md);
  color: var(--accent-hover);
  font-size: 0.8rem;
  font-weight: 500;
  box-shadow: var(--shadow-glow);
  opacity: 0;
  transform: translateY(12px);
  transition: all 300ms ease;
  pointer-events: none;
  z-index: 1000;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ============================================
   SCROLL-TO-TOP BUTTON
   ============================================ */
.scroll-top-btn {
  position: fixed;
  right: 2rem;
  bottom: 2rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--gradient-primary);
  border: 1px solid var(--border-subtle);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
}

.scroll-top-btn.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top-btn svg {
  transition: transform 0.3s ease;
}

.scroll-top-btn:hover {
  transform: translateY(-5px) scale(1.1);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.scroll-top-btn:hover svg {
  transform: translateY(-2px);
}

.scroll-top-btn:active {
  transform: scale(0.95);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
  .theme-lang-switcher {
    top: 0.55rem;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    gap: 0.4rem;
  }

  .header {
    padding-top: 3.1rem;
  }

  .title {
    font-size: 1.8rem;
    line-height: 1.2;
  }
}

@media (max-width: 800px) {
  .theme-lang-switcher {
    top: 0.5rem;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    gap: 0.35rem;
  }

  .theme-toggle-group {
    height: var(--control-height-sm);
    padding: 0 0.16rem;
    gap: 0.22rem;
  }

  .theme-toggle-btn {
    width: 1.72rem;
    height: 1.72rem;
  }

  .theme-toggle-btn svg {
    width: 13px;
    height: 13px;
  }

  .lang-select {
    height: var(--control-height-sm);
    font-size: 0.82rem;
    padding: 0 2.2rem 0 0.7rem;
    background-position: right 0.6rem center;
  }

  .header-inner {
    padding: var(--space-sm) var(--space-md);
  }
}

@media (max-width: 600px) {
  .footer-content {
    gap: 0.75rem;
  }

  .scroll-top-btn {
    right: 1.5rem;
    bottom: 1.5rem;
  }
}

@media (max-width: 850px) {
  .container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  .theme-lang-switcher {
    top: 0.45rem;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }

  .theme-toggle-btn {
    width: 1.58rem;
    height: 1.58rem;
  }

  .lang-select {
    height: var(--control-height-xs);
    max-width: 7.9rem;
    font-size: 0.78rem;
  }

  .theme-toggle-group {
    height: var(--control-height-xs);
  }
}
