/* ============================================================
   番茄钟
   ============================================================ */

/* ---------------- 悬浮按钮（第三个，最上） ---------------- */
#pomo-fab {
  position: fixed;
  right: 16px;
  bottom: 234px;
  z-index: 9998;
  min-width: 48px;
  height: 48px;
  padding: 0 10px;
  border: 0;
  border-radius: 24px;
  background: #e5534b;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(229, 83, 75, .42);
  transition: transform .18s, background .18s, box-shadow .18s;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .5px;
}

#pomo-fab:hover {
  transform: translateY(-2px) scale(1.04);
}

#pomo-fab svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#pomo-fab .pomo-fab-text {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 计时中：变成绿/蓝，带轻微呼吸 */
#pomo-fab.running {
  background: #2a9d8f;
  box-shadow: 0 6px 20px rgba(42, 157, 143, .45);
  animation: pomoBreath 2s ease-in-out infinite;
}

#pomo-fab.paused {
  background: #f0a020;
  box-shadow: 0 6px 20px rgba(240, 160, 32, .42);
}

@keyframes pomoBreath {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.05); }
}

/* 悬停文字标签（与另外两个按钮一致） */
#pomo-fab::after {
  content: attr(data-label);
  position: absolute;
  right: 58px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(20, 26, 38, .86);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 7px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-weight: 400;
  letter-spacing: 0;
}

#pomo-fab:hover::after {
  opacity: 1;
}

/* ---------------- 计时面板 ---------------- */
#pomo-panel {
  position: fixed;
  right: 16px;
  bottom: 296px;
  z-index: 9999;
  width: 268px;
  background: #fff;
  border: 1px solid #e8ebf0;
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 16px 44px rgba(20, 26, 38, .22);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: #2b3440;
  font-size: 14px;
}

#pomo-panel[hidden] {
  display: none;
}

.pomo-tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: 10px;
  background: #f6f8fb;
  margin-bottom: 12px;
}

.pomo-tabs button {
  flex: 1;
  border: 0;
  background: transparent;
  color: #8a94a6;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  padding: 6px 0;
  border-radius: 8px;
  cursor: pointer;
  transition: all .16s;
}

.pomo-tabs button:hover {
  color: #2b3440;
}

.pomo-tabs button.active {
  background: #fff;
  color: #e5534b;
  box-shadow: 0 1px 3px rgba(20, 26, 38, .12);
}

.pomo-clock-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-bottom: 10px;
}

.pomo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e5534b;
  flex-shrink: 0;
}

.pomo-dot.mode-focus { background: #e5534b; }
.pomo-dot.mode-short { background: #2a9d8f; }
.pomo-dot.mode-long  { background: #4e6ef2; }

.pomo-dot.spinning {
  animation: pomoBreath 2s ease-in-out infinite;
}

.pomo-clock {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}

.pomo-bar {
  height: 5px;
  border-radius: 3px;
  background: #eef2f7;
  overflow: hidden;
  margin-bottom: 10px;
}

.pomo-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 3px;
  background: linear-gradient(90deg, #e5534b, #f0806a);
  transition: width .4s linear;
}

.pomo-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: #8a94a6;
  margin-bottom: 12px;
}

.pomo-meta b {
  color: #2b3440;
}

.pomo-btns {
  display: flex;
  gap: 6px;
}

.pomo-btn {
  flex: 1;
  border: 1px solid #e8ebf0;
  background: #fff;
  color: #5a6474;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  padding: 9px 0;
  border-radius: 9px;
  cursor: pointer;
  transition: all .16s;
}

.pomo-btn:hover {
  border-color: #cfd8e6;
  color: #2b3440;
}

.pomo-btn.primary {
  flex: 1.4;
  border-color: #e5534b;
  background: #e5534b;
  color: #fff;
}

.pomo-btn.primary:hover {
  filter: brightness(1.08);
  color: #fff;
}

/* ---------------- 设置 ---------------- */
.pomo-gear {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #b6bfcc;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.pomo-gear:hover {
  background: #f6f8fb;
  color: #5a6474;
}

.pomo-cfg {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #e8ebf0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pomo-cfg[hidden] {
  display: none;
}

.pomo-cfg label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #8a94a6;
  margin: 0;
  font-weight: 400;
}

.pomo-cfg input[type="number"] {
  width: 54px;
  border: 1px solid #e8ebf0;
  border-radius: 7px;
  padding: 4px 7px;
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
}

.pomo-cfg input[type="number"]:focus {
  border-color: #e5534b;
}

.pomo-cfg .pomo-check {
  width: 100%;
  gap: 7px;
}

.pomo-cfg input[type="checkbox"] {
  margin: 0;
}

.pomo-gear ~ .pomo-cfg {
  width: 100%;
}

/* ---------------- 移动端 ---------------- */
@media screen and (max-width: 640px) {
  #pomo-fab {
    right: 12px;
    bottom: 204px;
    min-width: 44px;
    height: 44px;
    font-size: 14px;
  }

  #pomo-fab::after {
    display: none;
  }

  #pomo-panel {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: 258px;
  }

  .pomo-clock {
    font-size: 34px;
  }
}
