:root {
    --cream: #fdf6e3;
    --green-light: #c8e6c0;
    --green: #7cb342;
    --green-dark: #558b2f;
    --olive: #a5d6a7;
    --orange: #ff8a65;
    --orange-dark: #e64a19;
    --peach: #ffccbc;
    --violet: #ab47bc;
    --violet-light: #e1bee7;
    --white: #ffffff;
    --text: #4a4a3a;
    --text-light: #8c8c7a;
    --shadow: rgba(76, 175, 80, 0.12);
    --shadow-card: rgba(0, 0, 0, 0.06);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(170deg, #f0f7e6 0%, #fdf6e3 30%, #e8f5e9 60%, #fff8e1 100%);
    background-attachment: fixed;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    -webkit-overflow-scrolling: touch;
}

/* ============ 池塘波纹 ============ */
.bg-pond {
    position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(165, 214, 167, 0.25);
    animation: rippleOut 6s ease-out infinite;
}

.ripple:nth-child(1) { width: 100px; height: 100px; left: 20%; top: 50%; animation-delay: 0s; }
.ripple:nth-child(2) { width: 140px; height: 140px; left: 55%; top: 35%; animation-delay: 2s; }
.ripple:nth-child(3) { width: 80px; height: 80px; left: 75%; top: 60%; animation-delay: 4s; }

@keyframes rippleOut {
    0%   { transform: scale(0); opacity: 0.5; }
    100% { transform: scale(4); opacity: 0; }
}

/* ============ 叶子飘落 ============ */
.leaves {
    position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden;
}

.leaf {
    position: absolute; top: -40px;
    width: 20px; height: 20px;
    background: var(--olive);
    border-radius: 0 50% 50% 50%;
    opacity: 0.2;
    animation: leafFall linear infinite;
}

.leaf-1 { left: 12%; animation-duration: 14s; animation-delay: 0s; }
.leaf-2 { left: 28%; animation-duration: 17s; animation-delay: 3s; width: 16px; height: 16px; }
.leaf-3 { left: 52%; animation-duration: 13s; animation-delay: 6s; width: 22px; height: 22px; }
.leaf-4 { left: 78%; animation-duration: 16s; animation-delay: 9s; }

@keyframes leafFall {
    0%   { transform: translateY(0) rotate(0deg) translateX(0); opacity: 0; }
    5%   { opacity: 0.2; }
    90%  { opacity: 0.15; }
    100% { transform: translateY(105vh) rotate(720deg) translateX(60px); opacity: 0; }
}

/* ============ 气泡 ============ */
.bubbles {
    position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden;
}

.bubble {
    position: absolute; border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(165, 214, 167, 0.35), rgba(165, 214, 167, 0.06));
    animation: floatUp linear infinite;
}

.bubble:nth-child(1) { width: 60px; height: 60px; left: 10%; bottom: -80px; animation-duration: 12s; animation-delay: 0s; }
.bubble:nth-child(2) { width: 36px; height: 36px; left: 25%; bottom: -60px; animation-duration: 9s; animation-delay: 2s; }
.bubble:nth-child(3) { width: 80px; height: 80px; left: 50%; bottom: -100px; animation-duration: 14s; animation-delay: 4s; }
.bubble:nth-child(4) { width: 30px; height: 30px; left: 70%; bottom: -70px; animation-duration: 8s; animation-delay: 1s; }
.bubble:nth-child(5) { width: 48px; height: 48px; left: 85%; bottom: -90px; animation-duration: 11s; animation-delay: 3s; }
.bubble:nth-child(6) { width: 54px; height: 54px; left: 40%; bottom: -110px; animation-duration: 13s; animation-delay: 5s; }
.bubble:nth-child(7) { width: 42px; height: 42px; left: 60%; bottom: -75px; animation-duration: 10s; animation-delay: 7s; }
.bubble:nth-child(8) { width: 28px; height: 28px; left: 92%; bottom: -65px; animation-duration: 7s; animation-delay: 6s; }

@keyframes floatUp {
    0%   { transform: translateY(0) scale(1); opacity: 0.55; }
    50%  { opacity: 0.25; }
    100% { transform: translateY(-105vh) scale(0.55); opacity: 0; }
}

/* ============ 大乌龟装饰 ============ */
.hero-turtle {
    position: fixed;
    bottom: 24px; right: 24px;
    width: 90px; height: 90px;
    opacity: 0.1;
    pointer-events: none; z-index: 0;
    animation: turtleBob 4s ease-in-out infinite;
}

