:root {
  /* Color Scheme */
  --primary-brand-blue: #3B82F6;
  --primary-brand-blue-dark: #2563EB;
  --accent-purple: #8B5CF6;
  --success-green: #10B981;
  --warning-orange: #F59E0B;
  --error-red: #EF4444;

  /* Background System */
  --bg-primary: #0F172A; /* Deep Blue Black */
  --bg-secondary: #1E293B; /* Card Background */
  --bg-tertiary: #334155; /* Overlay Background */

  /* Text Colors */
  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;

  /* Font System */
  --font-family-primary: 'Inter', -apple-system, sans-serif;
  --font-family-code: 'Fira Code', 'Courier New', monospace;
  --font-family-chinese: 'PingFang SC', 'Microsoft YaHei', sans-serif;

  --h1-font-size: 48px;
  --h1-font-weight: 600;
  --h1-line-height: 1.2;

  --h2-font-size: 32px;
  --h2-font-weight: 600;
  --h2-line-height: 1.3;

  --h3-font-size: 24px;
  --h3-font-weight: 600;
  --h3-line-height: 1.4;

  --body-large-font-size: 18px;
  --body-large-line-height: 1.6;

  --body-font-size: 16px;
  --body-line-height: 1.5;

  --caption-font-size: 14px;
  --caption-line-height: 1.5;

  --small-font-size: 12px;
  --small-line-height: 1.4;

  /* Spacing System */
  --spacing-xs: 4px;
  --spacing-s: 8px;
  --spacing-m: 16px;
  --spacing-l: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;
  --spacing-3xl: 64px;
  --spacing-4xl: 96px;

  /* Border Radius System */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Shadow System */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.6);
  --glow-shadow: 0 0 20px rgba(59, 130, 246, 0.4);

  /* Transitions */
  --transition-standard: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease-out;
  --transition-elastic: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);

  /* Header Height (from requirements) */
  --header-height: 72px;
}

/* Dark theme specific adjustments (as primary theme) */
[data-theme="dark"], :root {
  color-scheme: dark;
  font-family: var(--font-family-primary), var(--font-family-chinese);
  --bg-color-gradient-start: var(--bg-primary);
  --bg-color-gradient-end: #1E1B4B;
}

/* Removed Light theme as it's not in scope for this redesign */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(135deg, var(--bg-primary), var(--bg-color-gradient-end));
  color: var(--text-primary);
  min-height: 100vh;
  line-height: var(--body-line-height);
  font-size: var(--body-font-size);
  overflow-x: hidden;
  animation: fadeIn 0.8s ease-out forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.main-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-m) var(--spacing-l);
  background: rgba(15, 23, 42, 0.8); /* 半透明背景 */
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-lg);
  height: var(--header-height);
  transition: var(--transition-standard);
  animation: slideInFromTop 0.5s ease-out forwards;
}

@keyframes slideInFromTop {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.header-brand {
  display: flex;
  align-items: center;
  font-size: 1.25rem;
  font-weight: var(--h3-font-weight);
  color: var(--text-primary);
}

.header-brand .badge {
  margin-right: var(--spacing-s);
  /* New badge styles (from requirements) */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xs) var(--spacing-m);
  border-radius: var(--radius-xl); /* Full rounded */
  background: linear-gradient(45deg, var(--primary-brand-blue), var(--accent-purple));
  color: #fff;
  font-size: var(--caption-font-size);
  font-weight: var(--h3-font-weight);
  margin-right: var(--spacing-s);
  box-shadow: var(--shadow-sm);
}

.header-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  margin-right: var(--spacing-m);
  padding: var(--spacing-s) 0;
  transition: var(--transition-standard);
  position: relative;
}

.header-nav a:hover {
  color: var(--primary-brand-blue);
}

.header-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-brand-blue), var(--accent-purple));
  transition: width var(--transition-fast);
}

.header-nav a:hover::after {
  width: 100%;
}

.header-user-actions {
  display: flex;
  align-items: center;
}

.header-user-actions a {
  margin-left: var(--spacing-m);
  text-decoration: none;
  color: var(--text-secondary);
  transition: var(--transition-standard);
}

.header-user-actions a:hover {
  color: var(--primary-brand-blue);
}

.header-user-actions .button {
  padding: var(--spacing-s) var(--spacing-m);
  border-radius: var(--radius-md);
  font-size: var(--body-font-size);
  font-weight: var(--h3-font-weight);
}

.main-footer {
  background: var(--bg-primary);
  color: var(--text-secondary);
  padding: var(--spacing-l) var(--spacing-l);
  text-align: center;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  align-items: center;
  margin-top: var(--spacing-xl);
}

