/* ---------- 工资实时显示（tools/salary-live.html） ---------- */

.sl-card {
  position: relative;
  margin-top: 14px;
  padding: 20px 20px 18px;
  border: 1px solid #DDEDE5;
  border-radius: 18px;
  background:
    radial-gradient(120% 110% at 100% 0%, #EAF8F1 0%, rgba(234, 248, 241, 0) 60%),
    #FFFFFF;
  box-shadow: 0 18px 40px -34px rgba(4, 120, 87, .45);
}

.sl-card__label {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  letter-spacing: .04em;
  color: #5E7A6E;
}

.sl-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, .12);
  animation: sl-pulse 2.2s ease-in-out infinite;
}
@keyframes sl-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .45; transform: scale(.8); }
}

.sl-card__tag {
  margin-left: auto;
  padding: 3px 9px;
  border-radius: 999px;
  background: #EDF8F2;
  font-size: 11.5px;
  letter-spacing: 0;
  color: #047857;
  white-space: nowrap;
}

.sl-amount {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px;
  margin-top: 12px;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  line-height: 1.05;
  letter-spacing: -.02em;
  white-space: nowrap;
}
.sl-amount.is-idle { opacity: .45; }

.sl-amount__cur {
  font-size: clamp(1rem, 4.2vw, 1.3rem);
  font-weight: 600;
  color: #0E9F6E;
  transform: translateY(-.35em);
}

.sl-amount__int {
  font-size: clamp(2rem, 10vw, 3.6rem);
  font-weight: 700;
  color: #0B2B22;
}

/* 小数部分放大到整数的六成左右，末三位看得清 */
.sl-amount__dec {
  font-size: clamp(1.25rem, 6.2vw, 2.2rem);
  font-weight: 600;
  color: #0E9F6E;
}
.sl-amount__hot {
  color: #047857;
  font-weight: 700;
}

/* 「距下班」显示的是文字，字号收小、允许换行，免得把卡片撑破 */
.sl-amount.is-text {
  white-space: normal;
  letter-spacing: 0;
}
.sl-amount.is-text .sl-amount__int {
  font-size: clamp(1.45rem, 6.6vw, 2.3rem);
  font-weight: 600;
  line-height: 1.2;
}

.sl-amount__hint {
  position: relative;
  margin-top: 10px;
  min-height: 1.4em;
  font-size: 12.5px;
  line-height: 1.5;
  color: #6B827A;
}

.sl-bar {
  position: relative;
  height: 8px;
  margin-top: 16px;
  border-radius: 999px;
  background: #E9F3EE;
  overflow: hidden;
}
.sl-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #34D399, #059669);
  transition: width .3s linear;
}

.sl-bar__meta {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 14px;
  margin-top: 8px;
  font-size: 12px;
  color: #6B827A;
}
.sl-bar__meta b {
  font-family: var(--mono);
  font-weight: 600;
  color: #0B2B22;
}

/* 六项指标同时是切换按钮：点哪一项，上方大数字就换成哪一项 */
.sl-metrics {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}
.sl-metric {
  display: grid;
  gap: 1px;
  padding: 9px 12px 10px;
  border: 1px solid #E4EFE9;
  border-radius: 12px;
  background: #FBFDFC;
  font-family: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .18s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease);
}
.sl-metric:hover { border-color: #CBE6D8; background: #F5FBF8; }
.sl-metric:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(4, 120, 87, .16);
}
.sl-metric.is-on {
  border-color: #9BD9BE;
  background: #EDF8F2;
  box-shadow: inset 0 0 0 1px #CDEEDD;
}
.sl-metric__k {
  font-size: 11.5px;
  color: #7C8F87;
}
.sl-metric__v {
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: -.02em;
  font-weight: 600;
  color: #0B2B22;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sl-metric.is-on .sl-metric__k { color: #047857; }
.sl-metric.is-on .sl-metric__v { color: #047857; }

.sl-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px 14px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  align-items: start;
}
/* 同一行里两格的说明文字长短不一，别让撑高出来的空间把控件往下推 */
.sl-form .ts-setting { align-content: start; }
.sl-form .field__hint { line-height: 1.55; }
.sl-form__full { grid-column: 1 / -1; }

/* 工作日快捷项：一键双休 / 单休，按钮上的天数按当月日历现算 */
.sl-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sl-quick__btn {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 5px 11px;
  border: 1px solid #DCEAE3;
  border-radius: 999px;
  background: #FBFDFC;
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.5;
  color: #4B6358;
  cursor: pointer;
  transition: border-color .18s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease);
}
.sl-quick__btn b {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: #0B2B22;
}
.sl-quick__btn:hover { border-color: #CBE6D8; background: #F5FBF8; }
.sl-quick__btn:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(4, 120, 87, .16);
}
.sl-quick__btn.is-on {
  border-color: #9BD9BE;
  background: #EDF8F2;
  color: #047857;
  box-shadow: inset 0 0 0 1px #CDEEDD;
}
.sl-quick__btn.is-on b { color: #047857; }

.sl-calc {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #F7FAF8;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted-fg);
}
.sl-calc b { color: var(--fg); font-weight: 600; }

/* 桌面悬浮小窗开关：样式只负责页面里这一颗按钮，小窗内部样式在 salary-pip.css */
.sl-pip-row {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-top: 14px;
}
.sl-pip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  border: 1px solid #CBE6D8;
  border-radius: 999px;
  background: #FBFDFC;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.4;
  color: #047857;
  cursor: pointer;
  transition: border-color .18s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease);
}
.sl-pip:hover { border-color: #9BD9BE; background: #F0F9F4; }
.sl-pip:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(4, 120, 87, .16);
}
.sl-pip.is-on {
  border-color: #047857;
  background: #047857;
  color: #FFFFFF;
}
.sl-pip.is-on:hover { background: #036B4E; }
.sl-pip__hint {
  flex: 1 1 200px;
  min-width: 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted-fg);
}

/* 极窄屏收一下字号，保证 6 位小数也不会横向溢出 */
@media (max-width: 380px) {
  .sl-amount { letter-spacing: -.03em; }
  .sl-amount__int { font-size: clamp(1.7rem, 8.4vw, 2.6rem); }
  .sl-amount__dec { font-size: clamp(1.05rem, 5vw, 1.5rem); }
}

@media (min-width: 560px) {
  .sl-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
  .sl-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .sl-dot { animation: none; }
  .sl-bar span { transition: none; }
}
