/* ============================================
   ChipAtlas — 芯探 Design System
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 1);
  --bg-glass: rgba(255, 255, 255, 0.7);
  --bg-glass-hover: rgba(255, 255, 255, 0.9);
  --border-color: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.15);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  --accent-blue: #2563eb;
  --accent-purple: #7c3aed;
  --accent-pink: #db2777;
  --accent-cyan: #0891b2;
  --accent-green: #059669;
  --accent-orange: #d97706;
  --accent-red: #dc2626;
  --accent-yellow: #ca8a04;
  --gradient-primary: linear-gradient(135deg, #2563eb, #7c3aed, #db2777);
  --gradient-blue: linear-gradient(135deg, #2563eb, #3b82f6);
  --gradient-purple: linear-gradient(135deg, #7c3aed, #8b5cf6);
  --gradient-card: linear-gradient(135deg, rgba(37, 99, 235, 0.04), rgba(124, 58, 237, 0.02));
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 30px rgba(37, 99, 235, 0.08);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --font-sans: 'Inter', 'Noto Sans SC', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --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);
  --header-height: 64px;
}

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

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

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* --- Ambient Background --- */
.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.12;
  animation: float 25s ease-in-out infinite;
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #3b82f6, transparent 70%);
  top: -200px;
  left: -100px;
  animation-delay: 0s;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #8b5cf6, transparent 70%);
  top: 40%;
  right: -150px;
  animation-delay: -7s;
}

.orb-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #06b6d4, transparent 70%);
  bottom: -100px;
  left: 30%;
  animation-delay: -14s;
}

@keyframes float {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(30px, -30px) scale(1.05);
  }

  66% {
    transform: translate(-20px, 20px) scale(0.95);
  }
}

/* --- Header --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition-base);
}

.header.scrolled {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-md);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

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

.header-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: 8px;
}

.header-link {
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.header-link:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.04);
}

.header-link.active {
  color: var(--accent-blue);
  font-weight: 600;
}

.header-stats {
  display: flex;
  gap: 6px;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 13px;
}

.stat-pill .stat-number {
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-pill .stat-label {
  color: var(--text-tertiary);
}

/* --- Hero Section --- */
.hero {
  position: relative;
  z-index: 1;
  padding: calc(var(--header-height) + 60px) 24px 40px;
  text-align: center;
}

.hero-content {
  max-width: 720px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  animation: fadeInUp 0.6s ease-out;
}

.badge-dot {
  width: 6px;
  height: 6px;
  background: var(--accent-green);
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(1.5);
  }
}

.hero-title {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1.5px;
  margin-bottom: 16px;
  animation: fadeInUp 0.6s ease-out 0.1s both;
}

.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 32px;
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

.hero-subtitle strong {
  color: var(--accent-blue);
  font-weight: 600;
}

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

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

/* --- Hero Metrics --- */
.hero-metrics {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 32px;
  padding: 20px 32px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  animation: fadeInUp 0.6s ease-out 0.25s both;
}

.hero-metric {
  text-align: center;
}

.hero-metric-value {
  display: block;
  font-size: 24px;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.hero-metric-label {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 500;
  letter-spacing: 0.3px;
}

.hero-metric-divider {
  width: 1px;
  height: 32px;
  background: var(--border-color);
}

/* --- Search --- */
.search-container {
  position: relative;
  max-width: 600px;
  margin: 0 auto 28px;
  animation: fadeInUp 0.6s ease-out 0.3s both;
}

.search-box {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0 20px;
  transition: var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.search-box:focus-within {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1), var(--shadow-md);
  background: #ffffff;
}

.search-icon {
  width: 20px;
  height: 20px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

#search-input {
  flex: 1;
  padding: 16px 14px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 16px;
  font-family: var(--font-sans);
}

#search-input::placeholder {
  color: var(--text-tertiary);
}

.search-shortcut {
  display: flex;
  gap: 4px;
}

.search-shortcut kbd {
  padding: 3px 7px;
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.2;
}

/* --- Quick Filters --- */
.quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  animation: fadeInUp 0.6s ease-out 0.4s both;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 14px;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: var(--transition-base);
}

