:root {
  --bg-primary: #18181b;
  --bg-block: #1f1f23;
  --bg-hover: #27272b;
  --border: #323237;
  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --accent: #a3e635;
  --accent-hover: #bef264;
  --danger: #ef4444;
  --radius-lg: 16px;
  --radius-md: 12px;
  --gap: 16px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  padding: var(--gap);
}

.container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--gap);
  max-width: 1600px;
  margin: 0 auto;
  height: calc(100vh - 32px);
}

.left-column {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  min-height: 0;
}

.left-column .block {
  flex: 1 1 0;
  min-height: 0;
}

.block {
  background: var(--bg-block);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.block h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text-primary);
  flex-shrink: 0;
}

.drop-zone {
  flex: 0 0 auto;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--accent);
  background: rgba(163, 230, 53, 0.05);
}

.drop-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  text-align: center;
  pointer-events: none;
}

.drop-content svg {
  color: var(--accent);
  margin-bottom: 8px;
}

.drop-text {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
}

.drop-hint {
  font-size: 14px;
  color: var(--text-secondary);
}

.file-list {
  flex: 1 1 auto;
  overflow-y: auto;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  max-height: 400px;
  padding-right: 5px;
}

.file-list::-webkit-scrollbar {
  width: 8px;
}

.file-list::-webkit-scrollbar-track {
  background: transparent;
}

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

.file-list::-webkit-scrollbar-thumb:hover {
  background: #44444a;
}

.right-panel {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.right-panel::-webkit-scrollbar {
  width: 8px;
}

.right-panel::-webkit-scrollbar-track {
  background: transparent;
}

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

.right-panel::-webkit-scrollbar-thumb:hover {
  background: #44444a;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: background 0.15s;
  flex-shrink: 0;
}

.file-item:hover {
  background: var(--bg-hover);
}

.file-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent);
}

.file-info {
  flex: 1;
  min-width: 0;
}

.file-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-size {
  font-size: 13px;
  color: var(--text-secondary);
}

.file-remove {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.15s;
}

.file-remove:hover {
  background: var(--danger);
  color: white;
}

.right-panel {
  background: var(--bg-block);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.panel-state {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel-state h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 4px;
}

.idle-icon {
  display: flex;
  justify-content: center;
  margin: 8px 0 0;
  opacity: 0.3;
}

.idle-icon svg {
  display: block;
  overflow: visible;
}

.idle-text {
  text-align: center;
  color: var(--text-secondary);
  font-size: 15px;
  margin: 0 auto 8px;
  max-width: 300px;
}

.progress-info {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 12px;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  white-space: pre-line;
}

.stats-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  gap: 8px;
}

.stat-label {
  font-size: 14px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.stat-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
}

.stat-value.highlight {
  color: var(--accent);
}

.action-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  background: var(--accent);
  color: #18181b;
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 4px;
}

.action-button:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.action-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.action-button.secondary {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  margin-top: 8px;
}

/* Keep the gap between the compression result and the next operation clear. */
#compressState + #decompressState {
  margin-top: 28px;
}

#compressState + #decompressState .panel-state {
  gap: 12px;
}

.action-button.secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--accent);
}

@media (max-width: 1200px) {
  .container {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    height: auto;
  }
  
  .right-panel {
    min-height: 400px;
  }
}

@media (max-width: 768px) {
  body {
    padding: 8px;
  }
  
  .container {
    gap: 8px;
  }
  
  .left-column {
    gap: 8px;
  }
  
  .block {
    padding: 16px;
  }
  
  .right-panel {
    padding: 20px;
  }
}
