/* ============================================
   添加查查 - 食品添加剂查询平台
   绿色健康主题 | 响应式设计
   ============================================ */

/* Bilingual language toggle: hide/show content by language */
html[lang="en"] .lang-zh { display: none !important; }
html[lang^="zh"] .lang-en { display: none !important; }
html[lang="en"] [data-lang-zh] { display: none !important; }

/* CSS Variables */
:root {
  --primary: #059669;
  --primary-dark: #047857;
  --primary-light: #d1fae5;
  --primary-bg: #ecfdf5;
  --primary-50: #f0fdf4;
  --primary-100: #dcfce7;
  --primary-200: #bbf7d0;
  --success: #10b981;
  --success-bg: #d1fae5;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --text: #1f2937;
  --text-secondary: #6b7280;
  --text-light: #9ca3af;
  --text-muted: #d1d5db;
  --bg: #ffffff;
  --bg-gray: #f9fafb;
  --bg-warm: #fefce8;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.02);
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 6px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 24px rgba(0,0,0,0.1), 0 4px 8px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 40px rgba(0,0,0,0.12), 0 8px 16px rgba(0,0,0,0.06);
  --shadow-glow: 0 0 0 3px rgba(5,150,105,0.15), 0 4px 12px rgba(5,150,105,0.1);
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 1200px;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

/* Utility Classes */
.text-gradient {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--success) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Animation delay utilities */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }

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

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: radial-gradient(rgba(0,0,0,0.03) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
  z-index: -1;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ===== Header ===== */
.site-header {
  background: white;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(255,255,255,0.95);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.logo:hover { color: var(--primary); }
.logo-icon { font-size: 28px; }
.site-nav { display: flex; gap: 24px; }
.nav-link {
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 500;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.nav-link:hover { color: var(--primary); border-bottom-color: var(--primary); }

/* Language Toggle */
.lang-toggle {
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid var(--primary);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-sans);
  white-space: nowrap;
}
.lang-toggle:hover {
  background: var(--primary);
  color: white;
}

@media (max-width: 600px) {
  .site-nav { gap: 12px; }
  .nav-link { font-size: 13px; }
  .logo-text { font-size: 18px; }
}

/* ===== Hero ===== */
.hero {
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(5,150,105,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(16,185,129,0.06) 0%, transparent 50%),
    radial-gradient(ellipse 50% 50% at 20% 60%, rgba(245,158,11,0.04) 0%, transparent 50%),
    linear-gradient(135deg, var(--primary-bg) 0%, #f0fdf4 50%, #fefce8 100%);
  padding: 100px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(5, 150, 105, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(16, 185, 129, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.04) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.hero > * { position: relative; z-index: 1; }
.hero .container {
  position: relative;
  z-index: 1;
}
.hero-title {
  font-size: 48px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text) 0%, var(--primary-dark) 40%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 40px;
  line-height: 1.7;
  letter-spacing: 0.02em;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
.hero-search { max-width: 640px; margin: 0 auto; position: relative; }
.search-box {
  display: flex;
  background: white;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  transition: var(--transition-base);
}
.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow), var(--shadow-xl);
  transform: translateY(-1px);
}
.search-input {
  flex: 1;
  padding: 18px 24px;
  border: none;
  font-size: 16px;
  background: transparent;
  outline: none;
  color: var(--text);
}
.search-input::placeholder { color: var(--text-light); }
.search-btn {
  padding: 18px 36px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-base);
  white-space: nowrap;
}
.search-btn:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #065f46 100%);
  box-shadow: -4px 0 12px rgba(5,150,105,0.2);
}
.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xl);
  margin-top: 8px;
  max-height: 320px;
  overflow-y: auto;
  display: none;
  z-index: 50;
}
.search-suggestions.active { display: block; }
.suggestion-item {
  padding: 12px 20px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s;
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover { background: var(--primary-bg); }
.suggestion-name { font-weight: 600; font-size: 15px; color: var(--text); }
.suggestion-category { font-size: 13px; color: var(--text-secondary); }
.suggestion-badge {
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.suggestion-badge.safe { background: var(--success-bg); color: var(--success); }
.suggestion-badge.caution { background: var(--warning-bg); color: var(--warning); }
.suggestion-badge.warning { background: var(--danger-bg); color: var(--danger); }

.hero-tags { margin-top: 32px; }
.hero-tags > span { color: var(--text-secondary); font-size: 14px; }
.hot-tag {
  display: inline-block;
  padding: 8px 18px;
  margin: 6px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 24px;
  font-size: 14px;
  color: var(--text);
  transition: var(--transition-base);
  box-shadow: var(--shadow-sm);
}
.hot-tag:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  .hero { padding: 60px 0 50px; }
  .hero-title { font-size: 32px; }
  .hero-subtitle { font-size: 16px; margin-bottom: 28px; }
  .search-btn { padding: 16px 24px; font-size: 14px; }
}

/* ===== Daily Highlight ===== */
.daily-highlight { padding: 40px 0; }
.highlight-card {
  background: linear-gradient(135deg, #fff7ed 0%, #fef2f2 100%);
  border: 1px solid #fed7aa;
  border-radius: var(--radius);
  padding: 28px 32px;
  position: relative;
  overflow: hidden;
}
.highlight-badge {
  display: inline-block;
  padding: 4px 14px;
  background: white;
  border: 1px solid var(--warning);
  border-radius: 20px;
  font-size: 14px;
  color: var(--warning);
  font-weight: 600;
  margin-bottom: 12px;
}
.highlight-card h3 { font-size: 22px; margin-bottom: 8px; }
.highlight-desc { color: var(--text-secondary); margin-bottom: 12px; line-height: 1.6; }
.highlight-link { font-weight: 600; font-size: 15px; }

/* ===== Section Title ===== */
.section-title {
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 32px;
  color: var(--text);
  position: relative;
  display: inline-block;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-200));
  border-radius: 2px;
}