.filter-chip:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.filter-chip.active {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.25);
  color: var(--accent-blue);
}

.filter-chip svg {
  width: 16px;
  height: 16px;
}

.filter-chip .cat-emoji {
  font-size: 16px;
}

/* --- Results Header --- */
.main-content {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.results-info {
  font-size: 15px;
  color: var(--text-secondary);
}

.results-info span:first-child {
  font-weight: 600;
  color: var(--text-primary);
}

.results-filter-text {
  color: var(--accent-blue);
  margin-left: 6px;
}

.view-controls {
  display: flex;
  gap: 4px;
}

.view-btn {
  padding: 8px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.view-btn:hover {
  color: var(--text-secondary);
  background: var(--bg-glass);
}

.view-btn.active {
  color: var(--accent-blue);
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.2);
}

.view-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* --- Product Grid --- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.product-grid.list-view {
  grid-template-columns: 1fr;
}

/* --- Product Card --- */
.product-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: var(--transition-base);
  position: relative;
  overflow: hidden;
  animation: cardFadeIn 0.4s ease-out both;
  box-shadow: var(--shadow-sm);
}

.product-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-card);
  opacity: 0;
  transition: var(--transition-base);
}

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

.product-card:hover::before {
  opacity: 1;
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

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

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  position: relative;
  z-index: 1;
  margin-bottom: 16px;
}

.card-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 26px;
  flex-shrink: 0;
}

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

.card-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-category {
  font-size: 12px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-desc {
  position: relative;
  z-index: 1;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.meta-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--accent-blue);
  font-weight: 500;
}

.meta-tag.chip-count {
  background: rgba(124, 58, 237, 0.06);
  border-color: rgba(124, 58, 237, 0.12);
  color: var(--accent-purple);
}

.meta-tag.module-count {
  background: rgba(8, 145, 178, 0.06);
  border-color: rgba(8, 145, 178, 0.12);
  color: var(--accent-cyan);
}

/* --- List View Card --- */
.list-view .product-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 24px;
}

.list-view .card-header {
  margin-bottom: 0;
  flex-shrink: 0;
}

.list-view .card-desc {
  margin-bottom: 0;
  flex: 1;
}

.list-view .card-meta {
  flex-shrink: 0;
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-base);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  width: 100%;
  max-width: 900px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  position: relative;
  transform: translateY(20px) scale(0.97);
  transition: var(--transition-slow);
  margin: auto 0;
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.modal-close:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
}

.modal-close svg {
  width: 20px;
  height: 20px;
}

.modal-content {
  padding: 32px;
}

/* Modal: Product Header */
.modal-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
}

.modal-icon {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  font-size: 36px;
}

.modal-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
}

.modal-desc {
  font-size: 15px;
  color: var(--text-secondary);
}

