/* ========== 基础重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue",
                 "Microsoft YaHei", "Source Han Sans CN", sans-serif;
    font-size: 14px;
    color: #333;
    background-color: #ffe9d6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

input, button {
    font-family: inherit;
    outline: none;
    border: none;
    background: none;
}

button {
    cursor: pointer;
}

ol, ul {
    list-style: none;
}

/* ========== 页面容器 ========== */
.page {
    position: relative;
    width: 100%;
    max-width: 750px;
    min-height: 100vh;
    margin: 0 auto;
    background-color: #fff4ea;
    overflow: hidden;
    padding-bottom: 8px;
}

/* ========== 顶部标题栏 ========== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 46px;
    padding: 0 12px;
    background: #ffffff;
    border-bottom: 1px solid #f0f0f0;
}

.nav-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: background 0.15s ease;
}

.nav-back:active {
    background: #f2f2f2;
}

.nav-title {
    flex: 1;
    text-align: center;
    font-size: 17px;
    font-weight: 600;
    color: #222;
    letter-spacing: 0.5px;
}

.nav-placeholder {
    width: 32px;
    height: 32px;
}

/* ========== 顶部背景图 ========== */
.header-bg {
    position: absolute;
    top: 46px;
    left: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    background-image: url("../images/chaxunbeijintupian.png");
    background-repeat: no-repeat;
    background-position: top center;
    background-size: 100% auto;
    z-index: 0;
    pointer-events: none;
}

/* ========== 主体内容 ========== */
.main-content {
    position: relative;
    z-index: 1;
    padding: 0 16px;
    padding-top: 190px;
}

/* ========== 卡片通用样式 ========== */
.card {
    background: #ffffff;
    border-radius: 16px;
    padding: 22px 18px;
    margin-bottom: 14px;
    box-shadow: 0 6px 20px rgba(255, 120, 60, 0.08);
}

/* ========== 查询卡片 ========== */
.query-card .card-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 8px;
}

.card-title-img {
    height: 38px;
    width: auto;
    display: block;
}

/* 输入框 */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    height: 48px;
    background: #f7f8fa;
    border-radius: 24px;
    padding: 0 16px;
    margin-bottom: 14px;
}

.input-icon {
    display: flex;
    align-items: center;
    margin-right: 8px;
}

.id-input {
    flex: 1;
    height: 100%;
    font-size: 15px;
    color: #333;
    background: transparent;
    border: none;
    width: 100%;
}

.id-input::placeholder {
    color: #bcbcbc;
}

