/* ============ 移动端 H5 询价程序 — 现代清爽风格 ============ */
:root {
    --md-primary: #2563eb;
    --md-primary-dark: #1d4ed8;
    --md-secondary: #06b6d4;
    --md-accent: #f59e0b;
    --md-bg: #f8fafc;
    --md-card: #ffffff;
    --md-text: #0f172a;
    --md-text-sec: #64748b;
    --md-border: #e2e8f0;
    --md-shadow: 0 4px 16px rgba(15, 23, 42, .08);
    --md-radius: 16px;
    --md-radius-sm: 12px;
    --md-gap: 16px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { -webkit-tap-highlight-color: transparent; }

html, body {
    margin: 0; padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--md-bg);
    color: var(--md-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.m-wrap {
    max-width: 540px;
    margin: 0 auto;
    min-height: 100vh;
    padding-bottom: calc(24px + var(--safe-bottom));
    background: var(--md-bg);
}

/* ===== 顶部栏 ===== */
.m-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: 54px;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226,232,240,.8);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}
.m-topbar .m-back {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    color: var(--md-text);
    font-size: 16px;
    border-radius: 50%;
    text-decoration: none;
}
.m-topbar .m-back:active { background: #f1f5f9; }
.m-topbar .m-logo {
    font-size: 17px;
    font-weight: 700;
    color: var(--md-text);
    letter-spacing: .3px;
}
.m-topbar .m-right {
    width: 32px;
    text-align: right;
    font-size: 12px;
    color: var(--md-text-sec);
}

/* ===== Hero 区域 ===== */
.m-hero {
    position: relative;
    padding: 28px 20px 32px;
    background: linear-gradient(135deg, var(--md-primary) 0%, #4f46e5 60%, var(--md-secondary) 100%);
    color: #fff;
    overflow: hidden;
}
.m-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 80% 20%, rgba(255,255,255,.12) 0%, transparent 40%),
                radial-gradient(circle at 20% 80%, rgba(6,182,212,.25) 0%, transparent 35%);
    pointer-events: none;
}
.m-hero-content { position: relative; z-index: 1; }
.m-hero h1 {
    font-size: 26px;
    margin: 0 0 8px;
    font-weight: 800;
    line-height: 1.25;
}
.m-hero p {
    margin: 0 0 20px;
    font-size: 14px;
    opacity: .88;
    line-height: 1.6;
    max-width: 90%;
}

