/* ==========================================================================
   components.css —— 卡片、按钮、表单、徽标、弹窗、Toast、骨架屏、进度、时间轴…
   ========================================================================== */

/* 站长提示条：只有本机访问前台时出现，提示去后台编辑 */
.owner-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 auto var(--sp-5);
  max-width: var(--container);
  padding: 10px var(--sp-4);
  border-radius: var(--r-md);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent-ink);
  font-size: var(--fs-sm);
}
.owner-hint .ic { width: 15px; height: 15px; flex-shrink: 0; }
.owner-hint a { font-weight: 620; text-decoration: underline; text-underline-offset: 2px; }
.owner-hint__close { margin-left: auto; color: var(--accent-ink); }

/* ============================== 卡片 ============================== */

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease),
    border-color var(--dur-2) var(--ease);
}
.card--pad { padding: var(--sp-5); }
.card--flush { padding: 0; overflow: hidden; }
.card--quiet { box-shadow: none; background: var(--bg-soft); }
.card--lift:hover { transform: translateY(-3px); box-shadow: var(--sh-2); border-color: var(--line-strong); }
.card--interactive { cursor: pointer; }
.card--interactive:active { transform: scale(.995); }

.card__head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-5) var(--sp-5) 0;
}
.card__head--bordered {
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--line);
}
.card__title { font-size: var(--fs-md); font-weight: 620; letter-spacing: -.015em; }
.card__sub { font-size: var(--fs-sm); color: var(--ink-3); }
.card__body { padding: var(--sp-5); }
.card__foot {
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--fs-sm);
  color: var(--ink-3);
}
.card__icon {
  width: 32px; height: 32px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--surface-2);
  color: var(--ink-2);
  flex-shrink: 0;
}
.card__icon svg { width: 17px; height: 17px; }
.card__icon--accent { background: var(--accent-soft); color: var(--accent-ink); }

/* ============================== 徽标 / 标签 ============================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .01em;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge svg { width: 12px; height: 12px; }
.badge--accent { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-line); }
.badge--ok { background: var(--ok-soft); color: var(--ok); }
.badge--warn { background: var(--warn-soft); color: var(--warn); }
.badge--danger { background: var(--danger-soft); color: var(--danger); }
.badge--muted { background: var(--surface-2); color: var(--ink-3); }
.badge--outline { background: transparent; border-color: var(--line-strong); color: var(--ink-2); }
.badge--pin { background: var(--ink); color: #fff; }
.badge--dot::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; opacity: .9;
}

/* 状态语义色：通过 data-tone 设置 */
[data-tone="study"]  { --tone: var(--t-study);  --tone-soft: var(--t-study-soft); }
[data-tone="sleep"]  { --tone: var(--t-sleep);  --tone-soft: var(--t-sleep-soft); }
[data-tone="game"]   { --tone: var(--t-game);   --tone-soft: var(--t-game-soft); }
[data-tone="free"]   { --tone: var(--t-free);   --tone-soft: var(--t-free-soft); }
[data-tone="custom"] { --tone: var(--t-custom); --tone-soft: var(--t-custom-soft); }
[data-tone="default"] { --tone: var(--t-default); --tone-soft: var(--t-default-soft); }

.badge--tone { background: var(--tone-soft); color: var(--tone); }

/* ============================== 按钮 ============================== */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 9px 15px;
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  font-weight: 580;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  box-shadow: var(--sh-1);
  transition: transform var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease),
    background var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
  white-space: nowrap;
  overflow: hidden;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { box-shadow: var(--sh-2); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.975); box-shadow: var(--sh-1); }
.btn[disabled], .btn.is-busy { opacity: .55; pointer-events: none; }

