/* ============================================================
   签到奖励浮层  —  风格对齐原站：白底 / #eb0909 品牌红 / 扁平圆角卡 / 轻阴影
   独立作用域：类名 tk- 前缀。支持 RTL(ar / farsi)。
   ============================================================ */
:root {
  --tk-main: #eb0909;
  --tk-main-d: #c80707;
  --tk-main-l: #ff5a55;
  --tk-soft: #fff1f0;
  --tk-gold: #ffb400;
  --tk-gold-d: #f59200;
  --tk-bg: #f8f8f8;
  --tk-line: #eeeeee;
  --tk-text: #1a1a1a;
  --tk-sub: #8a8a8a;
}

.tk-root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
               "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--tk-text);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}

.tk-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  animation: tkFade .2s ease both;
}
.tk-mask.tk-out { animation: tkFadeOut .16s ease both; }
@keyframes tkFade { from { opacity: 0 } to { opacity: 1 } }
@keyframes tkFadeOut { from { opacity: 1 } to { opacity: 0 } }

/* ---------- 卡片：白底 + 轻阴影（对齐站点卡片） ---------- */
.tk-card {
  width: 100%;
  max-width: 360px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .16);
  overflow: hidden;
  animation: tkPop .26s cubic-bezier(.2, .9, .3, 1.25) both;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
}
@keyframes tkPop {
  from { opacity: 0; transform: translateY(18px) scale(.94) }
  to   { opacity: 1; transform: translateY(0) scale(1) }
}

/* 顶部：白底 + 红色标题（不再用蓝渐变） */
.tk-hero {
  background: #fff;
  padding: 26px 20px 18px;
  text-align: center;
  position: relative;
  flex-shrink: 0;
}
.tk-hero-badge {
  display: inline-block;
  background: var(--tk-soft);
  color: var(--tk-main);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .4px;
  margin-bottom: 14px;
}
.tk-coin {
  width: 62px; height: 62px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--tk-gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 23px; font-weight: 800; color: #fff;
  letter-spacing: -0.5px;
  box-shadow: 0 4px 12px rgba(255, 180, 0, .35);
  animation: tkCoinFloat 2.6s ease-in-out infinite;
}
@keyframes tkCoinFloat {
  0%,100% { transform: translateY(0) rotate(-3deg) }
  50%     { transform: translateY(-6px) rotate(3deg) }
}
.tk-hero-title {
  font-size: 25px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--tk-main);
  letter-spacing: .2px;
}
.tk-hero-title em { font-style: normal; }
.tk-hero-sub {
  margin-top: 8px;
  font-size: 13px;
  color: var(--tk-sub);
  line-height: 1.5;
}

.tk-body { padding: 4px 20px 20px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.tk-tip {
  background: var(--tk-bg);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 12.5px;
  color: #6b6b6b;
  line-height: 1.65;
  margin: 4px 0 16px;
}
.tk-tip b { color: var(--tk-main); font-weight: 700; }

/* ---------- 按钮：红色实心（站点强调色） ---------- */
.tk-btn {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 24px;
  padding: 13px;
  font-size: 15.5px;
  font-weight: 700;
  color: #fff;
  background: var(--tk-main);
  cursor: pointer;
  transition: transform .12s ease, opacity .2s ease;
  letter-spacing: .3px;
}
.tk-btn:active { transform: scale(.975); }
.tk-btn[disabled], .tk-btn.is-done {
  background: #f0f0f0;
  color: #9a9a9a;
  cursor: default;
}
.tk-btn-ghost {
  margin-top: 8px;
  background: transparent;
  color: var(--tk-sub);
  font-size: 13px;
  font-weight: 500;
  padding: 9px;
}

.tk-x {
  position: absolute;
  top: 10px; inset-inline-end: 10px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--tk-bg);
  color: #999;
  border: 0;
  font-size: 15px;
  line-height: 28px;
  cursor: pointer;
  z-index: 3;
}

/* ---------- 签到页 ---------- */
.tk-page {
  position: fixed;
  inset: 0;
  background: var(--tk-bg);
  z-index: 2147483001;
  display: flex;
  flex-direction: column;
  animation: tkSlide .24s ease both;
  max-width: 640px;
  margin: 0 auto;
}
@keyframes tkSlide { from { transform: translateY(100%) } to { transform: translateY(0) } }

