/* ==========================================================================
   CORE PANEL — 中央：逾期警报 + 巨型倒计时 + 下一个任务
   ========================================================================== */

.core-panel {
  --type-color: var(--type-deadline);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(4px, 1vh, 14px) 0;
}

/* 中央背后的柔和光晕，颜色跟随任务类型，非常克制 */
.core-panel::before {
  content: "";
  position: absolute;
  top: 6%;
  left: 50%;
  width: min(760px, 92%);
  height: 62%;
  transform: translateX(-50%);
  background: radial-gradient(
    ellipse at 50% 50%,
    color-mix(in srgb, var(--type-color) 15%, transparent),
    transparent 68%
  );
  filter: blur(28px);
  opacity: 0.55;
  pointer-events: none;
  transition: background 0.8s var(--ease-out);
}

/* 到点那一刻：整个中栏的光晕先亮一下再回落 */
.core-panel.is-reached::before {
  animation: reachedVignette 1.8s cubic-bezier(0.16, 0.84, 0.24, 1) 1;
}

@keyframes reachedVignette {
  0% {
    opacity: 0.55;
  }
  12% {
    opacity: 1;
    filter: blur(34px) brightness(1.5);
  }
  55% {
    opacity: 0.75;
  }
  100% {
    opacity: 0.55;
    filter: blur(28px) brightness(1);
  }
}

/* ---------------- 逾期警报带 ---------------- */

.overdue-band {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: clamp(16px, 2.6vh, 30px);
  padding: 9px 14px 9px 12px;
  text-align: left;
  border-left: 2px solid var(--type-overdue);
  background: linear-gradient(
    90deg,
    rgba(180, 54, 47, 0.12),
    rgba(180, 54, 47, 0.015) 58%,
    transparent
  );
}

.overdue-band__head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #e0746c;
  text-shadow: 0 0 18px rgba(212, 74, 66, 0.55);
}

.overdue-band__head .pulse {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #e0574d;
  box-shadow: 0 0 10px 1px rgba(224, 87, 77, 0.85);
  animation: pulseDot 2.4s var(--ease-inout) infinite;
}

@keyframes pulseDot {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.32;
  }
}

.overdue-item {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 16px;
  width: 100%;
  padding: 3px 0;
  text-align: left;
  color: var(--ink-1);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  transition: color 0.3s var(--ease-out);
}

.overdue-item:hover {
  color: #f0b3ae;
}

.overdue-item__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overdue-item__time {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #d0706a;
}

.overdue-more {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: #a8625d;
  padding-top: 2px;
}

/* ---------------- 主倒计时 ---------------- */

.hero {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: clamp(8px, 1.4vh, 16px);
}

.hero__head .tag--cn {
  letter-spacing: 0.28em;
  color: var(--ink-3);
  font-family: var(--font-cn);
  font-size: 11px;
}

.hero__nums {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: clamp(10px, 1.5vw, 26px);
  margin: 0;
  line-height: 0.86;
}

.hero__unit {
  position: relative;
  display: block;
  padding-right: 1.15em;
}

.hero__num {
  font-family: var(--font-num);
  filter: brightness(calc(1 + var(--urgency, 0) * 0.42));
  font-weight: 300;
  font-size: clamp(46px, 6.6vw, 112px);
  font-variation-settings: "wght" 300, "wdth" 87;
  letter-spacing: 0.01em;
  color: var(--ink-0);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 70px rgba(120, 170, 220, 0.28),
    0 2px 30px rgba(0, 0, 0, 0.55);
  /* 数字用冷白渐变，避免纯白刺眼 */
  background: linear-gradient(
    180deg,
    #ffffff 0%,
    #e8eef7 48%,
    #b9c6d8 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: opacity 0.4s var(--ease-out);
}

.hero__u {
  position: absolute;
  left: 100%;
  bottom: 0.1em;
  margin-left: -1.05em;
  font-family: var(--font-cn);
  font-size: clamp(11px, 1vw, 14px);
  letter-spacing: 0.1em;
  color: var(--ink-2);
  font-weight: 300;
}

/* 秒位每秒跳动一次，用极轻的呼吸提示"正在走" */
.hero__num--sec {
  animation: secBreathe 2s var(--ease-inout) infinite;
}

@keyframes secBreathe {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.86;
  }
}

