* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; }

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px;
  min-height: 100vh;
}

.header { margin-bottom: 20px; position: relative; }
.title { font-size: 22px; font-weight: 700; }
.subtitle-row { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.subtitle { font-size: 13px; color: #888; }

/* ===== 主题切换 ===== */
.theme-trigger { font-size: 12px; color: #aaa; padding: 2px 0; cursor: pointer; }
.theme-dropdown {
  position: absolute; left: 0; right: 0; top: 100%;
  background: #fff; border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  padding: 8px 0; z-index: 50; margin-top: 4px;
}
.theme-option {
  display: flex; align-items: center; padding: 10px 16px; cursor: pointer;
}
.theme-option:active { background: #f5f5f5; }
.theme-option.active { background: #f5f5f5; }
.theme-dot-small {
  width: 14px; height: 14px; border-radius: 50%;
  margin-right: 10px; flex-shrink: 0;
}
.theme-name { font-size: 13px; color: #333; }

/* ===== 主题变量 ===== */
.theme-chanel { --accent: #1a1a1a; --accent-light: #f5f5f5; --bg: #fafaf9; }
.theme-hermes { --accent: #f37021; --accent-light: #fff5ed; --bg: #fffaf6; }
.theme-dior   { --accent: #0a2463; --accent-light: #eef1f8; --bg: #f8f9fc; }
.theme-ysl    { --accent: #9b1b30; --accent-light: #fdf2f4; --bg: #fdfafa; }
.theme-celine { --accent: #8b7355; --accent-light: #f9f5ef; --bg: #fdfbf7; }
.theme-lamer  { --accent: #2d6a4f; --accent-light: #edf5f1; --bg: #f6faf8; }

.container { background: var(--bg, #fafaf9); }

/* 产品类型 */
.type-bar { display: flex; gap: 8px; margin-bottom: 16px; }
.type-btn {
  flex: 1; padding: 12px 8px; border: 1.5px solid #ddd;
  border-radius: 10px; background: #fff; text-align: center; cursor: pointer;
}
.type-btn.active {
  border: 2px solid var(--accent, #1a1a1a);
  background: var(--accent, #1a1a1a); color: #fff;
}
.type-label { font-size: 15px; font-weight: 600; }
.type-desc { font-size: 11px; opacity: 0.7; margin-top: 2px; }

/* OCR */
.ocr-bar { margin-bottom: 10px; }
.ocr-btn {
  display: block; width: 100%; padding: 12px;
  border: 1.5px dashed var(--accent, #1a1a1a); border-radius: 10px;
  text-align: center; font-size: 14px; font-weight: 500;
  color: var(--accent, #1a1a1a); background: var(--accent-light, #f5f5f5);
  cursor: pointer;
}
.ocr-btn:active { opacity: 0.7; }
.ocr-hint { font-size: 11px; color: #aaa; text-align: center; margin-top: 4px; }
.ocr-preview {
  margin-bottom: 10px; border-radius: 10px; overflow: hidden;
  border: 1px solid #e5e7eb; background: #f9f9f9; position: relative;
}
.ocr-image { width: 100%; display: block; }
.ocr-status {
  text-align: center; font-size: 13px; color: #666;
  padding: 8px; background: rgba(255,255,255,0.9);
}
.ocr-progress-bar {
  height: 3px; background: #e5e7eb;
}
.ocr-progress-fill {
  height: 100%; width: 0%; background: var(--accent, #1a1a1a);
  transition: width 0.3s;
}

/* 输入 */
.input-area {
  width: 100%; height: 200px; padding: 14px;
  border: 1.5px solid #ddd; border-radius: 10px;
  font-size: 14px; line-height: 1.6; background: #fff;
  resize: none; outline: none; font-family: inherit;
}
.input-area:focus { border-color: var(--accent, #1a1a1a); }
.input-area::placeholder { color: #bbb; }

/* 按钮 */
.analyze-btn {
  width: 100%; padding: 14px; margin-top: 12px; border: none;
  border-radius: 10px; background: var(--accent, #1a1a1a); color: #fff;
  font-size: 16px; font-weight: 600; cursor: pointer;
}
.analyze-btn.disabled { background: #ccc; cursor: default; }

/* 总评 */
.verdict {
  margin-top: 24px; padding: 20px; border-radius: 12px;
  border: 1.5px solid; text-align: center; margin-bottom: 20px;
}
.score-display { display: flex; align-items: baseline; justify-content: center; margin-bottom: 4px; }
.score-number { font-size: 48px; font-weight: 800; line-height: 1; }
.score-label { font-size: 16px; color: #888; margin-left: 4px; }
.verdict-text { font-size: 16px; font-weight: 600; margin-top: 4px; }
.verdict-detail { font-size: 13px; color: #666; margin-top: 6px; }
.verdict-stats { font-size: 12px; color: #aaa; margin-top: 4px; }

/* 分组 */
.section { margin-bottom: 16px; }
.section-title { font-size: 14px; font-weight: 600; margin-bottom: 8px; }

/* 卡片 */
.card {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; background: #fff; border-radius: 8px;
  margin-bottom: 4px; border: 1px solid #e5e7eb;
}
.card-red { border-color: #fee2e2; }
.card-green { border-color: #dcfce7; }
.card-unknown { border-color: #e5e7eb; }
.card-filler { border-color: #f0f0f0; }

.card-left { flex: 1; min-width: 0; overflow: hidden; }
.card-name { font-size: 14px; }
.card-en { font-size: 11px; color: #999; margin-left: 6px; }
.card-name-gray { font-size: 13px; color: #888; }
.card-name-muted { font-size: 14px; color: #666; }
.card-risk-desc { font-size: 11px; color: #999; margin-top: 2px; }

/* 标签 */
.badge {
  font-size: 11px; padding: 3px 8px; border-radius: 4px;
  margin-left: 8px; font-weight: 600; white-space: nowrap;
}
.badge-feed { background: #fef2f2; color: #dc2626; }
.badge-irritant { background: #fff7ed; color: #c2410c; }
.badge-good { background: #f0fdf4; color: #16a34a; }
.badge-filler { background: #f5f5f5; color: #999; }

/* 折叠标题 */
.section-toggle {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px; cursor: pointer;
}
.toggle-arrow { font-size: 12px; color: #aaa; }

/* 未识别操作 */
.unknown-action {
  margin-top: 8px; padding: 10px; border-radius: 8px;
  border: 1.5px dashed #ccc; text-align: center;
  font-size: 13px; color: #666; background: #fafafa; cursor: pointer;
}

/* 弹窗 */
.modal-mask {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
.modal-content {
  width: 85%; max-width: 400px; background: #fff; border-radius: 14px;
  padding: 24px 20px;
}
.modal-title { font-size: 17px; font-weight: 700; text-align: center; }
.modal-hint { font-size: 12px; color: #999; text-align: center; margin-top: 4px; margin-bottom: 12px; }
.modal-scroll {
  max-height: 300px; overflow-y: auto; padding: 12px;
  background: #f5f5f5; border-radius: 8px;
}
.modal-item {
  font-size: 13px; line-height: 2; color: #333;
  border-bottom: 1px solid #eee; padding: 2px 0;
}
.modal-item:last-child { border-bottom: none; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal-btn {
  flex: 1; padding: 12px; border-radius: 10px;
  text-align: center; font-size: 15px; font-weight: 600; cursor: pointer;
}
.modal-btn-copy { background: var(--accent, #1a1a1a); color: #fff; }
.modal-btn-close { background: #f0f0f0; color: #666; }

/* 底部说明 */
.footer-section {
  margin-top: 20px; padding: 16px;
  background: #fff; border-radius: 10px; border: 1px solid #f0f0f0;
}
.footer-title { font-size: 13px; font-weight: 600; color: #666; margin-bottom: 8px; }
.footer-body { font-size: 11px; color: #999; line-height: 1.8; }
.footer-line { margin-bottom: 4px; }
.footer-ref { margin-bottom: 6px; line-height: 1.6; }