.btn--primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn--primary:hover { background: #2c2c29; }
.btn--accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn--accent:hover { background: var(--accent-ink); }
.btn--ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.btn--ghost:hover { background: rgba(27, 27, 26, .05); box-shadow: none; }
.btn--soft { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; box-shadow: none; }
.btn--soft:hover { background: #dfe7fa; }
.btn--danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; box-shadow: none; }
.btn--danger:hover { background: #f4dcda; }
.btn--sm { padding: 6px 11px; font-size: var(--fs-xs); }
.btn--icon { padding: 8px; width: 34px; height: 34px; }
.btn--icon.btn--sm { width: 28px; height: 28px; padding: 5px; border-radius: 9px; }
.btn--block { width: 100%; }
.btn--pill { border-radius: var(--r-pill); }

/* 加载态：样式统一的小旋转圆环 */
.spinner {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
.spinner--lg { width: 22px; height: 22px; border-width: 2.5px; }

/* 点击涟漪 */
.ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: currentColor;
  opacity: .18;
  pointer-events: none;
  animation: rippleOut .55s var(--ease-soft) forwards;
}
@keyframes rippleOut { to { transform: scale(2.4); opacity: 0; } }

/* ============================== 表单 ============================== */

.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: var(--fs-sm); font-weight: 580; color: var(--ink-2); }
.field__label .req { color: var(--danger); margin-left: 2px; }
.field__help { font-size: var(--fs-xs); color: var(--ink-3); }
.field__error { font-size: var(--fs-xs); color: var(--danger); display: none; }
.field.has-error .field__error { display: block; }
.field.has-error .input, .field.has-error .textarea, .field.has-error .select {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.input, .textarea, .select {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-size: var(--fs-sm);
  color: var(--ink);
  transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease),
    background var(--dur-2) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }
.input:hover, .textarea:hover, .select:hover { border-color: var(--ink-4); }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.textarea { min-height: 84px; resize: vertical; line-height: 1.55; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2378776f' stroke-width='1.6'%3E%3Cpath d='M4 6.5 8 10.5l4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 32px;
}
.input--search { padding-left: 32px; }
.search-wrap { position: relative; display: inline-flex; align-items: center; }
.search-wrap svg {
  position: absolute; left: 10px; width: 15px; height: 15px;
  color: var(--ink-4); pointer-events: none;
}

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
.form-grid .field--full { grid-column: 1 / -1; }
@media (max-width: 620px) { .form-grid { grid-template-columns: 1fr; } }

/* 开关 */
.switch { display: inline-flex; align-items: center; gap: var(--sp-3); cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__track {
  width: 40px; height: 23px; border-radius: var(--r-pill);
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  position: relative;
  transition: background var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease);
  flex-shrink: 0;
}
.switch__track::after {
  content: "";
  position: absolute; top: 2px; left: 2px;
  width: 17px; height: 17px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--sh-1);
  transition: transform var(--dur-2) var(--ease);
}
.switch input:checked + .switch__track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .switch__track::after { transform: translateX(17px); }
.switch__label { font-size: var(--fs-sm); color: var(--ink-2); }

/* 分段筛选器（滑动药丸） */
.segmented {
  position: relative;
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
}
/* 窄屏下让分段筛选器可以横向滚动，避免撑破布局 */
.scroll-x { max-width: 100%; overflow-x: auto; scrollbar-width: thin; }
.scroll-x::-webkit-scrollbar { height: 5px; }
.segmented__pill {
  position: absolute;
  top: 3px; left: 3px;
  height: calc(100% - 6px);
  border-radius: var(--r-pill);
  background: var(--surface);
  box-shadow: var(--sh-1);
  transition: transform var(--dur-2) var(--ease), width var(--dur-2) var(--ease);
  will-change: transform, width;
}
.segmented__item {
  position: relative;
  z-index: 1;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  font-weight: 550;
  color: var(--ink-3);
  transition: color var(--dur-2) var(--ease);
  white-space: nowrap;
}
.segmented__item:hover { color: var(--ink-2); }
.segmented__item.is-active { color: var(--ink); }
.segmented__count {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  opacity: .7;
  margin-left: 5px;
}

