/* 限时任务样式 — 主游戏覆盖层. 用游戏粉系 (#ff5c93 等), tq- 前缀避免跟 cm- / rw- / 任务面板撞. */

/* ── 限时任务卡片 — 迁移到主 UI v2 的限时竖卡拆层 ── */
.tq-card.cm-trigger-box {
  --ui-unit: calc(.6456px * var(--ui-top-control-scale, 1)); /* why: 与主画框共用 1920×1080 基准缩放；独立加载时回落 1 倍。 */
  --ui-editor-unit: calc(1.4128px * var(--ui-top-control-scale, 1)); /* why: 限时任务数字和卡片内容不再有 1.65px 封顶，跟页面连续同比缩放。 */
  position: absolute;
  /* why(用户改稿"左列垂直自动布局"): 走 stack 槽位定位(与 styles.css 的 .cm-gift-btn/.cm-trigger-box 同一套).
     本文件加载在 styles.css 之后(同特异性会赢), 故这里直接写 stack calc, 否则覆盖回旧 --ui-trigger-y. 槽位由 app.jsx 分配. */
  top: calc(var(--stack-top, 32%) + var(--stack-tq-slot, 2) * var(--stack-step, 14.5%));
  left: calc(var(--stack-left, 3%) + var(--stack-tq-col, 0) * var(--stack-col2-dx, 79%));
  transition: top .38s cubic-bezier(.3, .9, .35, 1.1), left .38s cubic-bezier(.3, .9, .35, 1.1);
  width: var(--ui-trigger-w, 14.7%); /* why: fallback matches the user 2026-07-01 UI editor export width */
  height: auto;
  min-height: 0;
  aspect-ratio: auto; /* why: 标题、目标和倒计时比普通礼包多一行；让框随真实内容增高，避免固定 154:216 比例把倒计时压到目标文字上。 */
  box-sizing: border-box;
  z-index: 35;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 calc(8 * var(--ui-editor-unit, 1px)); /* why: 百分比 padding 对绝对定位卡片会按外层画框宽度计算而异常拉长；固定 8 个设计单位只补足胶囊与进度条所需的一行。 */
  border: 0;
  border-radius: 0;
  color: var(--ui-v2-white, #f7fbff);
  background-color: transparent;
  background-image: url("../assets/ui/main-v2/panel_streak_base.png");
  background-position: top center;
  background-size: 100% calc(100% - var(--ui-asset-bottom-safe, 0%));
  background-repeat: no-repeat;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transform-origin: bottom center;
  isolation: isolate;
  overflow: visible; /* why: v2 拆层图标/计时胶囊/进度条都有外发光, 外层不能裁下沿 */
  /* why(用户"出现和消失和任务一样"): 出现从底淡入(cmCardEnter, 同任务条/礼包/限时框), 取代原 tq-card-v2-in 的从上springy弹入.
     此文件在 styles.css 之后加载, 这条覆盖 styles.css 里同名 .tq-card 规则(同款 cmCardEnter, 值一致). 退场 cmCardExit 见 styles.css .is-exiting. */
  animation: cmCardEnter .4s cubic-bezier(.2, .7, .2, 1) both;
}
.tq-card.cm-trigger-box::before {
  content: "";
  position: absolute;
  inset: 0 0 var(--ui-asset-bottom-safe, 0%) 0;
  border-radius: calc(14 * var(--ui-unit, 1px));
  background:
    linear-gradient(180deg, rgba(255, 255, 255, var(--ui-glass-highlight, .2)), rgba(255, 255, 255, .035)),
    rgba(8, 22, 34, var(--ui-glass-alpha, .34)); /* why: timed-quest.css 可独立加载, fallback 对齐主 UI v2 玻璃参数 */
  backdrop-filter: blur(var(--ui-glass-blur, calc(14 * var(--ui-editor-unit, 1px)))) saturate(var(--ui-glass-sat, 135%));
  -webkit-backdrop-filter: blur(var(--ui-glass-blur, calc(14 * var(--ui-editor-unit, 1px)))) saturate(var(--ui-glass-sat, 135%));
  box-shadow:
    inset 0 calc(1 * var(--ui-unit, 1px)) 0 rgba(255, 255, 255, .30),
    inset 0 calc(-12 * var(--ui-unit, 1px)) calc(18 * var(--ui-unit, 1px)) rgba(0, 0, 0, .16),
    0 0 calc(20 * var(--ui-unit, 1px)) rgba(255, 255, 255, var(--ui-glass-glow, .22));
  z-index: -1;
  pointer-events: none;
}
@keyframes tq-card-v2-in {
  from { opacity: 0; transform: translateY(calc(-8 * var(--ui-unit, 1px))) scale(.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.tq-card.cm-trigger-box.urgent {
  /* why: 同上改 cmCardEnter 出现, 紧迫脉动延后到出现完成(.4s)再起, 与礼包"出现完再浮动"同思路 */
  animation: cmCardEnter .4s cubic-bezier(.2, .7, .2, 1) both, tq-card-v2-urgent 1s ease-in-out .4s infinite;
}
@keyframes tq-card-v2-urgent {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(255, 126, 202, 0)); }
  50% { filter: drop-shadow(0 0 calc(10 * var(--ui-unit, 1px)) rgba(255, 126, 202, .75)); }
}

/* why: timed quest CSS loads after styles.css, so it repeats the v2 layering contract:
   glass below, PNG frame above glass, content/text/icon above both. */
.tq-card.cm-trigger-box {
  --ui-frame-image: url("../assets/ui/main-v2/panel_streak_base.png");
  background: none !important;
}
.tq-card.cm-trigger-box::before,
.tq-card.cm-trigger-box::after {
  content: "";
  position: absolute;
  inset: 0 0 var(--ui-asset-bottom-safe, 0%) 0;
  pointer-events: none;
}
.tq-card.cm-trigger-box::before {
  z-index: 0;
  border-radius: var(--ui-glass-radius, calc(14 * var(--ui-unit, 1px)));
  background:
    linear-gradient(180deg, rgba(255, 255, 255, var(--ui-glass-highlight, .02)), rgba(255, 255, 255, .035)),
    rgba(8, 22, 34, var(--ui-glass-alpha, 0));
  backdrop-filter: blur(var(--ui-glass-blur, calc(1 * var(--ui-editor-unit, 1px)))) saturate(var(--ui-glass-sat, 84%));
  -webkit-backdrop-filter: blur(var(--ui-glass-blur, calc(1 * var(--ui-editor-unit, 1px)))) saturate(var(--ui-glass-sat, 84%));
  box-shadow:
    inset 0 calc(1 * var(--ui-unit, 1px)) 0 rgba(255, 255, 255, .20),
    0 0 calc(18 * var(--ui-unit, 1px)) rgba(255, 255, 255, var(--ui-glass-glow, .08));
}
.tq-card.cm-trigger-box::after {
  z-index: 1;
  background: var(--ui-frame-image) top center/100% calc(100% - var(--ui-asset-bottom-safe, 0%)) no-repeat;
  filter:
    grayscale(1)
    sepia(1)
    saturate(var(--ui-machine-sat, 1.25))
    hue-rotate(var(--ui-machine-hue, 195deg))
    brightness(var(--ui-machine-bright, 1))
    drop-shadow(0 0 calc(7 * var(--ui-unit, 1px)) hsl(var(--ui-machine-hue, 195deg) 94% 70% / var(--ui-machine-glow-alpha, .32)));
  transition: filter 620ms cubic-bezier(.2, .7, .2, 1);
}
.tq-card.cm-trigger-box > * {
  position: relative;
  z-index: 2;
}
.cm-frame.is-ui-rainbow .tq-card.cm-trigger-box::after {
  animation: cmUiFrameHueSpin 920ms cubic-bezier(.2, .7, .2, 1);
}
.tq-card-v2-icon {
  display: block;
  flex: none;
  box-sizing: border-box;
  width: 80%;
  height: auto;
  aspect-ratio: 121 / 110; /* why: 卡片改为内容自适应后百分比高度没有稳定基准；按闹钟原图比例撑开，既保留图标大小又参与卡片自动增高。 */
  margin-top: 3%;
  padding: 4% 3% 0; /* why: 顶部大闹钟摇摆时铃铛像素会贴住自身绘制盒；独立透明安全区保证顶部和两侧始终完整。 */
  background-image: url("../assets/ui/main-v2/icon_streak_badge.png?v=bluealarm"); /* why: 同 styles.css — 换成 codex 蓝面金身闹钟, URL 带版本号刷掉旧紫面闹钟缓存 */
  background-origin: content-box;
  background-clip: content-box;
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  filter: drop-shadow(0 0 calc(10 * var(--ui-unit, 1px)) rgba(255, 189, 92, .50));
  transform: translate(var(--ui-trigger-icon-dx, 0px), var(--ui-trigger-icon-dy, 0px)) scale(var(--ui-trigger-icon-scale, 1));
  transform-origin: center;
}
.tq-card-v2-title {
  display: block;
  width: 100%;
  margin-top: -2%;
  text-align: center;
  font-size: var(--ui-trigger-title-font, calc(12 * var(--ui-editor-unit, 1px)));
  font-weight: 800;
  line-height: var(--ui-text-line-safe, 1.12);
  letter-spacing: .02em;
  /* why(用户"限时任务四字辉光看不清, 加强一点"): 白辉光提亮(.35→.95)缩紧成实光, 叠一层青色主题辉光(呼应限时任务全息青), 加深底影 → 暗背景上四字清晰可读 */
  text-shadow: 0 0 calc(5 * var(--ui-unit, 1px)) rgba(255, 255, 255, .95), 0 calc(1 * var(--ui-unit, 1px)) calc(3 * var(--ui-unit, 1px)) rgba(0, 0, 0, .92), 0 0 calc(2 * var(--ui-unit, 1px)) rgba(0, 0, 0, .8);
  transform: translate(var(--ui-trigger-title-dx, 0px), var(--ui-trigger-title-dy, 0px));
  pointer-events: none;
}
.tq-card-v2-goal {
  display: block;
  width: 84%;
  margin-top: 2%;
  padding-left: calc(4 * var(--ui-editor-unit, 1px)); /* why: 白色任务描述整体右移一个小字距，避免首字符贴住卡片左边缘。 */
  overflow: hidden;
  color: rgba(245, 250, 255, .84);
  font-size: calc(9 * var(--ui-editor-unit, 1px));
  font-weight: 700;
  line-height: var(--ui-text-line-safe, 1.12);
  text-align: left; /* why: 居中长句会同时产生不可滚到的左侧负溢出；从阅读起点左对齐后可完整连续滚到句尾。 */
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 calc(1 * var(--ui-unit, 1px)) calc(2 * var(--ui-unit, 1px)) rgba(0, 0, 0, .62);
  pointer-events: none;
}
.tq-card-v2-timer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(5 * var(--ui-unit, 1px));
  width: 73%;
  aspect-ratio: 109 / 46; /* why: timer pill PNG was cropped from the user-provided base frame at 109x46 */
  margin-top: 6%;
  color: #ffb6db;
  background-image: url("../assets/ui/main-v2/timer_streak_pill_base.png");
  background-position: top center;
  background-size: 100% calc(100% - var(--ui-asset-bottom-safe, 0%));
  background-repeat: no-repeat;
  font-size: var(--ui-trigger-timer-font, calc(11 * var(--ui-editor-unit, 1px)));
  font-weight: 800;
  line-height: var(--ui-text-line-safe, 1.12);
  text-shadow: 0 0 calc(8 * var(--ui-unit, 1px)) rgba(255, 126, 202, .62);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.tq-card-v2-timer .cm-mini-clock {
  display: block;
  flex: none;
  width: 21%;
  height: auto;
  aspect-ratio: 1 / 1; /* why: 用户要求小时钟显示盒为正圆；原图 23:22 的轻微扁比例交给 contain 留白，不再把显示框拉成长方形。 */
  background-image: url("../assets/ui/main-v2/icon_streak_timer_clock.png");
  /* why(用户"底部小钟保持圆形不被拉伸"): 元素框 21%×52% 非等比, 原 background-size:100%×100% 会把圆钟拉扁.
     改 contain → 圆钟按自身比例在框内居中显示, 只圆不拉伸(框尺寸不动, 零布局风险; 嫌小就调 --ui-trigger-clock-scale). */
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  transform: scale(1.7); /* why: 1 倍实测只有约 13px 太小；放回约 22px 的原视觉大小，同时 23:22 正圆盒和 flex 中线保证不拉伸、不上移。 */
  transform-origin: center;
}
/* why(用户"限时任务有动效的是上面的闹钟png图片, 不是底下的小时钟"): sway 从底部倒计时行的小时钟 .cm-mini-clock
   挪到顶部大闹钟徽章 .tq-card-v2-icon(icon_streak_badge.png). keyframes 用独立 rotate/translate/scale longhand,
   与 .tq-card-v2-icon 自身定位 transform(translate+scale)组合不打架; 底部小时钟从此静止. */
.tq-card-v2-icon { animation: cmQuestClockSway 1.7s ease-in-out infinite; }
/* why(用户"底下的时钟不要动效"): 底部倒计时行小时钟 .cm-mini-clock-pink 有全局 cmTriggerClockJiggle 打底, sway 移走后会回落到 jiggle 仍在抖 →
   在限时任务卡内显式关掉(scope 到 .tq-card-v2-timer, 不影响别处"限时连点触发框"的 .cm-mini-clock-pink jiggle). */
.tq-card-v2-timer .cm-mini-clock { animation: none; }
@keyframes cmQuestClockSway {
  0%, 100% { rotate: -9deg; translate: -2px 0; scale: 1; }
  20% { rotate: 0deg; translate: 0 -4px; scale: 1.09; }
  40% { rotate: 9deg; translate: 2px 0; scale: 1; }
  60% { rotate: 0deg; translate: 0 -3px; scale: 1.05; }
  80% { rotate: -9deg; translate: -2px 0; scale: 1; }
}
.tq-card-v2-timer .cm-trigger-timer-text {
  display: block;
  font-size: var(--ui-trigger-timer-font, calc(11 * var(--ui-editor-unit, 1px)));
  line-height: var(--ui-text-line-safe, 1.12);
  transform: none; /* why: 限时任务倒计时文字与小时钟交给胶囊 flex 居中，不继承外部编辑器的负向位移。 */
}
.tq-card.cm-trigger-box > .tq-card-v2-meter {
  position: absolute;
  left: 16%;
  right: 16%;
  bottom: 5%;
  height: calc(7 * var(--ui-unit, 1px)); /* why: 卡片高度改为内容自适应后百分比高度会解析为 0；沿用旧框约 7px 的视觉粗细，确保剩余时间条仍可见。 */
  border-radius: 999px;
  overflow: hidden;
  pointer-events: none;
}
.tq-card-v2-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255, 126, 202, .98), rgba(255, 189, 228, .92));
  box-shadow: 0 0 calc(8 * var(--ui-unit, 1px)) rgba(255, 126, 202, .78);
  transition: width .4s ease;
}