.hero-turtle img { width: 100%; height: 100%; object-fit: contain; }

@keyframes turtleBob {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    30%      { transform: translateY(-14px) rotate(4deg); }
    60%      { transform: translateY(-6px) rotate(-2deg); }
}

/* ============ 隐藏 SVG ============ */
.hide { position: absolute; width: 0; height: 0; }

/* ============ 卡片 ============ */
.card {
    position: relative; z-index: 1;
    width: 360px; max-width: 92vw;
    padding: 40px 30px 26px;
    background: var(--white);
    border-radius: 32px;
    box-shadow: 0 4px 16px var(--shadow-card), 0 20px 48px var(--shadow), 0 0 0 1px rgba(139, 195, 74, 0.08);
    text-align: center;
    animation: cardIn 0.75s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(40px) scale(0.92); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============ 头像 ============ */
.avatar {
    width: 90px; height: 90px;
    margin: 0 auto 14px;
    border-radius: 50%; overflow: hidden;
    border: 4px solid var(--green-light);
    box-shadow: 0 4px 12px var(--shadow), 0 0 0 6px rgba(200, 230, 192, 0.3);
    animation: avatarPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

@keyframes avatarPop {
    from { opacity: 0; transform: scale(0.4); }
    to   { opacity: 1; transform: scale(1); }
}

/* ============ 名字带闪光 ============ */
.name-line {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    margin-bottom: 2px;
    animation: fadeUp 0.5s ease 0.35s both;
}

.nickname {
    font-size: 24px; font-weight: 700;
    color: var(--green-dark);
    letter-spacing: 2px;
}

.sparkle {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--green);
    animation: sparklePulse 1.5s ease-in-out infinite;
}

.s-left  { animation-delay: 0s; }
.s-right { animation-delay: 0.75s; }

@keyframes sparklePulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50%      { opacity: 1;   transform: scale(1.6); background: #8bc34a; }
}

.signature {
    font-size: 13px; color: var(--text-light); letter-spacing: 1px;
    animation: fadeUp 0.5s ease 0.4s both;
}

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

/* ============ 波浪分割线 ============ */
.divider-wavy {
    width: 55%; height: 4px;
    margin: 20px auto;
    background: repeating-linear-gradient(
        90deg,
        var(--green-light) 0px, var(--green-light) 8px,
        transparent 8px, transparent 12px
    );
    border-radius: 2px;
    animation: fadeUp 0.5s ease 0.45s both;
}

/* ============ 按钮 ============ */
.actions {
    display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px;
}

.btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 13px 22px;
    border-radius: 50px;
    font-size: 15px; font-weight: 600;
    text-decoration: none;
    letter-spacing: 1px;
    position: relative; overflow: hidden;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.25s ease,
                background 0.25s ease;
    animation: fadeUp 0.5s ease both;
}

.btn:nth-child(1) { animation-delay: 0.5s; }
.btn:nth-child(2) { animation-delay: 0.55s; }
.btn:nth-child(3) { animation-delay: 0.6s; }

.btn:active { transform: scale(0.96) !important; transition: transform 0.08s ease; }

.btn-icon { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* --- 下载按钮 --- */
.btn-download {
    background: linear-gradient(135deg, var(--green-light), #e8f5e9);
    color: var(--green-dark);
    border: 2px solid var(--olive);
    box-shadow: 0 4px 14px rgba(139, 195, 74, 0.18);
}

.btn-download:hover {
    background: linear-gradient(135deg, #dcedc8, var(--green-light));
    box-shadow: 0 6px 22px rgba(139, 195, 74, 0.30);
    transform: translateY(-2px);
}

.arrow-down {
    display: block;
    width: 0; height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 10px solid var(--green-dark);
    animation: arrowBounce 1.6s ease-in-out infinite;
}

@keyframes arrowBounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(4px); }
}

/* --- QQ 按钮 --- */
.btn-qq {
    background: linear-gradient(135deg, var(--peach), #ffe0b2);
    color: var(--orange-dark);
    border: 2px solid rgba(255, 138, 101, 0.35);
    box-shadow: 0 4px 14px rgba(255, 138, 101, 0.13);
}

.btn-qq:hover {
    background: linear-gradient(135deg, #f8bbd0, var(--peach));
    box-shadow: 0 6px 22px rgba(255, 138, 101, 0.25);
    transform: translateY(-2px);
}

.chat-icon {
    display: flex; gap: 3px; align-items: flex-end;
    animation: chatBounce 2s ease-in-out infinite;
}

.chat-bubble-left, .chat-bubble-right {
    width: 8px; height: 6px;
    background: var(--orange-dark);
    border-radius: 3px;
    animation: bubbleTalk 1.2s ease-in-out infinite;
}

.chat-bubble-left  { animation-delay: 0s; }
.chat-bubble-right { animation-delay: 0.4s; }

@keyframes bubbleTalk {
    0%, 100% { transform: scaleY(1); }
    50%      { transform: scaleY(1.6); }
}

@keyframes chatBounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-2px); }
}