/* ============================== 复选框 ============================== */

.check {
  position: relative;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.6px solid var(--line-strong);
  background: var(--surface);
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: border-color var(--dur-2) var(--ease), background var(--dur-2) var(--ease),
    transform var(--dur-1) var(--ease);
}
.check:hover { border-color: var(--accent); transform: scale(1.06); }
.check:active { transform: scale(.92); }
.check svg { width: 13px; height: 13px; color: #fff; }
.check svg path {
  stroke-dasharray: 26;
  stroke-dashoffset: 26;
}
.check.is-done { background: var(--ok); border-color: var(--ok); }
.check.is-done svg path { animation: drawCheck .34s var(--ease) forwards; }

/* ============================== 进度条 / 圆环 ============================== */

.progress {
  position: relative;
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  overflow: hidden;
}
.progress--thin { height: 5px; }
.progress__value {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--accent) 0%, #5a7fda 100%);
  transform-origin: left center;
  animation: barGrow var(--dur-4) var(--ease) both;
  width: var(--p, 0%);
}
.progress__value--ok { background: linear-gradient(90deg, var(--ok) 0%, #4fae86 100%); }
.progress__value--warn { background: linear-gradient(90deg, var(--warn) 0%, #d79a52 100%); }
.progress__value--muted { background: var(--ink-4); }

.ring { position: relative; display: inline-grid; place-items: center; flex-shrink: 0; }
.ring svg { transform: rotate(-90deg); }
.ring__track { stroke: var(--surface-3); }
.ring__value {
  stroke: var(--accent);
  stroke-linecap: round;
  transition: stroke-dashoffset var(--dur-4) var(--ease);
}
.ring--warn .ring__value { stroke: var(--warn); }
.ring--danger .ring__value { stroke: var(--danger); }
.ring--ok .ring__value { stroke: var(--ok); }
.ring__label {
  position: absolute;
  display: flex; flex-direction: column; align-items: center; line-height: 1.1;
}
.ring__num { font-family: var(--font-mono); font-size: var(--fs-lg); font-weight: 620; letter-spacing: -.04em; }
.ring__unit { font-size: var(--fs-xs); color: var(--ink-3); }

/* ============================== 阶段节点条 ============================== */

.stepper { display: flex; align-items: center; gap: 0; width: 100%; }
.stepper__node { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.stepper__dot-row { display: flex; align-items: center; }
.stepper__dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1.5px solid var(--line-strong);
  flex-shrink: 0;
  transition: background var(--dur-3) var(--ease), border-color var(--dur-3) var(--ease),
    transform var(--dur-3) var(--ease);
}
.stepper__line {
  flex: 1;
  height: 2px;
  background: var(--surface-3);
  border-radius: 2px;
  transition: background var(--dur-3) var(--ease);
}
.stepper__label {
  font-size: var(--fs-xs);
  color: var(--ink-3);
  transition: color var(--dur-3) var(--ease);
  padding-right: 4px;
}
.stepper__node.is-done .stepper__dot { background: var(--accent); border-color: var(--accent); }
.stepper__node.is-done .stepper__line { background: var(--accent); }
.stepper__node.is-done .stepper__label { color: var(--ink-2); }
.stepper__node.is-current .stepper__dot {
  background: var(--surface);
  border-color: var(--accent);
  border-width: 3px;
  transform: scale(1.18);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.stepper__node.is-current .stepper__label { color: var(--accent-ink); font-weight: 620; }
.stepper--sm .stepper__dot { width: 9px; height: 9px; }

/* ============================== 垂直时间轴 ============================== */

.timeline { position: relative; padding-left: 30px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 9px; top: 6px; bottom: 6px;
  width: 0;
  border-left: 1.5px dashed var(--line-strong);
}
.timeline__item { position: relative; padding-bottom: var(--sp-5); }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__marker {
  position: absolute;
  left: -30px; top: 6px;
  width: 19px; height: 19px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  display: grid; place-items: center;
  transition: all var(--dur-3) var(--ease);
  z-index: 1;
}
.timeline__marker::after {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--line-strong);
  transition: background var(--dur-3) var(--ease), transform var(--dur-3) var(--ease);
}
.timeline__item.is-next .timeline__marker { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.timeline__item.is-next .timeline__marker::after { background: var(--accent); animation: softPulse 2.4s var(--ease-soft) infinite; }
.timeline__item.is-expired .timeline__marker { border-color: var(--line); }
.timeline__item.is-expired .timeline__marker::after { background: var(--line-strong); }
.timeline__item.is-expired { opacity: .58; filter: saturate(.35); }
.timeline__item.is-expired .timeline__marker { box-shadow: none; }

/* ============================== 骨架屏 ============================== */

.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
  border-radius: var(--r-sm);
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, .75) 45%, transparent 90%);
  background-size: 220% 100%;
  animation: shimmer 1.5s linear infinite;
}
.skeleton--text { height: 12px; border-radius: 6px; }
.skeleton--title { height: 18px; border-radius: 7px; }
.skeleton--card { height: 128px; border-radius: var(--r-lg); }
.skeleton--circle { border-radius: 50%; }
.skeleton-stack { display: flex; flex-direction: column; gap: var(--sp-3); }

.loading-row {
  display: flex; align-items: center; justify-content: center; gap: var(--sp-3);
  padding: var(--sp-6);
  color: var(--ink-3);
  font-size: var(--fs-sm);
}

/* ============================== 空状态 / 错误状态 ============================== */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--sp-3);
  padding: var(--sp-7) var(--sp-5);
  color: var(--ink-3);
}
.empty__art {
  width: 74px; height: 74px;
  border-radius: 22px;
  display: grid; place-items: center;
  background: linear-gradient(160deg, var(--surface-2), var(--surface-3));
  border: 1px solid var(--line);
  color: var(--ink-4);
  margin-bottom: var(--sp-1);
}
.empty__art svg { width: 30px; height: 30px; }
.empty__title { font-size: var(--fs-md); font-weight: 600; color: var(--ink-2); }
.empty__text { font-size: var(--fs-sm); max-width: 42ch; }
.empty--inline { padding: var(--sp-5); }
/* 仪表盘卡片里的空状态：收得更紧，避免大片留白 */
.empty--compact { padding: var(--sp-5) var(--sp-4); gap: var(--sp-2); }
.empty--compact .empty__art { width: 46px; height: 46px; border-radius: 14px; margin-bottom: 0; }
.empty--compact .empty__art svg { width: 20px; height: 20px; }
.empty--compact .empty__title { font-size: var(--fs-sm); }
.empty--compact .empty__text { font-size: var(--fs-xs); max-width: 34ch; }

