/* ===========================================
   备用查询站 · 移动优先全局样式
   黑色科技感 + 毛玻璃 · 适配手机 / 平板 / PC
   =========================================== */

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

html {
    height: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    min-height: 100dvh; /* 移动浏览器动态高度 */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: #e8e8e8;
    background: #0a0a0f;
    overflow-x: hidden;
    position: relative;
    line-height: 1.5;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

/* ===== 背景：渐变 + 动态光斑 ===== */
body {
    background:
        radial-gradient(ellipse 80% 60% at top left, rgba(0, 120, 255, 0.18), transparent 60%),
        radial-gradient(ellipse 80% 60% at bottom right, rgba(140, 0, 255, 0.14), transparent 60%),
        radial-gradient(ellipse 60% 50% at center, rgba(0, 200, 180, 0.06), transparent 70%),
        #0a0a0f;
    background-attachment: fixed;
}

/* 噪点纹理 */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        repeating-linear-gradient(0deg, rgba(255,255,255,0.02) 0, rgba(255,255,255,0.02) 1px, transparent 1px, transparent 3px);
    pointer-events: none;
    z-index: 0;
}

/* ===== 顶部 ===== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    gap: 12px;
    position: sticky;
}
.topbar .logo-wrap {
    flex: 1;
    text-align: center;
}
.topbar .logo {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #00d4ff, #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}
.topbar .actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}
.topbar .btn-link {
    color: #a0a8b8;
    text-decoration: none;
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s;
    white-space: nowrap;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
}
.topbar .btn-link:active {
    color: #fff;
    background: rgba(255,255,255,0.05);
}

/* ===== 主容器 ===== */
.wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: 20px 16px 32px;
}

/* ===== 卡片 (毛玻璃) ===== */
.card {
    background: rgba(20, 22, 32, 0.6);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 24px 20px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.card h1 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #fff;
}

.card .desc {
    color: #8a93a6;
    font-size: 13px;
    margin-bottom: 22px;
    line-height: 1.6;
}

/* ===== 输入框 ===== */
.input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 18px;
    letter-spacing: 4px;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    transition: all 0.2s;
    min-height: 48px; /* 触摸目标 */
}
.input:focus {
    outline: none;
    border-color: rgba(0, 212, 255, 0.6);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
    background: rgba(0, 0, 0, 0.45);
}
.input::placeholder {
    color: #4a5266;
    letter-spacing: 1px;
}
.label {
    display: block;
    font-size: 12px;
    color: #8a93a6;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* ===== 弹窗 ===== */
.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
    background: rgba(20, 22, 32, 0.95);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    width: 100%;
    max-width: 480px;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    animation: slideUp 0.25s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: sticky;
    top: 0;
    background: rgba(20, 22, 32, 0.95);
    z-index: 1;
}
.modal-head h2 {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}
.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: #a0a8b8;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-close:active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}
.modal form {
    padding: 16px 20px 20px;
}
.modal-foot {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}
.modal-foot .btn {
    margin-top: 0;
    flex: 1;
}
.field-row {
    display: flex;
    gap: 10px;
}
.field-row .field { flex: 1; }
.textarea {
    width: 100%;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    line-height: 1.6;
    font-family: inherit;
    resize: vertical;
    min-height: 96px;
    box-sizing: border-box;
    transition: all 0.2s;
}
.textarea:focus {
    outline: none;
    border-color: rgba(0, 212, 255, 0.6);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
    background: rgba(0, 0, 0, 0.45);
}
.textarea::placeholder {
    color: #4a5266;
}
.hint {
    text-align: right;
    color: #6a7388;
    font-size: 12px;
    margin-top: 4px;
}

/* ===== 选项按钮组 ===== */
.options {
    display: flex;
    gap: 10px;
}
.options .opt {
    flex: 1;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #c8cdd8;
    font-size: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
    user-select: none;
}
.options .opt:active {
    transform: scale(0.98);
}
.options .opt.active {
    background: rgba(0, 120, 255, 0.18);
    border-color: rgba(0, 212, 255, 0.6);
    color: #fff;
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.15) inset;
}

