/* 交互应用层样式（叠加在 style.css 的 Flat 2.0 tokens 之上） */

/* ---------- 模态（底部抽屉） ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 36, 48, 0.45);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  width: 100%;
  max-width: 480px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  max-height: 86vh;
  overflow-y: auto;
  box-shadow: 0 24px 48px rgba(28, 36, 48, 0.14);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.modal h3 { font-size: 1.125rem; font-weight: 700; }
.modal-hint { font-size: 0.875rem; color: var(--text-muted); }

/* ---------- 成员选择 ---------- */
.member-row { display: flex; gap: var(--space-sm); }
.member-row .btn { flex: 1; }

.member-custom { display: flex; gap: var(--space-sm); }
.member-custom input { flex: 1; min-width: 0; }
.member-custom .btn { width: auto; padding: 12px 20px; }

.member-chip {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 4px 12px;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  box-shadow: var(--shadow-1);
}
.member-chip:hover { background: var(--surface-strong); }

.member-chip-row { padding: 0 2px; margin-top: calc(-1 * var(--space-sm)); }

/* ---------- Toast ---------- */
#toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 10px 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 60;
  max-width: 90vw;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 空状态 / 错误状态 ---------- */
.empty-state {
  color: var(--text-muted);
  font-size: 0.875rem;
  text-align: center;
  padding: 24px 16px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border);
}

/* ---------- 计算规则行 ---------- */
.item-rule {
  font-size: 0.75rem;
  color: var(--primary);
  opacity: 0.75;
  margin-top: 2px;
}

/* ---------- 完成条 ---------- */
.done-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  background: rgba(46, 125, 79, 0.10);
  border: 1px solid rgba(46, 125, 79, 0.25);
  color: #2e7d4f;
  font-weight: 600;
  font-size: 0.9375rem;
  border-radius: var(--radius-lg);
  padding: 12px 16px;
}

.btn-sm { width: auto; padding: 8px 16px; font-size: 0.8125rem; }

/* ---------- 归档横幅 ---------- */
.archived-banner {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.875rem;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

/* ---------- 分享 ---------- */
.share-row { display: flex; gap: var(--space-sm); }
.share-row input { flex: 1; min-width: 0; }
.share-row .btn { width: auto; padding: 12px 18px; }

.share-code {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
}
.share-code strong { color: var(--text); font-size: 1.125rem; letter-spacing: 0.1em; }

.qr-wrap { display: flex; justify-content: center; }
.qr {
  width: 180px;
  height: 180px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

/* ---------- 历史时间戳 ---------- */
.history-when { font-size: 0.75rem; color: var(--text-muted); }

@media (prefers-reduced-motion: reduce) {
  #toast, .modal-overlay { transition: none; }
}
