/** * game.vue — 血糖消和乐 v2 (stitch_sugar_balance_blast code.html) */ .game-page { height: 100vh; height: 100dvh; /* 参考稿:顶部高光的薄荷渐变背景 */ background: #e9f0e9; background-image: radial-gradient(circle at 50% -20%, #ffffff 0%, #e9f0e9 60%, #d5dcd5 100%); color: #171d19; overflow: hidden; position: relative; display: flex; flex-direction: column; } .game-page.is-screen-shake { animation: gg-screen-shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both; } @keyframes gg-screen-shake { 0%, 100% { transform: translate3d(0, 0, 0); } 10%, 30%, 50%, 70%, 90% { transform: translate3d(-8px, -8px, 0); } 20%, 40%, 60%, 80% { transform: translate3d(8px, 8px, 0); } } .game-page .gg-glass { background: rgba(255, 255, 255, 0.6); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(255, 255, 255, 0.8); } /* ===== Header / TopAppBar(参考稿玻璃顶栏) ===== */ .game-page .gg-header { position: fixed; top: 0; left: 0; right: 0; z-index: 50; background: rgba(255, 255, 255, 0.4); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border-bottom: 1px solid rgba(255, 255, 255, 0.6); box-shadow: 0 4rpx 24rpx rgba(0, 0, 0, 0.02); } .game-page .gg-hud-nav { display: flex; align-items: center; justify-content: space-between; position: relative; min-height: var(--menu-height, 64rpx); margin-bottom: 0; } .game-page .gg-hud-control-group { display: flex; align-items: center; gap: 16rpx; } /* 玻璃圆形图标按钮 */ .game-page .gg-hud-btn { width: 84rpx; height: 84rpx; border-radius: 50%; background: rgba(255, 255, 255, 0.7); border: 1px solid rgba(255, 255, 255, 0.9); display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.04), inset 0 1px 2px rgba(255, 255, 255, 0.8); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: all 0.15s ease; } .game-page .gg-hud-btn--pressed { transform: scale(0.94); background: rgba(255, 255, 255, 0.95); } .game-page .gg-hud-btn.is-muted { opacity: 0.55; } .game-page .gg-hud-level-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; z-index: 5; } .game-page .gg-hud-level-text { font-size: 44rpx; font-weight: 800; color: #006c4b; line-height: 1.1; letter-spacing: 2rpx; text-shadow: 0 2rpx 6rpx rgba(0, 108, 75, 0.12); } .game-page .gg-hud-score { display: flex; align-items: baseline; gap: 6rpx; margin-top: 2rpx; } .game-page .gg-hud-score-val { font-size: 68rpx; font-weight: 800; color: #006c4b; font-variant-numeric: tabular-nums; line-height: 1; letter-spacing: -2rpx; text-shadow: 0 2rpx 6rpx rgba(0, 108, 75, 0.12); } .game-page .gg-hud-score.is-pop .gg-hud-score-val { animation: gg-pop-score 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); } .game-page .gg-hud-score-unit { font-size: 28rpx; font-weight: 700; color: #3d4a42; } /* ===== 信息横幅(参考稿玻璃卡 + 绿色 info 图标) ===== */ .game-page .gg-info-banner { flex-shrink: 0; width: 100%; max-width: 750rpx; margin: 0 auto 20rpx; padding: 20rpx 24rpx; box-sizing: border-box; display: flex; align-items: center; gap: 20rpx; border-radius: 28rpx; background: rgba(255, 255, 255, 0.6); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(255, 255, 255, 0.8); box-shadow: 0 12rpx 32rpx rgba(0, 0, 0, 0.06), inset 0 1px 2px rgba(255, 255, 255, 0.9); } .game-page .gg-info-banner-icon { flex-shrink: 0; width: 80rpx; height: 80rpx; border-radius: 22rpx; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #00a676, #006c4b); border: 1px solid rgba(255, 255, 255, 0.2); box-shadow: 0 8rpx 18rpx rgba(0, 108, 75, 0.28); } .game-page .gg-info-banner-body { flex: 1; min-width: 0; } .game-page .gg-info-banner-text { font-size: 28rpx; font-weight: 500; color: #171d19; line-height: 1.5; } .game-page .gg-info-banner-kw { font-size: 32rpx; font-weight: 800; color: #006c4b; letter-spacing: 1rpx; } /* —— 消除后:该食物的含糖 + 建议 —— */ .game-page .gg-info-banner.is-food { gap: 18rpx; animation: gg-info-food-in 0.28s cubic-bezier(0.22, 1, 0.36, 1); } .game-page .gg-info-banner.is-food.is-low { border-color: rgba(22, 163, 74, 0.28); } .game-page .gg-info-banner.is-food.is-mid { border-color: rgba(234, 88, 12, 0.28); } .game-page .gg-info-banner.is-food.is-high { border-color: rgba(220, 38, 38, 0.3); } /* 食物图标:白底 + GI 彩色描边(覆盖默认绿色渐变) */ .game-page .gg-info-banner-icon.is-food { background: #ffffff; box-shadow: 0 4rpx 12rpx rgba(15, 23, 42, 0.08), inset 0 1px 2px rgba(255, 255, 255, 0.9); border-width: 2rpx; border-style: solid; } .game-page .gg-info-banner-icon.is-food.is-low { border-color: rgba(22, 163, 74, 0.4); } .game-page .gg-info-banner-icon.is-food.is-mid { border-color: rgba(234, 88, 12, 0.4); } .game-page .gg-info-banner-icon.is-food.is-high { border-color: rgba(220, 38, 38, 0.45); } .game-page .gg-info-banner-icon.is-food .food-tile-icon--goal { width: 60rpx; height: 60rpx; } .game-page .gg-info-food-head { display: flex; align-items: center; gap: 14rpx; margin-bottom: 8rpx; } .game-page .gg-info-food-name { font-size: 34rpx; font-weight: 900; color: #171d19; line-height: 1.2; max-width: 320rpx; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } .game-page .gg-info-food-gi { flex-shrink: 0; display: inline-flex; align-items: center; padding: 4rpx 16rpx; border-radius: 999rpx; } .game-page .gg-info-food-gi-text { font-size: 24rpx; font-weight: 800; color: #ffffff; letter-spacing: 1rpx; } .game-page .gg-info-food-gi.is-low { background: linear-gradient(135deg, #5bdda8, #00a676); box-shadow: 0 2rpx 8rpx rgba(0, 166, 118, 0.32); } .game-page .gg-info-food-gi.is-mid { background: linear-gradient(135deg, #fbbf24, #d97706); box-shadow: 0 2rpx 8rpx rgba(217, 119, 6, 0.32); } .game-page .gg-info-food-gi.is-high { background: linear-gradient(135deg, #f87171, #ba1a1a); box-shadow: 0 2rpx 8rpx rgba(186, 26, 26, 0.34); } .game-page .gg-info-food-tip { display: block; font-size: 26rpx; font-weight: 600; color: #3d4a42; line-height: 1.4; } .game-page .gg-info-food-tip.is-low { color: #15803d; } .game-page .gg-info-food-tip.is-mid { color: #c2410c; } .game-page .gg-info-food-tip.is-high { color: #b91c1c; } @keyframes gg-info-food-in { from { opacity: 0.35; transform: translateY(-6rpx); } to { opacity: 1; transform: translateY(0); } } /* ===== 次:上次消除(名称 + 含糖量),GI 三色编码学习卡 ===== */ .game-page .gg-hud-last-food { flex-shrink: 0; width: 100%; max-width: 750rpx; margin: 0 auto 14rpx; padding: 16rpx 18rpx 18rpx; border-radius: 26rpx; background: rgba(255, 255, 255, 0.92); border: 1rpx solid rgba(0, 108, 73, 0.1); box-sizing: border-box; box-shadow: 0 6rpx 20rpx rgba(0, 108, 73, 0.07); } /* 头部:标题 + GI 状态胶囊 */ .game-page .gg-hud-last-food-head { display: flex; align-items: center; justify-content: space-between; gap: 12rpx; margin-bottom: 12rpx; } .game-page .gg-hud-last-food-kicker { display: flex; align-items: center; font-size: 24rpx; font-weight: 800; color: #64748b; letter-spacing: 0.08em; line-height: 1.3; padding-left: 16rpx; position: relative; } .game-page .gg-hud-last-food-kicker::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 6rpx; height: 24rpx; border-radius: 3rpx; background: #006c49; } /* 头部 GI 胶囊 */ .game-page .gg-hud-last-food-chip { display: flex; align-items: center; gap: 8rpx; padding: 5rpx 16rpx 5rpx 12rpx; border-radius: 999rpx; font-weight: 800; line-height: 1; border: 1rpx solid transparent; } .game-page .gg-hud-last-food-chip-dot { width: 14rpx; height: 14rpx; border-radius: 50%; flex-shrink: 0; } .game-page .gg-hud-last-food-chip-text { font-size: 24rpx; font-weight: 800; } .game-page .gg-hud-last-food-chip.is-low { background: rgba(22, 163, 74, 0.12); border-color: rgba(22, 163, 74, 0.22); } .game-page .gg-hud-last-food-chip.is-low .gg-hud-last-food-chip-dot { background: #16a34a; } .game-page .gg-hud-last-food-chip.is-low .gg-hud-last-food-chip-text { color: #15803d; } .game-page .gg-hud-last-food-chip.is-mid { background: rgba(234, 88, 12, 0.12); border-color: rgba(234, 88, 12, 0.22); } .game-page .gg-hud-last-food-chip.is-mid .gg-hud-last-food-chip-dot { background: #ea580c; } .game-page .gg-hud-last-food-chip.is-mid .gg-hud-last-food-chip-text { color: #c2410c; } .game-page .gg-hud-last-food-chip.is-high { background: rgba(220, 38, 38, 0.12); border-color: rgba(220, 38, 38, 0.24); } .game-page .gg-hud-last-food-chip.is-high .gg-hud-last-food-chip-dot { background: #dc2626; } .game-page .gg-hud-last-food-chip.is-high .gg-hud-last-food-chip-text { color: #b91c1c; } /* 主卡:左侧 GI 强调条 + 图标 + 文案 */ .game-page .gg-hud-last-food-card { position: relative; display: flex; align-items: center; gap: 18rpx; padding: 16rpx 18rpx 16rpx 24rpx; border-radius: 20rpx; overflow: hidden; background: #f8fafc; border: 1rpx solid rgba(15, 23, 42, 0.06); animation: gg-last-food-in 0.24s cubic-bezier(0.22, 1, 0.36, 1); } /* 左侧强调条(GI 三色) */ .game-page .gg-hud-last-food-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 8rpx; border-radius: 8rpx; background: #cbd5e1; } @media (prefers-reduced-motion: reduce) { .game-page .gg-hud-last-food-card { animation: none; } } .game-page .gg-hud-last-food-card.is-high { background: linear-gradient(90deg, rgba(254, 226, 226, 0.85) 0%, rgba(254, 242, 242, 0.6) 60%); border-color: rgba(220, 38, 38, 0.18); } .game-page .gg-hud-last-food-card.is-high::before { background: #dc2626; } .game-page .gg-hud-last-food-card.is-mid { background: linear-gradient(90deg, rgba(255, 237, 213, 0.85) 0%, rgba(255, 251, 235, 0.6) 60%); border-color: rgba(234, 88, 12, 0.16); } .game-page .gg-hud-last-food-card.is-mid::before { background: #ea580c; } .game-page .gg-hud-last-food-card.is-low { background: linear-gradient(90deg, rgba(220, 252, 231, 0.85) 0%, rgba(240, 253, 244, 0.6) 60%); border-color: rgba(22, 163, 74, 0.16); } .game-page .gg-hud-last-food-card.is-low::before { background: #16a34a; } /* 图标:白底 + GI 彩色描边环 */ .game-page .gg-hud-last-food-icon { width: 80rpx; height: 80rpx; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 18rpx; background: #fff; border: 2rpx solid rgba(15, 23, 42, 0.06); box-shadow: 0 3rpx 10rpx rgba(15, 23, 42, 0.08); } .game-page .gg-hud-last-food-icon.is-low { border-color: rgba(22, 163, 74, 0.35); } .game-page .gg-hud-last-food-icon.is-mid { border-color: rgba(234, 88, 12, 0.35); } .game-page .gg-hud-last-food-icon.is-high { border-color: rgba(220, 38, 38, 0.4); } .game-page .gg-hud-last-food-icon .food-tile-icon--goal { width: 62rpx; height: 62rpx; } .game-page .gg-hud-last-food-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10rpx; } .game-page .gg-hud-last-food-name { font-size: 36rpx; font-weight: 900; color: #0f172a; line-height: 1.2; word-break: break-all; } .game-page .gg-hud-last-food-sugar-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8rpx 14rpx; } /* 含糖等级徽标:GI 三色实底 + 白字(保证对比度) */ .game-page .gg-hud-last-food-gi { display: inline-flex; align-items: center; padding: 5rpx 16rpx; border-radius: 999rpx; line-height: 1.3; } .game-page .gg-hud-last-food-gi-text { font-size: 26rpx; font-weight: 800; color: #fff; letter-spacing: 0.02em; } .game-page .gg-hud-last-food-gi.is-low { background: #16a34a; box-shadow: 0 2rpx 8rpx rgba(22, 163, 74, 0.3); } .game-page .gg-hud-last-food-gi.is-mid { background: #ea580c; box-shadow: 0 2rpx 8rpx rgba(234, 88, 12, 0.3); } .game-page .gg-hud-last-food-gi.is-high { background: #dc2626; box-shadow: 0 2rpx 8rpx rgba(220, 38, 38, 0.32); } .game-page .gg-hud-last-food-sugar-hint { font-size: 26rpx; font-weight: 700; color: #475569; line-height: 1.35; } .game-page .gg-hud-last-food-card.is-high .gg-hud-last-food-sugar-hint { color: #b91c1c; } .game-page .gg-hud-last-food-card.is-mid .gg-hud-last-food-sugar-hint { color: #c2410c; } .game-page .gg-hud-last-food-card.is-low .gg-hud-last-food-sugar-hint { color: #15803d; } /* 空态占位 */ .game-page .gg-hud-last-food-placeholder { display: flex; align-items: center; gap: 12rpx; padding: 18rpx 16rpx; border-radius: 20rpx; background: #f8fafc; border: 1rpx dashed rgba(15, 23, 42, 0.12); } .game-page .gg-hud-last-food-placeholder-dot { width: 16rpx; height: 16rpx; border-radius: 50%; flex-shrink: 0; background: #cbd5e1; } .game-page .gg-hud-last-food-placeholder text { font-size: 27rpx; font-weight: 600; color: #94a3b8; line-height: 1.45; } @keyframes gg-last-food-in { from { opacity: 0; transform: translateY(6rpx); } to { opacity: 1; transform: translateY(0); } } /* 血糖圆环(主区摘要用 mini) */ .game-page .gg-glucose-ring { width: 88rpx; height: 88rpx; border-radius: 50%; padding: 6rpx; flex-shrink: 0; box-sizing: border-box; transition: all 0.3s ease; } .game-page .gg-glucose-ring-inner { width: 100%; height: 100%; border-radius: 50%; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; box-shadow: inset 0 0 0 1rpx rgba(0, 108, 73, 0.05), 0 2rpx 6rpx rgba(0, 108, 73, 0.04); } .game-page .gg-glucose-value { font-size: 30rpx; font-weight: 900; color: #0f172a; line-height: 1; font-variant-numeric: tabular-nums; } .game-page .gg-glucose-brief { display: flex; flex-direction: column; align-items: flex-start; gap: 10rpx; min-width: 0; } .game-page .gg-glucose-title { font-size: 30rpx; font-weight: 800; color: #334155; line-height: 1.2; } .game-page .gg-glucose-status { font-size: 28rpx; font-weight: 800; color: #ea580c; padding: 6rpx 18rpx; border-radius: 999rpx; background: rgba(234, 88, 12, 0.1); white-space: nowrap; line-height: 1.2; } .game-page .gg-glucose-status.is-warn-low { color: #2563eb; background: rgba(59, 130, 246, 0.1); } .game-page .gg-glucose-status.is-warn-high { color: #dc2626; background: rgba(239, 68, 68, 0.1); animation: gg-alert-pulse 1.5s infinite; } .game-page .gg-glucose-ring--mini { width: 56rpx; height: 56rpx; padding: 4rpx; } .game-page .gg-glucose-ring--mini .gg-glucose-value { font-size: 22rpx; } .game-page .gg-glucose-status--mini { font-size: 22rpx; padding: 2rpx 10rpx; } @keyframes gg-alert-pulse { 0% { opacity: 0.8; } 50% { opacity: 1; box-shadow: 0 0 8rpx rgba(239, 68, 68, 0.3); } 100% { opacity: 0.8; } } @keyframes gg-pop-score { 0% { transform: scale(1); } 50% { transform: scale(1.12); color: #ea580c; } 100% { transform: scale(1); } } /* ===== 主:棋盘区 ===== */ .game-page .gg-board-hero { flex: 1; width: 100%; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; } .game-page .gg-board-hint-inline { flex-shrink: 0; width: 100%; max-width: 750rpx; display: flex; align-items: center; justify-content: center; gap: 10rpx; margin-bottom: 12rpx; padding: 0 8rpx; box-sizing: border-box; } .game-page .gg-hint-tag { font-size: 22rpx; font-weight: 800; color: #ffffff; background: #006c49; padding: 4rpx 12rpx; border-radius: 8rpx; flex-shrink: 0; line-height: 1.3; } .game-page .gg-board-hint-text { font-size: 26rpx; font-weight: 600; color: #475569; line-height: 1.35; text-align: center; } .game-page .gg-board-stack { display: flex; flex-direction: column; align-items: stretch; box-sizing: border-box; } .game-page .gg-board-zone { position: relative; width: 100%; } /* ===== Main / Board ===== */ .game-page .gg-main { position: fixed; left: 0; right: 0; top: var(--board-area-top, 120px); bottom: var(--board-area-bottom, 180px); z-index: 10; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; box-sizing: border-box; overflow: visible; padding: 14rpx 20rpx 0; } /* gg-hint-banner 已移除,提示直接显示在棋盘食物上 */ /* 无可用移动时的小型提示条 */ .game-page .gg-no-move-tip { display: flex; align-items: center; gap: 10rpx; padding: 12rpx 24rpx; margin-bottom: 12rpx; border-radius: 999rpx; background: rgba(234, 88, 12, 0.1); border: 1rpx solid rgba(234, 88, 12, 0.3); box-sizing: border-box; } .game-page .gg-no-move-tip-text { font-size: 28rpx; font-weight: 600; color: #c2410c; } .game-page .gg-board-wrap { /* 5 行 × 4 列棋盘宽高由 JS boardWrapStyle 注入 */ flex-shrink: 0; position: relative; box-sizing: border-box; } .game-page .game-grid { display: flex; flex-direction: column; border-radius: 48rpx; background: rgba(255, 255, 255, 0.6); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 12rpx 32rpx rgba(0, 0, 0, 0.06), inset 0 1px 2px rgba(255, 255, 255, 0.9); border: 1px solid rgba(255, 255, 255, 0.8); box-sizing: border-box; overflow: visible; flex-shrink: 0; } .game-page .game-row { display: flex; flex-direction: row; flex-shrink: 0; } .game-page .game-cell { position: relative; flex-shrink: 0; overflow: visible; background: transparent; border-radius: 0; box-shadow: none; } .game-page .game-tile { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 28rpx; display: flex; align-items: stretch; justify-content: stretch; background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(244, 251, 245, 0.6)); box-shadow: 0 10rpx 20rpx rgba(0, 108, 75, 0.08), inset 0 2rpx 4rpx rgba(255, 255, 255, 0.8), inset 0 -2rpx 6rpx rgba(0, 0, 0, 0.02); border: 1px solid rgba(255, 255, 255, 0.9); transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, opacity 0.2s; z-index: 1; box-sizing: border-box; overflow: visible; } .game-page .game-tile.is-dragging { z-index: 20; will-change: transform; } .game-page .game-tile.is-drag-neighbor { z-index: 15; will-change: transform; } .game-page .game-tile.is-dragging.game-tile--pressed { transform: none; } .game-page .game-tile.is-drop-start { opacity: 0; transform: translateY(-30%); transition: none; } .game-page .game-tile.is-drop-animate { opacity: 1; transform: translateY(0); transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease; } .game-page .game-tile.is-selected { transform: scale(1.08); z-index: 20; border: 2px solid #00a676; border-radius: 28rpx; box-shadow: 0 0 20rpx rgba(0, 166, 118, 0.35), inset 0 0 10rpx rgba(0, 166, 118, 0.12); } .game-page .game-tile--pressed { transform: scale(0.92); } .game-page .game-tile.is-selected.game-tile--pressed { transform: scale(1.06); } /* 3 连:糖果弹跳消除(先弹大再缩没,带高光) */ .game-page .game-tile.is-matched.is-match-fx-3, .game-page .game-tile.is-matched:not(.is-match-fx-4):not(.is-match-fx-5) { animation: gg-candy-pop 0.42s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; z-index: 6; } @keyframes gg-candy-pop { 0% { transform: scale(1); opacity: 1; filter: brightness(1); } 35% { transform: scale(1.35); opacity: 1; filter: brightness(1.7) saturate(1.4); } 60% { transform: scale(1.12); opacity: 0.9; } 100% { transform: scale(0); opacity: 0; filter: brightness(2); } } /* 4 连:弹性旋转 + 金色高光 */ .game-page .game-tile.is-matched.is-match-fx-4 { animation: gg-candy-pop-4 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; z-index: 7; box-shadow: 0 0 0 6rpx rgba(255, 213, 74, 0.6), 0 0 28px rgba(255, 200, 40, 0.95), 0 0 56px rgba(255, 170, 20, 0.5); } @keyframes gg-candy-pop-4 { 0% { transform: scale(1) rotate(0deg); opacity: 1; filter: brightness(1) saturate(1); } 25% { transform: scale(1.6) rotate(-10deg); opacity: 1; filter: brightness(1.9) saturate(1.8); } 50% { transform: scale(1.32) rotate(8deg); opacity: 0.95; filter: brightness(1.5) saturate(1.5); } 100% { transform: scale(0) rotate(20deg); opacity: 0; filter: brightness(2.4); } } /* 5 连+:彩虹爆闪 + 强光晕 */ .game-page .game-tile.is-matched.is-match-fx-5 { animation: gg-candy-pop-5 0.72s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; z-index: 8; box-shadow: 0 0 0 8rpx rgba(255, 255, 255, 0.7), 0 0 44px rgba(255, 215, 0, 1), 0 0 90px rgba(255, 90, 156, 0.6); } @keyframes gg-candy-pop-5 { 0% { transform: scale(1) rotate(0deg); opacity: 1; filter: brightness(1) saturate(1) hue-rotate(0deg); } 20% { transform: scale(2) rotate(-14deg); opacity: 1; filter: brightness(2.6) saturate(2.4) hue-rotate(30deg); } 45% { transform: scale(1.7) rotate(12deg); opacity: 0.9; filter: brightness(2) saturate(2) hue-rotate(-20deg); } 100% { transform: scale(0) rotate(26deg); opacity: 0; filter: brightness(3); } } /* ===== 提示高亮:方块增强发光 ===== */ .game-page .game-tile.is-hint { border: 4rpx solid #10b981; z-index: 10; animation: gg-hint-glow 0.9s ease-in-out infinite alternate; box-shadow: 0 0 0 4rpx rgba(16, 185, 129, 0.3), 0 0 20rpx rgba(16, 185, 129, 0.4); } /* 提示标记角标 */ .game-page .game-tile.is-hint::after { content: '✦'; position: absolute; top: 4rpx; right: 6rpx; font-size: 18rpx; color: #006c49; line-height: 1; pointer-events: none; animation: gg-hint-badge-spin 1.8s linear infinite; } @keyframes gg-hint-badge-spin { from { transform: rotate(0deg) scale(1); opacity: 1; } 50% { transform: rotate(180deg) scale(1.3); opacity: 0.8; } to { transform: rotate(360deg) scale(1); opacity: 1; } } /* ===== 提示交换箭头(覆盖在两食物正中间) ===== */ .game-page .gg-hint-arrow { position: absolute; width: 48rpx; height: 48rpx; background: linear-gradient(135deg, #006c49, #10b981); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 26rpx; color: #fff; font-weight: 900; pointer-events: none; z-index: 30; transform: translate(-50%, -50%); box-shadow: 0 4rpx 16rpx rgba(0, 108, 73, 0.45); animation: gg-hint-arrow-pulse 0.7s ease-in-out infinite alternate; } @keyframes gg-hint-arrow-pulse { from { transform: translate(-50%, -50%) scale(1); box-shadow: 0 4rpx 16rpx rgba(0, 108, 73, 0.4); } to { transform: translate(-50%, -50%) scale(1.25); box-shadow: 0 4rpx 28rpx rgba(0, 108, 73, 0.7), 0 0 0 8rpx rgba(16, 185, 129, 0.15); } } /* 扩散发光光环(颜色/粗细/光晕由 JS 内联,弹性扩散) */ .game-page .gg-match-ripple { position: absolute; border-radius: 50%; border-style: solid; border-color: rgba(255, 255, 255, 0.9); border-width: 4px; transform: translate(-50%, -50%) scale(0.2); animation: gg-ripple-burst 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) forwards; pointer-events: none; will-change: transform, opacity; } @keyframes gg-ripple-burst { 0% { transform: translate(-50%, -50%) scale(0.2); opacity: 0.95; } 55% { opacity: 0.55; } 100% { transform: translate(-50%, -50%) scale(2.9); opacity: 0; } } /* 糖果粒子:圆点用背景色,星屑用字形 + 发光 */ .game-page .gg-particle { position: absolute; border-radius: 50%; pointer-events: none; display: flex; align-items: center; justify-content: center; line-height: 1; will-change: transform, opacity, left, top; } .game-page .gg-particle.is-star { border-radius: 0; background-color: transparent !important; text-shadow: 0 0 6px currentColor, 0 0 12px currentColor; } .game-page .gg-particle text { color: inherit; line-height: 1; } /* 大消除全屏闪光 */ .game-page .gg-screen-flash { position: fixed; inset: 0; pointer-events: none; transition: opacity 0.28s ease-out; } @keyframes gg-pop-out { 0% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.3); opacity: 0.8; } 100% { transform: scale(0); opacity: 0; } } @keyframes gg-hint-glow { from { transform: scale(1); filter: brightness(1.05); } to { transform: scale(1.1); filter: brightness(1.25) saturate(1.3); } } /* 棋盘内食材图标 — 撑满格子,避免 flex 居中导致小程序 image 贴顶 */ .game-page .game-tile .food-tile-icon { pointer-events: none; z-index: 2; flex: 1; align-self: stretch; width: 100%; height: 100%; min-width: 0; min-height: 0; } .game-page .game-tile .food-tile-icon--tile .food-tile-icon__emoji { font-size: inherit; } .game-page .tile-icon { font-size: 48rpx; line-height: 1; pointer-events: none; } /* ===== 棋子含糖等级常驻角标(认知核心:一眼看出高/中/低糖) ===== */ .game-page .gg-tile-gi { position: absolute; top: -12rpx; left: 50%; transform: translateX(-50%); z-index: 5; min-width: 40rpx; padding: 6rpx 16rpx; border-radius: 999rpx; display: flex; align-items: center; justify-content: center; font-size: 22rpx; font-weight: 800; color: #ffffff; line-height: 1; letter-spacing: 1rpx; pointer-events: none; border: 1px solid rgba(255, 255, 255, 0.6); text-shadow: 0 1rpx 2rpx rgba(0, 0, 0, 0.2); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); } .game-page .gg-tile-gi.is-low { background: linear-gradient(135deg, rgba(91, 221, 168, 0.95), rgba(0, 166, 118, 0.95)); box-shadow: 0 4rpx 12rpx rgba(0, 166, 118, 0.4), inset 0 2rpx 4rpx rgba(255, 255, 255, 0.4); } .game-page .gg-tile-gi.is-mid { background: linear-gradient(135deg, rgba(251, 191, 36, 0.95), rgba(217, 119, 6, 0.95)); box-shadow: 0 4rpx 12rpx rgba(217, 119, 6, 0.4), inset 0 2rpx 4rpx rgba(255, 255, 255, 0.4); } .game-page .gg-tile-gi.is-high { background: linear-gradient(135deg, rgba(248, 113, 113, 0.95), rgba(186, 26, 26, 0.95)); box-shadow: 0 4rpx 12rpx rgba(186, 26, 26, 0.4), inset 0 2rpx 4rpx rgba(255, 255, 255, 0.4); } /* ===== 点击食物的大字科普卡 ===== */ .game-page .gg-food-card { position: fixed; left: 50%; top: 30%; transform: translateX(-50%); z-index: 150; width: 560rpx; max-width: 86vw; padding: 32rpx 36rpx; border-radius: 32rpx; background: #ffffff; border: 6rpx solid #16a34a; box-shadow: 0 20rpx 60rpx rgba(22, 29, 25, 0.22); pointer-events: none; animation: gg-food-card-in 0.28s cubic-bezier(0.34, 1.56, 0.64, 1); } .game-page .gg-food-card.is-mid { border-color: #ea580c; } .game-page .gg-food-card.is-high { border-color: #dc2626; } .game-page .gg-food-card-head { display: flex; align-items: center; gap: 20rpx; margin-bottom: 16rpx; } .game-page .gg-food-card-name { flex: 1; min-width: 0; font-size: 46rpx; font-weight: 900; color: #161d19; line-height: 1.2; } .game-page .gg-food-card-gi { flex-shrink: 0; font-size: 32rpx; font-weight: 900; color: #ffffff; padding: 8rpx 24rpx; border-radius: 999rpx; line-height: 1.2; } .game-page .gg-food-card-tip { display: block; font-size: 34rpx; font-weight: 600; color: #3c4a42; line-height: 1.5; } @keyframes gg-food-card-in { from { transform: translateX(-50%) scale(0.86); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } } /* ===== FX Layer ===== */ .game-page .gg-fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 100; } .game-page .gg-floating-val { position: absolute; font-weight: 900; font-size: 44rpx; text-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.1); transform: translateX(-50%); animation: gg-float-up 1s ease-out forwards; } @keyframes gg-float-up { 0% { transform: translate(-50%, 0) scale(0.5); opacity: 0; } 20% { transform: translate(-50%, -20px) scale(1.2); opacity: 1; } 100% { transform: translate(-50%, -60px) scale(1); opacity: 0; } } /* ===== Footer boosters(辅,弱化) ===== */ .game-page .gg-footer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; border-radius: 64rpx 64rpx 0 0; border-top: 1px solid #ffffff; box-shadow: 0 -12rpx 40rpx rgba(0, 0, 0, 0.08); padding-top: 24rpx; padding-left: 24rpx; padding-right: 24rpx; background: rgba(255, 255, 255, 0.7); backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px); } .game-page .gg-boosters { display: flex; justify-content: space-around; align-items: flex-start; max-width: 750rpx; margin: 0 auto; } /* 单个道具:图标卡 + 角标 + 文字 */ .game-page .gg-booster-btn { display: flex; flex-direction: column; align-items: center; padding: 8rpx 0; width: 184rpx; background: transparent; border: none; transition: transform 0.2s ease; } .game-page .gg-booster-tile { position: relative; width: 112rpx; height: 112rpx; border-radius: 36rpx; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.85); border: 1px solid #ffffff; box-shadow: 0 8rpx 18rpx rgba(0, 0, 0, 0.08), inset 0 1px 2px rgba(255, 255, 255, 0.9); transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease; } .game-page .gg-booster-btn--pressed .gg-booster-tile { transform: scale(0.92); box-shadow: 0 4rpx 10rpx rgba(0, 0, 0, 0.06); } .game-page .gg-booster-btn.is-disabled { opacity: 0.4; filter: grayscale(100%); pointer-events: none !important; } .game-page .gg-booster-count { position: absolute; top: -12rpx; right: -12rpx; min-width: 50rpx; height: 50rpx; padding: 0 10rpx; border-radius: 26rpx; color: #fff; font-size: 28rpx; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 3rpx solid #ffffff; box-shadow: 0 4rpx 10rpx rgba(0, 0, 0, 0.18); text-shadow: 0 1rpx 1rpx rgba(0, 0, 0, 0.2); z-index: 2; } .game-page .gg-booster-count.is-green { background: linear-gradient(135deg, #00a676, #006c4b); box-shadow: 0 4rpx 10rpx rgba(0, 166, 118, 0.3); } .game-page .gg-booster-count.is-orange { background: linear-gradient(135deg, #f59e0b, #d97706); box-shadow: 0 4rpx 10rpx rgba(217, 119, 6, 0.3); } .game-page .gg-booster-count.is-rose { background: linear-gradient(135deg, #ef4444, #ba1a1a); box-shadow: 0 4rpx 10rpx rgba(186, 26, 26, 0.3); } .game-page .gg-booster-icon { transition: transform 0.2s ease; } .game-page .gg-booster-label { margin-top: 14rpx; font-size: 30rpx; font-weight: 700; color: #3d4a42; letter-spacing: 1rpx; } /* ===== 高糖消除红色警示弹窗 ===== */ .game-page .gg-high-alert-overlay { position: fixed; inset: 0; z-index: 210; background: rgba(127, 29, 29, 0.45); backdrop-filter: blur(16rpx); display: flex; align-items: center; justify-content: center; padding: 48rpx; animation: gg-high-alert-fade-in 0.28s ease-out; } .game-page .gg-high-alert-card { width: 100%; max-width: 560rpx; padding: 48rpx 40rpx 44rpx; border-radius: 40rpx; background: linear-gradient(165deg, #fff5f5 0%, #ffffff 42%); border: 4rpx solid #dc2626; box-shadow: 0 0 0 8rpx rgba(220, 38, 38, 0.12), 0 24rpx 64rpx rgba(185, 28, 28, 0.35); display: flex; flex-direction: column; align-items: center; text-align: center; animation: gg-high-alert-pop 0.42s cubic-bezier(0.34, 1.45, 0.64, 1); } .game-page .gg-high-alert-icon-wrap { width: 96rpx; height: 96rpx; border-radius: 50%; background: linear-gradient(145deg, #ef4444, #b91c1c); display: flex; align-items: center; justify-content: center; margin-bottom: 24rpx; box-shadow: 0 12rpx 32rpx rgba(220, 38, 38, 0.45); animation: gg-high-badge-pulse 1.2s ease-in-out infinite; } .game-page .gg-high-alert-badge-row { display: flex; align-items: center; gap: 12rpx; margin-bottom: 16rpx; flex-wrap: wrap; justify-content: center; } .game-page .gg-high-alert-badge { font-size: 32rpx; font-weight: 900; color: #ffffff; background: #dc2626; padding: 8rpx 24rpx; border-radius: 12rpx; letter-spacing: 4rpx; box-shadow: 0 6rpx 16rpx rgba(220, 38, 38, 0.4); } .game-page .gg-high-alert-badge-sub { font-size: 24rpx; font-weight: 700; color: #b91c1c; } .game-page .gg-high-alert-title { font-size: 40rpx; font-weight: 900; color: #991b1b; line-height: 1.25; margin-bottom: 12rpx; } .game-page .gg-high-alert-name { font-size: 44rpx; font-weight: 900; color: #dc2626; line-height: 1.2; margin-bottom: 16rpx; } .game-page .gg-high-alert-tip { font-size: 30rpx; font-weight: 600; color: #7f1d1d; line-height: 1.45; opacity: 0.9; } @keyframes gg-high-alert-fade-in { from { opacity: 0; } to { opacity: 1; } } @keyframes gg-high-alert-pop { from { opacity: 0; transform: scale(0.82) translateY(24rpx); } to { opacity: 1; transform: scale(1) translateY(0); } } @keyframes gg-high-badge-pulse { 0%, 100% { transform: scale(1); box-shadow: 0 12rpx 32rpx rgba(220, 38, 38, 0.45); } 50% { transform: scale(1.06); box-shadow: 0 16rpx 40rpx rgba(220, 38, 38, 0.55); } } /* ===== Result overlay ===== */ .game-page .gg-result-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(22, 29, 25, 0.35); backdrop-filter: blur(20rpx); display: flex; align-items: center; justify-content: center; padding: 48rpx; } .game-page .gg-result-card { width: 100%; max-width: 600rpx; border-radius: 48rpx; padding: 64rpx 48rpx; background: #ffffff; border: 1.5rpx solid rgba(255, 255, 255, 0.8); display: flex; flex-direction: column; align-items: center; text-align: center; box-shadow: 0 30rpx 80rpx rgba(22, 29, 25, 0.18); } .game-page .gg-result-card.is-high-clear { border: 4rpx solid #dc2626; background: linear-gradient(180deg, #fff5f5 0%, #ffffff 36%); box-shadow: 0 0 0 6rpx rgba(220, 38, 38, 0.1), 0 30rpx 80rpx rgba(185, 28, 28, 0.22); } .game-page .gg-result-high-head { display: flex; align-items: center; gap: 12rpx; margin-bottom: 20rpx; } .game-page .gg-result-high-badge { font-size: 30rpx; font-weight: 900; color: #fff; background: #dc2626; padding: 6rpx 20rpx; border-radius: 10rpx; letter-spacing: 3rpx; box-shadow: 0 4rpx 14rpx rgba(220, 38, 38, 0.35); } .game-page .gg-result-high-tag { font-size: 28rpx; font-weight: 800; color: #b91c1c; padding: 6rpx 16rpx; border-radius: 999rpx; background: rgba(254, 226, 226, 0.9); border: 2rpx solid rgba(220, 38, 38, 0.35); } .game-page .gg-result-card.is-high-clear .gg-result-title { color: #991b1b; } .game-page .gg-result-card.is-high-clear .gg-result-sub { color: #7f1d1d; font-weight: 600; } .game-page .gg-result-stats.is-high-clear { background: #fef2f2; border: 2rpx solid rgba(220, 38, 38, 0.2); } .game-page .gg-result-stat-val.is-high-val { color: #dc2626; display: flex; align-items: center; justify-content: flex-end; gap: 8rpx; flex-wrap: wrap; } .game-page .gg-result-inline-badge { font-size: 22rpx; font-weight: 900; color: #fff; background: #dc2626; padding: 2rpx 10rpx; border-radius: 6rpx; line-height: 1.3; } .game-page .gg-result-btn.is-high-primary { background: linear-gradient(135deg, #ef4444, #b91c1c); box-shadow: 0 10rpx 28rpx rgba(220, 38, 38, 0.35); } .game-page .gg-result-title { font-size: 44rpx; font-weight: 900; color: #161d19; margin-bottom: 24rpx; } .game-page .gg-result-sub { font-size: 34rpx; color: #2b3a32; margin-bottom: 24rpx; line-height: 1.6; } .game-page .gg-combo-banner { position: fixed; left: 50%; top: 38%; transform: translate(-50%, -50%) scale(0.6); z-index: 120; padding: 20rpx 48rpx; border-radius: 999rpx; background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; font-size: 40rpx; font-weight: 900; text-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.2); box-shadow: 0 12rpx 40rpx rgba(245, 158, 11, 0.45); animation: gg-combo-pop 1.1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; pointer-events: none; } .game-page .gg-combo-banner.is-tier-2 { background: linear-gradient(135deg, #fb923c, #ea580c); font-size: 44rpx; } .game-page .gg-combo-banner.is-tier-3 { background: linear-gradient(135deg, #f472b6, #db2777); font-size: 48rpx; box-shadow: 0 16rpx 48rpx rgba(219, 39, 119, 0.5); } @keyframes gg-combo-pop { 0% { transform: translate(-50%, -50%) scale(0.4); opacity: 0; } 20% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; } 70% { transform: translate(-50%, -50%) scale(1); opacity: 1; } 100% { transform: translate(-50%, -60%) scale(0.85); opacity: 0; } } .game-page .gg-result-stars { display: flex; gap: 16rpx; margin-bottom: 20rpx; } .game-page .gg-result-star { font-size: 56rpx; color: #e2e8f0; line-height: 1; } .game-page .gg-result-star.is-lit { color: #fbbf24; text-shadow: 0 4rpx 12rpx rgba(251, 191, 36, 0.5); } .game-page .gg-result-stats { width: 100%; margin-bottom: 32rpx; padding: 24rpx 32rpx; background: #f8faf9; border-radius: 24rpx; } .game-page .gg-result-stat { display: flex; justify-content: space-between; padding: 10rpx 0; } .game-page .gg-result-stat-label { font-size: 32rpx; color: #475569; } .game-page .gg-result-stat-val { font-size: 32rpx; font-weight: 800; color: #161d19; } .game-page .gg-result-actions { display: flex; flex-wrap: wrap; gap: 16rpx; width: 100%; } .game-page .gg-result-btn { flex: 1 1 40%; min-width: 180rpx; padding: 32rpx 0; border-radius: 999rpx; font-size: 36rpx; font-weight: 800; text-align: center; background: #eef6ee; color: #2b3a32; transition: all 0.2s; } .game-page .gg-result-btn.is-primary { background: linear-gradient(135deg, #10b981, #006c49); color: #fff; box-shadow: 0 10rpx 24rpx rgba(0, 108, 73, 0.2); } .game-page .gg-result-btn:active { transform: scale(0.97); } @media (prefers-reduced-motion: reduce) { .game-page.is-screen-shake, .game-page .game-tile.is-hint, .game-page .gg-food-card, .game-page .gg-combo-banner, .game-page .gg-floating-val { animation: none !important; } }