:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #1f2328;
  --muted: #6b7280;
  --line: #e5e7eb;
  --primary: #07c160;
  --primary-dark: #06ad56;
  --warn: #d97706;
  --danger: #dc2626;
  --blue: #185fa5;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--blue); text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 13px; }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, Menlo, Consolas, monospace; }
.msg { min-height: 20px; font-size: 13px; margin: 10px 0 0; }
.msg.err { color: var(--danger); }
.msg.ok { color: var(--primary); }
.msg.warn { color: var(--warn); }

/* ---------- 打卡页 ---------- */
.wrap { max-width: 640px; margin: 0 auto; padding: 16px 14px 40px; }

.hd { padding: 6px 4px 14px; }
.hd-book { font-size: 20px; font-weight: 600; letter-spacing: .2px; }
.hd-meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.hd-group { color: var(--blue); font-size: 13px; margin-top: 2px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.card h2 { font-size: 16px; margin: 0 0 6px; font-weight: 600; }
.card h3 { font-size: 15px; margin: 0 0 8px; font-weight: 600; }

label { display: block; margin: 12px 0; font-size: 14px; }
label input {
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 16px;
  background: #fbfbfc;
}
label input:focus { outline: 2px solid rgba(7, 193, 96, .35); border-color: var(--primary); background: #fff; }

.btn {
  display: inline-block;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 11px 18px;
  font-size: 15px;
  font-weight: 500;
  background: #f1f3f5;
  color: var(--text);
  cursor: pointer;
  transition: background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.primary:disabled { background: #c9ced6; cursor: not-allowed; }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--text); }
.btn.ghost:hover { border-color: #c9ced6; }
.btn.big { width: 100%; padding: 14px; font-size: 16px; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.danger { background: #fff; border-color: #f3c8c8; color: var(--danger); }

.content-card .content-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.content-head h3 { margin: 0; }
.content-body {
  font-size: 16px;
  line-height: 1.9;
  white-space: pre-wrap;
  word-break: break-word;
  -webkit-user-select: text;
  user-select: text;
  max-height: 46vh;
  overflow-y: auto;
  padding-right: 4px;
}
.note { color: var(--muted); font-size: 12px; margin: 10px 0 0; }

.timer-card { text-align: center; }
.timer-ring {
  width: 168px; height: 168px;
  margin: 6px auto 14px;
  border-radius: 50%;
  border: 6px solid #eef1f4;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.timer-ring.running { border-color: rgba(7, 193, 96, .25); }
.timer-ring.ready { border-color: var(--primary); }
.timer-num { font-size: 34px; font-weight: 600; font-variant-numeric: tabular-nums; }
.timer-label { font-size: 12px; color: var(--muted); margin-top: 4px; }

.progress { height: 6px; background: #eef1f4; border-radius: 999px; overflow: hidden; margin-bottom: 16px; }
.progress-bar { height: 100%; width: 0; background: var(--primary); transition: width .6s linear; }

.audio-row { display: flex; align-items: center; gap: 12px; }
.audio-row .mono { font-size: 15px; }
audio { width: 100%; margin-top: 12px; }

.me-card .me-row { display: flex; align-items: baseline; gap: 6px; font-size: 14px; }
.me-card .me-row + .me-row { margin-top: 6px; }
.me-card b { font-size: 20px; color: var(--primary); font-variant-numeric: tabular-nums; }

/* 本月打卡日期小圆点（成员自查用） */
.month-days { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed #e5e7eb; }
.month-days .day-chip {
  font-size: 12px; line-height: 1.5; padding: 1px 7px; border-radius: 999px;
  background: rgba(7, 193, 96, .12); color: var(--primary-dark);
  font-variant-numeric: tabular-nums;
}
.month-days .day-chip.today { background: var(--primary); color: #fff; }
.month-days .hint { font-size: 12px; color: var(--muted); width: 100%; }

.ft { text-align: center; color: #9aa3af; font-size: 12px; padding: 18px 0 0; }

.big-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: #f1f3f5; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 600; margin-bottom: 10px;
}
.center { text-align: center; }

/* ---------- 管理后台 ---------- */
.admin-layout { display: flex; min-height: 100vh; }

.side {
  width: 208px; flex: 0 0 208px;
  background: #fff; border-right: 1px solid var(--line);
  padding: 18px 12px;
}
.side h1 { font-size: 15px; margin: 0 0 4px; }
.side .side-sub { font-size: 11px; color: var(--muted); margin-bottom: 18px; word-break: break-all; }
.nav-item {
  display: block; width: 100%; text-align: left;
  border: none; background: transparent;
  padding: 10px 12px; border-radius: 9px;
  font-size: 14px; color: var(--text); cursor: pointer;
  margin-bottom: 2px;
}
.nav-item:hover { background: #f4f6f8; }
.nav-item.active { background: rgba(7, 193, 96, .1); color: var(--primary-dark); font-weight: 500; }

.main { flex: 1; padding: 22px 26px 60px; max-width: 1180px; }
.main h2 { font-size: 18px; margin: 0 0 4px; }
.main .page-desc { color: var(--muted); font-size: 13px; margin-bottom: 18px; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.panel h3 { font-size: 15px; margin: 0 0 12px; }

.grid { display: grid; gap: 12px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .admin-layout { flex-direction: column; }
  .side { width: 100%; flex: none; border-right: none; border-bottom: 1px solid var(--line); }
  .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; }
  .main { padding: 16px 14px 60px; }
}

.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; background: #fafbfc; white-space: nowrap; }
tbody tr:hover { background: #fafbfc; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }

input[type="text"], input[type="password"], input[type="number"], input[type="date"], input[type="time"], select, textarea {
  width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px;
  font-size: 14px; background: #fbfbfc; font-family: inherit;
}
textarea { min-height: 130px; resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(7, 193, 96, .3); border-color: var(--primary); background: #fff; }

.field { margin-bottom: 12px; }
.field label { margin: 0 0 5px; font-size: 13px; color: var(--muted); display: block; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: #f1f3f5; color: var(--muted); }
.tag.green { background: rgba(7, 193, 96, .12); color: var(--primary-dark); }
.tag.amber { background: #fef3c7; color: #92400e; }
.tag.red { background: #fee2e2; color: #991b1b; }
.tag.blue { background: #e6f1fb; color: var(--blue); }

.login-box {
  max-width: 360px; margin: 12vh auto; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 24px; box-shadow: var(--shadow);
}
.login-box h2 { margin: 0 0 4px; font-size: 18px; }

.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%);
  background: #1f2328; color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 13px; z-index: 999; max-width: 80vw; text-align: center;
}
.toast.err { background: #b91c1c; }
