/* ============================================================
   恋爱大挑战 · 72小时假装情侣 —— 粉色恋爱 UI（iOS 风格）
   ============================================================ */

:root {
    --primary:      #ff4d94;              /* 主色：恋爱粉 */
    --primary-deep: #ff2e7e;
    --primary-light:#ffa3c8;
    --pink-bg:      #fff0f6;              /* 页面底色 */
    --card:         #ffffff;
    --text:         #3a2430;              /* 主文字 */
    --text-sub:     #9a7b8a;              /* 次要文字 */
    --wx:           #07c160;              /* 微信绿 */
    --grad:         linear-gradient(135deg, #ff7eb3 0%, #ff4d94 100%);
    --radius:       16px;
    --shadow:       0 6px 20px rgba(255, 77, 148, .12);
}

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

html, body { height: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
    background: #f4e9ee;
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--pink-bg);
    position: relative;
    box-shadow: 0 0 40px rgba(0, 0, 0, .06);
}

/* ==================== 登录页 ==================== */
.login-page {
    min-height: 100vh;
    background: linear-gradient(160deg, #ffd6e6 0%, #ff8fb8 55%, #ff4d94 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 30px calc(40px + env(safe-area-inset-bottom));
    text-align: center;
    color: #fff;
}

.login-heart {
    width: 96px; height: 96px;
    background: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 10px 30px rgba(255, 255, 255, .45);
    animation: heartbeat 2s ease-in-out infinite;
    margin-bottom: 22px;
}

.login-title { font-size: 30px; font-weight: 700; letter-spacing: 4px; text-shadow: 0 2px 12px rgba(255, 255, 255, .35); }
.login-slogan { font-size: 15px; opacity: .95; margin: 10px 0 42px; letter-spacing: 1px; }

.wx-login-btn {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; max-width: 320px; height: 52px;
    background: #fff; color: var(--wx);
    border-radius: 26px; text-decoration: none;
    font-size: 17px; font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
    transition: transform .15s ease;
}
.wx-login-btn:active { transform: scale(.97); }

.login-tip { font-size: 12px; margin-top: 18px; opacity: .95; }
.login-tip .link { color: #fff; text-decoration: underline; }

.demo-login {
    margin-top: 14px; font-size: 12px; color: rgba(255, 255, 255, .8);
    text-decoration: underline; letter-spacing: .5px;
}

/* ==================== 通用卡片 / 按钮 / 输入框 ==================== */
.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 14px;
}

.card-title { font-size: 16px; font-weight: 600; margin-bottom: 12px; }

.btn-primary {
    display: block; width: 100%;
    height: 46px; border: none; border-radius: 23px;
    background: var(--grad); color: #fff;
    font-size: 16px; font-weight: 600; letter-spacing: 1px;
    box-shadow: 0 6px 16px rgba(255, 77, 148, .35);
    cursor: pointer;
    transition: transform .15s ease, opacity .2s;
}
.btn-primary:active { transform: scale(.97); }
.btn-primary:disabled { opacity: .6; }

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

.btn-ghost {
    background: #fff; color: var(--primary);
    border: 1.5px solid var(--primary);
    box-shadow: none;
}

.btn-block { width: 100%; margin-top: 12px; }

.inp {
    flex: 1; min-width: 0; height: 40px;
    border: 1px solid #f0dbe6; border-radius: 10px;
    background: #fdf7fa; padding: 0 12px;
    font-size: 15px; color: var(--text);
    outline: none;
}
.inp:focus { border-color: var(--primary); background: #fff; }

.link { color: var(--primary); text-decoration: underline; }

/* ==================== 页面切换动画 ==================== */
.pages { min-height: 100vh; }

.page { display: none; padding: 16px 16px calc(86px + env(safe-area-inset-bottom)); }
.page.active { display: block; animation: pageIn .28s ease; }

@keyframes pageIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

/* ==================== 首页 ==================== */
.home-hero { text-align: center; padding: 26px 0 18px; }
.hero-heart { margin-bottom: 10px; }
.home-title { font-size: 26px; font-weight: 700; letter-spacing: 3px; }
.home-subtitle { font-size: 15px; color: var(--text-sub); margin-top: 6px; letter-spacing: 2px; }

.rules-card .card-title { text-align: center; font-size: 17px; }

.rules { list-style: none; padding: 0 4px; }
.rules li {
    position: relative; padding: 9px 0 9px 18px;
    font-size: 14px; color: #5d4553; border-bottom: 0.5px dashed #f5e3ec;
}
.rules li:last-child { border-bottom: none; }
.rules li::before {
    content: ""; position: absolute; left: 0; top: 16px;
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--primary);
}

.notice-box {
    background: #fff3f8; border-radius: 12px;
    padding: 12px 14px; margin: 14px 0 18px;
    font-size: 13px; color: #8a5f73;
}
.notice-warn { color: #e04a6f; font-weight: 600; margin-top: 4px; }

.home-footer { text-align: center; font-size: 12px; color: var(--text-sub); margin-top: 22px; letter-spacing: 1px; }

/* ==================== 匹配页 ==================== */
.marquee {
    overflow: hidden; height: 36px;
    background: var(--grad); border-radius: 12px;
    color: #fff; font-size: 13px;
    box-shadow: var(--shadow);
}
.marquee-track { display: flex; flex-direction: column; animation: marqueeUp 20s linear infinite; }
.marquee-track .item {
    height: 36px; line-height: 36px; padding: 0 14px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.marquee-track .dot { margin-right: 8px; }

@keyframes marqueeUp {
    0%   { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}

.match-hero { text-align: center; padding: 20px 0 4px; }
.match-hero h2 { font-size: 21px; font-weight: 700; letter-spacing: 1px; }
.match-hero p { font-size: 12px; color: var(--text-sub); margin-top: 4px; }

.gender-row { display: flex; gap: 12px; }
.gender-card {
    flex: 1; text-align: center; padding: 18px 10px;
    border: 2px solid #f2dce8; border-radius: 14px;
    background: #fff; cursor: pointer;
    transition: all .2s ease;
}
.gender-card.selected { border-color: var(--primary); background: #fff5fa; box-shadow: 0 4px 14px rgba(255, 77, 148, .15); }
.gc-name { font-size: 15px; font-weight: 600; margin-top: 8px; }
.gc-price { font-size: 16px; color: var(--primary); font-weight: 700; margin-top: 4px; }

.filter-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.filter-row label { flex: none; width: 46px; font-size: 14px; color: var(--text-sub); }
.filter-row .sep { color: var(--text-sub); }
.filter-row .unit { flex: none; font-size: 13px; color: var(--text-sub); }

.switch-row { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-top: 4px; cursor: pointer; }
.switch-row input, .agree-row input { display: none; }
.switch-box {
    width: 18px; height: 18px; border-radius: 5px;
    border: 2px solid #e8c8d8; background: #fff;
    position: relative; flex: none;
}
.switch-row input:checked + .switch-box,
.agree-row input:checked + .switch-box {
    background: var(--primary); border-color: var(--primary);
}
.switch-row input:checked + .switch-box::after,
.agree-row input:checked + .switch-box::after {
    content: ""; position: absolute; left: 5px; top: 1px;
    width: 5px; height: 10px;
    border: solid #fff; border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.pay-card {
    background: var(--grad); border-radius: var(--radius);
    padding: 18px 16px; color: #fff;
    box-shadow: 0 8px 24px rgba(255, 77, 148, .3);
}
.refund-note { text-align: center; font-size: 13px; opacity: .95; margin-bottom: 14px; }
.pay-card .btn-primary {
    background: #fff; color: var(--primary); box-shadow: 0 6px 16px rgba(0, 0, 0, .15);
}
.agree-row { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-top: 12px; justify-content: center; }
.agree-row .link { color: #fff; text-decoration: underline; }

/* ==================== 情侣页 ==================== */
.cp-empty, .cp-matching, .cp-matched { text-align: center; padding-top: 34px; }
.cp-empty h3 { font-size: 20px; margin-top: 14px; }
.cp-empty p { color: var(--text-sub); font-size: 14px; margin: 8px 0 26px; }
.cp-empty-heart { animation: heartbeat 2s ease-in-out infinite; }

.cp-matching h3 { font-size: 20px; }
.cp-sub { color: var(--text-sub); font-size: 14px; margin: 8px 0 18px; }
.big-heart { font-size: 44px; animation: heartbeat 1.6s ease-in-out infinite; margin: 10px 0 22px; }

.countdown-card {
    background: var(--card); border-radius: var(--radius);
    padding: 20px 16px; box-shadow: var(--shadow);
}
.cd-label { font-size: 13px; color: var(--text-sub); }
.cd-time {
    font-size: 34px; font-weight: 700; letter-spacing: 2px;
    color: var(--primary); font-variant-numeric: tabular-nums;
    margin: 8px 0 16px;
}
.btn-speed {
    width: 100%; height: 46px; border: none; border-radius: 23px;
    background: var(--grad); color: #fff; font-size: 16px; font-weight: 600;
    box-shadow: 0 6px 16px rgba(255, 77, 148, .35); cursor: pointer;
}
.btn-speed:active { transform: scale(.97); }
.btn-speed:disabled { opacity: .6; }

.cp-pair { display: flex; align-items: center; justify-content: center; gap: 20px; margin: 14px 0 6px; }
.cp-avatar {
    width: 84px; height: 84px; border-radius: 50%;
    border: 3px solid #fff; box-shadow: 0 4px 16px rgba(255, 77, 148, .3);
    overflow: hidden; background: #ffe3ee;
}
.cp-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pair-heart { animation: heartbeat 1.6s ease-in-out infinite; }

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    12%      { transform: scale(1.16); }
    24%      { transform: scale(1); }
    36%      { transform: scale(1.16); }
    55%      { transform: scale(1); }
}

.cp-info {
    display: inline-block; margin-top: 14px;
    background: #fff; border-radius: 20px; padding: 8px 18px;
    font-size: 14px; color: #6d4a5c; box-shadow: var(--shadow);
}
.rel-countdown { font-size: 13px; color: var(--text-sub); margin-top: 10px; }
.rel-countdown span { color: var(--primary); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---- 虚拟聊天框 ---- */
.chat-box { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-top: 16px; text-align: left; }
.chat-header { background: var(--grad); color: #fff; text-align: center; padding: 10px; font-size: 14px; font-weight: 600; }
.chat-body { height: 250px; overflow-y: auto; padding: 12px; background: #faf1f6; }
.chat-tip { text-align: center; color: #c3a4b4; font-size: 12px; padding: 8px 0 12px; }

.msg { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 10px; }
.msg .avatar { width: 30px; height: 30px; border-radius: 50%; background: #ffe3ee; flex: none; object-fit: cover; }
.msg .bubble { max-width: 72%; padding: 8px 12px; border-radius: 14px; font-size: 14px; line-height: 1.45; word-break: break-all; }
.msg.mine { flex-direction: row-reverse; }
.msg.mine .bubble { background: var(--grad); color: #fff; border-bottom-right-radius: 4px; }
.msg.cp .bubble { background: #fff; border: 0.5px solid rgba(0, 0, 0, .05); border-bottom-left-radius: 4px; }

.chat-actions { display: flex; gap: 8px; padding: 10px 12px; }
.chat-btn {
    flex: 1; height: 40px; border: none; border-radius: 20px;
    background: var(--grad); color: #fff; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: transform .15s;
}
.chat-btn:active { transform: scale(.95); }
.chat-btn:disabled { opacity: .45; }
.chat-time-hint { text-align: center; color: var(--text-sub); font-size: 11px; padding: 0 12px 12px; }

/* ==================== 我的页 ==================== */
.mine-header { text-align: center; padding: 30px 0 18px; }
.mine-avatar {
    width: 84px; height: 84px; border-radius: 50%;
    border: 3px solid #fff; box-shadow: 0 4px 16px rgba(255, 77, 148, .3);
    object-fit: cover; background: #ffe3ee;
}
.mine-nick { font-size: 19px; font-weight: 700; margin-top: 12px; }
.mine-wxid { font-size: 13px; color: var(--text-sub); margin-top: 4px; }

.mine-menu { padding: 4px 16px; }
.menu-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 15px 2px; font-size: 15px; text-decoration: none; color: var(--text);
    border-bottom: 0.5px solid #f5e3ec; cursor: pointer;
}
.menu-item:last-child { border-bottom: none; }
.menu-item .arrow { color: #d4b8c6; font-size: 18px; font-style: normal; }

.btn-logout {
    display: block; width: 100%; height: 48px;
    border: 1.5px solid #f0b8c9; border-radius: 24px;
    background: #fff; color: #e04a6f;
    font-size: 16px; font-weight: 600; cursor: pointer;
    margin-top: 8px;
}
.btn-logout:active { background: #fff0f5; }

/* ==================== 子页面（覆盖层） ==================== */
.view {
    position: fixed; top: 0; bottom: 0; left: 50%;
    transform: translateX(-50%);
    width: 100%; max-width: 480px;
    background: var(--pink-bg); z-index: 60;
    display: none; flex-direction: column;
    animation: viewIn .28s ease;
}
.view.open { display: flex; }

@keyframes viewIn {
    from { transform: translateX(calc(-50% + 100%)); }
    to   { transform: translateX(-50%); }
}

.view-header {
    display: flex; align-items: center; height: 50px;
    background: #fff; padding: 0 10px;
    border-bottom: 0.5px solid rgba(0, 0, 0, .06);
    flex: none;
}
.view-header .back {
    width: 36px; height: 36px; border: none; background: none;
    font-size: 26px; color: var(--primary); cursor: pointer; line-height: 1;
}
.view-title { font-size: 16px; font-weight: 600; margin-left: 4px; }
.view-body { flex: 1; overflow-y: auto; padding: 16px; }

.form-card { padding: 18px 16px; }
.form-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.form-row > label { flex: none; width: 54px; font-size: 15px; color: var(--text-sub); }
.form-card .btn-primary { margin-top: 10px; }
.form-card .btn-ghost { margin-top: 12px; }

.sex-picker { display: flex; gap: 10px; flex: 1; }
.sex-opt {
    flex: 1; height: 40px; line-height: 40px; text-align: center;
    border: 1.5px solid #f0dbe6; border-radius: 20px;
    font-size: 15px; color: var(--text-sub); cursor: pointer;
    transition: all .2s;
}
.sex-opt.active { border-color: var(--primary); color: var(--primary); background: #fff5fa; font-weight: 600; }

.list { display: flex; flex-direction: column; gap: 10px; }
.list-item {
    display: flex; align-items: center; justify-content: space-between;
    background: #fff; border-radius: 14px; padding: 13px 14px;
    box-shadow: 0 2px 8px rgba(255, 77, 148, .07);
}
.li-title { font-size: 14px; font-weight: 600; }
.li-amount { color: var(--primary); font-weight: 700; }
.li-sub { font-size: 12px; color: var(--text-sub); margin-top: 3px; }
.li-status { font-size: 12px; color: var(--primary); flex: none; }
.list-empty { text-align: center; color: var(--text-sub); font-size: 13px; padding: 60px 0; }

/* ==================== 弹窗 ==================== */
.modal-mask {
    position: fixed; inset: 0; z-index: 70;
    background: rgba(40, 10, 26, .5);
    display: none; align-items: flex-end; justify-content: center;
}
.modal-mask.open { display: flex; }

.modal {
    width: 100%; max-width: 480px;
    background: #fff; border-radius: 20px 20px 0 0;
    padding: 16px 18px calc(16px + env(safe-area-inset-bottom));
    animation: modalUp .3s ease;
    max-height: 86vh; display: flex; flex-direction: column;
}

@keyframes modalUp {
    from { transform: translateY(100%); }
    to   { transform: none; }
}

.modal-header { display: flex; align-items: center; justify-content: center; position: relative; padding: 4px 0 10px; }
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close {
    position: absolute; right: 0; top: 0;
    width: 34px; height: 34px; border: none; background: #f6ebf1;
    border-radius: 50%; color: var(--text-sub); font-size: 14px; cursor: pointer;
}

.agree-content { flex: 1; overflow-y: auto; padding: 4px 2px 10px; }
.agree-content h1 { font-size: 17px; text-align: center; margin-bottom: 12px; }
.agree-content h2 { font-size: 15px; margin: 14px 0 8px; color: var(--primary-deep); }
.agree-content p { font-size: 13px; color: #5d4553; text-indent: 2em; margin-bottom: 8px; }
.agree-content ol { padding-left: 22px; }
.agree-content ol li { font-size: 13px; color: #5d4553; margin-bottom: 6px; }
.agree-content ul { padding-left: 18px; margin: 4px 0; }
.agree-content ul li { font-size: 13px; color: #5d4553; margin-bottom: 4px; }
.agree-content .agree-end { text-align: center; text-indent: 0; color: var(--text-sub); margin-top: 14px; }

.about-content { padding: 6px 2px 4px; }
.about-content p { font-size: 14px; color: #5d4553; margin-bottom: 10px; }

.about-btns { display: flex; gap: 12px; margin-top: 14px; }
.about-btns .btn-primary, .about-btns .btn-ghost { flex: 1; }

.service-content { text-align: center; padding: 10px 0 6px; }
.service-qr {
    width: 190px; height: 190px; border-radius: 14px;
    border: 1px solid #f0dbe6; background: #fff;
    object-fit: contain; display: inline-block;
}
.service-content p { font-size: 14px; font-weight: 600; margin-top: 12px; }
.service-tip { font-size: 12px !important; color: var(--text-sub); font-weight: 400 !important; }

/* ==================== 轻提示 ==================== */
.toast {
    position: fixed; left: 50%; top: 46%;
    transform: translate(-50%, -50%) scale(.9);
    background: rgba(40, 10, 26, .85); color: #fff;
    padding: 12px 22px; border-radius: 12px;
    font-size: 14px; max-width: 78vw; text-align: center;
    z-index: 99; opacity: 0; pointer-events: none;
    transition: all .25s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