/* ===== 按钮 ===== */
.btn {
    display: block;
    width: 100%;
    margin-top: 20px;
    padding: 17px 22px;
    background: linear-gradient(135deg, #0078ff, #7c3aed);
    color: #fff;
    border: 2px solid rgba(0, 212, 255, 0.4);
    border-radius: 14px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 4px;
    text-align: center;
    text-decoration: none;
    min-height: 54px; /* 触摸目标 */
    box-shadow:
        0 4px 16px rgba(0, 120, 255, 0.35),
        0 0 0 0 rgba(0, 212, 255, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.btn:hover {
    box-shadow:
        0 6px 24px rgba(0, 120, 255, 0.5),
        0 0 0 4px rgba(0, 212, 255, 0.15);
    border-color: rgba(0, 212, 255, 0.7);
}
.btn:active {
    transform: scale(0.98);
    opacity: 0.92;
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.btn.btn-secondary {
    background: rgba(20, 22, 32, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.btn.btn-secondary:hover {
    background: rgba(40, 42, 52, 0.8);
    border-color: rgba(0, 212, 255, 0.5);
}
.btn.btn-secondary:active {
    background: rgba(40, 42, 52, 0.9);
}

/* ===== 错误/成功提示 ===== */
.error, .success {
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.5;
}
.error {
    background: rgba(220, 50, 70, 0.12);
    border: 1px solid rgba(220, 50, 70, 0.3);
    color: #ff7d8e;
}
.success {
    background: rgba(40, 200, 130, 0.12);
    border: 1px solid rgba(40, 200, 130, 0.3);
    color: #4ddb9d;
}

/* ===== 结果列表 ===== */
.result-list {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.result-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 14px 16px;
    transition: all 0.2s;
}
.result-item .row {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 14px;
    line-height: 1.5;
}
.result-item .row:last-child { margin-bottom: 0; }
.result-item .row .k {
    color: #8a93a6;
    min-width: 56px;
    flex-shrink: 0;
    font-size: 13px;
}
.result-item .row .v {
    color: #e8e8e8;
    word-break: break-all;
    flex: 1;
}
.result-item .phone {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 15px;
    color: #00d4ff;
    letter-spacing: 0.5px;
}
.empty {
    text-align: center;
    color: #6a7388;
    padding: 24px;
    font-size: 14px;
}

/* ===== 页脚 ===== */
.footer {
    text-align: center;
    color: #4a5266;
    font-size: 12px;
    margin-top: 24px;
    line-height: 1.8;
    padding: 0 16px;
}

/* ===== 后台表格 ===== */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -20px;
    padding: 0 20px;
}
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-top: 12px;
    min-width: 400px;
}
.table th, .table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    white-space: nowrap;
}
.table th {
    color: #8a93a6;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.02);
    position: sticky;
    top: 0;
}
.table td {
    color: #c8cdd8;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

/* ===== 统计卡片 ===== */
.stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
.stats .stat {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 14px 12px;
    text-align: center;
}
.stats .stat .n {
    font-size: 24px;
    font-weight: 600;
    color: #00d4ff;
}
.stats .stat .l {
    color: #8a93a6;
    font-size: 11px;
    margin-top: 2px;
}

/* ===== 平板/PC 适配 ===== */
@media (min-width: 600px) {
    body { font-size: 16px; }
    .topbar { padding: 18px 24px; }
    .topbar .logo { font-size: 17px; }
    .topbar .btn-link { font-size: 14px; }
    .wrap { padding: 36px 24px 48px; }
    .card { padding: 32px 32px; border-radius: 20px; }
    .card h1 { font-size: 24px; }
    .card .desc { font-size: 14px; margin-bottom: 28px; }
    .input { font-size: 20px; padding: 16px 18px; }
    .btn { font-size: 16px; }
    .stats { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
    .stats .stat { padding: 16px; }
    .stats .stat .n { font-size: 28px; }
}

@media (min-width: 900px) {
    .wrap { max-width: 720px; }
    .card { padding: 36px 40px; }
}

/* 安全区适配（iPhone 刘海） */
@supports (padding: max(0px)) {
    .topbar {
        padding-left: max(18px, env(safe-area-inset-left));
        padding-right: max(18px, env(safe-area-inset-right));
    }
    .wrap {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }
}

/* ===== 底部 Tab 浮动导航 ===== */
.tabbar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 50;
    display: flex;
    background: rgba(20, 22, 32, 0.88);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    padding: 6px;
    gap: 4px;
}
@supports (padding: max(0px)) {
    .tabbar {
        bottom: max(12px, env(safe-area-inset-bottom));
    }
}
.tabbar .tab {
    flex: 1;
    padding: 12px 8px;
    text-align: center;
    color: #8a93a6;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-height: 56px;
    justify-content: center;
    font-weight: 600;
}
.tabbar .tab:active {
    background: rgba(255, 255, 255, 0.05);
}
.tabbar .tab.active {
    background: rgba(0, 120, 255, 0.18);
    color: #fff;
}
.tabbar .tab .icon {
    font-size: 18px;
    line-height: 1;
}
.tabbar .tab .label {
    font-size: 14px;
    letter-spacing: 1px;
    margin-top: 2px;
}

/* 给底部 Tab 让出空间，避免遮挡最后内容 */
body {
    padding-bottom: 84px;
}

/* ===== 滚动框（结果区/表单区） ===== */
.scroll-box {
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 16px;
    padding-right: 4px;
}
.scroll-box::-webkit-scrollbar { width: 4px; }
.scroll-box::-webkit-scrollbar-track { background: transparent; }
.scroll-box::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}
.scroll-box.tall { max-height: 70vh; }