.tk-nav {
  background: #fff;
  color: var(--tk-text);
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 12px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--tk-line);
  flex-shrink: 0;
}
.tk-nav h2 { flex: 1; font-size: 16.5px; font-weight: 700; text-align: center; margin: 0; }
.tk-nav button {
  background: transparent;
  border: 0;
  color: var(--tk-main);
  font-size: 13.5px;
  cursor: pointer;
  padding: 6px 4px;
  min-width: 48px;
}
.tk-nav .r { color: var(--tk-sub); text-align: end; }

.tk-page-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px; }

.tk-balance {
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
  margin-bottom: 12px;
  text-align: center;
}
.tk-balance .lb { font-size: 12.5px; color: var(--tk-sub); }
.tk-balance .num { font-size: 34px; font-weight: 800; color: var(--tk-main); margin: 4px 0 10px; }
.tk-balance .num small { font-size: 15px; margin-inline-start: 2px; }
.tk-balance .row {
  display: flex; justify-content: space-between;
  font-size: 12.5px; color: var(--tk-sub);
  border-top: 1px solid var(--tk-line); padding-top: 10px;
}
.tk-balance .row b { color: var(--tk-text); font-weight: 600; }

.tk-card-box {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
}
.tk-card-box h3 {
  margin: 0 0 12px;
  font-size: 14.5px;
  font-weight: 700;
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.tk-card-box h3 span { font-size: 11.5px; color: var(--tk-sub); font-weight: 500; }

.tk-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.tk-day {
  background: #fff;
  border: 1.5px solid var(--tk-line);
  border-radius: 11px;
  padding: 10px 3px 8px;
  text-align: center;
  position: relative;
}
.tk-day .d { font-size: 11px; color: var(--tk-sub); }
.tk-day .v { font-size: 13px; font-weight: 800; color: var(--tk-text); margin-top: 3px; }
.tk-day.done { background: var(--tk-soft); border-color: var(--tk-main-l); }
.tk-day.done .v { color: var(--tk-main); }
.tk-day.done::after {
  content: "";
  position: absolute; inset-block-start: 4px; inset-inline-end: 5px;
  width: 13px; height: 13px;
  background: var(--tk-main);
  border-radius: 50%;
}
.tk-day.done::before {
  content: "";
  position: absolute; inset-block-start: 7.5px; inset-inline-end: 8.5px;
  width: 3.5px; height: 6.5px;
  border: solid #fff; border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
  z-index: 1;
}
.tk-day.today { border-color: var(--tk-gold); box-shadow: 0 0 0 3px rgba(255, 180, 0, .14); }
.tk-day.today .v { color: var(--tk-gold-d); }

.tk-progress { height: 8px; background: #f0f0f0; border-radius: 999px; overflow: hidden; margin: 4px 0 8px; }
.tk-progress i {
  display: block; height: 100%; border-radius: 999px;
  background: var(--tk-main);
  transition: width .5s cubic-bezier(.2, .9, .3, 1.1);
}
.tk-progress-txt { font-size: 12px; color: var(--tk-sub); display: flex; justify-content: space-between; }

.tk-rules { font-size: 12px; color: var(--tk-sub); line-height: 1.85; margin: 0; padding-inline-start: 16px; }

.tk-withdraw-ok {
  background: var(--tk-soft);
  border: 1px solid #ffd0cd;
  color: var(--tk-main-d);
  border-radius: 12px;
  padding: 12px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
  text-align: center;
}

/* 提示 */
.tk-toast {
  position: fixed;
  inset-inline-start: 50%; top: 42%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, .8);
  color: #fff;
  border-radius: 12px;
  padding: 16px 24px;
  text-align: center;
  z-index: 2147483003;
  animation: tkPop .26s cubic-bezier(.2, .9, .3, 1.25) both;
}
.tk-toast .big { font-size: 27px; font-weight: 800; color: #ffd24d; }
.tk-toast .sm { font-size: 12.5px; margin-top: 4px; opacity: .95; }

.tk-fly {
  position: fixed;
  z-index: 2147483002;
  font-size: 24px; font-weight: 800;
  color: var(--tk-main);
  pointer-events: none;
  animation: tkFly 1s ease-in forwards;
}
@keyframes tkFly {
  0%   { transform: translateY(0) scale(.6); opacity: 0 }
  25%  { transform: translateY(-22px) scale(1.15); opacity: 1 }
  100% { transform: translateY(-84px) scale(.4); opacity: 0 }
}

/* ---------- 礼物悬浮窗 ---------- */
.tk-fab {
  position: fixed;
  inset-inline-end: 16px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 78px);
  width: 54px; height: 54px;
  border-radius: 50%;
  background: var(--tk-main);
  box-shadow: 0 6px 18px rgba(235, 9, 9, .4);
  display: flex; align-items: center; justify-content: center;
  z-index: 2147482999;
  cursor: pointer;
  border: 2px solid #fff;
  animation: tkFabIn .32s cubic-bezier(.2, .9, .3, 1.4) both;
}
@keyframes tkFabIn { from { transform: scale(0) } to { transform: scale(1) } }
.tk-fab::after {
  content: "";
  position: absolute; inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(235, 9, 9, .55);
  animation: tkPulse 1.8s ease-out infinite;
}
@keyframes tkPulse {
  0%   { transform: scale(.9); opacity: .75 }
  100% { transform: scale(1.45); opacity: 0 }
}
.tk-fab .dot {
  position: absolute; top: -3px;
  inset-inline-end: -3px;
  min-width: 18px; height: 18px; padding: 0 4px;
  background: #fff; color: var(--tk-main);
  border-radius: 999px;
  font-size: 11px; font-weight: 800; line-height: 18px;
  text-align: center;
  border: 1.5px solid var(--tk-main);
  box-sizing: border-box;
}

.tk-panel {
  position: fixed;
  inset-inline-end: 16px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 78px);
  width: 296px;
  max-width: calc(100vw - 32px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .2);
  z-index: 2147483000;
  overflow: hidden;
  animation: tkPanelIn .26s cubic-bezier(.2, .9, .3, 1.2) both;
}
@keyframes tkPanelIn {
  from { opacity: 0; transform: translateY(16px) scale(.92) }
  to   { opacity: 1; transform: translateY(0) scale(1) }
}
.tk-panel-head {
  padding: 13px 14px;
  display: flex; align-items: center;
  border-bottom: 1px solid var(--tk-line);
}
.tk-panel-head .t { flex: 1; font-size: 14.5px; font-weight: 700; }
.tk-panel-head .c {
  background: var(--tk-bg); border: 0; color: #999;
  width: 24px; height: 24px; border-radius: 50%;
  font-size: 13px; line-height: 24px; cursor: pointer;
}
.tk-panel-body { padding: 14px; }
.tk-panel .num { font-size: 28px; font-weight: 800; color: var(--tk-main); text-align: center; line-height: 1.15; }
.tk-panel .num small { font-size: 13px; }
.tk-panel .cap { text-align: center; font-size: 11.5px; color: var(--tk-sub); margin: 2px 0 4px; }
.tk-panel .mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 10px 0 12px; }
.tk-panel .mini-grid div {
  text-align: center; font-size: 9.5px; color: var(--tk-sub);
  background: var(--tk-bg); border-radius: 7px; padding: 6px 0 5px;
  border: 1px solid var(--tk-line);
}
.tk-panel .mini-grid div.on { background: var(--tk-soft); border-color: var(--tk-main-l); color: var(--tk-main); font-weight: 700; }
.tk-panel .mini-grid div.on b { display: block; font-size: 8.5px; font-weight: 700; }
.tk-panel .tk-btn { padding: 11px; font-size: 14.5px; }
.tk-panel .fp { text-align: center; font-size: 11px; color: var(--tk-sub); margin-top: 8px; }

/* RTL 微调 */
.tk-root[dir="rtl"] .tk-fly { left: auto; right: 50%; margin-left: 0; margin-right: -30px; }
.tk-root[dir="rtl"] .tk-toast { transform: translate(50%, -50%); }

@media (max-width: 360px) {
  .tk-grid { grid-template-columns: repeat(3, 1fr); }
  .tk-hero-title { font-size: 22px; }
}