/* 标题区 */
.hero__title {
  margin-top: clamp(14px, 2.4vh, 28px);
  font-size: clamp(19px, 1.9vw, 29px);
  font-weight: 300;
  letter-spacing: 0.1em;
  color: var(--ink-0);
  text-wrap: balance;
  max-width: 22em;
}

.hero__title .quote {
  color: var(--ink-2);
  font-weight: 200;
}

/* 类型标签：中文直写，不再用英文缩写和细字距 */
.hero__type {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  font-family: var(--font-cn);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.16em;
  color: var(--type-color);
}

.hero__type::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--type-color);
  opacity: 0.85;
}

/* 元信息行：截止时间 / 关联项目 / 状态 */
.hero__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 30px;
  margin-top: clamp(14px, 2.2vh, 24px);
  font-family: var(--font-cn);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-2);
}

.hero__meta span {
  white-space: nowrap;
}

.hero__meta .k {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
  margin-right: 8px;
  letter-spacing: 0.18em;
}

.hero__meta .v {
  color: var(--ink-1);
}

/* 进度：一行三件（标签 / 细条 / 百分比），不再重复写两遍 */
.hero__progress {
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(360px, 78%);
  margin-top: 20px;
}

.hero__progress-k {
  flex: 0 0 auto;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ink-3);
}

.hero__progress-v {
  flex: 0 0 auto;
  min-width: 38px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-1);
}

/* 进度细条（1px，属于信息而非装饰） */
.progress-rail {
  position: relative;
  width: min(320px, 72%);
  height: 1px;
  margin-top: 16px;
  background: var(--line-mid);
}

.hero__progress .progress-rail {
  flex: 1 1 auto;
  width: auto;
  margin-top: 0;
}

.progress-rail__fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--type-color) 55%, transparent),
    var(--type-color)
  );
  box-shadow: 0 0 14px color-mix(in srgb, var(--type-color) 45%, transparent);
  transition: width 0.7s var(--ease-out);
}

.progress-rail__num {
  display: block;
  margin-top: 9px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  color: var(--ink-3);
}

/* 空闲状态 */
.hero--idle .hero__num {
  font-size: clamp(28px, 3vw, 42px);
  letter-spacing: 0.22em;
  -webkit-text-fill-color: var(--ink-2);
  background: none;
  text-shadow: none;
}

/* ---------------- 下一个任务 ---------------- */

.next {
  width: 100%;
  max-width: 560px;
  margin-top: clamp(24px, 4.2vh, 46px);
  padding-top: 16px;
  border-top: var(--hair) solid var(--line);
}

.next__head {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}

.next__row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 12.5px;
  color: var(--ink-1);
  letter-spacing: 0.05em;
}

.next__name {
  color: var(--ink-1);
}

.next__dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--next-color, var(--ink-3));
  box-shadow: 0 0 8px color-mix(in srgb, var(--next-color) 60%, transparent);
  transform: translateY(-3px);
}

.next__count {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--ink-2);
}

.next__count b {
  color: var(--ink-1);
  font-weight: 500;
}

.next__empty {
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.12em;
}

/* 任务类型标签（复用于月历 / 详情） */
.type-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--chip-color, var(--ink-2));
}

.type-chip i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px color-mix(in srgb, currentColor 70%, transparent);
}

@media (max-width: 900px) {
  .hero__num {
    font-size: clamp(38px, 11.4vw, 62px);
  }
  .hero__nums {
    gap: 6px;
  }
  .hero__u {
    font-size: 10.5px;
    letter-spacing: 0.02em;
  }
  .hero__meta {
    gap: 6px 14px;
    font-size: 10.5px;
  }
  .core-panel::before {
    height: 46%;
  }
}