.inline-error {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-4);
  border-radius: var(--r-md);
  background: var(--danger-soft);
  color: #8f3a35;
  font-size: var(--fs-sm);
  border: 1px solid #f0d5d2;
}
.inline-error svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 1px; }

/* ============================== Toast ============================== */

.toast-host {
  position: fixed;
  z-index: var(--z-toast);
  right: var(--sp-5);
  bottom: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  align-items: flex-end;
  pointer-events: none;
  max-width: min(92vw, 380px);
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: 11px 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-3);
  font-size: var(--fs-sm);
  color: var(--ink-2);
  pointer-events: auto;
  animation: slideInRight var(--dur-2) var(--ease) both;
  max-width: 100%;
}
.toast.is-leaving { animation: fadeIn var(--dur-2) var(--ease) reverse both; }
.toast__icon {
  width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; flex-shrink: 0;
  background: var(--surface-2); color: var(--ink-2);
}
.toast__icon svg { width: 12px; height: 12px; }
.toast__text { line-height: 1.45; word-break: break-word; }
.toast__title { font-weight: 620; color: var(--ink); display: block; }
.toast--success .toast__icon { background: var(--ok-soft); color: var(--ok); }
.toast--error .toast__icon { background: var(--danger-soft); color: var(--danger); }
.toast--warn .toast__icon { background: var(--warn-soft); color: var(--warn); }
.toast--info .toast__icon { background: var(--accent-soft); color: var(--accent-ink); }