.footer-section {
  margin: var(--spacing-m);
}

.footer-section a {
  color: var(--text-secondary);
  text-decoration: none;
  margin: 0 var(--spacing-s);
  transition: color 0.2s ease;
}

.footer-section a:hover {
  color: var(--primary-brand-blue);
}

.footer-section p {
  margin: 0;
  font-size: 0.9rem;
}

/* Basic Button Styles (will be refined) */
.button {
  cursor: pointer;
  padding: var(--spacing-m) var(--spacing-xl);
  border-radius: var(--radius-md);
  border: none;
  font-size: var(--body-font-size);
  font-weight: var(--h3-font-weight);
  transition: var(--transition-standard);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.button.primary-button {
  background: linear-gradient(135deg, var(--primary-brand-blue) 0%, var(--accent-purple) 100%);
  height: 56px;
  color: #fff;
  box-shadow: var(--shadow-md);
}

.button.primary-button:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
}

.button.secondary-button {
  background: transparent;
  border: 2px solid var(--primary-brand-blue);
  color: var(--primary-brand-blue);
  height: 56px;
}

.button.secondary-button:hover {
  background: rgba(59, 130, 246, 0.1);
  transform: scale(1.02);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* Icon Button */
.icon-button {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: var(--radius-md); /* Square with rounded corners */
  background: rgba(255, 255, 255, 0.05);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-standard);
}

.icon-button i {
  font-size: 20px;
  color: var(--text-primary);
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: rotate(5deg) scale(1.05);
}

/* Main Layout */
main {
  max-width: 1200px;
  margin: var(--spacing-l) auto;
  padding: 0 var(--spacing-l);
}

.hero-section {
  text-align: center;
  padding: var(--spacing-4xl) var(--spacing-l);
  margin-bottom: var(--spacing-4xl);
  background: var(--bg-primary);
  position: relative; /* For decorative elements */
  overflow: hidden; /* For background patterns */
  min-height: 500px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-color-gradient-end) 100%);
  opacity: 0.9;
  z-index: -1;
}

.hero-section h1 {
  font-size: var(--h1-font-size);
  font-weight: var(--h1-font-weight);
  line-height: var(--h1-line-height);
  margin-bottom: var(--spacing-m);
  background: linear-gradient(90deg, var(--primary-brand-blue), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent; /* Fallback for browsers not supporting -webkit-text-fill-color */
  animation: fadeInDown 0.8s ease-out forwards;
}

.hero-section p {
  font-size: var(--body-large-font-size);
  line-height: var(--body-large-line-height);
  max-width: 600px;
  margin: 0 auto var(--spacing-xl) auto;
  color: var(--text-secondary);
  animation: fadeInUp 1s ease-out forwards;
  animation-delay: 0.2s;
}

.hero-buttons {
  display: flex;
  gap: var(--spacing-l);
  margin-top: var(--spacing-xl);
  animation: fadeInUp 1s ease-out forwards;
  animation-delay: 0.4s;
}

.hero-buttons .button {
  min-width: 200px;
  height: 56px;
  font-size: var(--body-font-size);
  font-weight: var(--h2-font-weight);
  border-radius: var(--radius-md);
}

.main-content-area {
  display: grid;
  grid-template-columns: 2fr 1fr; /* Two-column layout */
  gap: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
}

.operation-cards-container {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--spacing-xl);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: var(--transition-standard);
}

.operation-cards-container:hover {
  transform: translateY(-4px);
  border-color: var(--primary-brand-blue);
  box-shadow: var(--glow-shadow);
}

.info-section-container {
  display: grid;
  gap: var(--spacing-l);
}

/* Tabs */
.tabs {
  display: flex;
  margin-bottom: var(--spacing-xl);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-button {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: var(--spacing-s) var(--spacing-m);
  cursor: pointer;
  font-size: var(--body-font-size);
  font-weight: 500;
  transition: var(--transition-fast);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab-button:hover {
  color: var(--primary-brand-blue);
}

.tab-button.active {
  color: var(--primary-brand-blue);
  border-bottom-color: var(--primary-brand-blue);
  font-weight: var(--h3-font-weight);
}

/* Card Panels for Operations */
.card-panel {
  display: none;
  padding: var(--spacing-xl);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary); /* Use card-bg from root */
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: var(--transition-standard);
  margin-top: var(--spacing-xl);
}

.card-panel:hover {
  transform: translateY(-4px);
  border-color: var(--primary-brand-blue);
  box-shadow: var(--glow-shadow);
}

.card-panel.active {
  display: block;
}

.card-panel h2 {
  font-size: var(--h3-font-size);
  font-weight: var(--h3-font-weight);
  margin-bottom: var(--spacing-l);
  color: var(--text-primary);
}

/* Info Cards */
.info-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--spacing-xl);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: var(--transition-standard);
}

