/* 贵港甄选溯源 H5 扫码页样式 —— 与演示端 index.html <style> 原样一致 */
/* ===== CSS Variables & Reset ===== */
:root {
  --primary: #1e40af;
  --primary-light: #3b82f6;
  --primary-light1: #dae8fe;
  --primary-dark: #1e3a5f;
  --primary-bg: #eff6ff;
  --success: #059669;
  --success-bg: #ecfdf5;
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --info: #0891b2;
  --info-bg: #ecfeff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --transition: 150ms ease;
}
* { margin:0; padding:0; box-sizing:border-box; }
body { font-family:'Inter',system-ui,sans-serif; background:var(--gray-50); color:var(--gray-800); line-height:1.5; font-size:14px; }
a { color:var(--primary); text-decoration:none; }
button { font-family:inherit; cursor:pointer; border:none; background:none; font-size:14px; }
input,select,textarea { font-family:inherit; font-size:14px; }

/* ===== Form & Buttons ===== */
.form-group { margin-bottom:20px; }
.form-group label { display:block; font-weight:500; color:var(--gray-700); margin-bottom:6px; font-size:13px; }
.form-group label .required { color:var(--danger); }
.form-input { width:100%; height:44px; padding:0 12px; border:1px solid var(--gray-300); border-radius:var(--radius); background:#fff; transition:border-color var(--transition); }
.form-input:focus { outline:none; border-color:var(--primary-light); box-shadow:0 0 0 3px rgba(59,130,246,0.1); }
.form-select { width:100%; height:44px; padding:0 12px; border:1px solid var(--gray-300); border-radius:var(--radius); background:#fff; appearance:none; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%236b7280'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 12px center; }
.form-textarea { width:100%; padding:10px 12px; border:1px solid var(--gray-300); border-radius:var(--radius); background:#fff; resize:vertical; min-height:80px; }
.btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; height:40px; padding:0 20px; border-radius:var(--radius); font-weight:500; transition:all var(--transition); white-space:nowrap; }
.btn-primary { background:var(--primary); color:#fff; }
.btn-primary:hover { background:var(--primary-light); }
.btn-success { background:var(--success); color:#fff; }
.btn-outline { border:1px solid var(--gray-300); color:var(--gray-700); background:#fff; }
.btn-outline:hover { background:var(--gray-50); border-color:var(--gray-400); }
.btn-ghost { color:var(--gray-600); }
.btn-ghost:hover { background:var(--gray-100); color:var(--gray-800); }
.btn-sm { height:32px; padding:0 12px; font-size:13px; }

/* ===== Badges & Text utils ===== */
.badge { display:inline-flex; align-items:center; padding:3px 10px; border-radius:6px; font-size:12px; font-weight:500; }
.badge-success { background:var(--success-bg); color:var(--success); }
.badge-warning { background:var(--warning-bg); color:var(--warning); }
.badge-danger { background:var(--danger-bg); color:var(--danger); }
.badge-info { background:var(--info-bg); color:var(--info); }
.badge-primary { background:var(--primary-bg); color:var(--primary); }
.badge-gray { background:var(--gray-100); color:var(--gray-600); }
.chain-badge { display:inline-flex; align-items:center; gap:6px; padding:4px 12px; border-radius:6px; background:var(--info-bg); color:var(--info); font-size:12px; font-weight:500; }
.chain-badge svg { width:14px; height:14px; }
.text-sm { font-size:13px; }
.text-gray { color:var(--gray-500); }
.text-center { text-align:center; }
.font-medium { font-weight:500; }
.hidden { display:none!important; }

/* ===== Drawer ===== */
.drawer-overlay { position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,0.45); z-index:90; opacity:0; transition:opacity 250ms ease; pointer-events:none; }
.drawer-overlay.show { opacity:1; pointer-events:auto; }
.drawer { position:fixed; top:0; right:0; bottom:0; background:#fff; z-index:91; transform:translateX(100%); transition:transform 300ms cubic-bezier(0.16,1,0.3,1); box-shadow:-4px 0 24px rgba(0,0,0,0.12); overflow-y:auto; overflow-x:hidden; width:480px; }
.drawer.show { transform:translateX(0); }
.drawer.drawer-sm { width:380px; }
.drawer.drawer-lg { width:720px; }
.drawer-header { padding:20px 24px; border-bottom:1px solid var(--gray-200); display:flex; align-items:center; justify-content:space-between; position:sticky; top:0; background:#fff; z-index:2; }
.drawer-header h3 { font-size:18px; font-weight:600; color:var(--gray-900); }
.drawer-header .drawer-close { width:36px; height:36px; display:flex; align-items:center; justify-content:center; border-radius:var(--radius); color:var(--gray-500); transition:all var(--transition); }
.drawer-header .drawer-close:hover { background:var(--gray-100); color:var(--gray-800); }
.drawer-body { padding:24px; }
.drawer-footer { padding:16px 24px; border-top:1px solid var(--gray-200); display:flex; justify-content:flex-end; gap:8px; position:sticky; bottom:0; background:#fff; z-index:2; }

/* ===== Toast ===== */
.toast-container { position:fixed; top:20px; right:20px; z-index:200; display:flex; flex-direction:column; gap:8px; }
.toast { padding:12px 20px; border-radius:var(--radius); background:#fff; box-shadow:var(--shadow-md); display:flex; align-items:center; gap:8px; font-size:14px; animation:slideIn 200ms ease; }
.toast-success { border-left:4px solid var(--success); }
.toast-error { border-left:4px solid var(--danger); }
.toast-warning { border-left:4px solid var(--warning); }
.toast-info { border-left:4px solid var(--info); }
@keyframes slideIn { from{transform:translateX(100%);opacity:0} to{transform:translateX(0);opacity:1} }

/* ===== Scan Page ===== */
.scan-page { max-width:420px; margin:0 auto; background:#fff; }
.scan-header { background:var(--primary); padding:24px; text-align:center; color:#fff; }
/* 容器保持原样 */
.scan-header .brand-logo { 
  width: 48px; 
  height: 48px; 
  background: #fff; 
  border-radius: 12px; 
  display: inline-flex; 
  align-items: center; 
  justify-content: center; 
  margin-bottom: 8px; 
  overflow: hidden; /* 防止图片溢出圆角 */
}

/* 【关键】控制内部图片的大小 */
.scan-header .brand-logo img {
  width: 100%;       /* 宽度占满容器的 48px */
  height: 100%;      /* 高度占满容器的 48px */
  object-fit: contain; /* 保持图片比例，完整显示在盒子里，不裁剪 */
  /* 如果希望图片填满整个盒子（可能裁剪边缘），改用 object-fit: cover */
}

.scan-header h2 { font-size:20px; font-weight:700; }
.scan-header .cert-no { font-size:13px; opacity:0.9; margin-top:4px; }
.scan-section { padding:20px; border-bottom:1px solid var(--gray-200); }
.scan-section h4 { font-size:16px; font-weight:600; margin-bottom:12px; display:flex; align-items:center; gap:8px; }
.scan-section h4 svg { width:18px; height:18px; }
.scan-info-row { display:flex; padding:8px 0; }
.scan-info-row .label { width:100px; font-size:13px; color:var(--gray-500); }
.scan-info-row .value { font-size:14px; color:var(--gray-800); flex:1; }
.scan-chain { background:var(--info-bg); border-radius:var(--radius); padding:12px 16px; display:flex; align-items:center; gap:12px; }
.scan-chain svg { width:24px; height:24px; color:var(--info); }
.scan-chain .chain-text { font-size:13px; color:var(--info); }
.scan-chain .tx-hash { font-size:12px; color:var(--gray-500); margin-top:2px; word-break:break-all; }

/* ===== Category Bar ===== */
.category-bar { padding:12px 16px; background:#fff; border-bottom:1px solid var(--gray-200); display:flex; align-items:center; gap:8px; position:sticky; top:0; z-index:10; flex-wrap:wrap; }
.category-bar .bar-label { font-size:13px; color:var(--gray-500); white-space:nowrap; }
.category-bar .bar-divider { margin:0 4px; font-size:12px; color:var(--gray-400); }
