.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  font-weight: 650;
  white-space: nowrap;
  border: 1px solid transparent;
  letter-spacing: .01em;
}
.tag-green { color: #157a45; background: #e7f6ee; border-color: #c9ead7; }
.tag-orange { color: #b85a16; background: #fff1e4; border-color: #ffd7b8; }
.tag-red { color: #c23535; background: #fdecec; border-color: #f8d0d0; }
.tag-blue { color: #2458c7; background: #eaf1ff; border-color: #d4e2ff; }
.tag-gray { color: #5e6b66; background: #f1f0ec; border-color: #e4e1d8; }

.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--orange);
  display: inline-block; margin-right: 4px; animation: soft-pulse 1.4s ease infinite;
  box-shadow: 0 0 0 0 rgba(217, 111, 36, .4);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 42px;
  padding: 0 16px;
  border-radius: 13px;
  border: 1px solid transparent;
  background: #fff;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.01em;
  transition: transform .16s var(--ease), background .16s ease, box-shadow .16s ease, border-color .16s ease;
  user-select: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.985); }
.btn:disabled, .btn.disabled { opacity: .45; pointer-events: none; }
.btn-primary { background: linear-gradient(180deg, #23915a, var(--green)); color: #fff; box-shadow: 0 10px 18px rgba(31, 122, 77, .22); }
.btn-primary:hover { background: linear-gradient(180deg, #1f8452, #17663d); }
.btn-orange { background: linear-gradient(180deg, #eb8a3c, var(--orange)); color: #fff; box-shadow: 0 10px 18px rgba(224, 122, 47, .22); }
.btn-danger { background: linear-gradient(180deg, #db5252, var(--red)); color: #fff; }
.btn-ghost { background: #fff; border-color: var(--line-strong); color: var(--ink); box-shadow: var(--shadow-xs); }
.btn-ghost:hover { border-color: #c3bcae; background: #fffcf7; }
.btn-soft { background: var(--green-soft); color: var(--green-deep); }
.btn-text { background: transparent; color: var(--green); height: 32px; padding: 0 8px; box-shadow: none; }
.btn-block { width: 100%; }
.btn-sm { height: 32px; padding: 0 12px; border-radius: 10px; font-size: 13px; font-weight: 600; }
.btn-lg { height: 50px; border-radius: 15px; font-size: 16px; font-weight: 700; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 650; }
.field input, .field select, .field textarea,
.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 13px;
  padding: 11px 13px;
  outline: none;
  font-size: 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea, .textarea { min-height: 92px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus,
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(31, 122, 77, .12);
}
.help { color: var(--muted); font-size: 12px; line-height: 1.55; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.notice {
  background: #fff8ee;
  border: 1px solid #f1dec4;
  color: #8a5a2b;
  border-radius: 13px;
  padding: 11px 13px;
  font-size: 12px;
  line-height: 1.65;
}
.notice-green { background: var(--green-soft); border-color: var(--green-line); color: var(--green-deep); }
.notice-red { background: var(--red-soft); border-color: #f3cccc; color: #9d2b2b; }
.notice-blue { background: var(--blue-soft); border-color: #d5e3ff; color: #214ea8; }

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(12, 28, 22, .5);
  backdrop-filter: blur(4px);
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fade-up .16s ease;
}
.modal-mask.sheet { align-items: flex-end; padding: 0; }
.modal {
  width: min(560px, 100%);
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: pop .2s var(--ease);
}
.modal-mask.sheet .modal {
  width: min(430px, 100%);
  border-radius: 22px 22px 0 0;
  animation: slide .24s var(--ease);
  padding-bottom: var(--safe-bottom);
}
.modal-h, .modal-f { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; }
.modal-h { border-bottom: 1px solid var(--line); }
.modal-h h3 { font-size: 16px; color: var(--ink); font-weight: 750; }
.modal-b { padding: 16px 18px; max-height: min(68vh, 640px); overflow: auto; }
.modal-f { border-top: 1px solid var(--line); justify-content: flex-end; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 11px; border: none; background: var(--gray-soft); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; transition: background .15s ease;
}
.icon-btn:hover { background: #e6e2da; }
.toast-root { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  min-width: 220px;
  max-width: min(420px, calc(100vw - 32px));
  background: rgba(20, 32, 27, .94);
  color: #fff;
  border-radius: 14px;
  padding: 12px 16px;
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 550;
  backdrop-filter: blur(8px);
  animation: fade-up .2s var(--ease);
}
.toast-ok { background: rgba(20, 92, 58, .95); }
.toast-err { background: rgba(143, 45, 45, .95); }
.toast-warn { background: rgba(138, 78, 18, .95); }

.battery { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 12px; }
.battery-green { color: #157a45; }
.battery-orange { color: #b85a16; }
.battery-red { color: #c23535; }
.avatar {
  width: 40px; height: 40px; border-radius: 14px; color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 750; flex: none; box-shadow: inset 0 -2px 8px rgba(0,0,0,.12);
}
.avatar.lg { width: 64px; height: 64px; border-radius: 22px; font-size: 26px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: 13px; border-bottom: 1px dashed transparent; }
.kv + .kv { border-top: 1px dashed var(--line); }
.kv span { color: var(--muted); }
.kv b { font-weight: 650; text-align: right; color: var(--ink); }
.divider { height: 1px; background: var(--line); margin: 8px 0; }

.empty {
  padding: 36px 16px;
  text-align: center;
  color: var(--muted);
  background: rgba(255,255,255,.72);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}
.empty-art {
  width: 72px; height: 72px; margin: 0 auto 12px; border-radius: 22px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--green-soft), #fff);
  color: var(--green);
  box-shadow: var(--shadow-xs);
}
.empty b { display: block; color: var(--ink); margin-bottom: 6px; font-size: 15px; }
.empty span, .empty p { font-size: 13px; line-height: 1.6; }

.sticky-action {
  position: sticky;
  bottom: 0;
  margin: 16px -16px -18px;
  padding: 12px 16px calc(12px + var(--safe-bottom));
  background: linear-gradient(180deg, rgba(247,243,235,0), rgba(247,243,235,.94) 28%, #f7f3eb);
  backdrop-filter: blur(8px);
  z-index: 4;
}
.sticky-action .btn + .btn,
.sticky-action .btn + .two-btn,
.sticky-action .two-btn { margin-top: 8px; }

.page-enter { animation: fade-up .28s var(--ease); }

@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes slide { from { transform: translateY(18px); } to { transform: none; } }
