/* ============ 家庭积分激励系统 通用样式 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --bg: #f3f6fb;
  --card: #ffffff;
  --ink: #26324a;
  --sub: #8a94a8;
  --line: #e6ebf3;
  --brand: #4f8ef7;
  --green: #22b573;
  --red: #f05d5e;
  --gold: #ffb020;
  --radius: 18px;
  --shadow: 0 8px 24px rgba(38, 50, 74, .08);
}
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
}
a { color: var(--brand); text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; }
input, select, textarea { font-family: inherit; font-size: 15px; }
.hidden { display: none !important; }

/* ---------- 通用组件 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 12px; font-size: 15px; font-weight: 600;
  background: var(--brand); color: #fff; transition: opacity .15s, transform .1s;
}
.btn:active { transform: scale(.97); }
.btn.ghost { background: #eef2f9; color: var(--ink); }
.btn.green { background: var(--green); }
.btn.red { background: var(--red); }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }

.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; border: 1px solid var(--line);
}
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: #eef2f9; color: var(--sub);
}
.chip.green { background: #e3f7ee; color: var(--green); }
.chip.red { background: #fdecec; color: var(--red); }
.chip.gold { background: #fff3d9; color: #b97a00; }

/* 顶栏 */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 18px; background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.topbar .brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 17px; }
.topbar .brand .logo { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 17px; color: #fff; background: linear-gradient(135deg, #5aa2ff, #7b6cff); }
.topbar .right { display: flex; align-items: center; gap: 8px; }

/* ========== 弹窗 ========== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(20, 28, 45, .45);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
  animation: fadeIn .18s ease;
}
.modal {
  background: var(--card); border-radius: 20px; padding: 22px; width: 100%; max-width: 420px;
  box-shadow: 0 20px 60px rgba(20, 28, 45, .25); animation: popIn .2s ease;
  max-height: 88vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
/* 标题栏：标题与关闭按钮两端对齐，关闭按钮统一为圆形 */
.modal h3 {
  font-size: 17px; font-weight: 700; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.modal h3 .close {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-size: 19px; line-height: 1;
  color: var(--sub); background: #eef2f9; transition: background .15s, color .15s;
}
.modal h3 .close:hover { background: #e2e8f2; color: var(--ink); }

/* ========== 统一表单控件（弹窗/设置/筛选通用） ========== */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--sub); font-weight: 600; margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; }

input, select, textarea {
  font-family: inherit; font-size: 14px; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 11px;
  background: #fbfcfe; outline: none;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
input, select { height: 44px; padding: 0 13px; }
textarea { padding: 11px 13px; min-height: 70px; resize: vertical; line-height: 1.65; }
input:focus, select:focus, textarea:focus {
  border-color: var(--brand); background: #fff;
  box-shadow: 0 0 0 3px rgba(79,142,247,.12);
}
/* 下拉框：去除原生黑色箭头，统一为柔和灰色 chevron */
select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a94a8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 16px;
}
/* 日期/时间类原生图标弱化，风格统一 */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  width: 17px; height: 17px; margin: 0; padding: 0; opacity: .4; cursor: pointer; transition: opacity .15s;
}
input[type="date"]:hover::-webkit-calendar-picker-indicator,
input[type="time"]:hover::-webkit-calendar-picker-indicator,
input[type="datetime-local"]:hover::-webkit-calendar-picker-indicator { opacity: .75; }
input[type="date"]:focus::-webkit-calendar-picker-indicator,
input[type="time"]:focus::-webkit-calendar-picker-indicator,
input[type="datetime-local"]:focus::-webkit-calendar-picker-indicator { opacity: 1; }
/* 取色器统一 */
input[type="color"] { padding: 4px; cursor: pointer; }
input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 7px; }

/* 底部操作按钮：右对齐、统一最小宽度 */
.m-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.m-actions .btn { min-width: 92px; }

@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { transform: scale(.94); opacity: 0; } }

.toast {
  position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%);
  background: rgba(30, 40, 60, .92); color: #fff; padding: 11px 20px; border-radius: 999px;
  font-size: 14px; z-index: 200; max-width: 86vw; text-align: center;
  animation: popIn .2s ease;
}
.toast.err { background: rgba(200, 60, 60, .95); }

/* 空状态 */
.empty { text-align: center; color: var(--sub); padding: 40px 10px; font-size: 14px; }
.empty .big { font-size: 44px; margin-bottom: 10px; }

/* 加载 */
.loading { text-align: center; color: var(--sub); padding: 40px; }
.spinner {
  width: 26px; height: 26px; margin: 0 auto 10px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