/* ===== Categories ===== */
.categories { padding: 60px 0; background: var(--bg-gray); }
.categories .section-title { display: block; }
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 16px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition-base);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.category-card:hover {
  border-color: var(--primary-200);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}
.category-card::before {
  content: '';
  position: absolute;
  top: 12px; left: 0;
  width: 3px; height: 24px;
  background: var(--primary);
  border-radius: 0 2px 2px 0;
  opacity: 0;
  transition: opacity 0.3s;
}
.category-card:hover::before { opacity: 1; }
.category-card { position: relative; overflow: hidden; }
.category-icon-wrap {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-50);
  border-radius: 50%;
  transition: var(--transition-base);
}
.category-card:hover .category-icon-wrap {
  background: var(--primary-100);
  transform: scale(1.1);
}
.category-icon { font-size: 28px; line-height: 1; }
.category-name { font-size: 14px; font-weight: 600; text-align: center; }
.category-count { font-size: 12px; color: var(--text-secondary); }

@media (max-width: 600px) {
  .category-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .category-card { padding: 14px 8px; }
  .category-icon { font-size: 24px; }
  .category-name { font-size: 12px; }
}

/* ===== Why Us ===== */
.why-us { padding: 70px 0; }
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
}
.feature-card {
  text-align: center;
  padding: 40px 28px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition-base);
  box-shadow: var(--shadow-sm);
}
.feature-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--primary-200);
}
.feature-icon { font-size: 48px; margin-bottom: 16px; }
.feature-card h3 { font-size: 18px; margin-bottom: 8px; }
.feature-card p { color: var(--text-secondary); font-size: 14px; line-height: 1.6; }

/* ===== Breadcrumb ===== */
.breadcrumb {
  padding: 16px 0;
  font-size: 14px;
  color: var(--text-secondary);
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--primary); }

/* ===== Additive Detail ===== */
.additive-detail { padding-bottom: 60px; }
.detail-header {
  padding: 28px 32px;
  border-radius: var(--radius);
  margin-bottom: 24px;
}
.detail-title-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.detail-name { font-size: 32px; font-weight: 800; }
.safety-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border: 1.5px solid rgba(255,255,255,0.3);
}
.detail-ename { color: var(--text-secondary); font-size: 16px; margin-top: 4px; font-style: italic; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; }
.meta-item { font-size: 14px; color: var(--text-secondary); background: white; padding: 4px 12px; border-radius: 6px; }
.detail-aliases { margin-top: 12px; font-size: 14px; color: var(--text-secondary); }