.modal-tags {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

/* Modal: Stats */
.modal-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.stat-card {
  padding: 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  text-align: center;
}

.stat-card .stat-value {
  font-size: 28px;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-card .stat-desc {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

/* Modal: Module Section */
.modules-section {
  margin-bottom: 24px;
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 20px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

/* Module Card */
.module-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
  transition: var(--transition-base);
}

.module-card:hover {
  border-color: var(--border-hover);
}

.module-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.module-header:hover {
  background: var(--bg-glass-hover);
}

.module-icon {
  font-size: 24px;
  width: 40px;
  text-align: center;
}

.module-name {
  flex: 1;
  font-weight: 600;
  font-size: 15px;
}

.module-chip-count {
  font-size: 13px;
  color: var(--text-tertiary);
  padding: 3px 10px;
  background: var(--bg-glass);
  border-radius: var(--radius-full);
}

.module-arrow {
  color: var(--text-tertiary);
  transition: transform var(--transition-base);
}

.module-card.expanded .module-arrow {
  transform: rotate(180deg);
}

.module-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.module-card.expanded .module-body {
  max-height: 2000px;
}

.module-desc {
  padding: 0 20px 12px;
  font-size: 14px;
  color: var(--text-secondary);
}

/* Chip List */
.chip-list {
  padding: 0 20px 16px;
}

.chip-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.chip-item:hover {
  background: rgba(37, 99, 235, 0.05);
  border-color: rgba(37, 99, 235, 0.15);
}

.chip-type-badge {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

.chip-type-badge.mcu {
  background: rgba(37, 99, 235, 0.15);
  color: var(--accent-blue);
}

.chip-type-badge.power {
  background: rgba(251, 146, 60, 0.15);
  color: var(--accent-orange);
}

.chip-type-badge.driver {
  background: rgba(8, 145, 178, 0.15);
  color: var(--accent-cyan);
}

.chip-type-badge.comm {
  background: rgba(52, 211, 153, 0.15);
  color: var(--accent-green);
}

.chip-type-badge.sensor {
  background: rgba(219, 39, 119, 0.15);
  color: var(--accent-pink);
}

.chip-type-badge.memory {
  background: rgba(124, 58, 237, 0.15);
  color: var(--accent-purple);
}

.chip-type-badge.analog {
  background: rgba(251, 191, 36, 0.15);
  color: var(--accent-yellow);
}

.chip-main {
  flex: 1;
  min-width: 0;
}

.chip-name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
}

.chip-mfr {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}

.chip-brief {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.chip-price {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-green);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Chip Detail Expansion */
.chip-detail {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  display: none;
}

.chip-item.expanded .chip-detail {
  display: block;
}

.chip-specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  font-size: 13px;
}

.spec-label {
  color: var(--text-tertiary);
}

.spec-value {
  color: var(--text-primary);
  font-weight: 500;
  font-family: var(--font-mono);
  font-size: 12px;
}

.chip-features {
  margin-bottom: 12px;
}

.chip-features h5,
.chip-notes h5,
.chip-alts h5 {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 6px;
  font-weight: 500;
}

.feature-tag {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.12);
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--accent-green);
  margin: 2px 4px 2px 0;
}

.note-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.note-item::before {
  content: '⚠';
  font-size: 12px;
  flex-shrink: 0;
  margin-top: 1px;
}

.chip-alts {
  margin-top: 8px;
}

.alt-chip {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.12);
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--accent-purple);
  margin: 2px 4px 2px 0;
}

/* CTA Buttons in Modal */
.modal-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: var(--transition-base);
  border: none;
}

.cta-btn.primary {
  background: var(--gradient-primary);
  color: white;
}

.cta-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.cta-btn.secondary {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.cta-btn.secondary:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.cta-btn .lock-icon {
  opacity: 0.6;
}

/* --- Registration Modal --- */
.reg-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-base);
}

.reg-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.reg-modal {
  width: 100%;
  max-width: 520px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 40px;
  text-align: center;
  transform: scale(0.95);
  transition: var(--transition-slow);
}

.reg-overlay.active .reg-modal {
  transform: scale(1);
}

.reg-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.reg-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}

.reg-desc {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.6;
}

.reg-features {
  display: grid;
  gap: 10px;
  text-align: left;
  margin-bottom: 28px;
}

.reg-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-secondary);
}

.reg-feature-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.1);
  border-radius: var(--radius-sm);
  font-size: 16px;
  flex-shrink: 0;
}

.reg-form {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.reg-input {
  padding: 14px 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 15px;
  font-family: var(--font-sans);
  outline: none;
  transition: var(--transition-fast);
}

.reg-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

.reg-submit {
  padding: 14px;
  background: var(--gradient-primary);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: var(--transition-base);
}

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

.reg-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--text-tertiary);
}

.reg-divider::before,
.reg-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.reg-wechat {
  padding: 20px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.reg-wechat p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.wechat-qr-placeholder {
  width: 160px;
  height: 160px;
  margin: 0 auto;
  background: white;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #333;
}

.reg-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.reg-close:hover {
  background: var(--bg-glass);
  color: var(--text-primary);
}

/* --- Load More --- */
.load-more-container {
  text-align: center;
  margin-top: 40px;
}

.load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: var(--transition-base);
}

.load-more-btn:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
  transform: translateY(-2px);
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-tertiary);
}

.empty-icon {
  margin-bottom: 20px;
}

.empty-icon svg {
  width: 80px;
  height: 80px;
}

.empty-state h3 {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* --- Scroll Top --- */
.scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: var(--transition-base);
}