/* --- 付费按钮 --- */
.btn-vip {
    background: linear-gradient(135deg, #e1bee7, #f3e5f5);
    color: var(--violet);
    border: 2px solid rgba(171, 71, 188, 0.3);
    box-shadow: 0 4px 14px rgba(171, 71, 188, 0.13);
}

.btn-vip:hover {
    background: linear-gradient(135deg, #ce93d8, #e1bee7);
    box-shadow: 0 6px 22px rgba(171, 71, 188, 0.25);
    transform: translateY(-2px);
}

.vip-icon { position: relative; }

.crown {
    display: block;
    width: 0; height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 10px solid var(--violet);
    position: relative;
    top: -2px;
    animation: crownFloat 2s ease-in-out infinite;
}

.crown::before {
    content: '';
    position: absolute; top: 10px; left: -4px;
    width: 8px; height: 3px;
    background: var(--violet);
    border-radius: 0 0 2px 2px;
}

@keyframes crownFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25%      { transform: translateY(-3px) rotate(-3deg); }
    75%      { transform: translateY(-3px) rotate(3deg); }
}

/* ============ 底部 ============ */
.footer {
    font-size: 12px; color: var(--text-light); opacity: 0.45;
    letter-spacing: 1px;
    display: flex; align-items: center; justify-content: center; gap: 4px;
    animation: fadeUp 0.5s ease 0.65s both;
}

.turtle-track {
    width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #c8e6c0, #a5d6a7);
    border-radius: 50%;
    padding: 3px;
}

.mini-turtle-img {
    width: 100%; height: 100%;
    object-fit: contain;
    display: block;
    filter: brightness(0.35) sepia(1) saturate(3) hue-rotate(70deg) brightness(1.2);
    animation: miniWalk 2s ease-in-out infinite;
}

@keyframes miniWalk {
    0%, 100% { transform: translateX(-2px) rotate(-3deg); }
    50%      { transform: translateX(2px) rotate(3deg); }
}

/* ============ 跳转提醒弹窗 ============ */
.modal-overlay {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.show { opacity: 1; pointer-events: auto; }

body.modal-open { overflow: hidden; }

.modal-box {
    position: relative;
    width: 300px; max-width: 88vw;
    background: var(--white);
    border-radius: 28px;
    padding: 36px 26px 24px;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(139, 195, 74, 0.08);
    animation: modalIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px) scale(0.92); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* 乌龟图 */
.modal-turtle-img {
    width: 72px; height: 72px;
    margin: 0 auto 10px;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c0);
    border-radius: 50%;
    padding: 12px;
    animation: turtleBounce 1.8s ease-in-out infinite;
}

.modal-turtle-img img {
    width: 100%; height: 100%;
    object-fit: contain;
    display: block;
}

@keyframes turtleBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    30%      { transform: translateY(-8px) scale(1.06); }
    60%      { transform: translateY(0) scale(0.97); }
}