/* 查询按钮 */
.query-btn {
    display: block;
    width: 100%;
    height: 46px;
    line-height: 46px;
    text-align: center;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    border-radius: 24px;
    background: linear-gradient(90deg, #ff7a47 0%, #ff5a3c 100%);
    box-shadow: 0 6px 14px rgba(255, 110, 70, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.query-btn:active {
    transform: scale(0.98);
    box-shadow: 0 3px 8px rgba(255, 110, 70, 0.3);
}

.query-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 提示文字图片 */
.notice {
    display: flex;
    justify-content: center;
    margin-top: 14px;
}

.notice-img {
    height: 16px;
    width: auto;
    display: block;
}

/* ========== 查询结果卡片 ========== */
.result-title {
    font-size: 17px;
    font-weight: 600;
    color: #333;
    margin-bottom: 14px;
}

/* 空状态 */
.result-empty {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 18px 0 14px;
}

.empty-img {
    width: 80%;
    max-width: 320px;
    height: auto;
    display: block;
}

/* 未中奖状态 */
.result-none {
    text-align: center;
    padding: 28px 0;
}

.result-none-icon {
    margin-bottom: 14px;
}

.result-none-title {
    font-size: 16px;
    color: #333;
    font-weight: 600;
    margin-bottom: 6px;
}

.result-none-tip {
    font-size: 13px;
    color: #999;
}

/* 中奖列表 */
.result-list {
    padding: 4px 0;
}

.prize-item {
    position: relative;
    background: linear-gradient(135deg, #fff5ec 0%, #ffe4d0 100%);
    border-radius: 12px;
    padding: 16px 14px;
    margin-bottom: 12px;
    overflow: hidden;
    border: 1px solid #ffd9bf;
}

.prize-item:last-child {
    margin-bottom: 0;
}

.prize-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.prize-name {
    font-size: 16px;
    font-weight: 600;
    color: #ff5a3c;
}

.prize-status {
    font-size: 12px;
    color: #ffffff;
    background: linear-gradient(90deg, #ff7a47 0%, #ff5a3c 100%);
    padding: 3px 10px;
    border-radius: 10px;
}

.prize-info {
    font-size: 13px;
    color: #666;
    line-height: 1.7;
}

.prize-info span {
    color: #333;
    font-weight: 500;
}

/* ========== 违规名单提醒 ========== */
.result-violation {
    margin-bottom: 14px;
}

.violation-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: linear-gradient(135deg, #fff3f0 0%, #ffe1d8 100%);
    border: 1px solid #ffc9bd;
    border-radius: 12px;
}

.violation-banner-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}

.violation-banner-text {
    flex: 1;
    min-width: 0;
}

.violation-banner-title {
    font-size: 14px;
    font-weight: 600;
    color: #c62828;
    line-height: 1.4;
    margin-bottom: 2px;
}

.violation-banner-tip {
    font-size: 12px;
    color: #b14a3a;
    line-height: 1.5;
}

.violation-records {
    margin-top: 10px;
}

.violation-record-item {
    background: #fff8f6;
    border: 1px solid #ffd9cf;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 8px;
}

.violation-record-item:last-child {
    margin-bottom: 0;
}

.violation-record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.violation-record-tag {
    display: inline-block;
    font-size: 12px;
    color: #ffffff;
    background: linear-gradient(90deg, #ff6a5a 0%, #e64545 100%);
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: 500;
}

.violation-record-time {
    font-size: 12px;
    color: #999;
}

.violation-record-info {
    font-size: 13px;
    color: #666;
    line-height: 1.7;
}

.violation-record-info span {
    color: #333;
    font-weight: 500;
}

/* ========== 温馨提示 ========== */
.tips {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    padding: 14px 16px;
    margin-top: 4px;
}

.tips-title {
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.tips-icon {
    margin-right: 6px;
    font-size: 15px;
}

.tips-list {
    counter-reset: tip;
    padding-left: 0;
}

.tips-list li {
    position: relative;
    padding-left: 18px;
    font-size: 13px;
    color: #888;
    line-height: 1.9;
    counter-increment: tip;
}

.tips-list li::before {
    content: counter(tip) ".";
    position: absolute;
    left: 0;
    color: #888;
}

.tech-support {
    text-align: center;
    font-size: 12px;
    color: #999;
    padding: 14px 0 4px;
}

/* ========== Toast ========== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.75);
    color: #ffffff;
    font-size: 14px;
    padding: 10px 18px;
    border-radius: 8px;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    max-width: 80%;
    text-align: center;
}

.toast.show {
    opacity: 1;
}

[hidden] {
    display: none !important;
}

/* ========== 图形验证码弹窗 ========== */
.captcha-modal {
    position: fixed;
    inset: 0;
    z-index: 9997;
    display: flex;
    align-items: center;
    justify-content: center;
}

.captcha-mask {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    animation: fadeIn 0.18s ease;
}

.captcha-box {
    position: relative;
    width: calc(100% - 48px);
    max-width: 340px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(255, 120, 60, 0.18);
    overflow: hidden;
    animation: popIn 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.captcha-box.is-shake {
    animation: shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.captcha-header {
    position: relative;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #f3f3f5;
}

.captcha-title {
    font-size: 16px;
    font-weight: 600;
    color: #222;
}

.captcha-close {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.captcha-close:active {
    background: #f5f5f5;
}

.captcha-body {
    padding: 18px 20px 4px;
}

.captcha-tip {
    font-size: 13px;
    color: #888;
    margin-bottom: 14px;
    line-height: 1.5;
    text-align: center;
}

.captcha-row {
    display: flex;
    align-items: stretch;
    gap: 12px;
}

.captcha-input {
    flex: 1;
    min-width: 0;
    height: 44px;
    padding: 0 14px;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 4px;
    color: #222;
    background: #fff8f4;
    border: 1.5px solid #ffd9bf;
    border-radius: 10px;
    text-align: center;
    text-transform: uppercase;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.captcha-input::placeholder {
    color: #c9c9d1;
    font-weight: 400;
    letter-spacing: 1px;
    font-size: 14px;
}

.captcha-input:focus {
    border-color: #ff7a47;
    background: #fff;
}

.captcha-canvas {
    flex-shrink: 0;
    width: 120px;
    height: 44px;
    border-radius: 8px;
    background: #fff5ec;
    cursor: pointer;
    user-select: none;
    -webkit-user-drag: none;
}

.captcha-canvas:active {
    opacity: 0.85;
}

.captcha-hint {
    margin-top: 10px;
    font-size: 12px;
    color: #b0b0b0;
    text-align: center;
}

.captcha-hint a {
    color: #ff7a47;
    text-decoration: none;
}

.captcha-actions {
    display: flex;
    border-top: 1px solid #f3f3f5;
    margin-top: 14px;
}

.captcha-btn {
    flex: 1;
    height: 48px;
    font-size: 16px;
    transition: background 0.15s ease, color 0.15s ease;
}

.captcha-cancel {
    color: #777;
    border-right: 1px solid #f3f3f5;
}

.captcha-cancel:active {
    background: #f7f7f8;
}

.captcha-confirm {
    color: #ff5a3c;
    font-weight: 600;
}

.captcha-confirm:active {
    background: #fff5ec;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes popIn {
    0%   { opacity: 0; transform: scale(0.85); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes shake {
    10%, 90%  { transform: translate3d(-1px, 0, 0); }
    20%, 80%  { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
    40%, 60%  { transform: translate3d(6px, 0, 0); }
}

/* ========== Loading 遮罩 ========== */
.loading-mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 9998;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading-box {
    background: rgba(0, 0, 0, 0.75);
    color: #ffffff;
    padding: 20px 24px;
    border-radius: 10px;
    text-align: center;
    min-width: 110px;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    margin: 0 auto 10px;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    font-size: 13px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 页面进入/刷新加载遮罩淡出 */
.page-loading-mask {
    transition: opacity 0.35s ease;
}

.page-loading-mask.is-hidden {
    opacity: 0;
    pointer-events: none;
}

body.is-loading {
    overflow: hidden;
}

/* ========== 响应式调整 ========== */
@media (max-width: 360px) {
    .main-content {
        padding-top: 160px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .card {
        padding: 18px 14px;
    }

    .card-title-img {
        height: 36px;
    }

    .id-input {
        font-size: 14px;
    }

    .query-btn {
        font-size: 15px;
        height: 44px;
        line-height: 44px;
    }
}

@media (min-width: 500px) {
    .main-content {
        padding-top: 240px;
    }
}

@media (min-width: 750px) {
    .page {
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.08);
    }

    .main-content {
        padding-top: 320px;
        padding-left: 24px;
        padding-right: 24px;
    }

    .card {
        padding: 26px 22px;
    }

    .card-title-img {
        height: 38px;
    }

    .id-input {
        font-size: 16px;
    }

    .query-btn {
        height: 50px;
        line-height: 50px;
        font-size: 17px;
    }
}
