/* ==========================================================
 * 防伪码查询系统 - 浅色科技蓝主题
 * ========================================================== */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    color: #1A1A1A;
    background: #F4F8FE;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(33, 150, 243, 0.12) 0%, transparent 60%),
        linear-gradient(180deg, #E8F2FE 0%, #F4F8FE 40%, #FFFFFF 100%);
    background-attachment: fixed;
}

/* 背景点阵 */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(33, 150, 243, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(33, 150, 243, 0.05) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    z-index: 0;
}

.page {
    position: relative;
    z-index: 1;
    max-width: 640px;
    margin: 0 auto;
    min-height: 100vh;
    padding: 0 16px 40px;
    display: flex;
    flex-direction: column;
}

/* ---------- 头部 ---------- */
.header {
    text-align: center;
    padding: 14px 0 12px;
    position: relative;
}

.header .logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFFFFF 0%, #E3F2FD 100%);
    border: 2px solid #BBDEFB;
    box-shadow:
        0 4px 12px rgba(33, 150, 243, 0.15),
        inset 0 0 0 4px #fff;
    margin-bottom: 8px;
    position: relative;
    overflow: hidden;
}
.header .logo-wrap::after {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 1px dashed rgba(33, 150, 243, 0.4);
    animation: spin 16s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.header .logo-wrap img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    position: relative;
    z-index: 1;
}

.header h1 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: #1565C0;
    letter-spacing: 2px;
}

.header .subtitle {
    font-size: 10px;
    color: #7898C2;
    margin-top: 4px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.header .tech-line {
    margin: 8px auto 0;
    width: 40%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #90CAF9, transparent);
    position: relative;
}
.header .tech-line::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -2px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #2196F3;
    transform: translateX(-50%);
    box-shadow: 0 0 8px #2196F3;
}

/* ---------- 卡片 ---------- */
.card {
    background: #FFFFFF;
    border: 1px solid #E3F2FD;
    border-radius: 14px;
    padding: 22px 18px;
    margin-top: 20px;
    box-shadow:
        0 8px 24px rgba(33, 150, 243, 0.08),
        0 2px 6px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}
.card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, #1976D2, #42A5F5, #90CAF9);
}

