/* =====================================================================
   微信H5营销落地页 移动端样式
   适配：微信内置浏览器(X5) / iOS Safari / Android Chrome
   ===================================================================== */

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

html, body {
    width: 100%;
    background: #f5f5f5;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
                 "Helvetica Neue", "Microsoft YaHei", sans-serif;
    color: #333;
    -webkit-text-size-adjust: 100%;
}

ul, li { list-style: none; }
button { border: none; outline: none; font-family: inherit; cursor: pointer; }
input { outline: none; font-family: inherit; }

/* ================= 顶部固定栏：弹幕 + 音乐 ================= */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 38px;
    z-index: 50;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, .55);
}

/* 左上角横向滚动弹幕 */
.dm-box {
    flex: 1;
    min-width: 0;
    height: 100%;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding-left: 10px;
}

.dm-horn {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    fill: #ffd98a;
    margin-right: 6px;
}

.dm-viewport {
    position: relative;
    flex: 1;
    min-width: 0;
    height: 100%;
    overflow: hidden;
}

.dm-track {
    position: absolute;
    left: 0;
    top: 0;
    white-space: nowrap;
    font-size: 13px;
    line-height: 38px;
    color: #ffe7b0;
    /* 默认不使用动画，由 JS 动态开启 */
    will-change: transform;
}

/* 弹幕横向滚动：从右侧外滚入，滚到左侧外 */
.dm-track.dm-run {
    animation-name: dmScroll;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

@keyframes dmScroll {
    from { transform: translateX(100%); }
    to   { transform: translateX(-100%); }
}

/* 右上角音乐按钮 */
.music-btn {
    position: relative;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 6px;
}

.music-btn .icon-note { width: 20px; height: 20px; fill: #fff; }
.music-btn.is-playing .icon-note { display: none; }

/* 播放中的跳动音柱 */
.music-bars {
    display: none;
    align-items: flex-end;
    justify-content: center;
    width: 20px;
    height: 18px;
}
.music-btn.is-playing .music-bars { display: flex; }

.music-bars span {
    width: 3px;
    margin: 0 1px;
    background: #ffd98a;
    border-radius: 2px;
    animation: musicBar .8s ease-in-out infinite alternate;
}
.music-bars span:nth-child(1) { height: 60%; animation-delay: 0s; }
.music-bars span:nth-child(2) { height: 100%; animation-delay: .2s; }
.music-bars span:nth-child(3) { height: 40%; animation-delay: .4s; }

@keyframes musicBar {
    from { transform: scaleY(.3); }
    to   { transform: scaleY(1); }
}

/* ================= 页面主体图片区 ================= */
.page-main {
    padding-top: 38px; /* 避开顶部固定栏 */
}

.page-main img {
    display: block;
    width: 100%;
    height: auto;
}

.page-empty {
    padding: 120px 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* ================= 底部固定按钮区 ================= */
.bottom-space {
    height: 104px;
}

.bottom-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    padding: 8px 16px calc(8px + constant(safe-area-inset-bottom));
    padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
    background: #fff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, .06);
}

.cta-btn {
    width: 100%;
    height: 46px;
    border-radius: 999px;
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 2px;
    background: linear-gradient(90deg, #ff5a3c 0%, #ff2424 100%);
    box-shadow: 0 4px 10px rgba(255, 60, 50, .35);
}
.cta-btn:active { opacity: .85; }

.privacy {
    margin-top: 6px;
    text-align: center;
    font-size: 11px;
    color: #999;
    line-height: 1.5;
}

/* 订单查询悬浮入口（底部按钮右上方） */
.query-entry {
    position: fixed;
    right: 12px;
    bottom: 112px;
    z-index: 39;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-size: 12px;
    text-decoration: none;
}
.query-entry:active { opacity: .8; }

/* ================= 弹窗（底部滑出式） ================= */
.modal-mask {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, .55);
    display: none;
    align-items: flex-end;
}
.modal-mask.show { display: flex; }

.modal-sheet {
    position: relative;
    width: 100%;
    background: #fff;
    border-radius: 16px 16px 0 0;
    padding: 22px 18px calc(22px + constant(safe-area-inset-bottom));
    padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
    animation: sheetUp .25s ease;
}

@keyframes sheetUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 30px;
    height: 30px;
    background: transparent;
    font-size: 22px;
    color: #999;
    line-height: 30px;
}

.modal-title {
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 18px;
    color: #222;
}

/* 表单 */
.form-item { margin-bottom: 14px; }

.form-item input {
    width: 100%;
    height: 46px;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 0 12px;
    font-size: 15px;
    color: #333;
    background: #fafafa;
}
.form-item input:focus { border-color: #ff5a3c; background: #fff; }
.form-item input.input-err { border-color: #ff2424; }

/* 省市区三级联动下拉 */
.addr-row { display: flex; gap: 8px; }

.addr-row select {
    flex: 1;
    min-width: 0;
    height: 46px;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 0 4px;
    font-size: 14px;
    color: #333;
    background: #fafafa;
}
.addr-row select:focus { border-color: #ff5a3c; background: #fff; }

/* 复制快递单号按钮 */
.copy-btn {
    display: inline-block;
    padding: 4px 12px;
    margin-left: 8px;
    border: none;
    border-radius: 999px;
    background: #ff5a3c;
    color: #fff;
    font-size: 12px;
}
.copy-btn:active { opacity: .85; }
.exp-no { word-break: break-all; }

.form-err {
    display: none;
    margin-top: 5px;
    font-size: 12px;
    color: #ff2424;
}
.form-err.show { display: block; }

.submit-btn {
    width: 100%;
    height: 46px;
    margin-top: 6px;
    border-radius: 10px;
    color: #fff;
    font-size: 17px;
    font-weight: bold;
    background: linear-gradient(90deg, #ff5a3c 0%, #ff2424 100%);
}
.submit-btn:active { opacity: .85; }
.submit-btn:disabled { opacity: .6; }

/* 订单查询结果 */
.query-result {
    margin-top: 6px;
    max-height: 46vh;
    overflow-y: auto;
}

.order-card {
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
}

.order-line {
    font-size: 13px;
    color: #555;
    line-height: 1.7;
    word-break: break-all;
}

.order-line .label { color: #999; }

.order-status {
    float: right;
    font-size: 13px;
    font-weight: bold;
}
.order-status.pending { color: #ff8f1f; }
.order-status.shipped { color: #19b557; }

.order-time {
    margin-top: 6px;
    font-size: 12px;
    color: #aaa;
}

.query-empty {
    padding: 30px 0;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* ================= Toast 轻提示 ================= */
.toast {
    position: fixed;
    top: 42%;
    left: 50%;
    z-index: 200;
    max-width: 76%;
    padding: 12px 20px;
    border-radius: 10px;
    background: rgba(0, 0, 0, .82);
    color: #fff;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -50%);
    transition: opacity .2s;
    pointer-events: none;
}
.toast.show { opacity: 1; visibility: visible; }