.info-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary-brand-blue);
  box-shadow: var(--glow-shadow);
}

.info-card h2 {
  font-size: var(--h3-font-size);
  font-weight: var(--h3-font-weight);
  margin-bottom: var(--spacing-m);
  color: var(--text-primary);
}

.how-it-works-list {
  list-style: none;
  padding: 0;
}

.how-it-works-list li {
  margin-bottom: var(--spacing-s);
  color: var(--text-secondary);
  font-size: var(--body-font-size);
}

.results-section {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--spacing-xl);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: var(--spacing-4xl);
  transition: var(--transition-standard);
  animation: fadeInUp 0.8s ease-out forwards;
  animation-delay: 1.2s;
}

.results-section:hover {
  transform: translateY(-4px);
  border-color: var(--primary-brand-blue);
  box-shadow: var(--glow-shadow);
}

.results-section h2 {
  font-size: var(--h3-font-size);
  font-weight: var(--h3-font-weight);
  margin-bottom: var(--spacing-l);
  color: var(--text-primary);
}

/* Form element styles */
label {
  display: block;
  margin-bottom: var(--spacing-s);
  font-weight: 500;
  color: var(--text-primary);
  font-size: var(--body-font-size);
}

/* URL Input Box */
.url-input-group {
  position: relative;
  margin-bottom: var(--spacing-l);
}

.url-input-group input[type="url"] {
  height: 56px;
  background: var(--bg-tertiary);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  padding: var(--spacing-m) var(--spacing-l);
  color: var(--text-primary);
  font-size: var(--body-font-size);
  width: 100%;
  transition: var(--transition-standard);
}

.url-input-group input[type="url"]::placeholder {
  color: var(--text-muted);
}

.url-input-group input[type="url"]:focus {
  outline: none;
  border-color: var(--primary-brand-blue);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
  background: #3F4D61;
}

.url-input-group .icon-left {
  position: absolute;
  left: var(--spacing-m);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: var(--body-large-font-size);
}

.url-input-group .paste-button {
  position: absolute;
  right: var(--spacing-m);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: var(--radius-sm);
  padding: var(--spacing-s) var(--spacing-m);
  color: var(--text-primary);
  cursor: pointer;
  font-size: var(--caption-font-size);
  transition: var(--transition-fast);
  opacity: 0;
  visibility: hidden;
}

.url-input-group:hover .paste-button {
  opacity: 1;
  visibility: visible;
}

input[type="file"], textarea {
  width: 100%;
  padding: var(--spacing-m);
  margin-bottom: var(--spacing-l);
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: var(--body-font-size);
  transition: var(--transition-standard);
}

input[type="file"]:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-brand-blue);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
  background: #3F4D61;
}

.checkbox-group {
  margin-bottom: var(--spacing-l);
}

.checkbox-group label {
  display: flex;
  align-items: center;
  font-weight: 400;
  font-size: var(--body-font-size);
  color: var(--text-primary);
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  /* Hide default checkbox */
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--text-muted); /* Initial border color */
  border-radius: var(--radius-sm);
  margin-right: var(--spacing-s);
  position: relative;
  cursor: pointer;
  transition: var(--transition-standard);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.checkbox-group input[type="checkbox"]::before {
  content: '\f00c'; /* Font Awesome check icon */
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  font-size: 14px;
  color: #fff;
  opacity: 0;
  transform: scale(0.5);
  transition: var(--transition-standard);
}

.checkbox-group input[type="checkbox"]:checked {
  background: linear-gradient(135deg, var(--primary-brand-blue), var(--accent-purple));
  border-color: transparent;
}

.checkbox-group input[type="checkbox"]:checked::before {
  opacity: 1;
  transform: scale(1);
  animation: checkmark-pop 0.3s ease-out forwards;
}

.checkbox-group input[type="checkbox"]:hover {
  border-color: var(--primary-brand-blue);
  transform: scale(1.05);
}

.checkbox-group span {
  font-size: var(--body-font-size);
  color: var(--text-primary);
  line-height: var(--body-line-height);
}

.checkbox-group span a {
  color: var(--primary-brand-blue);
  text-decoration: underline;
}

.format-options.grid {
  margin-bottom: var(--spacing-l);
}

.pro-feature-notice {
  background: rgba(var(--primary-brand-blue), 0.1);
  border: 1px dashed var(--primary-brand-blue);
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  text-align: center;
  margin-top: var(--spacing-l);
}

