/* 移动端 H5 样式（微信内置浏览器友好） */
/* 主色调变量：由页面按「平台 / 公司」配色输出 <style>:root{...}</style> 覆盖，
   也可在此处直接改默认值。变量含义：
   --c-main 主色 / --c-main-2 渐变第二色 / --c-accent 点缀色（扫码框等）
   --c-main-dark 深主色 / --c-main-light 浅底色 / --c-main-soft 半透明主色 */
:root {
    --c-main: #16a34a;
    --c-main-2: #0d9488;
    --c-accent: #22c55e;
    --c-main-dark: #117c38;
    --c-main-light: #edf9f0;
    --c-main-soft: rgba(22,163,74,.16);
}
* { box-sizing: border-box; }
html, body {
    margin: 0;
    padding: 0;
    background: #f2f4f7;
    color: #1f2937;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
    font-size: 15px;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
}
.page { max-width: 640px; margin: 0 auto; padding: 12px 12px 28px; }

/* 顶部 */
.topbar {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 14px; border-radius: 12px;
    background: linear-gradient(135deg, var(--c-main), var(--c-main-2));
    color: #fff;
}
.topbar .logo {
    width: 40px; height: 40px; border-radius: 10px; flex: 0 0 40px; overflow: hidden;
    background: rgba(255,255,255,.22);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; font-weight: 700;
}
.topbar .logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.topbar-text h1 { margin: 0; font-size: 17px; font-weight: 600; }
.topbar-text p { margin: 0; font-size: 12px; opacity: .85; }

/* 卡片 */
.card {
    background: #fff; border-radius: 12px; padding: 16px; margin-top: 12px;
    box-shadow: 0 1px 3px rgba(16,24,40,.06);
}
.card-title {
    font-size: 15px; font-weight: 600; margin-bottom: 12px;
    padding-left: 9px; border-left: 3px solid var(--c-main);
}