/* ── 触发横幅 (居中, 短暂) — 全息投影款 (抄主页 .cm-ad-popup.cm-holo: 无框/中心放射暗影/青扫描线/故障抽搐) ── */
.tq-announce {
  position: absolute;
  top: 32%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(300px, calc(100% - 48px));
  padding: 20px 22px;
  border-radius: 16px;
  text-align: center;
  overflow: visible; /* 炫彩: 彩虹::after靠blur向外发光需可溢出; ::before现是inset:0梯度边框不需hidden裁 */
  /* why: 全息青三件套 — 主青/高亮青/辉光, 给标题色散/扫描线共用 */
  --tq-cyan: #ffffff;
  --tq-cyan-bright: #ffffff;
  --tq-glow: rgba(255, 255, 255, .5);
  /* why: 抄 cm-holo — 去边框去底色, 只留中心放射暗影(衬住文字)+极淡青辉光, 像悬空全息面板 */
  border: none;
  /* iOS玻璃: 去青辐射底改玻璃(specular + 淡深垫底); backdrop 由 styles.css .tq-announce 共用规则给 */
  background: var(--cm-glass-specular), var(--cm-glass-popup-tint);
  color: #ffffff;
  text-shadow: var(--cm-glass-text-outline);
  box-shadow: var(--cm-glass-shadow);
  z-index: 230;
  pointer-events: none;
  /* 弹跳入场 + 呼吸; 去 tq-holo-glitch 故障 */
  /* why: 保留 .45s 弹跳入场；浅亮玻璃不再挂 5s 常驻强呼吸。 */
  animation: tq-announce-in .45s cubic-bezier(.2, 1.3, .4, 1) both;
}
/* iOS玻璃: 扫描线 ::before 改渐变受光描边 */
.tq-announce::before {
  content: ""; position: absolute; inset: 0; z-index: 2;
  pointer-events: none; border-radius: inherit; padding: 1px;
  background: var(--cm-glass-edge);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.tq-announce > * { position: relative; z-index: 1; } /* why: 内容压在扫描线上, 文字清晰 */
/* 用户: 限时任务加炫彩 — 同弹窗那套四边渐变彩虹边框(从外到内逐渐变透明). --cm-laser-a/cmLaserSpin 由 styles.css 全局提供 */
.tq-announce::after {
  content: ""; position: absolute; inset: 0; z-index: 0; border-radius: inherit;
  background: conic-gradient(from var(--cm-laser-a), #ff3d8b, #ff9a3d, #ffe23d, #6fff9e, #4ac8ff, #b46cff, #ff3d8b);
  -webkit-mask:
    linear-gradient(to top, #000, transparent 32px),
    linear-gradient(to bottom, #000, transparent 32px),
    linear-gradient(to left, #000, transparent 32px),
    linear-gradient(to right, #000, transparent 32px);
  mask:
    linear-gradient(to top, #000, transparent 32px),
    linear-gradient(to bottom, #000, transparent 32px),
    linear-gradient(to left, #000, transparent 32px),
    linear-gradient(to right, #000, transparent 32px);
  -webkit-mask-composite: source-over; mask-composite: add;
  filter: blur(3px); opacity: .6; mix-blend-mode: screen;
  animation: cmLaserSpin 8s linear infinite; pointer-events: none;
}
@keyframes tq-announce-in {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(.7); }
  60%  { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
/* why: 退场 = 缩回限时任务卡片(.tq-card 左下角) — JS 量出横幅中心→卡片中心位移注入 --tq-dx/dy.
   先微鼓(18% 1.06)蓄力, 再缩到 .2 并平移到卡片位置淡出, 像"横幅收进卡片". 覆盖呼吸/glitch 那串无限动画. */
.tq-announce.is-closing {
  animation: tq-announce-out .4s cubic-bezier(.5, 0, .75, .4) forwards;
}
@keyframes tq-announce-out {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  18%  { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--tq-dx, 0px)), calc(-50% + var(--tq-dy, 0px))) scale(.2); }
}
@keyframes tq-holo-breathe {
  0%, 100% { filter: brightness(1)    saturate(1);    }
  50%      { filter: brightness(1.09) saturate(1.08); }
}
@keyframes tq-holo-scan {
  0%   { background-position-y: 0; }
  100% { background-position-y: 3px; }
}
/* why: 故障抽搐 — 抄 cmMultGlitch, 每 5s 三段(切片跳/斜切/双闪); translate(-50%,-50%) 写进每帧保持居中 */
@keyframes tq-holo-glitch {
  0%, 17%  { transform: translate(-50%, -50%) skewX(0); opacity: 1; }
  18%      { transform: translate(calc(-50% - 4px), -50%) skewX(0); opacity: .72; }
  18.8%    { transform: translate(calc(-50% + 4px), -50%); opacity: 1; }
  19.6%    { transform: translate(-50%, -50%); }
  46%      { transform: translate(-50%, -50%) skewX(0); opacity: 1; }
  47%      { transform: translate(calc(-50% + 2px), calc(-50% - 1px)) skewX(6deg); opacity: .85; }
  47.7%    { transform: translate(calc(-50% - 2px), calc(-50% + 1px)) skewX(-5deg); opacity: 1; }
  48.4%    { transform: translate(-50%, -50%) skewX(0); }
  73%      { transform: translate(-50%, -50%); opacity: 1; }
  73.6%    { transform: translate(calc(-50% + 3px), -50%); opacity: .6; }
  74%      { transform: translate(-50%, -50%); opacity: 1; }
  74.6%    { transform: translate(calc(-50% - 2px), -50%); opacity: .7; }
  75%      { transform: translate(-50%, -50%); opacity: 1; }
  100%     { transform: translate(-50%, -50%) skewX(0); opacity: 1; }
}
.tq-announce-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #ffffff; /* 用户: 蓝底白字 */
  background: linear-gradient(90deg, #5ab6f5, #3a86e0); /* 用户: 标签改蓝色背景 */
  padding: 3px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
  box-shadow: 0 0 12px rgba(90, 182, 245, .55); /* 蓝辉光呼应蓝底 */
}
.tq-announce-title {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .04em;
  color: #ffffff;
  text-shadow: var(--cm-glass-text-outline);
  margin-bottom: 6px;
}
@keyframes tq-holo-title-glitch {
  0%, 17.5%, 20%, 46.5%, 49%, 73%, 75.5%, 100% { text-shadow: 0 0 22px var(--tq-glow), 0 0 4px rgba(255, 255, 255, .6); }
  18.4% { text-shadow: -3px 0 rgba(255,60,180,.9),  3px 0 rgba(60,225,255,.9),  0 0 22px var(--tq-glow); }
  47.4% { text-shadow:  2px -1px rgba(255,60,180,.8), -2px 1px rgba(60,225,255,.8), 0 0 22px var(--tq-glow); }
  73.8% { text-shadow: -2px 0 rgba(255,60,180,.75),  2px 0 rgba(60,225,255,.75),  0 0 22px var(--tq-glow); }
}
.tq-announce-goal {
  font-size: 13px;
  color: rgba(255, 255, 255, .9);
  text-shadow: var(--cm-glass-text-outline);
  margin-bottom: 10px;
}
.tq-announce-reward {
  font-size: 12px;
  font-weight: 700;
  color: #ffe1a0;
  text-shadow: var(--cm-glass-text-outline);
  padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, .18);
}

/* ── 完成领奖弹窗 — 全息投影款 (跟触发横幅/主页全息弹窗同皮: 无框/中心放射暗影/青扫描线/故障抽搐) ── */
.tq-claim-mask {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  /* why: 改青蓝暗底 (原品红紫), 跟全息青调统一; 仍压暗背景聚焦领奖 */
  background: rgba(4, 12, 26, .62);
  backdrop-filter: blur(3px);
  z-index: 240;
  animation: tq-fade .25s ease both;
}
@keyframes tq-fade { from { opacity: 0; } to { opacity: 1; } }
.tq-claim {
  position: relative;
  width: min(300px, calc(100% - 56px));
  padding: 26px 24px 22px;
  border-radius: 16px;
  text-align: center;
  overflow: visible; /* 炫彩: 彩虹::after靠blur向外发光需可溢出; ::before现是inset:0梯度边框不需hidden裁 */
  /* why: 全息青三件套 — 主青/高亮青/辉光, 给标题/扫描线/按钮共用 */
  --tq-cyan: #ffffff;
  --tq-cyan-bright: #ffffff;
  --tq-glow: rgba(255, 255, 255, .5);
  /* why: 抄 cm-holo — 去边框去实底, 只留中心放射暗影(衬住文字)+极淡青辉光, 像悬空全息面板 */
  border: none;
  /* iOS玻璃: 去青辐射底改玻璃 */
  background: var(--cm-glass-specular), var(--cm-glass-popup-tint);
  color: #ffffff;
  text-shadow: var(--cm-glass-text-outline);
  box-shadow: var(--cm-glass-shadow);
  -webkit-backdrop-filter: var(--cm-glass-backdrop-fb);
  backdrop-filter: var(--cm-glass-backdrop);
  /* 跳出入场 + 呼吸; 去 tq-claim-glitch 故障 */
  /* why: 保留 .45s 跳出入场；浅亮玻璃不再挂 5s 常驻强呼吸。 */
  animation: tq-claim-pop .45s cubic-bezier(.2, 1.3, .4, 1) both;
}
/* iOS玻璃: 扫描线 ::before 改渐变受光描边 */
.tq-claim::before {
  content: ""; position: absolute; inset: 0; z-index: 2;
  pointer-events: none; border-radius: inherit; padding: 1px;
  background: var(--cm-glass-edge);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.tq-claim > * { position: relative; z-index: 1; } /* why: 内容压在扫描线上, 文字清晰 */
/* 用户: 限时任务领奖弹窗加炫彩 — 同款四边渐变彩虹边框(从外到内逐渐变透明) */
.tq-claim::after {
  content: ""; position: absolute; inset: 0; z-index: 0; border-radius: inherit;
  background: conic-gradient(from var(--cm-laser-a), #ff3d8b, #ff9a3d, #ffe23d, #6fff9e, #4ac8ff, #b46cff, #ff3d8b);
  -webkit-mask:
    linear-gradient(to top, #000, transparent 36px),
    linear-gradient(to bottom, #000, transparent 36px),
    linear-gradient(to left, #000, transparent 36px),
    linear-gradient(to right, #000, transparent 36px);
  mask:
    linear-gradient(to top, #000, transparent 36px),
    linear-gradient(to bottom, #000, transparent 36px),
    linear-gradient(to left, #000, transparent 36px),
    linear-gradient(to right, #000, transparent 36px);
  -webkit-mask-composite: source-over; mask-composite: add;
  filter: blur(3px); opacity: .6; mix-blend-mode: screen;
  animation: cmLaserSpin 8s linear infinite; pointer-events: none;
}
/* why: 跳出 — 从中心缩着弹出放大, 55% 过冲 1.08 回弹到 1 (同 cmPopBounceIn 弹跳曲线, 但居中无位移) */
@keyframes tq-claim-pop {
  0%   { opacity: 0; transform: scale(.25); }
  55%  { opacity: 1; transform: scale(1.08); }
  78%  { opacity: 1; transform: scale(.97); }
  100% { opacity: 1; transform: scale(1); }
}
/* why: 故障抽搐 — 抄 tq-holo-glitch, 但弹窗居中(grid)无需 -50%, 直接小幅平移/斜切 */
@keyframes tq-claim-glitch {
  0%, 17%  { transform: scale(1) skewX(0); opacity: 1; }
  18%      { transform: translateX(-4px); opacity: .72; }
  18.8%    { transform: translateX(4px); opacity: 1; }
  19.6%    { transform: translateX(0); }
  46%      { transform: scale(1) skewX(0); opacity: 1; }
  47%      { transform: translate(2px, -1px) skewX(6deg); opacity: .85; }
  47.7%    { transform: translate(-2px, 1px) skewX(-5deg); opacity: 1; }
  48.4%    { transform: translate(0, 0) skewX(0); }
  73%      { transform: scale(1); opacity: 1; }
  73.6%    { transform: translateX(3px); opacity: .6; }
  74%      { transform: translateX(0); opacity: 1; }
  74.6%    { transform: translateX(-2px); opacity: .7; }
  75%      { transform: translateX(0); opacity: 1; }
  100%     { transform: scale(1) skewX(0); opacity: 1; }
}
.tq-claim-burst {
  font-size: 46px;
  line-height: 1;
  margin-bottom: 6px;
  animation: tq-pop .6s ease both;
}
@keyframes tq-pop {
  0% { transform: scale(0); }
  60% { transform: scale(1.25); }
  100% { transform: scale(1); }
}
.tq-claim h3 {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: var(--cm-glass-text-outline);
}
.tq-claim-name {
  font-size: 13px;
  color: rgba(255, 255, 255, .85);
  text-shadow: var(--cm-glass-text-outline);
  margin-bottom: 14px;
}
.tq-claim-reward {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  border-radius: var(--cm-glass-r-btn);
  /* iOS玻璃: 去青膜改中性淡白玻璃 */
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .16);
  margin-bottom: 18px;
}
.tq-claim-reward-icon {
  font-size: 30px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .5));
}
.tq-claim-reward-text {
  font-size: 15px;
  font-weight: 800;
  color: #ffe1a0; /* 奖励文字暖金强调 */
  text-shadow: var(--cm-glass-text-outline);
}
.tq-claim-btn {
  width: 100%;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: var(--cm-glass-r-btn);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #ffffff;
  text-shadow: var(--cm-glass-text-outline);
  /* iOS玻璃: 领奖按钮改中性玻璃(主操作稍亮) */
  background: var(--cm-glass-specular), rgba(255, 255, 255, .16);
  box-shadow: var(--cm-glass-shadow);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.tq-claim-btn:active {
  transform: scale(.96);
  box-shadow: var(--cm-glass-shadow);
}

/* ── 详情弹窗 (任务3: 点任务卡片打开) — 骨架复用 .tq-claim-mask/.tq-claim 全息皮肤, 这里只补内容行样式 ── */
.tq-detail {
  text-align: left; /* why: 详情是"目标/进度/倒计时"多行信息, 左对齐比居中易扫读; 标题/按钮各自居中覆盖 */
}
.tq-detail .tq-announce-tag {
  display: block;
  width: fit-content;
  margin: 0 auto 10px; /* why: 标签胶囊仍居中 — 跟触发横幅的记忆点一致 */
}
.tq-detail-title {
  font-size: 20px;
  font-weight: 900;
  text-align: center;
  color: var(--tq-cyan-bright);
  text-shadow: 0 0 18px var(--tq-glow), 0 0 4px rgba(255, 255, 255, .6);
  margin-bottom: 14px;
}
.tq-detail-row {
  font-size: 13px;
  color: rgba(255, 255, 255, .88);
  text-shadow: var(--cm-glass-text-outline);
  margin-bottom: 8px;
}
.tq-detail-row b {
  font-weight: 800;
  color: var(--tq-cyan-bright);
  text-shadow: 0 0 12px var(--tq-glow);
}
.tq-detail-done {
  font-size: 11px;
  font-weight: 800;
  color: #ffe1a0; /* why(iOS玻璃): 达成态绿→暖金(完成用金色更贴合, 同主界面满级/礼包达成态) */
  text-shadow: var(--cm-glass-text-outline); /* why(iOS玻璃): 去绿荧光字辉光→黑描边 token (与 styles.css 同文档加载, var 可解析) */
}
.tq-detail-meter {
  height: 8px; /* why: 弹窗里的进度条比卡片版(4.6%卡高)粗一档, 详情页要一眼读出进度 */
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 126, 202, .18);
  margin: 2px 0 12px;
}
.tq-detail-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255, 126, 202, .98), rgba(255, 189, 228, .92)); /* why: 同任务卡片进度条配色, 卡片↔弹窗视觉连续 */
  box-shadow: 0 0 8px rgba(255, 126, 202, .78);
  transition: width .4s ease;
}
.tq-detail-remain.urgent b {
  color: #ff9ec1; /* why: 剩余 <10min 倒计时转粉红告警, 跟卡片 urgent 脉动同色系 */
  text-shadow: 0 0 12px rgba(255, 126, 202, .85);
  animation: tq-detail-urgent 1s ease-in-out infinite;
}
@keyframes tq-detail-urgent {
  0%, 100% { opacity: 1; }
  50% { opacity: .55; } /* why: 只闪透明度不动布局, 弹窗内文字抖动会晕 */
}
.tq-detail .tq-announce-reward {
  text-align: center;
  margin-bottom: 16px; /* why: 奖励行和"知道了"按钮之间留缝, 不然按钮顶着分隔线 */
}

/* ── 限时任务浅亮玻璃覆盖层 ──
   why: 本文件晚于 styles.css 加载，需显式接回主界面的浅亮玻璃 token，并移除常驻呼吸/故障感。 */
:is(.tq-announce, .tq-claim, .tq-detail) {
  border: 1.5px solid var(--cm-light-popup-border);
  border-radius: 15px;
  background: var(--cm-light-popup-bg);
  -webkit-backdrop-filter: var(--cm-light-popup-backdrop);
  backdrop-filter: var(--cm-light-popup-backdrop);
  box-shadow: var(--cm-light-popup-shadow);
  isolation: isolate;
  overflow: visible;
}
:is(.tq-announce, .tq-claim, .tq-detail) > * { position: relative; z-index: 1; }
/* why: 任务横幅保留 450ms 快速出现和收回任务卡片的专属退场，只删除 5s 无限呼吸。 */
.tq-announce { animation: tq-announce-in .45s cubic-bezier(.2, 1.3, .4, 1) both; }
.tq-announce.is-closing { animation: tq-announce-out .4s cubic-bezier(.5, 0, .75, .4) forwards; }
/* why: 领奖与详情使用主界面轻回弹幅度，420ms 内完成且不再无限呼吸。 */
:is(.tq-claim, .tq-detail) { animation: cmLightGlassPanelIn 420ms cubic-bezier(.18, .78, .24, 1) both; }
/* why: 任务弹窗沿用家园弹窗的 44px 内晕、4px 柔化和 8s 慢速旋转，避免面板泛白。 */
:is(.tq-announce, .tq-claim, .tq-detail)::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: conic-gradient(from var(--cm-light-prism-angle), #ff3d8b, #ff9a3d, #ffe23d, #6fff9e, #4ac8ff, #b46cff, #ff3d8b);
  -webkit-mask: linear-gradient(to right, #000, transparent 44px) left / 44px 100% no-repeat, linear-gradient(to left, #000, transparent 44px) right / 44px 100% no-repeat, linear-gradient(to bottom, #000, transparent 44px) top / 100% 44px no-repeat, linear-gradient(to top, #000, transparent 44px) bottom / 100% 44px no-repeat;
  mask: linear-gradient(to right, #000, transparent 44px) left / 44px 100% no-repeat, linear-gradient(to left, #000, transparent 44px) right / 44px 100% no-repeat, linear-gradient(to bottom, #000, transparent 44px) top / 100% 44px no-repeat, linear-gradient(to top, #000, transparent 44px) bottom / 100% 44px no-repeat;
  -webkit-mask-composite: source-over;
  mask-composite: add;
  filter: blur(4px);
  opacity: .6;
  mix-blend-mode: screen;
  animation: cmLightPrismDrift 8s linear infinite;
  pointer-events: none;
}
/* why: 1.5px 静态棱镜边逐项复刻家园弹窗，彩边不旋转、不闪烁。 */
:is(.tq-announce, .tq-claim, .tq-detail)::after {
  content: "";
  position: absolute;
  inset: -1.5px;
  z-index: -1;
  padding: 1.5px;
  border-radius: inherit;
  background: conic-gradient(from 212deg, rgba(88, 232, 255, .92), rgba(154, 130, 255, .74), rgba(255, 142, 220, .68), rgba(255, 230, 166, .62), rgba(132, 255, 229, .84), rgba(88, 232, 255, .92));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  filter: drop-shadow(0 0 2px rgba(164, 226, 255, .28));
  opacity: .78;
  animation: none;
  pointer-events: none;
}
/* why: 领奖按钮复刻家园升级按钮的浅玻璃，保留原宽高和按压缩放。 */
.tq-claim-btn {
  position: relative;
  isolation: isolate;
  overflow: visible;
  border-color: rgba(210, 246, 255, .58);
  border-radius: 10px;
  background: var(--cm-light-button-rainbow), var(--cm-light-button-primary-bg);
  box-shadow: var(--cm-light-button-primary-shadow);
  text-shadow: 0 0 4px rgba(255, 255, 255, .32), 0 2px 6px rgba(0, 0, 0, .94);
  -webkit-backdrop-filter: blur(3px) saturate(.9);
  backdrop-filter: blur(3px) saturate(.9);
}
/* why: 领奖按钮使用家园按钮同款 -20% 彩虹光圈，视觉层不参与命中测试。 */
.tq-claim-btn::after {
  content: "";
  position: absolute;
  inset: -20%;
  z-index: -1;
  border-radius: 50%;
  background: conic-gradient(from var(--cm-light-prism-angle), #ff3d8b, #ff9a3d, #ffe23d, #6fff9e, #4ac8ff, #b46cff, #ff3d8b);
  -webkit-mask: radial-gradient(closest-side, #000 24%, rgba(0, 0, 0, .4) 54%, transparent 80%);
  mask: radial-gradient(closest-side, #000 24%, rgba(0, 0, 0, .4) 54%, transparent 80%);
  filter: blur(16px);
  opacity: .68;
  mix-blend-mode: screen;
  animation: cmLightPrismDrift 8s linear infinite;
  pointer-events: none;
}