.pro-feature-notice p {
  margin-bottom: var(--spacing-md);
  color: var(--primary-brand-blue);
  font-weight: 500;
}

.pro-feature-notice .button {
  display: inline-block;
  padding: 8px 16px;
  font-size: 0.9rem;
}

/* Alerts */
#alerts { /* This #alerts is for global alerts, not specific to card-panel */
  margin-bottom: var(--spacing-l);
}

.alert {
  padding: var(--spacing-md) var(--spacing-l);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-md);
  font-weight: 500;
}

.alert-error {
  background: rgba(248, 113, 113, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.5);
  color: #fca5a5;
}

.alert-success {
  background: rgba(134, 239, 172, 0.15);
  border: 1px solid rgba(134, 239, 172, 0.5);
  color: #a7f3d0;
}

/* General Grid layout (retained for format options) */
.grid {
  display: grid;
  gap: 16px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* Job Card for results display */
.job-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: var(--spacing-m);
  background: var(--bg-tertiary);
  margin-bottom: var(--spacing-m);
  display: flex;
  align-items: center;
  gap: var(--spacing-m);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-standard);
}

.job-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.job-card .thumbnail {
  width: 60px;
  height: 60px;
  background-color: var(--bg-secondary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.job-card .thumbnail i {
  font-size: var(--h3-font-size);
  color: var(--text-secondary);
}

.job-card .job-details {
  flex-grow: 1;
}

.job-card .job-details .filename {
  font-size: var(--body-font-size);
  color: var(--text-primary);
  font-weight: var(--h3-font-weight);
  margin-bottom: var(--spacing-xs);
}

.job-card .job-details .status-text {
  font-size: var(--caption-font-size);
  color: var(--text-secondary);
}

.job-card .progress-bar {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  margin-top: var(--spacing-s);
}

.job-card .progress-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary-brand-blue), var(--accent-purple));
  transition: width 0.3s ease;
  animation: progress-flow 2s infinite linear;
}

@keyframes progress-flow {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.job-card .job-actions {
  display: flex;
  gap: var(--spacing-s);
}

.job-card .job-actions .icon-button {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.job-card .job-actions .icon-button:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Modal styles (retained as is, not specifically requested for change) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-backdrop.active {
  display: flex;
}

.modal {
  background: rgba(15, 23, 42, 0.95);
  padding: 24px;
  border-radius: 16px;
  max-width: 520px;
  width: 90%;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.5);
}

/* Badge style (retained as is) */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.2);
  color: #bfdbfe;
  font-size: 13px;
  margin-right: 8px;
}

/* Table and details (retained as is) */
.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

.table th, .table td {
  padding: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  text-align: left;
}