/* Info Grid */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.info-card {
  display: flex;
  gap: 16px;
  padding: 20px 24px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-base);
  border-left: 3px solid var(--primary);
}
.info-card.safe-card { border-left-color: var(--success); }
.info-card.caution-card { border-left-color: var(--warning); }
.info-card.warning-card { border-left-color: var(--danger); }
.info-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--primary-200);
}
.info-card-icon { font-size: 32px; flex-shrink: 0; }
.info-card-content h4 { font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.info-value {
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.info-note { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

.food-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.food-tag {
  padding: 4px 12px;
  background: var(--bg-gray);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text);
}

/* Detail Sections */
.detail-section {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-light);
}
.detail-section:last-child { border-bottom: none; }
.section-heading { font-size: 20px; font-weight: 700; margin-bottom: 16px; color: var(--text); }
.explain-section { background: #faf5ff; border: 1px solid #e9d5ff; border-radius: var(--radius); padding: 24px; }
.explain-ad { font-size: 16px; line-height: 1.8; color: var(--text); margin-bottom: 16px; }
.explain-safety { background: white; border-radius: var(--radius-sm); padding: 20px; }
.explain-safety h4 { font-size: 15px; color: var(--primary); margin-bottom: 8px; }
.explain-safety p { font-size: 15px; line-height: 1.7; color: var(--text); }
.function-block { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: var(--radius-sm); padding: 20px; font-size: 15px; line-height: 1.7; }
.caution-block { background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--radius-sm); padding: 20px; font-size: 15px; line-height: 1.7; }

/* Limit Table */
.limit-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.limit-table th {
  background: linear-gradient(180deg, #f9fafb, #f3f4f6);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  text-align: left;
  padding: 12px 16px;
  border-bottom: 2px solid var(--border);
  font-weight: 600;
}
.limit-table td { padding: 12px 16px; border-bottom: 1px solid var(--border-light); }
.limit-table tr:hover { background: var(--bg-gray); }

/* Tags */
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.additive-tag {
  padding: 6px 16px;
  background: var(--primary-bg);
  color: var(--primary);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}
.mini-tag {
  padding: 2px 8px;
  background: var(--bg-gray);
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-secondary);
}

/* Related */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.related-card {
  display: block;
  padding: 20px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition-base);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.related-card:hover {
  border-color: var(--primary-200);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.related-name { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.related-ename { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.related-tags { display: flex; gap: 4px; }

/* ===== Search Page ===== */
.search-page { padding-bottom: 60px; }
.search-results-header { margin: 24px 0 16px; }
.search-results-header h2 { font-size: 20px; font-weight: 600; }
.search-results { display: flex; flex-direction: column; gap: 8px; }
.search-result-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition-base);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  border-left: 3px solid transparent;
}
.search-result-card:hover {
  border-color: var(--primary-200);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-left-color: var(--primary);
}
.result-name { font-size: 18px; font-weight: 600; }
.result-ename { font-size: 13px; color: var(--text-secondary); }
.result-category { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.result-side { text-align: right; }
.result-safety { display: inline-block; padding: 5px 14px; border-radius: 8px; font-size: 13px; font-weight: 700; box-shadow: 0 1px 4px rgba(0,0,0,0.06); border: 1px solid rgba(255,255,255,0.4); }
.result-safety.safe { background: var(--success-bg); color: var(--success); }
.result-safety.caution { background: var(--warning-bg); color: var(--warning); }
.result-safety.warning { background: var(--danger-bg); color: var(--danger); }
.result-tags { display: flex; gap: 4px; margin-top: 6px; justify-content: flex-end; }

.no-results { text-align: center; padding: 80px 0; }
.no-results-icon { font-size: 64px; display: block; margin-bottom: 16px; }
.no-results p { font-size: 18px; color: var(--text-secondary); }
.no-results-hint { font-size: 14px; margin-top: 8px; color: var(--text-light); }

.hot-search-section { margin-top: 40px; }
.hot-search-section h3 { font-size: 18px; margin-bottom: 16px; }
.hot-search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.hot-search-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition-base);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.hot-search-card:hover {
  border-color: var(--primary-200);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.hot-search-name { font-weight: 600; font-size: 15px; }
.hot-search-count { font-size: 12px; color: var(--text-light); }

/* ===== Analyze Page ===== */
.analyze-page { padding-bottom: 60px; }
.analyze-hero { text-align: center; margin: 40px 0 32px; }
.analyze-hero h1 { font-size: 36px; font-weight: 800; margin-bottom: 8px; }
.analyze-hero p { color: var(--text-secondary); font-size: 16px; }
.analyze-input-wrapper { max-width: 700px; margin: 0 auto; }
.analyze-input {
  width: 100%;
  padding: 16px 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: var(--font-sans);
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}
.analyze-input:focus { border-color: var(--primary); }
.analyze-btn {
  display: block;
  width: 100%;
  max-width: 700px;
  margin: 16px auto 0;
  padding: 14px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.analyze-btn:hover { background: var(--primary-dark); }
.analyze-tips { max-width: 700px; margin: 16px auto 0; font-size: 14px; color: var(--text-secondary); }

.analyze-result { max-width: 800px; margin: 32px auto 0; }
.result-summary {
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
}
.result-summary h3 { font-size: 18px; margin-bottom: 8px; }
.result-summary p { font-size: 15px; line-height: 1.6; }
.result-stats { display: flex; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.result-stat {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  border: 1px solid rgba(255,255,255,0.4);
}
.result-stat.safe { background: var(--success-bg); color: var(--success); }
.result-stat.caution { background: var(--warning-bg); color: var(--warning); }
.result-stat.warning { background: var(--danger-bg); color: var(--danger); }

.result-list { display: flex; flex-direction: column; gap: 12px; }
.result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  gap: 16px;
}
.result-item-left { flex: 1; }
.result-item-name { font-weight: 600; font-size: 16px; }
.result-item-function { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.result-item-badge {
  padding: 5px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  border: 1px solid rgba(255,255,255,0.4);
}
.result-item-badge.safe { background: var(--success-bg); color: var(--success); }
.result-item-badge.caution { background: var(--warning-bg); color: var(--warning); }
.result-item-badge.warning { background: var(--danger-bg); color: var(--danger); }
.result-item-link {
  font-size: 14px;
  color: var(--primary);
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}
.result-item-link:hover { text-decoration: underline; }

.analyze-loading { text-align: center; padding: 40px 0; }
.loading-spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 16px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Category Page ===== */
.category-page { padding-bottom: 60px; }
.category-title { font-size: 32px; font-weight: 800; margin: 24px 0 8px; }
.category-desc { color: var(--text-secondary); margin-bottom: 24px; }
.category-grid-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.category-item-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition-base);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.category-item-card:hover {
  border-color: var(--primary-200);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.cat-item-name { font-weight: 600; font-size: 16px; }
.cat-item-ename { font-size: 13px; color: var(--text-secondary); }
.cat-item-safety { font-size: 13px; font-weight: 600; }
.cat-item-safety.safe { color: var(--success); }
.cat-item-safety.caution { color: var(--warning); }
.cat-item-safety.warning { color: var(--danger); }

/* ===== List Page ===== */
.list-page { padding-bottom: 60px; }
.list-page h1 { font-size: 32px; font-weight: 800; margin: 24px 0 8px; }
.list-desc { color: var(--text-secondary); margin-bottom: 24px; }
.list-filter { margin-bottom: 20px; }
.list-filter .search-input { border: 2px solid var(--border); border-radius: var(--radius); width: 100%; }

.list-grid { display: flex; flex-direction: column; gap: 6px; }
.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: white;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  transition: var(--transition-base);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.list-item:hover {
  background: var(--primary-bg);
  border-color: var(--primary-200);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.list-item-name { font-weight: 600; font-size: 15px; }
.list-item-ename { font-size: 13px; color: var(--text-secondary); margin-left: 12px; }
.list-item-right { display: flex; align-items: center; gap: 12px; }
.list-item-category { font-size: 13px; color: var(--text-secondary); }
.list-item-safety { padding: 2px 10px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.list-item-safety.safe { background: var(--success-bg); color: var(--success); }
.list-item-safety.caution { background: var(--warning-bg); color: var(--warning); }
.list-item-safety.warning { background: var(--danger-bg); color: var(--danger); }

/* ===== Error Page ===== */
.error-page { text-align: center; padding: 100px 0; }
.error-icon { font-size: 80px; margin-bottom: 16px; }
.error-page h1 { font-size: 64px; font-weight: 800; color: var(--primary); margin-bottom: 8px; }
.error-page p { font-size: 18px; color: var(--text-secondary); }
.error-hint { font-size: 14px; color: var(--text-light); margin-top: 4px; }
.error-actions { margin-top: 32px; display: flex; gap: 12px; justify-content: center; }
.btn { padding: 12px 28px; border-radius: var(--radius); font-size: 15px; font-weight: 600; cursor: pointer; display: inline-block; text-decoration: none; border: none; transition: all 0.2s; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: white; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary-bg); }

/* ===== Footer ===== */
.site-footer {
  background: #111827;
  color: #d1d5db;
  padding: 28px 0 16px;
  margin-top: 40px;
  position: relative;
}
.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--primary) 30%, var(--success) 70%, transparent 100%);
  opacity: 0.5;
}
.footer-content { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 16px; }
.footer-col h4 { color: white; font-size: 13px; font-weight: 600; margin-bottom: 8px; letter-spacing: 0.03em; text-transform: uppercase; }
.footer-col p { font-size: 12px; line-height: 1.5; color: #9ca3af; }
.footer-col ul { list-style: none; padding: 0; }
.footer-col ul li { font-size: 12px; padding: 2px 0; color: #9ca3af; transition: var(--transition-fast); }
.footer-col ul li:hover { color: var(--primary-light); }
.footer-col ul li::before { content: "• "; color: var(--primary); font-size: 10px; }
.footer-bottom {
  border-top: 1px solid #374151;
  padding-top: 10px;
  text-align: center;
  font-size: 11px;
  color: #6b7280;
  letter-spacing: 0.01em;
}

/* ===== ADI 卡片强化 ===== */
.info-card-adi { background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%); }
.info-value-large {
  font-size: 26px !important;
  line-height: 1.3;
  margin: 8px 0 6px;
}
.info-note-small {
  font-size: 12px !important;
  color: var(--text-light);
  margin-top: 2px;
}
.info-note-help {
  font-size: 12px !important;
  color: var(--text-secondary);
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px dashed var(--border);
}
.info-note-source {
  font-size: 11px !important;
  color: var(--text-light);
  margin-top: 6px;
  line-height: 1.5;
}

/* ===== 争议说明 ===== */

.controversy-block {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 24px;
}
.controversy-explanation {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 20px;
}
.controversy-timeline {
  position: relative;
  padding-left: 20px;
  margin-bottom: 20px;
}
.controversy-timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--warning);
}
.timeline-item {
  position: relative;
  margin-bottom: 16px;
  padding-left: 16px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -18px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--warning);
  border: 2px solid white;
  box-shadow: 0 0 0 2px var(--warning-bg);
}
.timeline-year {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--warning);
  background: var(--warning-bg);
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 4px;
}
.timeline-content p {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 2px;
}
.timeline-source {
  font-size: 12px;
  color: var(--text-light);
}
.controversy-verdict {
  background: white;
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  border-left: 3px solid var(--warning);
}

