/* =========================================================
   查验报告系统 - 前台查验页样式（明亮现代风）
   与原深色霓虹科幻风完全不同的视觉语言
   ========================================================= */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #4f46e5;        /* 靛蓝 */
    --primary-deep: #3730a3;
    --secondary: #7c3aed;      /* 紫 */
    --accent: #06b6d4;         /* 青 */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #f4f6fb;
    --card: #ffffff;
    --text: #1e293b;
    --text-weak: #64748b;
    --line: #e2e8f0;
    --radius: 18px;
    --shadow: 0 18px 45px -18px rgba(30, 41, 59, 0.22);
}

html, body { height: 100%; }

body {
    font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ---------- 背景装饰：柔和光斑 + 网格 + 浮动圆点 ---------- */
.bg-decor { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .45; }
.blob-1 { width: 480px; height: 480px; left: -160px; top: -140px; background: linear-gradient(135deg, #c7d2fe, #a5b4fc); }
.blob-2 { width: 520px; height: 520px; right: -180px; bottom: -160px; background: linear-gradient(135deg, #fbcfe8, #ddd6fe); }
.grid-mask {
    position: absolute; inset: 0;
    background-image: linear-gradient(rgba(79, 70, 229, .05) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(79, 70, 229, .05) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 30%, transparent 75%);
}
.particles { position: absolute; inset: 0; }
.particle {
    position: absolute; bottom: -12px; width: 7px; height: 7px; border-radius: 50%;
    background: rgba(79, 70, 229, .30);
    animation: floatUp linear infinite;
    opacity: 0;
}
@keyframes floatUp {
    0%   { transform: translateY(0) scale(.6); opacity: 0; }
    10%  { opacity: .8; }
    90%  { opacity: .5; }
    100% { transform: translateY(-108vh) scale(1.05); opacity: 0; }
}

/* ---------- 顶部导航 ---------- */
.topbar {
    position: relative; z-index: 2;
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 6vw; max-width: 1080px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
    width: 38px; height: 38px; border-radius: 12px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff; font-weight: 800; font-size: 19px;
    box-shadow: 0 8px 18px -6px rgba(79, 70, 229, .55);
}
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: .5px; color: var(--text); }
.topbar-meta { display: flex; align-items: center; gap: 10px; }
.meta-chip {
    display: inline-flex; align-items: center; gap: 7px;
    background: var(--card); border: 1px solid var(--line);
    color: var(--text-weak); font-size: 12.5px;
    padding: 7px 13px; border-radius: 999px;
    box-shadow: 0 4px 14px -8px rgba(30, 41, 59, .25);
}
.dot-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--success); animation: pulse 1.8s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(16,185,129,.45);} 60% { box-shadow: 0 0 0 6px rgba(16,185,129,0);} }

/* ---------- 主体 ---------- */
.page { position: relative; z-index: 1; max-width: 680px; margin: 0 auto; padding: 26px 20px 40px; }

/* 标题 */
.hero { text-align: center; padding: 16px 0 26px; }
.hero-title { font-size: 34px; font-weight: 800; letter-spacing: 2px; color: var(--text); }
.hero-title .accent {
    background: linear-gradient(120deg, var(--primary), var(--secondary) 60%, var(--accent));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { margin-top: 9px; color: var(--text-weak); font-size: 14.5px; letter-spacing: .5px; }

/* 查验卡片 */
.verify-card {
    background: var(--card); border: 1px solid #eef1f8; border-radius: var(--radius);
    padding: 24px; box-shadow: var(--shadow);
    animation: riseIn .5s ease both;
}
@keyframes riseIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.step-badge {
    font-size: 11.5px; font-weight: 700; letter-spacing: 1px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff; padding: 4px 10px; border-radius: 8px;
}
.card-head h2 { font-size: 16.5px; font-weight: 700; }

.input-row { display: flex; gap: 12px; }
.input-row input {
    flex: 1; height: 52px; padding: 0 18px;
    border: 1.6px solid var(--line); border-radius: 13px;
    font-size: 15.5px; letter-spacing: 1px; color: var(--text);
    background: #fbfcff; outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.input-row input::placeholder { color: #a8b3c5; letter-spacing: 0; }
.input-row input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79,70,229,.12); }

.btn-primary {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: 52px; padding: 0 26px; border: none; border-radius: 13px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; white-space: nowrap;
    box-shadow: 0 10px 22px -8px rgba(79,70,229,.55);
    transition: transform .18s, box-shadow .18s;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 28px -10px rgba(79,70,229,.6); }
.btn-primary:active { transform: translateY(0); }

.card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.attempts { font-size: 13px; color: var(--text-weak); }
.attempts b {
    display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px;
    border-radius: 999px; background: #eef2ff; color: var(--primary); font-size: 13px;
    transition: background .2s, color .2s;
}
.attempts b.warning { background: #fef3c7; color: var(--warning); }
.attempts b.danger { background: #fee2e2; color: var(--danger); }
.hint { font-size: 12px; color: #a8b3c5; }

/* 结果卡片 */
.result-card {
    margin-top: 22px; background: var(--card); border-radius: var(--radius);
    border: 1px solid #eef1f8; box-shadow: var(--shadow); padding: 22px;
    animation: riseIn .45s ease both;
}
.result-banner { font-size: 15px; font-weight: 700; color: #fff; padding: 10px 16px; border-radius: 11px; }
.result-banner.success { background: linear-gradient(120deg, #10b981, #059669); }
.result-banner.error { background: linear-gradient(120deg, #f43f5e, #e11d48); }
.result-title { font-size: 18px; font-weight: 700; margin: 15px 4px 0; }

/* 密码验证 */
.pwd-box { margin-top: 16px; background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 12px; padding: 15px; }
.pwd-tip { font-size: 13.5px; color: var(--text-weak); margin-bottom: 11px; }
.pwd-row { display: flex; gap: 10px; }
.pwd-row input {
    flex: 1; height: 44px; padding: 0 14px; border: 1.5px solid var(--line);
    border-radius: 11px; font-size: 14.5px; outline: none; transition: border-color .2s;
}
.pwd-row input:focus { border-color: var(--primary); }
.btn-secondary {
    height: 44px; padding: 0 20px; border: none; border-radius: 11px;
    background: var(--primary); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
    box-shadow: 0 8px 16px -8px rgba(79,70,229,.5); transition: transform .18s;
}
.btn-secondary:hover { transform: translateY(-1px); }

/* 文件展示 */
.file-box { margin-top: 16px; }
.file-meta-row { display: flex; align-items: center; gap: 13px; padding: 6px 2px 14px; }
.file-icon {
    width: 52px; height: 52px; flex: none; display: grid; place-items: center;
    font-size: 24px; background: #eef2ff; border-radius: 14px;
}
.file-name { font-size: 15.5px; font-weight: 700; }
.file-meta { margin-top: 4px; font-size: 12.5px; color: var(--text-weak); }
.file-preview { width: 100%; }
.preview-image {
    width: 100%; max-height: 460px; object-fit: contain;
    border-radius: 13px; border: 1px solid var(--line); background: #fbfcff;
    cursor: zoom-in;
}
.preview-placeholder { text-align: center; padding: 40px 10px; color: var(--text-weak); font-size: 14px; }
.preview-placeholder .placeholder-icon { font-size: 40px; display: block; margin-bottom: 10px; }
.file-actions { display: flex; gap: 12px; margin-top: 16px; }
.file-actions .btn-primary { height: 46px; }
.btn-outline {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: 46px; padding: 0 24px; border: 1.6px solid var(--primary); border-radius: 13px;
    background: transparent; color: var(--primary); font-size: 14.5px; font-weight: 600;
    text-decoration: none; transition: background .18s;
}
.btn-outline:hover { background: #eef2ff; }

/* 页脚 */
.page-foot { text-align: center; margin-top: 42px; color: #a8b3c5; font-size: 12.5px; letter-spacing: .5px; }

/* ---------- 加载遮罩 ---------- */
.loading-overlay {
    position: fixed; inset: 0; z-index: 60;
    display: none; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
    background: rgba(244, 246, 251, .82); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.loading-overlay.active { display: flex; }
.loading-overlay p { color: var(--text-weak); font-size: 14px; letter-spacing: 1px; }
.spinner {
    width: 46px; height: 46px; border-radius: 50%;
    border: 4px solid #e2e8f0; border-top-color: var(--primary);
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 图片灯箱 ---------- */
.image-modal {
    position: fixed; inset: 0; z-index: 70;
    display: none; flex-direction: column; align-items: center; justify-content: center;
    background: rgba(15, 23, 42, .88); padding: 30px;
}
.image-modal.active { display: flex; }
.image-modal-content { max-width: 92vw; max-height: 82vh; border-radius: 12px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.image-modal-caption { margin-top: 14px; color: #cbd5e1; font-size: 14px; }
.image-modal-close {
    position: absolute; top: 22px; right: 30px;
    color: #fff; font-size: 34px; line-height: 1; cursor: pointer; opacity: .85;
}
.image-modal-close:hover { opacity: 1; }

/* ---------- Toast ---------- */
.toast {
    position: fixed; left: 50%; bottom: 34px; transform: translate(-50%, 16px);
    z-index: 80; display: flex; align-items: center; gap: 10px;
    background: var(--card); color: var(--text);
    border: 1px solid var(--line); border-radius: 13px;
    padding: 13px 20px; box-shadow: 0 18px 40px -12px rgba(30,41,59,.35);
    opacity: 0; visibility: hidden; transition: opacity .25s, transform .25s, visibility .25s;
    max-width: 88vw;
}
.toast.active { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.toast-icon {
    width: 22px; height: 22px; flex: none; display: grid; place-items: center;
    border-radius: 50%; color: #fff; font-size: 13px; font-weight: 800;
}
.toast.success .toast-icon { background: var(--success); }
.toast.error .toast-icon { background: var(--danger); }
.toast.warning .toast-icon { background: var(--warning); }
.toast.info .toast-icon { background: var(--accent); }
.toast-message { font-size: 14px; }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
    .topbar { padding: 14px 16px; }
    .topbar-meta .meta-chip:first-child { display: none; }
    .hero-title { font-size: 27px; }
    .input-row { flex-direction: column; }
    .input-row .btn-primary { width: 100%; }
    .file-actions { flex-direction: column; }
    .file-actions .btn-primary, .file-actions .btn-outline { width: 100%; }
}