@media (max-width: 620px) {
  .toast-host { left: var(--sp-4); right: var(--sp-4); bottom: calc(78px + env(safe-area-inset-bottom)); align-items: stretch; }
}

/* ============================== 弹窗 ============================== */

.modal-host {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: grid;
  place-items: center;
  padding: var(--sp-5);
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 24, 23, .34);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fadeIn var(--dur-2) var(--ease) both;
}
.modal {
  position: relative;
  width: min(620px, 100%);
  max-height: min(86dvh, 900px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-3);
  animation: popIn var(--dur-3) var(--ease) both;
  overflow: hidden;
}
.modal--wide { width: min(840px, 100%); }
.modal--narrow { width: min(460px, 100%); }
.modal__head {
  display: flex; align-items: flex-start; gap: var(--sp-4);
  padding: var(--sp-5) var(--sp-5) var(--sp-4);
  border-bottom: 1px solid var(--line);
}
.modal__title { font-size: var(--fs-lg); font-weight: 630; letter-spacing: -.02em; }
.modal__sub { font-size: var(--fs-sm); color: var(--ink-3); margin-top: 3px; }
.modal__body { padding: var(--sp-5); overflow: auto; flex: 1; }
.modal__foot {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
}
.modal__close { margin-left: auto; }

@media (max-width: 620px) {
  .modal-host { padding: 0; align-items: flex-end; }
  .modal {
    width: 100%;
    max-height: 92dvh;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    animation: slideInTop var(--dur-3) var(--ease) both;
  }
  .modal__foot { padding-bottom: calc(var(--sp-4) + env(safe-area-inset-bottom)); }
}

/* ============================== 附件 / 指标 / 其他 ============================== */

.attach {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: var(--fs-xs);
  color: var(--ink-2);
  transition: all var(--dur-2) var(--ease);
  max-width: 100%;
}
.attach svg { width: 13px; height: 13px; flex-shrink: 0; color: var(--ink-3); }
.attach:hover { background: var(--surface-3); border-color: var(--line-strong); }
.attach span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.metric { display: flex; flex-direction: column; gap: 2px; }
.metric__value {
  font-family: var(--font-mono);
  font-size: var(--fs-2xl);
  font-weight: 620;
  letter-spacing: -.04em;
  line-height: 1.1;
}
.metric__label { font-size: var(--fs-xs); color: var(--ink-3); letter-spacing: .02em; }
.metric__unit { font-size: var(--fs-sm); color: var(--ink-3); font-family: var(--font-sans); margin-left: 2px; }

.divider { height: 1px; background: var(--line); margin: var(--sp-4) 0; }
.divide-y > * + * { border-top: 1px solid var(--line); }

.count-tick { display: inline-block; animation: tick var(--dur-3) var(--ease) both; }

/* 悬浮新增按钮（移动端） */
.fab {
  position: fixed;
  right: var(--sp-4);
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: var(--z-fab);
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: none;
  place-items: center;
  box-shadow: var(--sh-3);
  transition: transform var(--dur-2) var(--ease);
}
.fab svg { width: 22px; height: 22px; }
.fab:active { transform: scale(.94); }

.toolbar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-bottom: var(--sp-5);
}
.toolbar__group { display: flex; align-items: center; gap: var(--sp-2); }
.toolbar .spacer { flex: 1; min-width: 8px; }

@media (max-width: 620px) {
  .fab { display: grid; }
  .toolbar { gap: var(--sp-2); }
  .hide-sm { display: none !important; }
}