.scroll-top.visible {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.scroll-top:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.scroll-top svg {
  width: 20px;
  height: 20px;
}

/* --- Footer --- */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border-color);
  padding: 60px 24px 32px;
  background: #ffffff;
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}


.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.footer-brand-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
}

.footer-trust {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: #f1f5f9;
  border-radius: var(--radius-full);
}

.footer-col-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.footer-link {
  display: block;
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 5px 0;
  transition: var(--transition-fast);
}

.footer-link:hover {
  color: var(--accent-blue);
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.footer-bottom p {
  font-size: 13px;
  color: var(--text-tertiary);
}

@media(max-width:768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .header-links {
    display: none;
  }

  .header-stats {
    display: none;
  }
}

/* === NEW: Modal Tab Navigation === */
.modal-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.modal-tab {
  flex: 1;
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.modal-tab:hover {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
}

.modal-tab.active {
  background: rgba(37, 99, 235, 0.12);
  color: var(--accent-blue);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeInUp 0.3s ease-out;
}

/* === NEW: System Architecture Diagram === */
.arch-diagram {
  position: relative;
  padding: 28px;
  background:
    radial-gradient(circle at 50% 50%, rgba(37, 99, 235, 0.04) 0%, transparent 70%),
    var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  overflow: hidden;
}

.arch-diagram::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.03) 1px, transparent 1px);
  background-size: 30px 30px;
  pointer-events: none;
}

.arch-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.arch-title::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--accent-blue);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-blue);
}

.arch-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.arch-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: stretch;
}

.arch-node {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.3);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-base);
  position: relative;
  min-width: 0;
  flex-shrink: 1;
}

.arch-node .node-emoji {
  font-size: 18px;
  flex-shrink: 0;
}

.arch-node .node-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.arch-node:hover {
  border-color: var(--accent-blue);
  background: rgba(37, 99, 235, 0.08);
  color: var(--text-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.arch-node.active {
  border-color: var(--accent-blue);
  background: rgba(37, 99, 235, 0.12);
  color: var(--accent-blue);
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.2);
}

.arch-node.core {
  border-color: rgba(124, 58, 237, 0.4);
  background: rgba(124, 58, 237, 0.08);
  padding: 14px 24px;
  font-size: 14px;
  font-weight: 600;
}

.arch-node.core:hover,
.arch-node.core.active {
  border-color: var(--accent-purple);
  background: rgba(124, 58, 237, 0.15);
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.2);
}

.arch-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-size: 11px;
  position: relative;
  padding: 0 6px;
}

.arch-connector::before {
  content: '';
  position: absolute;
  border-left: 1px dashed rgba(37, 99, 235, 0.2);
  height: 100%;
  left: 50%;
}

.arch-bus-label {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--accent-blue);
  opacity: 0.6;
  padding: 2px 6px;
  background: rgba(37, 99, 235, 0.06);
  border-radius: 4px;
  white-space: nowrap;
}

.arch-row-label {
  font-size: 11px;
  color: var(--text-tertiary);
  padding: 2px 10px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-full);
  white-space: nowrap;
  align-self: center;
  flex-shrink: 0;
}

/* === NEW: BOM Cost Breakdown === */
.bom-section {
  margin-bottom: 24px;
}

.bom-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.bom-total {
  font-size: 28px;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bom-total-label {
  font-size: 13px;
  color: var(--text-tertiary);
}

.bom-bars {
  display: grid;
  gap: 10px;
}

.bom-bar-item {
  display: grid;
  grid-template-columns: 120px 1fr 80px;
  align-items: center;
  gap: 12px;
}

.bom-bar-label {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: right;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.bom-bar-track {
  height: 24px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.bom-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  padding-left: 10px;
  font-size: 11px;
  font-weight: 600;
  color: white;
  min-width: 30px;
  width: 0;
}

.bom-bar-cost {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

/* === NEW: Design Difficulty Rating === */
.difficulty-section {
  margin-bottom: 24px;
}

.difficulty-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.diff-card {
  padding: 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.diff-label {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.diff-stars {
  display: flex;
  gap: 3px;
  margin-bottom: 4px;
}

.diff-star {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  transition: var(--transition-base);
}

.diff-star.filled {
  background: var(--accent-orange);
  box-shadow: 0 0 8px rgba(251, 146, 60, 0.3);
}

.diff-star.empty {
  background: rgba(255, 255, 255, 0.06);
}

.diff-text {
  font-size: 12px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

/* === NEW: Domestic Alternative Badge === */
.domestic-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.2);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-red);
  margin-left: 6px;
}

.import-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-blue);
  margin-left: 6px;
}

/* === NEW: Design Tips Section === */
.tips-section {
  margin-bottom: 24px;
}

.tips-grid {
  display: grid;
  gap: 12px;
}

.tip-card {
  padding: 16px 20px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  gap: 14px;
  transition: var(--transition-fast);
}

.tip-card:hover {
  border-color: var(--border-hover);
}

.tip-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 20px;
  flex-shrink: 0;
}