/* 每次结构重绘时，主数字轻轻浮上来，避免整块生硬切换 */
.hero {
  animation: heroIn 0.55s cubic-bezier(0.16, 0.84, 0.24, 1) forwards;
}

@keyframes heroIn {
  from {
    opacity: 0.35;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 最后 30 秒起：连续逼近，不逐秒跳 ---------- */

.core-panel {
  --urgency: 0;
}

.hero__nums {
  transform: scale(calc(1 + var(--urgency) * 0.04));
  transform-origin: 50% 55%;
  will-change: transform;
}

.core-panel.is-final .hero__num {
  color: #ffcdc5;
}

.core-panel.is-final .hero__num--sec {
  color: #ff8e84;
  text-shadow: 0 0 30px rgba(255, 90, 78, 0.45);
}

.core-panel.is-final .hero__nums::after {
  content: "";
  position: absolute;
  inset: -8% -4%;
  background: radial-gradient(closest-side, rgba(216, 84, 76, 0.2), transparent 70%);
  opacity: calc(0.2 + var(--urgency) * 0.8);
  pointer-events: none;
  transition: none;
}

/* ---------- 归零瞬间：数字向外扩散、冲击波、字牌浮现 ---------- */

.hero__nums {
  position: relative;
}

.hero__reached {
  display: none;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.3em;
  color: #ffb4ab;
  opacity: 0;
}

.hero__reached i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff5a4e;
  box-shadow: 0 0 18px rgba(255, 90, 78, 1);
}

.core-panel.is-reached .hero__reached {
  display: inline-flex;
  opacity: 1;
  animation: plateIn 0.7s cubic-bezier(0.16, 0.84, 0.24, 1) forwards;
}

@keyframes plateIn {
  from {
    transform: translateY(6px) scale(0.97);
  }
  to {
    transform: none;
  }
}

.core-panel.is-reached .hero__num {
  color: #ff8f86;
  text-shadow: 0 0 46px rgba(216, 84, 76, 0.6);
}

/* 数字从中心向外扩散、过曝、散掉；动画不可用时退化为变暗静止 */
.core-panel.is-reached .hero__nums {
  transform-origin: 50% 55%;
  opacity: 1;
  transform: scale(1.12);
  filter: brightness(0.62);
  animation: zeroBurst 1.15s cubic-bezier(0.16, 0.84, 0.24, 1) forwards;
}

@keyframes zeroBurst {
  0% {
    transform: scale(1);
    filter: brightness(1);
  }
  16% {
    transform: scale(1.09);
    filter: brightness(2.5);
  }
  46% {
    transform: scale(1.16);
    filter: brightness(1.15);
  }
  100% {
    transform: scale(1.12);
    filter: brightness(0.62);
  }
}

/* 冲击波 */
.core-panel.is-reached .hero__nums::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 180px;
  height: 180px;
  margin: -90px 0 0 -90px;
  border: 1px solid rgba(255, 130, 118, 0.7);
  border-radius: 50%;
  pointer-events: none;
  animation: zeroShock 1.2s cubic-bezier(0.16, 0.84, 0.24, 1) forwards;
}

@keyframes zeroShock {
  0% {
    opacity: 0;
    transform: scale(0.35);
  }
  12% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: scale(2.6);
  }
}

.core-panel.is-reached .hero__type {
  color: #ff9088;
}

/* JS 在归零时插入的冲击波 */
.alarm-shock {
  position: absolute;
  left: 50%;
  top: 40%;
  width: 220px;
  height: 220px;
  margin: -110px 0 0 -110px;
  border: 1px solid rgba(255, 130, 118, 0.75);
  border-radius: 50%;
  box-shadow: 0 0 40px rgba(255, 110, 96, 0.22);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.25);
  z-index: 2;
}
