/* 比赛/作业倒计时：嵌进导航右侧的胶囊 + 顶栏进度条（客观题与 IDE 共用） */

pre.contest-timer {
  display: none !important;
}

body.exam-countdown-on #nprogress .bar {
  display: none !important;
}

.exam-countdown-nav {
  display: flex;
  align-items: center;
  height: 45px;
  padding: 0 8px 0 4px;
}

.exam-countdown {
  position: relative;
  z-index: 1;
  visibility: visible;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  color: #1f2937;
  pointer-events: none;
  user-select: none;
}

.exam-countdown[hidden] {
  display: none !important;
}

.exam-countdown__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.45);
  animation: exam-countdown-pulse 1.6s ease-out infinite;
  flex-shrink: 0;
}

.exam-countdown__label {
  font-size: 11px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #6b7280;
}

.exam-countdown__time {
  font-size: 12px;
  line-height: 1;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  letter-spacing: 0.02em;
  color: #111827;
}

.exam-countdown--urgent {
  background: rgba(255, 247, 237, 0.96);
  border-color: rgba(234, 88, 12, 0.22);
  box-shadow: 0 1px 2px rgba(154, 52, 18, 0.06), 0 6px 16px rgba(234, 88, 12, 0.1);
}

.exam-countdown--urgent .exam-countdown__dot {
  background: #ea580c;
  box-shadow: 0 0 0 0 rgba(234, 88, 12, 0.4);
}

.exam-countdown--urgent .exam-countdown__label {
  color: #c2410c;
}

.exam-countdown--urgent .exam-countdown__time {
  color: #9a3412;
}

.exam-countdown--ended {
  background: rgba(248, 250, 252, 0.96);
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.exam-countdown--ended .exam-countdown__dot {
  background: #94a3b8;
  animation: none;
  box-shadow: none;
}

.exam-countdown--ended .exam-countdown__label {
  color: #94a3b8;
}

.exam-countdown--ended .exam-countdown__time {
  color: #64748b;
  font-weight: 600;
}

@keyframes exam-countdown-pulse {
  0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

.exam-countdown-progress {
  position: fixed;
  top: 45px;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 10040;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.06);
}

.exam-countdown-progress[hidden] {
  display: none !important;
}

.exam-countdown-progress__bar {
  display: block;
  height: 100%;
  width: 0;
  background: #1677ff;
  transform-origin: left center;
  transition: width 0.35s linear, background-color 0.2s ease;
}

.exam-countdown-progress--urgent .exam-countdown-progress__bar {
  background: #ea580c;
}

.exam-countdown-progress--ended .exam-countdown-progress__bar {
  background: #94a3b8;
}

.theme--dark .exam-countdown {
  background: rgba(24, 24, 27, 0.88);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.28), 0 8px 20px rgba(0, 0, 0, 0.22);
  color: #e5e7eb;
}

.theme--dark .exam-countdown__label {
  color: #9ca3af;
}

.theme--dark .exam-countdown__time {
  color: #f3f4f6;
}

.theme--dark .exam-countdown--urgent {
  background: rgba(67, 20, 7, 0.88);
  border-color: rgba(251, 146, 60, 0.28);
}

.theme--dark .exam-countdown--urgent .exam-countdown__label {
  color: #fdba74;
}

.theme--dark .exam-countdown--urgent .exam-countdown__time {
  color: #fed7aa;
}

.theme--dark .exam-countdown--ended {
  background: rgba(24, 24, 27, 0.78);
  border-color: rgba(255, 255, 255, 0.06);
}

.theme--dark .exam-countdown--ended .exam-countdown__label,
.theme--dark .exam-countdown--ended .exam-countdown__time {
  color: #94a3b8;
}

.theme--dark .exam-countdown-progress {
  background: rgba(255, 255, 255, 0.08);
}

.theme--dark .exam-countdown-progress__bar {
  background: #69b1ff;
}

.theme--dark .exam-countdown-progress--urgent .exam-countdown-progress__bar {
  background: #fb923c;
}

.theme--dark .exam-countdown-progress--ended .exam-countdown-progress__bar {
  background: #64748b;
}

@media (max-width: 768px) {
  .exam-countdown--in-mobile-header {
    position: relative;
    margin-right: 8px;
    vertical-align: middle;
  }
  .exam-countdown-progress {
    top: 0;
  }
}