details {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

summary {
  cursor: pointer;
  font-weight: 600;
}

.code-block {
  font-family: 'Fira Code', monospace;
  background: rgba(15, 23, 42, 0.8);
  padding: 16px;
  border-radius: 12px;
  overflow-x: auto;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .main-content-area {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
  }

  .operation-cards-container,
  .info-section-container {
    padding: var(--spacing-l);
  }
}

@media (max-width: 768px) {
  .main-header {
    flex-direction: column;
    height: auto;
    padding: var(--spacing-m);
    box-shadow: var(--shadow-md);
  }

  .header-brand {
    width: 100%;
    justify-content: center;
    margin-bottom: var(--spacing-s);
  }

  .header-nav {
    display: none; /* Hidden for mobile, will be toggled by JS for hamburger menu */
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-top: var(--spacing-m);
  }

  .header-nav a {
    margin: var(--spacing-s) 0;
    width: 100%;
    text-align: center;
  }

  .header-user-actions {
    display: none; /* Hidden for mobile, will be toggled by JS */
    flex-direction: column;
    width: 100%;
    margin-top: var(--spacing-m);
  }

  .header-user-actions a {
    margin: var(--spacing-s) 0;
    width: 100%;
    text-align: center;
  }

  .hero-section {
    padding: var(--spacing-2xl) var(--spacing-m);
    min-height: 400px;
  }

  .hero-section h1 {
    font-size: var(--h2-font-size);
  }

  .hero-section p {
    font-size: var(--body-font-size);
  }

  .hero-buttons {
    flex-direction: column;
    gap: var(--spacing-m);
    width: 100%;
  }

  .hero-buttons .button {
    width: 100%;
    min-width: unset;
  }

  main {
    padding: 0 var(--spacing-m);
  }

  .footer-section {
    margin: var(--spacing-s) 0;
  }
}

@media (max-width: 640px) {
  .main-content-area {
    gap: var(--spacing-l);
  }

  .operation-cards-container,
  .info-section-container,
  .results-section {
    padding: var(--spacing-m);
  }

  .tab-button {
    font-size: var(--caption-font-size);
    padding: var(--spacing-s);
  }

  .hero-section h1 {
    font-size: var(--h3-font-size);
  }

  .footer-section {
    flex-basis: 100%;
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* File Upload Area */
.file-upload-area {
  min-height: 200px;
  background: transparent;
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
  text-align: center;
  cursor: pointer;
  margin-bottom: var(--spacing-l);
  transition: var(--transition-standard);
  position: relative;
  overflow: hidden;
}

.file-upload-area:hover {
  border-color: var(--primary-brand-blue);
  background-color: rgba(59, 130, 246, 0.05);
}

.file-upload-area.drag-over {
  border-color: var(--accent-purple);
  background-color: rgba(139, 92, 246, 0.1);
  animation: pulse-border 1.5s infinite alternate;
}

@keyframes pulse-border {
  from { border-color: var(--primary-brand-blue); }
  to { border-color: var(--accent-purple); }
}

.file-upload-area .upload-icon {
  font-size: var(--spacing-3xl);
  color: var(--text-secondary);
  margin-bottom: var(--spacing-s);
}

.file-upload-area .main-text {
  font-size: var(--body-large-font-size);
  font-weight: var(--h3-font-weight);
  color: var(--text-primary);
  margin-bottom: var(--spacing-xs);
}

.file-upload-area .sub-text {
  font-size: var(--body-font-size);
  color: var(--text-secondary);
  margin-bottom: var(--spacing-m);
}

.file-upload-area .supported-formats {
  font-size: var(--caption-font-size);
  color: var(--text-muted);
}

.file-upload-area input[type="file"] {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  left: 0;
  top: 0;
  margin: 0;
  padding: 0;
  z-index: 1;
}

/* Batch Textarea */
textarea {
  min-height: 160px;
  background: var(--bg-tertiary);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: var(--spacing-m);
  font-family: var(--font-family-code);
  font-size: var(--body-font-size);
  color: var(--text-primary);
  line-height: 1.8;
  resize: vertical;
  transition: var(--transition-standard);
}

textarea:focus {
  outline: none;
  border-color: var(--primary-brand-blue);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
  background: #3F4D61;
}

/* Format Options Tabs */
.format-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--spacing-m);
  margin-bottom: var(--spacing-l);
}

.format-options label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  height: 48px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition-standard);
  position: relative; /* For the custom checkbox */
  padding: var(--spacing-s);
}

.format-options label:hover {
  background: rgba(255, 255, 255, 0.1);
}

.format-options input[type="checkbox"] {
  /* Hide the actual checkbox */
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.format-options label span {
  font-size: var(--body-font-size);
  color: var(--text-primary);
  margin-top: var(--spacing-xs); /* Space for icon */
}

.format-options input[type="checkbox"]:checked + span {
  color: var(--primary-brand-blue);
}

.format-options input[type="checkbox"]:checked + span::before {
  /* Icon for selected state, if needed - this part needs HTML change */
}

.format-options input[type="checkbox"]:checked ~ i {
  color: var(--primary-brand-blue);
}

.format-options input[type="checkbox"]:checked + span::before,
.format-options input[type="checkbox"]:checked ~ i {
  color: var(--primary-brand-blue);
}

.format-options input[type="checkbox"]:checked + span,
.format-options input[type="checkbox"]:checked {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--primary-brand-blue);
}

/* Error state for inputs */
input.error, textarea.error {
  border-color: var(--error-red) !important;
  box-shadow: 0 0 0 4px rgba(var(--error-red), 0.2) !important;
  animation: shake 0.3s cubic-bezier(.36,.07,.19,.97) both;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  perspective: 1000px;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Button loading/success states */
.button.loading {
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.8;
}

.button.loading .spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
  margin-right: var(--spacing-s);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.button.success {
  background: var(--success-green);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
  animation: pulse-success 0.5s ease-out;
}

.button.success .icon-check {
  display: inline-block;
  margin-right: var(--spacing-s);
}

@keyframes pulse-success {
  0% { transform: scale(0.9); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

/* Checkbox checkmark animation */
.checkbox-group input[type="checkbox"]:checked::before {
  opacity: 1;
  transform: scale(1);
  animation: checkmark-pop 0.3s ease-out forwards;
}

@keyframes checkmark-pop {
  0% { transform: scale(0.5); }
  80% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.tasks-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: var(--spacing-m);
}
