/* 全局重置：消除浏览器默认样式，小白不用改 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft Yahei", sans-serif;
}
body {
    background-color: #f5f5f5; /* 参考页浅灰背景，突出白色卡片 */
    padding: 15px;
}
a {
    text-decoration: none;
}

/* 头部样式：居中，和参考页一致 */
.page-header {
    text-align: center;
    padding: 20px 0;
}
.page-header h1 {
    font-size: 20px;
    color: #333;
    font-weight: 600;
}

/* 卡片列表：纵向排列，卡片间距12px */
.card-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 核心：测算卡片，复刻参考页样式（上图下文结构） */
.tool-card {
    background: #fff;
    border-radius: 12px; /* 参考页圆角设计 */
    padding: 0;
    display: flex;
    flex-direction: column; /* 上图下文 */
    box-shadow: 0 2px 8px rgba(0,0,0,0.05); /* 轻微阴影，和参考页一致 */
    cursor: pointer;
    transition: transform 0.2s;
}
/* 卡片点击反馈 */
.tool-card:active {
    background: #fafafa;
    transform: scale(0.98);
}

/* 卡片信息区域 */
.card-info {
    flex: 1;
}

/* 首页卡片大图（类似参考页横幅） */
.card-banner-wrap {
    position: relative;
    overflow: hidden;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.card-banner {
    width: 100%;
    height: auto;
    display: block;
}

/* 覆盖在图片右下角的“XXX人已测”气泡 */
.card-count-pill {
    position: absolute;
    right: 10px;
    bottom: 10px;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 11px;
}

.card-body {
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.card-text {
    flex: 1;
}
.count {
    font-size: 12px;
    color: #999; /* 浅灰色参与人数，和参考页一致 */
    margin-bottom: 4px;
}
.card-title {
    font-size: 16px;
    color: #333;
    font-weight: 600;
    margin-bottom: 6px;
}
.card-desc {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    /* 描述超出2行省略，避免卡片高度不一致 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 核心：立即测算按钮，复刻参考页红色按钮 */
.test-btn {
    width: 88px;
    height: 36px;
    line-height: 36px;
    text-align: center;
    background: #FF2D55; /* 参考页同款红色，视觉焦点 */
    color: #fff;
    font-size: 14px;
    border-radius: 18px; /* 圆形按钮，贴合移动端 */
    white-space: nowrap;
    display: block;
    transition: all 0.2s;
}
/* 按钮点击反馈，按压效果 */
.test-btn:active {
    background: #E62448;
    transform: scale(0.98);
}

/* 媒体查询：适配小屏手机（如苹果SE/安卓千元机） */
@media (max-width: 375px) {
    .tool-card {
        padding: 0;
    }
    .card-title {
        font-size: 15px;
    }
    .test-btn {
        width: 80px;
        height: 32px;
        line-height: 32px;
    }
}

/* 通用：输入页样式（后续子页面复用） */
.input-box {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.input-item {
    margin-bottom: 18px;
}
.input-item label {
    font-size: 14px;
    color: #333;
    display: block;
    margin-bottom: 8px;
}
.input-item input,
.input-item select {
    width: 100%;
    height: 44px; /* 移动端舒适点击高度 */
    padding: 0 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    font-size: 16px;
    background: #fff;
}
.input-item input:focus,
.input-item select:focus {
    outline: none;
    border-color: #FF2D55;
}
/* 提交按钮 */
.submit-btn {
    width: 100%;
    height: 48px;
    line-height: 48px;
    background: #FF2D55;
    color: #fff;
    border: none;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    animation: buttonPulse 2s ease-in-out infinite;
}
@keyframes buttonPulse {
    0%, 100% {
        transform: translateY(0) scale(1);
        box-shadow: 0 4px 12px rgba(255, 45, 85, 0.4);
    }
    50% {
        transform: translateY(-4px) scale(1.02);
        box-shadow: 0 8px 20px rgba(255, 45, 85, 0.6);
    }
}
    transition: all 0.2s;
}
.submit-btn:active {
    background: #E62448;
    transform: scale(0.98);
}
.submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 红包弹窗样式：复刻参考页，核心转化组件 */
.red-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7); /* 半透明遮罩 */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999; /* 弹窗置顶 */
    display: none; /* 默认隐藏 */
}
.red-content {
    width: 90%;
    max-width: 380px;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    animation: popupShow 0.3s ease-out;
}
@keyframes popupShow {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}
.red-top {
    background: #FF2D55;
    color: #fff;
    padding: 20px;
    text-align: center;
}
.red-top h2 {
    font-size: 18px;
    margin-bottom: 10px;
}
.red-top .amount {
    font-size: 24px;
    font-weight: 700;
    margin: 10px 0;
}
.red-top p {
    font-size: 14px;
    opacity: 0.9;
}
.red-bottom {
    padding: 20px;
    text-align: center;
}
.red-bottom .timer {
    color: #999;
    font-size: 14px;
    margin-bottom: 20px;
}
.red-btn {
    width: 100%;
    height: 48px;
    line-height: 48px;
    border-radius: 24px;
    font-size: 16px;
    border: none;
    cursor: pointer;
    margin-bottom: 10px;
    transition: all 0.2s;
}
.pay-btn {
    background: #FF2D55;
    color: #fff;
    font-weight: 600;
}
.pay-btn:active {
    background: #E62448;
    transform: scale(0.98);
}
.give-up-btn {
    background: #f5f5f5;
    color: #666;
}
.give-up-btn:active {
    background: #e5e5e5;
}

/* 点击震动效果 */
.mw-shake {
    animation: shake 0.5s infinite;
}
@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    50% { transform: translateX(0); }
    75% { transform: translateX(2px); }
    100% { transform: translateX(0); }
}

/* 结果展示样式，复刻参考页卡片式 */
.result-box {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.result-title {
    font-size: 16px;
    color: #333;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    margin-bottom: 15px;
}
.result-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
}
.result-item:last-child {
    border-bottom: none;
}
.item-label {
    color: #666;
    font-size: 14px;
}
.item-value {
    color: #333;
    font-size: 14px;
    font-weight: 500;
}
.free-tip {
    color: #FF2D55;
    font-size: 14px;
    text-align: center;
    padding: 10px;
    background: #fff3f5;
    border-radius: 8px;
    margin-bottom: 20px;
}
.result-content {
    color: #666;
    font-size: 14px;
    line-height: 1.8;
    margin-top: 10px;
}

/* 合规提示 */
.compliance-tip {
    font-size: 12px;
    color: #999;
    text-align: center;
    padding: 15px;
    line-height: 1.6;
}

/* 兼容性提示（微信/QQ 内置浏览器等） */
.compat-tip {
    font-size: 11px;
    color: #999;
    text-align: left;
    padding: 10px 12px;
    margin: 0 15px 12px;
    border-radius: 8px;
    background: #f9f9f9;
    line-height: 1.6;
}
