/* 锁定html和body高度，防止安卓键盘弹起时改变布局 */
html {
    height: 100%;
    overflow: hidden;
}
* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

img {
    max-width: 100%;
}

a {
    text-decoration: none;
    color: inherit;
}

body {
    position: relative;
    height: 100%;
    background: #fff;
    max-width: 750px;
    margin: 0px auto;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

body::before {
    content: '';
    display: block;
    height: 100vh;
    width: 1px;
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

/* 提示信息容器 - 中心弹窗样式 */
#alert {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 280px;
    max-width: 80%;
    padding: 20px 30px;
    border-radius: 12px;
    font-size: 15px;
    text-align: center;
    font-weight: 500;
    z-index: 9999;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    animation: popIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.alert-success {
    background-color: #fff !important;
    color: #4caf50 !important;
    border: 3px solid #4caf50 !important;
    display: block !important;
}

.alert-success::before {
    content: "✓";
    display: block;
    width: 50px;
    height: 50px;
    line-height: 50px;
    margin: 0 auto 15px;
    background-color: #4caf50;
    color: #fff;
    border-radius: 50%;
    font-size: 28px;
    font-weight: bold;
}

.alert-error {
    background-color: #fff !important;
    color: #f44336 !important;
    border: 3px solid #f44336 !important;
    display: block !important;
}

.alert-error::before {
    content: "✕";
    display: block;
    width: 50px;
    height: 50px;
    line-height: 50px;
    margin: 0 auto 15px;
    background-color: #f44336;
    color: #fff;
    border-radius: 50%;
    font-size: 28px;
    font-weight: bold;
}

.alert-info {
    background-color: #fff !important;
    color: #2196f3 !important;
    border: 3px solid #2196f3 !important;
    display: block !important;
}

.alert-info::before {
    content: "ℹ";
    display: block;
    width: 50px;
    height: 50px;
    line-height: 50px;
    margin: 0 auto 15px;
    background-color: #2196f3;
    color: #fff;
    border-radius: 50%;
    font-size: 28px;
    font-weight: bold;
}

#alert-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9998;
}

#alert-overlay.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

#alert-overlay.fade-out {
    animation: fadeOut 0.3s ease forwards !important;
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

.search-input {
    width: 100%;
    height: 45px;
    background-color: #eef5ff;
    border-radius: 20px;
    font-size: 15px;
    border: 1px solid #fff;
    padding: 0 10px;
    box-sizing: border-box;
}

.search-btn {
    display: block;
    width: 100%;
    height: 45px;
    background-color: #3a65ff;
    border-radius: 20px;
    margin-top: 20px;
    font-size: 18px;
    color: #fff;
    border: 0;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.search-btn:hover:not(:disabled) {
    background-color: #2d52cc;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(58, 101, 255, 0.3);
}

.search-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(58, 101, 255, 0.3);
}

.search-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

form {
    padding: 0px 10%;
    border: none;
    margin: 0;
}

input {
    border: none;
}

input[type=tel]:focus,
input[type=text]:focus {
    outline: none;
}

.search-input {
    position: relative;
    margin-bottom: 10px;
}

.search-input input {
    padding-left: 40px;
    width: 100%;
    height: 100%;
    background-color: #eef5ff;
    border-radius: 20px;
    padding: 0 10px 0 40px;
    font-size: 15px;
}

.search-input input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.search-input input::placeholder {
    color: #999;
}

.search-input::before {
    content: "";
    background-size: 20px 20px;
    background-repeat: no-repeat;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 10px;
    width: 20px;
    height: 20px;
}

.search-input.mobile::before {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%233a65ff"><path d="M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4v-6h16v6zm0-10H4V6h16v2z"/></svg>');
}

.search-input.phone::before {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%233a65ff"><path d="M17 1.01L7 1c-1.1 0-2 .9-2 2v18c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V3c0-1.1-.9-1.99-2-1.99zM17 19H7V5h10v14z"/></svg>');
}

.loading {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.search-wrapper {
    flex: 0 0 auto;
}

.logo {
    padding: 0 0 20px;
    text-align: center;
}

.card-input {
    position: relative;
}

.phone-input {
    position: relative;
    margin-top: 15px;
}

.input-tips {
    display: none;
    position: absolute;
    left: 0;
    top: -60px;
    padding: 10px 16px;
    background-color: #3a65ff;
    color: #fff;
    border-radius: 10px;
    font-size: 13px;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(58, 101, 255, 0.3);
    animation: fadeInDown 0.4s ease-out;
    z-index: 10;
    cursor: pointer;
    transition: all 0.2s ease;
    max-width: calc(100vw - 60px);
}

.input-tips:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(58, 101, 255, 0.4);
}

.input-tips.show {
    display: block;
}

.input-tips .tips-text {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.input-tips::before {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 45px;
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 12px solid #3a65ff;
}

@keyframes fadeInDown {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.steps-guide {
    position: absolute;
    top: 85%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 750px;
    padding: 20px;
    border: 3px solid #3a65ff;
    border-radius: 20px;
    background-color: #fff;
    box-shadow: 0 4px 20px rgba(58, 101, 255, 0.15);
}

.steps-guide .step-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    font-size: 16px;
    color: #333;
    line-height: 1.6;
}

.steps-guide .step-item:last-child {
    margin-bottom: 0;
}

.steps-guide .step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    width: 24px;
    height: 24px;
    background-color: #3a65ff;
    color: #fff;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
    margin-right: 12px;
}

.steps-guide .step-text {
    flex: 1;
    word-break: break-all;
    word-wrap: break-word;
    font-weight: 500;
}

@media (max-width: 480px) {
    .steps-guide {
        width: 84%;
        padding: 15px;
        top: 83%;
        border-width: 4px;
    }
    .steps-guide .step-item {
        font-size: 15px;
        margin-bottom: 12px;
    }
    .steps-guide .step-number {
        min-width: 22px;
        width: 22px;
        height: 22px;
        font-size: 13px;
        margin-right: 10px;
    }
    .input-tips {
        font-size: 12px;
        padding: 8px 12px;
        top: -55px;
        max-width: calc(100vw - 50px);
    }
    .input-tips::before {
        left: 40px;
    }
}

@media (max-width: 375px) {
    .steps-guide {
        width: 86%;
        padding: 12px;
        top: 81%;
        border-width: 3px;
    }
    .steps-guide .step-item {
        font-size: 14px;
        margin-bottom: 10px;
    }
    .steps-guide .step-number {
        min-width: 20px;
        width: 20px;
        height: 20px;
        font-size: 12px;
    }
    .input-tips {
        font-size: 11px;
        padding: 7px 10px;
        top: -52px;
        max-width: calc(100vw - 40px);
    }
    .input-tips::before {
        left: 35px;
    }
}

@media (max-width: 320px) {
    .steps-guide {
        width: 88%;
        padding: 10px;
        top: 79%;
        border-width: 3px;
    }
    .steps-guide .step-item {
        font-size: 13px;
        margin-bottom: 8px;
    }
    .steps-guide .step-number {
        min-width: 18px;
        width: 18px;
        height: 18px;
        font-size: 11px;
        margin-right: 8px;
    }
    .input-tips {
        font-size: 10px;
        padding: 6px 8px;
        top: -48px;
        max-width: calc(100vw - 30px);
    }
    .input-tips::before {
        left: 30px;
    }
}