.tip-icon.pcb {
  background: rgba(37, 99, 235, 0.1);
}

.tip-icon.emc {
  background: rgba(251, 146, 60, 0.1);
}

.tip-icon.thermal {
  background: rgba(248, 113, 113, 0.1);
}

.tip-icon.debug {
  background: rgba(52, 211, 153, 0.1);
}

.tip-icon.cost {
  background: rgba(124, 58, 237, 0.1);
}

.tip-icon.safety {
  background: rgba(251, 191, 36, 0.1);
}

.tip-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

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

/* === NEW: Product Card Tags === */
.card-difficulty {
  display: flex;
  align-items: center;
  gap: 2px;
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}

.card-diff-dot {
  width: 6px;
  height: 6px;
  border-radius: 2px;
}

.card-diff-dot.filled {
  background: var(--accent-orange);
}

.card-diff-dot.empty {
  background: rgba(255, 255, 255, 0.1);
}

/* === NEW: National Alt Summary === */
.domestic-summary {
  margin-top: 12px;
  padding: 12px 16px;
  background: rgba(248, 113, 113, 0.04);
  border: 1px solid rgba(248, 113, 113, 0.1);
  border-radius: var(--radius-sm);
}

.domestic-summary-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-red);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.domestic-summary-text {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .header-stats {
    display: none;
  }

  .header-nav {
    gap: 8px;
  }

  .hero {
    padding-top: calc(var(--header-height) + 40px);
  }

  .hero-title {
    font-size: 28px;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .search-shortcut {
    display: none;
  }

  .modal-content {
    padding: 20px;
  }

  .modal-hero {
    flex-direction: column;
    text-align: center;
  }

  .modal-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .chip-specs-grid {
    grid-template-columns: 1fr;
  }

  .modal-cta {
    flex-direction: column;
  }

  .cta-btn {
    justify-content: center;
  }

  .reg-modal {
    padding: 24px;
  }
}

@media (max-width: 480px) {
  .quick-filters {
    gap: 6px;
  }

  .filter-chip {
    padding: 6px 12px;
    font-size: 13px;
  }

  .card-meta {
    gap: 6px;
  }
}

/* ===================================================================
   AUTH MODAL (Login / Register) — Professional Redesign
   =================================================================== */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.auth-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.auth-modal {
  position: relative;
  width: 92%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 20px;
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.03);
  padding: 28px 32px 24px;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.25s ease;
}

.auth-overlay.active .auth-modal {
  transform: translateY(0) scale(1);
}

/* Brand header */
.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.auth-brand-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-sans);
}

/* Close */
.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: 8px;
  transition: var(--transition-fast);
  z-index: 10;
}

.auth-close:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
}

/* Auth Tabs — underline style */
.auth-tabs {
  position: relative;
  display: flex;
  gap: 0;
  background: #f1f5f9;
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 22px;
}

.auth-tab {
  flex: 1;
  padding: 9px 16px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #64748b;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  z-index: 1;
}

.auth-tab:hover {
  color: #334155;
}