.card-title {
    font-size: 15px;
    color: #1565C0;
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}
.card-title::before {
    content: "";
    width: 3px;
    height: 14px;
    background: linear-gradient(180deg, #1976D2, #42A5F5);
    border-radius: 2px;
}

/* ---------- 输入区 ---------- */
.input-hint {
    color: #6E8AAE;
    font-size: 12.5px;
    text-align: center;
    margin: 4px 0 16px;
}

.code-inputs {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.code-group {
    flex: 1;
    min-width: 0;
    height: 46px;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    color: #1565C0;
    background: #F8FBFF;
    border: 1.5px solid #BBDEFB;
    border-radius: 8px;
    outline: none;
    letter-spacing: 2px;
    caret-color: #1976D2;
    transition: all 0.2s ease;
    font-family: "SF Mono", Consolas, Monaco, monospace;
    -webkit-appearance: none;
    appearance: none;
    text-transform: uppercase;
}
.code-group::placeholder {
    color: #C5D7EC;
    letter-spacing: 4px;
}
.code-group:focus {
    border-color: #1976D2;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.15);
}

.code-dash {
    width: 8px;
    height: 2px;
    background: #90CAF9;
    border-radius: 1px;
    flex-shrink: 0;
}

/* ---------- 按钮 ---------- */
.btn-query {
    display: block;
    width: 100%;
    height: 48px;
    margin-top: 20px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #1976D2 0%, #42A5F5 100%);
    box-shadow:
        0 6px 16px rgba(25, 118, 210, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    cursor: pointer;
    letter-spacing: 4px;
    position: relative;
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.btn-query::before {
    content: "";
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}
.btn-query:hover::before { left: 100%; }
.btn-query:active {
    transform: translateY(1px);
    box-shadow: 0 3px 10px rgba(25, 118, 210, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn-query:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(0.3);
}

.btn-clear {
    margin-top: 10px;
    background: none;
    border: none;
    color: #7898C2;
    font-size: 13px;
    cursor: pointer;
    display: block;
    width: 100%;
    text-align: center;
    padding: 6px;
}
.btn-clear:active { color: #1565C0; }

/* ---------- 提示文字 ---------- */
.notice-text {
    margin-top: 16px;
    padding: 12px 14px;
    background: #F0F7FF;
    border-left: 2px solid #2196F3;
    border-radius: 0 8px 8px 0;
    color: #5F7CA0;
    font-size: 12px;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ---------- 步骤说明 ---------- */
.steps {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 6px;
}
.step {
    flex: 1;
    text-align: center;
    padding: 12px 6px;
    background: #F4F8FE;
    border: 1px solid #E3F2FD;
    border-radius: 8px;
}
.step .num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1976D2, #42A5F5);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 6px;
    box-shadow: 0 2px 6px rgba(25, 118, 210, 0.3);
}
.step .label {
    font-size: 11.5px;
    color: #5F7CA0;
    line-height: 1.4;
}

/* ---------- 底部 ---------- */
.footer {
    margin-top: 28px;
    text-align: center;
    color: #94A8C2;
    font-size: 11.5px;
    line-height: 1.9;
}
.footer .phone {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid #BBDEFB;
    border-radius: 20px;
    color: #1976D2;
    margin-bottom: 12px;
    font-size: 13px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(33, 150, 243, 0.08);
}
.footer .phone a { color: inherit; text-decoration: none; }
.footer a { color: #7898C2; text-decoration: none; }

/* ---------- 弹窗 ---------- */
.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(20, 40, 80, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.25s ease;
}
.modal-mask.show { display: flex; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.modal {
    width: 100%;
    max-width: 340px;
    background: #FFFFFF;
    border-radius: 16px;
    padding: 28px 22px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: scaleIn 0.3s ease;
    box-shadow: 0 20px 50px rgba(25, 118, 210, 0.25), 0 4px 12px rgba(0, 0, 0, 0.1);
}
.modal::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #1976D2, #42A5F5, #90CAF9);
}

.modal .status-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}
.modal .status-icon svg {
    width: 36px;
    height: 36px;
    stroke-width: 3;
    fill: none;
    stroke: #fff;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.modal.success .status-icon { background: linear-gradient(135deg, #43A047, #66BB6A); }
.modal.warn .status-icon { background: linear-gradient(135deg, #FB8C00, #FFA726); }
.modal.warn { animation: scaleIn 0.3s ease, shake 0.4s ease 0.3s; }
.modal.error .status-icon { background: linear-gradient(135deg, #E53935, #EF5350); }
.modal.error { animation: scaleIn 0.3s ease, shake 0.4s ease 0.3s; }

.modal .status-title {
    font-size: 19px;
    font-weight: 700;
    margin: 0 0 6px;
}
.modal.success .status-title { color: #2E7D32; }
.modal.warn .status-title { color: #EF6C00; }
.modal.error .status-title { color: #C62828; }

.modal .status-sub {
    color: #6E8AAE;
    font-size: 13px;
    line-height: 1.7;
    margin: 0 0 16px;
    padding: 11px 14px;
    border-radius: 8px;
    text-align: left;
    background: #F4F8FE;
    border: 1px solid #E3F2FD;
    border-left: 3px solid #1976D2;
    word-break: break-all;
}
.modal.success .status-sub {
    background: #F1F8E9;
    border-color: #DCEDC8;
    border-left-color: #43A047;
    color: #33691E;
}
.modal.error .status-sub {
    background: #FFEBEE;
    border-color: #FFCDD2;
    border-left-color: #E53935;
    color: #B71C1C;
}
.modal.warn .status-sub {
    background: #FFF8E1;
    border-color: #FFE082;
    border-left-color: #FB8C00;
    color: #8C5A00;
}

.modal .warn-box {
    background: linear-gradient(135deg, #FFF8E1 0%, #FFECB3 100%);
    border: 1px solid #FFE082;
    border-left: 3px solid #FB8C00;
    border-radius: 8px;
    padding: 11px 14px;
    margin: 0 0 18px;
    text-align: left;
    font-size: 12.5px;
    line-height: 1.7;
    color: #8C5A00;
    word-break: break-all;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    animation: warnPulse 1.2s ease-in-out 1;
}
@keyframes warnPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(251, 140, 0, 0); }
    50% { box-shadow: 0 0 0 6px rgba(251, 140, 0, 0.15); }
}

.modal .btn-close {
    width: 100%;
    height: 42px;
    border: none;
    background: linear-gradient(135deg, #1976D2 0%, #42A5F5 100%);
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 2px;
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
    transition: all 0.2s ease;
}
.modal .btn-close:active {
    transform: scale(0.98);
    box-shadow: 0 2px 6px rgba(25, 118, 210, 0.3);
}

/* 加载中 */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

/* 极小屏适配 */
@media (max-width: 340px) {
    .code-group { height: 42px; font-size: 16px; letter-spacing: 1px; }
    .code-group::placeholder { letter-spacing: 2px; }
    .code-dash { width: 5px; }
    .code-inputs { gap: 4px; }
    .header h1 { font-size: 20px; }
}