.modal-title {
    font-size: 16px; font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.modal-target {
    font-size: 12px; color: var(--text-light);
    margin-bottom: 16px;
    word-break: break-all;
}

/* 倒计时圆圈 */
.modal-countdown {
    position: relative;
    width: 90px; height: 90px;
    margin: 0 auto 20px;
}

.countdown-ring {
    width: 100%; height: 100%;
    transform: rotate(-90deg);
}

.ring-bg {
    fill: none;
    stroke: #e8f5e9;
    stroke-width: 6;
}

.ring-fill {
    fill: none;
    stroke: var(--green);
    stroke-width: 6;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
}

.ring-fill.ring-tick {
    stroke: var(--violet);
    animation: ringFlare 0.4s ease;
}

@keyframes ringFlare {
    0%, 100% { stroke-width: 6; }
    50%      { stroke-width: 10; }
}

.countdown-num {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; font-weight: 800;
    color: var(--green-dark);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 按钮区 */
.modal-btns {
    display: flex; gap: 12px;
}

.modal-btn {
    flex: 1;
    padding: 11px 0;
    border-radius: 50px;
    border: none;
    font-size: 13px; font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
    letter-spacing: 1px;
    min-height: 42px;
}

.modal-btn:active { transform: scale(0.95); }

.modal-cancel {
    background: #f5f5f0;
    color: var(--text-light);
}

.modal-cancel:hover { background: #eeeeee; }

.modal-go {
    background: var(--green);
    color: #fff;
}

.modal-go:hover { background: var(--green-dark); }

.modal-hint {
    font-size: 13px;
    color: #e64a19;
    margin-top: -12px;
    margin-bottom: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    animation: hintFlash 2s ease-in-out infinite;
}

@keyframes hintFlash {
    0%, 100% { opacity: 0.85; }
    50%      { opacity: 0.55; }
}

/* ============================================= */
/*               MOBILE 适配                      */
/* ============================================= */
@media (max-width: 480px) {
    .card {
        width: 88vw; max-width: 100%;
        padding: 32px 20px 22px;
        border-radius: 28px;
    }

    .avatar {
        width: 78px; height: 78px;
        border-width: 3px;
        box-shadow: 0 3px 9px var(--shadow), 0 0 0 5px rgba(200, 230, 192, 0.25);
        margin-bottom: 12px;
    }

    .nickname { font-size: 20px; letter-spacing: 1.5px; }

    .signature { font-size: 12px; }

    .sparkle { width: 5px; height: 5px; }

    .divider-wavy { margin: 16px auto; width: 50%; }

    .actions { gap: 10px; margin-bottom: 12px; }

    .btn {
        padding: 14px 18px;
        font-size: 14px;
        letter-spacing: 0.5px;
        min-height: 48px; /* 触摸友好 */
    }

    .btn-icon { width: 22px; height: 22px; }

    .hero-turtle {
        width: 50px; height: 50px;
        bottom: 16px; right: 12px;
        opacity: 0.07;
    }

    .bubble:nth-child(1) { width: 36px; height: 36px; }
    .bubble:nth-child(3) { width: 48px; height: 48px; }
    .bubble:nth-child(5) { width: 30px; height: 30px; }
    .bubble:nth-child(6) { width: 34px; height: 34px; }

    .ripple:nth-child(1) { width: 60px; height: 60px; }
    .ripple:nth-child(2) { width: 80px; height: 80px; }
    .ripple:nth-child(3) { width: 50px; height: 50px; }

    .leaf-1 { width: 14px; height: 14px; }
    .leaf-2 { width: 11px; height: 11px; }
    .leaf-3 { width: 16px; height: 16px; }
    .leaf-4 { width: 10px; height: 10px; }

    .modal-box { padding: 28px 20px 20px; border-radius: 24px; }
    .modal-title { font-size: 15px; }
    .modal-countdown { width: 72px; height: 72px; }
    .countdown-num { font-size: 26px; }
    .modal-btn { padding: 10px 0; font-size: 12px; min-height: 38px; }
    .modal-turtle-img { width: 54px; height: 54px; padding: 8px; }

    .footer {
        padding-bottom: var(--safe-bottom);
    }
}

/* 更小屏（375px 级别 iPhone SE） */
@media (max-width: 380px) {
    .card { padding: 28px 16px 18px; border-radius: 24px; }
    .avatar { width: 68px; height: 68px; }
    .nickname { font-size: 18px; }
    .btn { padding: 12px 16px; font-size: 13px; min-height: 44px; }
    .actions { gap: 8px; }
    .divider-wavy { margin: 12px auto; }
}

/* 横屏手机 */
@media (max-height: 480px) and (orientation: landscape) {
    .card {
        padding: 20px 28px 16px;
        border-radius: 24px;
    }

    .avatar { width: 56px; height: 56px; margin-bottom: 8px; }
    .nickname { font-size: 16px; }
    .signature { font-size: 11px; }
    .divider-wavy { margin: 10px auto; }
    .actions { gap: 6px; margin-bottom: 8px; }
    .btn { padding: 10px 16px; font-size: 13px; min-height: 40px; }

    .hero-turtle { display: none; }

    .footer { font-size: 10px; }
}

/* 触摸设备通用优化 */
@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        transform: none !important;
        box-shadow: inherit;
    }

    .btn:active {
        transform: scale(0.96) !important;
    }

    .btn-download:active {
        box-shadow: 0 6px 22px rgba(139, 195, 74, 0.30);
    }

    .btn-qq:active {
        box-shadow: 0 6px 22px rgba(255, 138, 101, 0.25);
    }

    .btn-vip:active {
        box-shadow: 0 6px 22px rgba(171, 71, 188, 0.25);
    }
}
