:root {
  color-scheme: light;
  
  /* === 色彩系统 - 浅色现代主题 === */
  --bg-primary: #fafbfc;
  --bg-secondary: #f0f2f5;
  --bg-tertiary: #e8ecf1;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-solid: #ffffff;
  --bg-input: #ffffff;
  --bg-hover: rgba(59, 130, 246, 0.04);
  --bg-active: rgba(59, 130, 246, 0.08);
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #ffffff;
  
  --accent-primary: #3b82f6;
  --accent-primary-hover: #2563eb;
  --accent-primary-light: rgba(59, 130, 246, 0.1);
  --accent-secondary: #8b5cf6;
  --accent-secondary-light: rgba(139, 92, 246, 0.1);
  --accent-success: #10b981;
  --accent-warning: #f59e0b;
  --accent-danger: #ef4444;
  --accent-danger-light: rgba(239, 68, 68, 0.1);
  
  --border-subtle: rgba(226, 232, 240, 0.6);
  --border-default: #e2e8f0;
  --border-focus: #3b82f6;
  
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.06), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.15);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* === 基础重置 === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

html {
  height: 100%;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  height: 100%;
  min-height: 100vh;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  overflow: hidden;
}

/* === 环境光背景 === */
.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: orbFloat 20s ease-in-out infinite;
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.15), transparent 70%);
  top: -200px;
  right: -100px;
  animation-delay: 0s;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.1), transparent 70%);
  bottom: -150px;
  left: -100px;
  animation-delay: -7s;
}

.orb-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.08), transparent 70%);
  top: 40%;
  left: 50%;
  animation-delay: -14s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -30px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(20px, 10px) scale(1.02); }
}

/* === 应用容器 === */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 1720px;
  height: 100vh;
  margin: 0 auto;
  padding: 24px 28px;
}

/* === Header === */
.app-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-subtle);
  animation: fadeSlideDown 0.6s ease-out;
}

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

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

.brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: var(--text-inverse);
  box-shadow: var(--shadow-md), 0 0 20px rgba(59, 130, 246, 0.2);
  animation: iconPulse 3s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% { box-shadow: var(--shadow-md), 0 0 20px rgba(59, 130, 246, 0.2); }
  50% { box-shadow: var(--shadow-md), 0 0 30px rgba(59, 130, 246, 0.35); }
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand-eyebrow {
  font-family: "Space Grotesk", monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-primary);
}

.brand-title {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.header-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.badge:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-default);
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot-color, var(--accent-success));
  box-shadow: 0 0 8px var(--dot-color, var(--accent-success));
  animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(0.85); }
}

/* === Main Layout === */
.app-main {
  display: grid;
  grid-template-columns: 400px minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  animation: fadeSlideUp 0.6s ease-out 0.15s both;
}

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

/* === Sidebar === */
.search-sidebar {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.search-form {
  min-height: 100%;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  transition: box-shadow var(--transition-base);
}

.search-form:hover {
  box-shadow: var(--shadow-xl);
}

/* === Panel Header === */
.panel-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.panel-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.panel-eyebrow {
  font-family: "Space Grotesk", monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-primary);
}

.panel-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
}

/* === Buttons === */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-hover));
  color: var(--text-inverse);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm), 0 0 0 0 rgba(59, 130, 246, 0);
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md), 0 0 20px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: var(--shadow-sm);
}

.btn-icon {
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.btn-primary:hover .btn-icon {
  transform: translateX(2px);
}

/* === Upload Section === */
.upload-section {
  margin-bottom: 20px;
}

.drop-zone {
  position: relative;
  display: block;
  min-height: 220px;
  border: 2px dashed var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  cursor: pointer;
  overflow: hidden;
  transition: all var(--transition-base);
}

.drop-zone:hover {
  border-color: var(--accent-primary);
  background: var(--accent-primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.drop-zone.is-dragover {
  border-color: var(--accent-primary);
  background: var(--accent-primary-light);
  border-style: solid;
  box-shadow: var(--shadow-glow);
}

.drop-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.drop-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px 24px;
  text-align: center;
  transition: opacity var(--transition-base);
}

.drop-zone.has-preview .drop-content {
  opacity: 0;
  pointer-events: none;
}

.drop-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--bg-card-solid);
  color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-bounce);
}