/* ===== 延伸阅读 ===== */
.learn-more-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.learn-more-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: var(--transition-base);
  box-shadow: var(--shadow-sm);
}
.learn-more-card:hover {
  border-color: var(--primary-200);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.learn-more-icon { font-size: 28px; flex-shrink: 0; }
.learn-more-card h4 { font-size: 15px; margin-bottom: 4px; color: var(--text); }
.learn-more-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin: 0; }

/* ===== 添加剂货架 ===== */

.shelf-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: -12px;
  margin-bottom: 16px;
}
.shelf-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.shelf-tab {
  padding: 8px 14px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text);
}
.shelf-tab:hover { border-color: var(--primary); color: var(--primary); }
.shelf-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.shelf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.shelf-card {
  position: relative;
  display: block;
  padding: 18px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: var(--transition-base);
  box-shadow: var(--shadow-sm);
}
.shelf-card:hover {
  border-color: var(--primary-200);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}
.shelf-card.current { border-color: var(--primary); background: var(--primary-bg); }
.shelf-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.shelf-safety { font-size: 18px; }
.shelf-name { font-size: 16px; font-weight: 700; margin: 0; }
.shelf-ename {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shelf-amount {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 8px;
  padding: 4px 8px;
  background: var(--primary-bg);
  border-radius: 4px;
  display: inline-block;
}
.shelf-function {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}
.shelf-current-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 10px;
  font-weight: 600;
  color: var(--primary);
  background: white;
  border: 1px solid var(--primary);
  padding: 2px 8px;
  border-radius: 10px;
}