.auth-tab.active {
  background: #fff;
  color: #1e293b;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Form Wrap */
.auth-form-wrap {
  display: none;
}

.auth-form-wrap.active {
  display: block;
  animation: fadeInUp 0.2s ease-out;
}

.auth-title {
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.auth-desc {
  font-size: 13px;
  color: #94a3b8;
  text-align: center;
  margin-bottom: 18px;
}

/* Form */
.auth-form {
  display: grid;
  gap: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.form-group {
  display: grid;
  gap: 5px;
}

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: #475569;
}

.auth-input {
  padding: 10px 12px;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-sans);
  outline: none;
  transition: all 0.15s ease;
  width: 100%;
  box-sizing: border-box;
}

.auth-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.auth-input::placeholder {
  color: #cbd5e1;
}

/* Password toggle */
.password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrap .auth-input {
  padding-right: 40px;
}

.password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  border-radius: 6px;
  transition: var(--transition-fast);
}

.password-toggle:hover {
  background: #f1f5f9;
  color: #475569;
}

/* Form options */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.remember-me {
  font-size: 13px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.remember-me input[type="checkbox"] {
  accent-color: #6366f1;
  width: 15px;
  height: 15px;
  cursor: pointer;
}

/* Error display */
.auth-error {
  font-size: 13px;
  color: #ef4444;
  min-height: 18px;
  text-align: center;
  transition: var(--transition-fast);
}

/* Submit button */
.auth-submit {
  padding: 11px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-submit:hover:not(:disabled) {
  background: linear-gradient(135deg, #4338ca, #6d28d9);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
  transform: translateY(-1px);
}

.auth-submit:disabled {
  opacity: 0.7;
  cursor: wait;
}

.btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.spinner {
  animation: spin 0.8s linear infinite;
}

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

/* Shake animation */
@keyframes shake {

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

  20%,
  60% {
    transform: translateX(-6px);
  }

  40%,
  80% {
    transform: translateX(6px);
  }
}

.shake {
  animation: shake 0.4s ease-in-out;
}

/* Switch link */
.auth-switch {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: #94a3b8;
}

.auth-switch a {
  color: #6366f1;
  text-decoration: none;
  font-weight: 500;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* ===================================================================
   HEADER USER CONTROLS
   =================================================================== */
.header-user {
  display: flex;
  align-items: center;
}

.user-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: var(--transition-base);
}

.user-login-btn:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.header-user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: white;
}

.user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-logout-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.user-logout-btn:hover {
  background: rgba(248, 113, 113, 0.1);
  color: var(--accent-red);
}

/* ===================================================================
   TOAST NOTIFICATIONS
   =================================================================== */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  font-size: 14px;
  color: var(--text-primary);
  pointer-events: all;
  transform: translateX(120%);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 360px;
  backdrop-filter: blur(12px);
}

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

.toast.hide {
  transform: translateX(120%);
  opacity: 0;
}

.toast-success {
  border-left: 3px solid #34d399;
}

.toast-error {
  border-left: 3px solid var(--accent-red);
}

.toast-info {
  border-left: 3px solid var(--accent-blue);
}

.toast-warning {
  border-left: 3px solid var(--accent-orange);
}

.toast-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.toast-msg {
  font-size: 14px;
  line-height: 1.4;
}

/* ===================================================================
   RESPONSIVE OVERRIDES FOR AUTH
   =================================================================== */
@media (max-width: 768px) {
  .auth-modal {
    padding: 24px 20px;
    max-width: 95%;
  }

  .user-name {
    display: none;
  }

  .header-user-info {
    gap: 4px;
  }
}

/* ===================================================================
   PAGINATION NAV (SEO)
   =================================================================== */
.pagination-nav {
  text-align: center;
  margin: 40px 0 20px;
  position: relative;
  z-index: 1;
}

.pagination-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition-fast);
  cursor: pointer;
}

.page-link:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.page-link.active {
  background: rgba(37, 99, 235, 0.15);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  font-weight: 600;
  cursor: default;
}

.page-link.disabled {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

.pagination-info {
  font-size: 13px;
  color: var(--text-tertiary);
}

/* ===================================================================
   BREADCRUMB (SEO)
   =================================================================== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-tertiary);
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition-fast);
}

.breadcrumb a:hover {
  color: var(--accent-blue);
}

@media (max-width: 768px) {
  .pagination-wrap {
    gap: 4px;
  }

  .page-link {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    font-size: 13px;
  }
}