.drop-zone:hover .drop-icon {
  transform: scale(1.1) rotate(-5deg);
  box-shadow: var(--shadow-md);
}

.drop-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.drop-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.drop-hint {
  display: inline-flex;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-card-solid);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 500;
}

.batch-sidebar {
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(59, 130, 246, 0.05), rgba(255, 255, 255, 0.92)),
    var(--bg-card-solid);
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}

.batch-sidebar--sidebar {
  margin-bottom: 18px;
  padding: 10px;
}

.batch-sidebar-head {
  margin-bottom: 8px;
}

.batch-sidebar-title {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.batch-sidebar-desc {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.batch-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 10px;
}

.batch-thumbs--sidebar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.batch-thumb {
  padding: 8px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.84);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}

.batch-thumb:hover {
  transform: translateY(-1px);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
}

.batch-thumb.is-active {
  border-color: var(--accent-primary);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.14), rgba(255, 255, 255, 0.98));
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(59, 130, 246, 0.14);
}

.batch-thumb-image-wrap {
  aspect-ratio: 1.1;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
}

.batch-thumbs--sidebar .batch-thumb {
  width: 82px;
  min-width: 82px;
  padding: 6px;
}

.batch-thumbs--sidebar .batch-thumb-image-wrap {
  aspect-ratio: 1;
}

.batch-thumb-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.batch-thumb-body {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}

.batch-thumbs--sidebar .batch-thumb-body {
  margin-top: 6px;
  flex-direction: column;
  gap: 0;
}

.batch-thumb-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.batch-thumbs--sidebar .batch-thumb-title {
  font-size: 11px;
}

.batch-thumb-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.batch-thumbs--sidebar .batch-thumb-meta {
  font-size: 10px;
}

/* === Preview === */
.drop-preview {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card-solid);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.drop-zone.has-preview .drop-preview {
  opacity: 1;
  pointer-events: auto;
}

.drop-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
}

.preview-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  z-index: 3;
}

.preview-remove:hover {
  background: var(--accent-danger);
  transform: scale(1.1);
}

/* === Fields Grid === */
.fields-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

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

.field.span-2 {
  grid-column: 1 / -1;
}

.field-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: none;
  letter-spacing: 0;
}

.field-input,
.field-select {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  transition: all var(--transition-fast);
  outline: none;
}

/* === Input with Unit === */
.input-with-unit {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-unit .field-input {
  padding-right: 36px;
}

.input-unit {
  position: absolute;
  right: 12px;
  color: var(--text-tertiary);
  font-size: 13px;
  font-weight: 500;
  pointer-events: none;
}

.field-input::placeholder {
  color: var(--text-tertiary);
}

.field-input:hover,
.field-select:hover {
  border-color: var(--accent-primary);
  background: var(--bg-card-solid);
}

.field-input:focus,
.field-select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  background: var(--bg-card-solid);
}

.select-wrapper {
  position: relative;
}

.select-wrapper .field-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 36px;
}

.select-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
  transition: transform var(--transition-fast);
}

.select-wrapper:focus-within .select-arrow {
  transform: translateY(-50%) rotate(180deg);
  color: var(--accent-primary);
}

/* === Checkbox === */
.checkbox-field {
  grid-column: 1 / -1;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 8px 0;
}

.checkbox-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.checkbox-check {
  color: white;
  opacity: 0;
  transform: scale(0);
  transition: all var(--transition-bounce);
}

.checkbox-input:checked + .checkbox-box {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.checkbox-input:checked + .checkbox-box .checkbox-check {
  opacity: 1;
  transform: scale(1);
}

.checkbox-input:focus + .checkbox-box {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

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

/* === Tooltip === */
.tooltip-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
  cursor: help;
  flex-shrink: 0;
  transition: all var(--transition-fast);
  position: relative;
}

.tooltip-trigger:hover {
  background: var(--accent-primary-light);
  color: var(--accent-primary);
}

.tooltip-trigger::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(6px);
  width: min(280px, 78vw);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--text-primary);
  color: var(--text-inverse);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.55;
  box-shadow: var(--shadow-xl);
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-fast);
  z-index: 100;
  text-align: left;
}