.m-search {
    display: flex;
    background: #fff;
    border-radius: 999px;
    padding: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.m-search input {
    flex: 1;
    border: 0;
    outline: 0;
    padding: 12px 16px;
    font-size: 15px;
    background: transparent;
    color: var(--md-text);
    min-width: 0;
}
.m-search input::placeholder { color: #94a3b8; }
.m-search button {
    border: 0;
    background: linear-gradient(135deg, var(--md-accent) 0%, #f97316 100%);
    color: #fff;
    padding: 0 20px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    display: flex; align-items: center; gap: 4px;
}
.m-search button:active { transform: scale(.98); }

.m-quick {
    margin-top: 18px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.m-quick a {
    display: inline-flex;
    align-items: center;
    background: rgba(255,255,255,.18);
    color: #fff;
    font-size: 12px;
    padding: 7px 14px;
    border-radius: 999px;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,.2);
    backdrop-filter: blur(4px);
}
.m-quick a:active { background: rgba(255,255,255,.28); }

/* ===== 区块 ===== */
.m-section { padding: 20px 16px 4px; }
.m-section-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--md-text);
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.m-section-title::before {
    content: '';
    width: 5px; height: 18px;
    background: linear-gradient(180deg, var(--md-primary), var(--md-secondary));
    border-radius: 3px;
}
.m-section-title .more {
    margin-left: auto;
    font-size: 12px;
    font-weight: 500;
    color: var(--md-primary);
    text-decoration: none;
}

/* ===== 卡片 ===== */
.m-card {
    background: var(--md-card);
    border-radius: var(--md-radius);
    padding: 14px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--md-shadow);
    text-decoration: none;
    color: inherit;
    transition: transform .1s, box-shadow .1s;
    border: 1px solid rgba(226,232,240,.6);
}
.m-card:active { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(15,23,42,.1); }
.m-card-img {
    width: 64px; height: 64px;
    border-radius: var(--md-radius-sm);
    object-fit: cover;
    background: #f1f5f9;
    flex-shrink: 0;
}
.m-card-body { flex: 1; min-width: 0; }
.m-card-name {
    font-size: 15px; font-weight: 700; color: var(--md-text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.m-card-cas {
    display: inline-block;
    font-size: 11px; color: var(--md-primary);
    margin-top: 5px;
    background: #eff6ff;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
}
.m-card-meta { font-size: 12px; color: var(--md-text-sec); margin-top: 5px; }
.m-card-arrow { color: #cbd5e1; font-size: 16px; flex-shrink: 0; }

.m-card.dashed {
    border: 2px dashed #cbd5e1;
    background: #f8fafc;
    box-shadow: none;
}
.m-card.dashed .m-card-name { color: var(--md-primary); }

/* ===== 空态 / 提示 ===== */
.m-empty {
    text-align: center;
    color: var(--md-text-sec);
    font-size: 14px;
    padding: 40px 0 32px;
    background: var(--md-card);
    border-radius: var(--md-radius);
    box-shadow: var(--md-shadow);
    margin-bottom: 14px;
}
.m-empty .m-empty-icon { font-size: 44px; opacity: .35; display: block; margin-bottom: 12px; }
.m-empty h3 { margin: 0 0 6px; font-size: 16px; color: var(--md-text); }

.m-tip {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fde68a;
    color: #92400e;
    font-size: 13px;
    padding: 12px 14px;
    border-radius: var(--md-radius-sm);
    margin: 0 0 14px;
    line-height: 1.6;
}
.m-tip a {
    color: #b45309;
    font-weight: 700;
    text-decoration: underline;
}

/* ===== 表单 ===== */
.m-form { padding: 20px 16px; }
.m-field { margin-bottom: 18px; }
.m-field label {
    display: block;
    font-size: 14px;
    color: var(--md-text);
    margin-bottom: 8px;
    font-weight: 700;
}
.m-field label .req { color: #ef4444; margin-left: 2px; }
.m-field input,
.m-field textarea,
.m-field select {
    width: 100%;
    border: 1px solid var(--md-border);
    border-radius: var(--md-radius-sm);
    padding: 13px 15px;
    font-size: 15px;
    outline: 0;
    background: var(--md-card);
    color: var(--md-text);
    box-sizing: border-box;
    -webkit-appearance: none;
    transition: border-color .15s, box-shadow .15s;
}
.m-field input:focus,
.m-field textarea:focus { border-color: var(--md-primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.m-field textarea { resize: vertical; min-height: 80px; }
.m-field .hint { font-size: 12px; color: var(--md-text-sec); margin-top: 6px; }
.m-field .readonly {
    background: #f8fafc;
    color: var(--md-text);
    font-weight: 600;
    border-color: var(--md-border);
}
.m-form-section {
    font-size: 14px;
    font-weight: 700;
    color: var(--md-text);
    margin: 24px 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--md-border);
}

.m-submit {
    width: 100%;
    border: 0;
    background: linear-gradient(135deg, var(--md-primary) 0%, var(--md-primary-dark) 100%);
    color: #fff;
    font-size: 17px;
    font-weight: 800;
    padding: 16px;
    border-radius: var(--md-radius-sm);
    margin-top: 10px;
    box-shadow: 0 8px 20px rgba(37,99,235,.32);
    letter-spacing: .3px;
}
.m-submit:active { transform: scale(.995); }

/* ===== 成功页 ===== */
.m-success-wrap { background: var(--md-bg); min-height: 100vh; }
.m-success {
    text-align: center;
    padding: 64px 28px 40px;
    background: var(--md-card);
    border-radius: 0 0 24px 24px;
    box-shadow: var(--md-shadow);
    margin-bottom: 20px;
}
.m-success .m-check {
    width: 84px; height: 84px;
    border-radius: 50%;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
    font-size: 46px;
    line-height: 84px;
    margin: 0 auto 22px;
    box-shadow: 0 10px 28px rgba(34,197,94,.35);
}
.m-success h2 { font-size: 22px; color: var(--md-text); margin: 0 0 10px; font-weight: 800; }
.m-success p { font-size: 14px; color: var(--md-text-sec); margin: 0 0 28px; line-height: 1.7; }
.m-success .m-no {
    display: inline-block;
    background: #eff6ff;
    color: var(--md-primary);
    font-weight: 800;
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 14px;
    margin-bottom: 24px;
}
.m-success .m-btn {
    display: inline-block;
    background: var(--md-primary); color: #fff;
    padding: 13px 32px; border-radius: 999px;
    font-size: 15px; text-decoration: none; font-weight: 700;
    margin: 0 6px 10px;
}
.m-success .m-btn.ghost { background: #fff; color: var(--md-primary); border: 1px solid var(--md-border); }

/* ===== 底部固定导航 / 底栏 ===== */
.m-foot {
    text-align: center;
    font-size: 12px;
    color: var(--md-text-sec);
    padding: 24px 16px 12px;
    line-height: 1.6;
}

/* ===== 安全适配 ===== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .m-success { padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
}

/* ===== 小屏适配 ===== */
@media (max-width: 360px) {
    .m-hero { padding: 22px 16px 26px; }
    .m-hero h1 { font-size: 22px; }
    .m-card { padding: 12px; }
    .m-card-img { width: 56px; height: 56px; }
    .m-section { padding: 16px 12px 4px; }
}
