/* === 基础重置 === */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  background: #f5f7fa; color: #333; line-height: 1.6;
  min-height: 100vh; overflow-x: hidden;
}

/* === 页面容器 === */
.page { display: none; min-height: 100vh; }
.page.active { display: block; }
.page-content {
  width: 100%; max-width: 480px; margin: 0 auto;
  padding: 20px 16px 40px;
}

/* === 顶部标题区 === */
.hero {
  text-align: center;
  padding: 20px 0 16px;
  border-bottom: 1px solid #eee;
  margin-bottom: 16px;
}
.hero-title {
  font-size: 24px; font-weight: 700; color: #1a1a2e;
  margin-bottom: 6px;
}
.hero-subtitle {
  font-size: 13px; color: #888; line-height: 1.6;
}

/* === 到货信息条 === */
.delivery-banner {
  display: flex; gap: 12px;
  background: linear-gradient(135deg, #fff8e1, #ffecb3);
  border: 1px solid #ffd54f;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
}
.delivery-item { flex: 1; display: flex; align-items: center; gap: 8px; }
.delivery-icon { font-size: 22px; flex-shrink: 0; }
.delivery-text { flex: 1; min-width: 0; }
.delivery-label { font-size: 11px; color: #8d6e00; margin-bottom: 2px; }
.delivery-value { font-size: 14px; font-weight: 700; color: #5d4a00; }

/* === 紧迫感列表 === */
.urgency-section {
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 20px;
  border: 1px solid #f0f0f0;
}
.urgency-header {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 8px; border-bottom: 1px solid #f5f5f5; margin-bottom: 8px;
}
.urgency-title { font-size: 14px; font-weight: 700; color: #e65100; }
.urgency-count { font-size: 13px; color: #666; }
.urgency-count strong { color: #e65100; font-weight: 700; }
.urgency-list {
  max-height: 180px; overflow-y: auto;
}
.urgency-item {
  display: grid;
  grid-template-columns: 1.2fr 1.4fr auto;
  gap: 8px;
  padding: 7px 0;
  font-size: 12.5px;
  border-bottom: 1px dashed #f5f5f5;
  align-items: center;
}
.urgency-item:last-child { border-bottom: none; }
.urgency-user { color: #333; font-weight: 500; }
.urgency-product { color: #666; }
.urgency-time { color: #999; font-size: 11px; text-align: right; }
.urgency-empty, .urgency-loading {
  padding: 20px; text-align: center; color: #aaa; font-size: 13px;
}

/* === 产品卡片 === */
.products { display: flex; flex-direction: column; gap: 18px; margin-bottom: 24px; }
.product-card {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  border: 1px solid #eee;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}
.product-header {
  display: flex; gap: 14px; align-items: flex-start;
  margin-bottom: 10px;
}
.product-image {
  width: 90px; height: 90px; flex-shrink: 0;
  border-radius: 10px; overflow: hidden;
  background: #f5f5f5; display: flex; align-items: center; justify-content: center;
}
.product-image img { width: 100%; height: 100%; object-fit: cover; }
.product-image-placeholder {
  font-size: 11px; color: #aaa; text-align: center; padding: 8px;
}
.product-title-block { flex: 1; min-width: 0; }
.product-name { font-size: 18px; font-weight: 700; color: #1a1a2e; margin-bottom: 3px; }
.product-brand { font-size: 11px; color: #999; margin-bottom: 6px; }
.product-tagline {
  font-size: 12px; color: #667eea; font-weight: 600;
  background: #f0f2ff; padding: 3px 8px; border-radius: 6px;
  display: inline-block;
}
.product-pitch {
  font-size: 14px; color: #555; line-height: 1.6;
  padding: 10px 12px; margin-bottom: 12px;
  background: #f9fafc; border-radius: 8px;
  border-left: 3px solid #667eea;
}

/* === 产品卡片内的折叠区块 === */
.product-section {
  border-top: 1px solid #f0f0f0;
  padding: 10px 0 6px;
}
.product-section summary {
  cursor: pointer;
  font-size: 14px; font-weight: 600; color: #333;
  padding: 4px 0;
  list-style: none;
  display: flex; align-items: center; justify-content: space-between;
}
.product-section summary::-webkit-details-marker { display: none; }
.product-section summary::after {
  content: "▸"; color: #999; font-size: 12px;
  transition: transform .2s;
}
.product-section[open] summary::after { transform: rotate(90deg); }
.section-content { padding: 8px 0 4px; }

/* 适合人群 */
.suitable-group { margin-bottom: 10px; }
.suitable-group:last-child { margin-bottom: 0; }
.suitable-group-title {
  font-size: 13px; font-weight: 600; color: #667eea;
  margin-bottom: 4px;
}
.suitable-list {
  padding-left: 18px;
  font-size: 13px; color: #555;
}
.suitable-list li { padding: 2px 0; line-height: 1.6; }

/* 用法 */
.usage-item {
  display: flex; gap: 10px; padding: 5px 0;
  font-size: 13px; color: #555;
}
.usage-label {
  flex: 0 0 64px;
  color: #999; font-size: 12px;
}
.usage-item.warning .usage-label { color: #e65100; }
.usage-item.warning span:last-child { color: #e65100; }
.usage-item.highlight {
  background: #f0fdf4; padding: 8px 10px; border-radius: 6px; margin-top: 6px;
}
.usage-item.highlight .usage-label { color: #16a34a; }
.usage-item.highlight span:last-child { color: #15803d; font-weight: 600; }

/* 价格 */
.spec-line { font-size: 12.5px; color: #888; margin-bottom: 8px; }
.price-table {
  background: #f9fafc; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px;
}
.price-row {
  display: flex; justify-content: space-between;
  padding: 4px 0; font-size: 13px;
}
.price-label { color: #666; }
.price-value { color: #333; font-weight: 600; }
.suggestion-block {
  background: #fff8e1; border-radius: 8px; padding: 10px 12px;
}
.suggestion-title {
  font-size: 13px; font-weight: 600; color: #8d6e00; margin-bottom: 4px;
}
.suggestion-list {
  padding-left: 18px; font-size: 13px; color: #5d4a00;
}
.suggestion-list li { padding: 2px 0; }

/* 数量选择器 */
.qty-selector {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid #f0f0f0;
}
.qty-label { font-size: 15px; font-weight: 600; color: #333; }
.qty-controls { display: flex; align-items: center; gap: 10px; }
.qty-btn {
  width: 36px; height: 36px;
  border: 1.5px solid #ddd; background: #fff; border-radius: 8px;
  font-size: 20px; font-weight: 600; color: #667eea; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.qty-btn:active { background: #f0f2ff; }
.qty-value { font-size: 18px; font-weight: 700; min-width: 28px; text-align: center; }
.qty-unit { font-size: 13px; color: #888; }

/* === 登记表单 === */
.form-section {
  background: #fff; border-radius: 14px; padding: 20px;
  border: 1px solid #eee;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}
.form-title {
  font-size: 17px; font-weight: 700; color: #1a1a2e;
  margin-bottom: 16px;
}
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 14px; font-weight: 600; color: #555;
  margin-bottom: 6px;
}
.required { color: #e74c3c; font-weight: 700; }
.optional { color: #aaa; font-size: 12px; font-weight: normal; }
.form-group input[type="text"],
.form-group input[type="tel"],
.form-group textarea {
  width: 100%; padding: 11px 12px;
  border: 1.5px solid #e8e8e8; border-radius: 10px;
  font-size: 15px; outline: none;
  font-family: inherit;
  -webkit-appearance: none;
}
.form-group input:focus, .form-group textarea:focus { border-color: #667eea; }
.form-group textarea { resize: vertical; min-height: 60px; }
.form-hint {
  font-size: 12px; color: #999; margin-top: 5px;
}

.checkbox-confirm {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px; background: #f9f9ff; border-radius: 10px;
  cursor: pointer; margin-bottom: 16px;
  font-size: 13px; color: #555; line-height: 1.5;
}
.checkbox-confirm input[type="checkbox"] {
  width: 18px; height: 18px; margin-top: 1px;
  accent-color: #667eea; flex-shrink: 0;
}

/* === 按钮 === */
.btn-primary {
  width: 100%; padding: 14px; border: none; border-radius: 12px;
  background: linear-gradient(135deg, #667eea, #764ba2); color: #fff;
  font-size: 17px; font-weight: 600; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity .2s, transform .1s;
}
.btn-primary:active { transform: scale(0.99); }
.btn-primary:disabled { opacity: 0.5; pointer-events: none; }

.form-footer {
  text-align: center; margin-top: 14px;
  font-size: 13px;
}
.form-footer a { color: #667eea; text-decoration: none; }

/* === 查询页 === */
.back-link {
  display: inline-block; color: #667eea; text-decoration: none;
  font-size: 14px; margin-bottom: 12px;
}
.step-header h2 {
  font-size: 20px; color: #1a1a2e; margin-bottom: 6px;
}
.hint { font-size: 13px; color: #888; margin-bottom: 18px; }

.hidden { display: none !important; }

#lookup-result { margin-top: 20px; }
.lookup-loading, .lookup-empty {
  padding: 24px; text-align: center; color: #888;
  background: #fff; border-radius: 12px; border: 1px solid #eee;
}
.lookup-card {
  background: #fff; border-radius: 12px; padding: 18px;
  border: 1px solid #eee;
}
.lookup-title {
  font-size: 16px; font-weight: 700; color: #1a1a2e; margin-bottom: 14px;
}
.lookup-rows { margin-bottom: 12px; }
.lookup-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid #f5f5f5;
  font-size: 14px;
}
.lookup-row:last-child { border-bottom: none; }
.qty-edit { display: flex; align-items: center; gap: 8px; }
.qty-edit button {
  width: 28px; height: 28px;
  border: 1px solid #ddd; background: #fff; border-radius: 6px;
  font-size: 16px; cursor: pointer; color: #667eea;
}
.lookup-hint { font-size: 12px; color: #999; margin-bottom: 14px; }

/* === 成功页 === */
.success-icon {
  font-size: 64px; text-align: center;
  margin: 40px 0 16px;
}
.success-title {
  text-align: center; font-size: 24px;
  color: #1a1a2e; margin-bottom: 8px;
}
.success-subtitle {
  text-align: center; font-size: 14px; color: #888;
  margin-bottom: 24px;
}
.success-card {
  background: #fff; border-radius: 14px; padding: 18px;
  border: 1px solid #eee; margin-bottom: 20px;
}
.success-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid #f5f5f5;
  font-size: 14px;
}
.success-row:last-child { border-bottom: none; }
.success-row span:first-child { color: #888; }
.success-row span:last-child { color: #333; font-weight: 500; }
.status-pending { color: #e65100 !important; font-weight: 700 !important; }
.success-tips {
  background: #f9fafc; border-radius: 12px; padding: 16px;
  margin-bottom: 20px;
}
.tip-item {
  font-size: 13px; color: #555; padding: 4px 0;
}

/* === Toast === */
.toast {
  position: fixed;
  bottom: 80px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.85); color: #fff;
  padding: 12px 20px; border-radius: 10px;
  font-size: 14px; z-index: 1000;
  max-width: 80%; text-align: center;
}