.tooltip-trigger:hover::after,
.tooltip-trigger:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* === Results Panel === */
.results-panel {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  min-height: 600px;
}

/* === Status Bar === */
.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  margin-bottom: 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-base);
}

.status-bar:hover {
  box-shadow: var(--shadow-md);
}

.status-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.status-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-card-solid);
  color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
  transition: all var(--transition-bounce);
}

.status-bar:hover .status-icon {
  transform: scale(1.05);
}

.status-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.status-label {
  font-family: "Space Grotesk", monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-primary);
}

.status-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.status-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-external {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  background: var(--accent-primary-light);
  color: var(--accent-primary);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.link-external:hover {
  background: var(--accent-primary);
  color: var(--text-inverse);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* === Results Header === */
.results-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.results-header-side {
  display: flex;
  align-items: center;
  gap: 12px;
}

.results-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.results-meta {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.meta-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.meta-badge--page {
  background: var(--accent-primary-light);
  color: var(--accent-primary);
  border-color: rgba(59, 130, 246, 0.2);
}

/* === Products Grid === */
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* === Product Card === */
.product-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  animation: cardAppear 0.5s ease-out both;
}

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

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--border-default);
}

.product-image-link {
  display: block;
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
}

.product-image-wrap {
  position: relative;
  width: 100%;
  height: 100%;
}

.product-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-slow);
}

.product-card:hover .product-image-wrap img {
  transform: scale(1.08);
}

.product-image-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.5);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.product-card:hover .product-image-overlay {
  opacity: 1;
}

.view-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.95);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  transform: translateY(8px);
  transition: transform var(--transition-bounce);
}

.product-card:hover .view-hint {
  transform: translateY(0);
}

.product-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8em;
}

.product-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.price-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-danger);
  letter-spacing: -0.02em;
}

.price-unit {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.product-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.detail-value {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
  text-align: right;
}

.product-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px;
  margin-top: 4px;
  border-radius: var(--radius-md);
  background: var(--accent-danger-light);
  color: var(--accent-danger);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.product-action:hover {
  background: var(--accent-danger);
  color: var(--text-inverse);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* === Staggered Card Animation === */
.products-grid .product-card:nth-child(1) { animation-delay: 0.05s; }
.products-grid .product-card:nth-child(2) { animation-delay: 0.1s; }
.products-grid .product-card:nth-child(3) { animation-delay: 0.15s; }
.products-grid .product-card:nth-child(4) { animation-delay: 0.2s; }
.products-grid .product-card:nth-child(5) { animation-delay: 0.25s; }
.products-grid .product-card:nth-child(6) { animation-delay: 0.3s; }
.products-grid .product-card:nth-child(7) { animation-delay: 0.35s; }
.products-grid .product-card:nth-child(8) { animation-delay: 0.4s; }

/* === Responsive === */
@media (max-width: 1400px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1200px) {
  .app-main {
    grid-template-columns: 360px minmax(0, 1fr);
  }
}

@media (max-width: 1024px) {
  body {
    overflow: auto;
  }

  .app-container {
    height: auto;
    min-height: 100vh;
    padding-bottom: 24px;
  }

  .app-main {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }
  
  .search-sidebar {
    height: auto;
    min-height: auto;
    overflow: visible;
  }

  .search-form,
  .results-panel {
    height: auto;
    overflow: visible;
  }
  
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .batch-thumbs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .app-container {
    padding: 16px 16px 24px;
  }
  
  .app-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .brand-title {
    font-size: 24px;
  }
  
  .header-badges {
    width: 100%;
  }
  
  .fields-grid {
    grid-template-columns: 1fr;
  }
  
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .results-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .results-header-side {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
  }

  .batch-thumbs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  
  .status-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}

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

  .batch-thumbs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  
  .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* === Scrollbar === */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: var(--radius-full);
}

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

/* === Selection === */
::selection {
  background: rgba(59, 130, 246, 0.2);
  color: var(--text-primary);
}

/* === Focus Visible === */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* === Loading State === */
.btn-primary:disabled .btn-text::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