/* ===== 反馈表单 ===== */
.feedback-section {
  background: #1f2937;
  border-radius: var(--radius);
  padding: 28px;
  margin-top: 32px;
}
.feedback-section h4 { color: white; font-size: 18px; margin-bottom: 8px; }
.feedback-section p { color: #9ca3af; font-size: 13px; margin-bottom: 16px; }
.feedback-form { display: flex; flex-direction: column; gap: 12px; }
.feedback-textarea {
  width: 100%;
  min-height: 90px;
  padding: 14px;
  border: 1px solid #4b5563;
  border-radius: var(--radius-sm);
  background: #111827;
  color: white;
  font-family: var(--font-sans);
  font-size: 14px;
  resize: vertical;
  outline: none;
}
.feedback-textarea::placeholder { color: #6b7280; }
.feedback-textarea:focus { border-color: var(--primary); }
.feedback-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.feedback-file {
  color: #9ca3af;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}
.feedback-file input { display: none; }
.feedback-btn {
  padding: 10px 24px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.feedback-btn:hover { background: var(--primary-dark); }
.feedback-success {
  color: var(--success);
  font-size: 14px;
  display: none;
}

/* ===== Fuzzy search highlight ===== */
.suggestion-item .highlight {
  color: var(--primary);
  font-weight: 700;
}

@media (max-width: 768px) {
  .info-value-large { font-size: 20px !important; }
  .shelf-grid { grid-template-columns: repeat(2, 1fr); }
  .learn-more-grid { grid-template-columns: 1fr; }
  .feedback-section { padding: 20px; }
}

@media (max-width: 480px) {
  .shelf-grid { grid-template-columns: 1fr; }
  .shelf-categories { gap: 6px; }
  .shelf-tab { padding: 6px 10px; font-size: 12px; }
}

/* ===== Animations ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.animate-fade-in {
  animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.animate-scale-in {
  animation: scaleIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* Staggered entrance for grids */
.category-grid .category-card:nth-child(1) { animation-delay: 0.05s; }
.category-grid .category-card:nth-child(2) { animation-delay: 0.1s; }
.category-grid .category-card:nth-child(3) { animation-delay: 0.15s; }
.category-grid .category-card:nth-child(4) { animation-delay: 0.2s; }
.category-grid .category-card:nth-child(5) { animation-delay: 0.25s; }
.category-grid .category-card:nth-child(6) { animation-delay: 0.3s; }
.category-grid .category-card:nth-child(7) { animation-delay: 0.35s; }
.category-grid .category-card:nth-child(8) { animation-delay: 0.4s; }

.features-grid .feature-card:nth-child(1) { animation-delay: 0.1s; }
.features-grid .feature-card:nth-child(2) { animation-delay: 0.2s; }
.features-grid .feature-card:nth-child(3) { animation-delay: 0.3s; }
.features-grid .feature-card:nth-child(4) { animation-delay: 0.4s; }

/* Stats Counter */
.stat-number {
  font-size: 36px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}
.stat-label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}