/* 顶部广告轮播 */
.slider {
    position: relative; max-width: 620px; margin: 0 auto;
    border-radius: 0 0 12px 12px; overflow: hidden;
    background: #e5e7eb; box-shadow: 0 1px 3px rgba(16,24,40,.06);
}
.slider .slides { display: flex; transition: transform .4s ease; }
.slider .slide { flex: 0 0 100%; }
.slider .slide img,
.slider .slide a { display: block; width: 100%; }
.slider .slide img { height: auto; aspect-ratio: 75 / 34; object-fit: cover; }
.slider .dots {
    position: absolute; left: 0; right: 0; bottom: 8px;
    display: flex; justify-content: center; gap: 6px;
}
.slider .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: rgba(255,255,255,.6);
}
.slider .dot.on { background: #fff; width: 14px; border-radius: 3px; }

/* 搜索 */
.search-card form { display: flex; gap: 8px; }
.search-card input {
    flex: 1; height: 42px; padding: 0 12px; font-size: 15px;
    border: 1px solid #d1d5db; border-radius: 8px; background: #f9fafb;
    outline: none;
}
.search-card input:focus { border-color: var(--c-main); background: #fff; }
.search-card button {
    height: 42px; padding: 0 18px; border: 0; border-radius: 8px;
    background: var(--c-main); color: #fff; font-size: 15px;
}
.tip { margin: 10px 0 0; font-size: 12px; color: #6b7280; }

/* 销售公司 / 公司主页 */
.store-box { padding-top: 4px; }
.store-logo { display: block; width: 100%; max-height: 150px; object-fit: cover; border-radius: 10px; margin-bottom: 10px; }
.store-name { font-size: 16px; font-weight: 600; color: #111827; }
.store-intro { margin-top: 6px; font-size: 13px; color: #4b5563; line-height: 1.6; }
.store-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.store-btn {
    display: inline-block; padding: 8px 16px; border-radius: 20px;
    border: 1px solid var(--c-main); color: var(--c-main); font-size: 13px; background: #fff;
}
.store-btn:active { background: var(--c-main-light); }
.store-btn.small { margin-top: 8px; padding: 6px 14px; font-size: 12px; }

.p-list { list-style: none; margin: 0; padding: 0; }
.p-item { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid #f1f5f9; }
.p-item:last-child { border-bottom: 0; padding-bottom: 0; }
.p-cover { width: 78px; height: 78px; object-fit: cover; border-radius: 8px; flex: 0 0 78px; }
.p-main { flex: 1; min-width: 0; }
.p-name { font-size: 15px; font-weight: 600; color: #111827; }
.p-meta { margin-top: 4px; font-size: 12px; color: #6b7280; }
.empty { padding: 18px 0; text-align: center; color: #9ca3af; font-size: 13px; }

/* 扫一扫按钮 */
.scan-btn {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    width: 100%; height: 42px; margin-top: 10px;
    border: 1px solid var(--c-main); border-radius: 8px;
    background: #fff; color: var(--c-main); font-size: 15px; font-family: inherit;
}
.scan-btn:active { background: var(--c-main-light); }
.scan-btn svg { width: 18px; height: 18px; }

/* 扫码浮层 */
.scan-mask { position: fixed; left: 0; top: 0; right: 0; bottom: 0; background: #000; z-index: 99; display: none; }
.scan-mask video { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.scan-mask canvas { display: none; }
.scan-frame {
    position: absolute; left: 50%; top: 42%;
    width: 66vw; height: 66vw; max-width: 280px; max-height: 280px;
    transform: translate(-50%, -50%);
    border: 2px solid var(--c-accent); border-radius: 12px; overflow: hidden;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, .55);
}
.scan-line {
    position: absolute; left: 8px; right: 8px; height: 2px;
    background: var(--c-accent); box-shadow: 0 0 8px var(--c-accent);
    animation: scanMove 2.4s linear infinite;
}
@keyframes scanMove { 0% { top: 8px; } 50% { top: calc(100% - 10px); } 100% { top: 8px; } }
.scan-tip {
    position: absolute; left: 0; right: 0; bottom: 120px; margin: 0;
    padding: 0 24px; text-align: center; color: #fff; font-size: 13px; line-height: 1.5;
}
.scan-actions {
    position: absolute; left: 0; right: 0; bottom: 52px;
    display: flex; justify-content: center; gap: 16px;
}
.scan-actions button {
    padding: 9px 20px; border-radius: 22px; font-size: 14px; font-family: inherit;
    border: 1px solid rgba(255,255,255,.6); background: rgba(255,255,255,.12); color: #fff;
}

/* 查询状态 */
.status-box { text-align: center; padding: 6px 0 12px; }
.status-box h2 { margin: 8px 0 4px; font-size: 17px; }
.status-box p { margin: 0; font-size: 13px; color: #6b7280; }
.status-icon {
    width: 52px; height: 52px; margin: 0 auto; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; color: #fff;
}
.status-ok .status-icon { background: var(--c-main); }
.status-bad .status-icon { background: #dc2626; }
.status-ok h2 { color: var(--c-main-dark); }
.status-bad h2 { color: #b91c1c; }
.code-line {
    border-top: 1px dashed #e5e7eb; padding-top: 10px;
    font-size: 13px; color: #374151; word-break: break-all;
}
.muted { color: #9ca3af; }

/* 产品 */
.cover { width: 100%; border-radius: 10px; display: block; margin-bottom: 12px; }
.product-name { font-size: 17px; font-weight: 600; }
.product-sub { font-size: 13px; color: #6b7280; margin-top: 2px; }
.info-list { list-style: none; margin: 14px 0 0; padding: 0; }
.info-list li {
    display: flex; justify-content: space-between; gap: 12px;
    padding: 9px 0; border-bottom: 1px solid #f1f3f5; font-size: 14px;
}
.info-list li:last-child { border-bottom: 0; }
.info-list span { color: #6b7280; flex: none; }
.info-list b { font-weight: 500; text-align: right; word-break: break-all; }
.summary {
    margin-top: 12px; padding: 10px 12px; font-size: 13px; color: #4b5563;
    background: #f8faf9; border-radius: 8px;
}

/* 扫码结果：正品提示条 */
.verify-strip {
    display: flex; align-items: center; gap: 10px; margin-top: 12px;
    padding: 12px 14px; border-radius: 12px;
    background: linear-gradient(135deg, var(--c-main), var(--c-main-2)); color: #fff;
}
.verify-strip .verify-ico {
    width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%;
    background: rgba(255,255,255,.22); display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 700;
}
.verify-text { display: flex; flex-direction: column; line-height: 1.4; }
.verify-text b { font-size: 15px; }
.verify-text span { font-size: 12px; opacity: .9; }

/* 产品铭牌（仿金属铭牌，静态版式 + 动态字段值） */
.nameplate {
    margin-top: 12px; padding: 16px 14px 14px; border-radius: 10px;
    background: #ffffff;
    border: 1px solid #cfd3d6;
    box-shadow: 0 2px 6px rgba(16,24,40,.08);
    color: #1a1a1a;
}
.np-head { padding-bottom: 8px; }
.np-head img { display: block; width: 100%; height: auto; }
.np-fields { padding-top: 6px; }
.np-row { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; padding: 4px 0; border-bottom: 1px dashed #d5d8db; }
.np-row:last-child { border-bottom: 0; }
.np-fields > .np-row:first-child { grid-template-columns: 0.8fr 1.2fr; }
.np-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.np-cell { min-width: 0; }
.np-line { font-size: 12px; line-height: 1.45; }
.np-cell .np-line { display: flex; align-items: baseline; }
.np-cell .np-line + .np-line { font-size: 11px; }
.np-label { color: #555; flex: 0 0 auto; white-space: nowrap; margin-right: 5px; }
.np-val { flex: 1 1 auto; min-width: 0; font-weight: 600; overflow-wrap: break-word; }
.np-merge { white-space: nowrap; }
.np-merge .np-line { display: inline; }
.np-merge .np-line + .np-line::before { content: '　'; }
.np-merge .np-line:nth-child(2) { font-size: 10px; }
.np-merge .np-line:nth-child(2) .np-val { font-size: 10px; }
.np-addr { grid-template-columns: 1fr; }
.np-addr .np-line:first-child { font-size: 12px; white-space: nowrap; }
.np-addr .np-line:last-child { font-size: 11px; line-height: 1.4; }
/* 单字段占满整行：中英文各一行且不折行 */
.np-single { grid-template-columns: 1fr; }
.np-single .np-line { white-space: nowrap; }
.np-single .np-line:first-child { font-size: 12px; }
.np-single .np-line:last-child { font-size: 11px; line-height: 1.4; }
.np-certs {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
    gap: 8px 14px; margin-top: 12px; padding-top: 12px; border-top: 1px solid #d5d8db;
}
.np-cert { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; min-width: 78px; }
.np-cert span { font-size: 10px; color: #444; line-height: 1.3; }
.np-cert-sym { justify-content: center; }
.np-ce { font-size: 22px; font-weight: 800; letter-spacing: 1px; }
.np-made { font-weight: 700; }
/* 手机端适配（主使用场景：375–414px 宽屏） */
@media (max-width: 480px) {
    .page { padding: 8px 8px 20px; }
    .nameplate { padding: 12px 10px 10px; }
    .np-row { gap: 2px 8px; padding: 4px 0; }
    .np-fields > .np-row:first-child { grid-template-columns: 0.85fr 1.15fr; }
    .np-line { font-size: 11.5px; }
    .np-cell .np-line + .np-line { font-size: 10px; }
    .np-merge { white-space: normal; }
    .np-merge .np-line:nth-child(2) { font-size: 9.5px; }
    .np-merge .np-line:nth-child(2) .np-val { font-size: 9.5px; }
    .np-addr .np-line:first-child { font-size: 11px; white-space: nowrap; }
    .np-addr .np-line:last-child { font-size: 10px; line-height: 1.35; }
    .np-single .np-line:first-child { font-size: 11px; white-space: nowrap; }
    .np-single .np-line:last-child { font-size: 9.5px; line-height: 1.35; white-space: nowrap; }
    .np-certs { gap: 8px 10px; }
    .np-cert { min-width: 70px; }
}

/* 时间轴 */
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
.timeline li { position: relative; padding: 0 0 16px 22px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
    content: ''; position: absolute; left: 5px; top: 8px; bottom: -6px;
    border-left: 1px dashed #d1d5db;
}
.timeline li:last-child::before { display: none; }
.timeline .dot {
    position: absolute; left: 0; top: 6px; width: 11px; height: 11px;
    border-radius: 50%; background: var(--c-main); box-shadow: 0 0 0 3px var(--c-main-soft);
}
.tl-title { font-size: 15px; font-weight: 600; }
.tl-meta { font-size: 12px; color: #6b7280; margin-top: 2px; }
.tl-content { font-size: 13px; color: #4b5563; margin-top: 4px; }
.tl-img { width: 100%; margin-top: 8px; border-radius: 8px; display: block; }

/* 二维码 */
.qr-box { text-align: center; }
.qr-box img { width: 168px; height: 168px; }
.qr-box p { margin: 6px 0 0; font-size: 12px; color: #6b7280; }

/* 底部 */
.footer { text-align: center; color: #9ca3af; font-size: 12px; margin-top: 18px; }
.footer p { margin: 2px 0; }
