:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --ink: #1a1f36;
  --muted: #6b7280;
  --line: #e9ecf5;

  --indigo: #4f46e5;
  --violet: #7c3aed;
  --pink: #db2777;
  --blue: #2563eb;
  --cyan: #0891b2;
  --mint: #10b981;
  --amber: #f59e0b;
  --danger: #e11d48;

  --radius: 18px;
  --shadow-sm: 0 1px 2px rgba(26, 31, 54, .05);
  --shadow: 0 2px 6px rgba(26, 31, 54, .05), 0 12px 28px rgba(26, 31, 54, .06);
  --shadow-lg: 0 10px 40px rgba(79, 70, 229, .14);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  color: var(--ink);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  padding: 16px 14px 44px;
  background:
    radial-gradient(900px 480px at 12% -8%, #e5e9ff 0%, rgba(229, 233, 255, 0) 62%),
    radial-gradient(760px 420px at 92% 4%, #ffe9f2 0%, rgba(255, 233, 242, 0) 60%),
    radial-gradient(720px 520px at 50% 108%, #e6fbf4 0%, rgba(230, 251, 244, 0) 58%),
    linear-gradient(180deg, #f7f8fd 0%, #f3f5fb 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

.wrap { max-width: 720px; margin: 0 auto; }
.hide { display: none !important; }
.muted { color: var(--muted); font-size: 13px; margin-left: 8px; }
.err { color: #fecdd3; }
hr { border: 0; border-top: 1px dashed var(--line); margin: 18px 0; }

/* ---------- 顶部 ---------- */
.hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  border-radius: 22px;
  padding: 20px 20px 18px;
  margin-bottom: 14px;
  background:
    radial-gradient(420px 220px at 88% -10%, rgba(255, 255, 255, .30) 0%, rgba(255, 255, 255, 0) 62%),
    radial-gradient(360px 260px at 4% 120%, rgba(6, 182, 212, .55) 0%, rgba(6, 182, 212, 0) 60%),
    linear-gradient(135deg, #4f46e5 0%, #7c3aed 48%, #c026d3 100%);
  box-shadow: 0 14px 34px rgba(79, 70, 229, .28);
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .18) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity: .35;
  pointer-events: none;
}
.hero.compact { padding: 16px 20px; }
.hero-top { position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.hero-title h1 { font-size: 20px; margin: 0 0 5px; font-weight: 700; letter-spacing: .2px; text-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.hero-title p { margin: 0; font-size: 13px; color: rgba(255, 255, 255, .82); }
.ghost-btn {
  flex: 0 0 auto;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 11px;
  padding: 7px 13px;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  backdrop-filter: blur(6px);
  transition: background .18s ease, transform .06s ease;
}
.ghost-btn:hover { background: rgba(255, 255, 255, .3); }
.ghost-btn:active { transform: scale(.97); }
.who { position: relative; margin-top: 13px; display: flex; align-items: baseline; gap: 6px; }
.who b { font-size: 17px; }
.who .muted { color: rgba(255, 255, 255, .7); }
.meta { position: relative; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.chip {
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 12px;
  color: #fff;
  backdrop-filter: blur(4px);
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid rgba(233, 236, 245, .9);
  border-radius: var(--radius);
  padding: 17px;
  margin-bottom: 13px;
  box-shadow: var(--shadow);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 650;
  margin-bottom: 12px;
  font-size: 15px;
}
.stat { font-size: 12px; font-weight: 500; color: var(--muted); }

/* ---------- 表单 ---------- */
textarea, input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], select {
  width: 100%;
  border: 1.5px solid var(--line);
  background: #fafbfe;
  border-radius: 12px;
  padding: 11px 13px;
  font: inherit;
  color: var(--ink);
  outline: none;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
textarea:focus, input:focus, select:focus {
  border-color: #a5b4fc;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, .12);
}
textarea { resize: vertical; margin-bottom: 11px; line-height: 1.65; }
.form { display: grid; gap: 11px; }
.form.grid2 { grid-template-columns: 1fr 1fr; gap: 11px 13px; }
.form.inline { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); align-items: end; }
label { display: grid; gap: 5px; font-size: 13px; color: var(--muted); }

.btn {
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 12px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform .06s ease, box-shadow .18s ease, background .18s ease;
}
.btn:active { transform: scale(.985); }
.btn.primary {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 20px rgba(79, 70, 229, .28);
}
.btn.primary:hover { box-shadow: 0 10px 26px rgba(79, 70, 229, .36); }
.btn.primary.run { background: linear-gradient(135deg, #f59e0b, #f97316); border-color: transparent; box-shadow: 0 8px 20px rgba(245, 158, 11, .3); }
.btn.done { background: linear-gradient(135deg, #ecfdf5, #d1fae5); border-color: #a7f3d0; color: #047857; }
.btn.ghost { background: #f7f8fc; color: var(--muted); border-color: #eef0f7; }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 9px; }

.hint { font-size: 12px; color: var(--muted); margin: 11px 0 0; line-height: 1.6; }
.empty {
  color: var(--muted);
  font-size: 13px;
  padding: 20px 0;
  text-align: center;
  border: 1.5px dashed #e4e8f3;
  border-radius: 14px;
  background: #fbfcff;
}
.stat-line { font-size: 12px; color: var(--muted); margin: 11px 0 7px; }
.sub-title {
  font-weight: 650;
  font-size: 13px;
  margin: 18px 0 9px;
  color: #4b5563;
  display: flex;
  align-items: center;
  gap: 7px;
}
.sub-title::before {
  content: "";
  width: 4px; height: 14px; border-radius: 3px;
  background: linear-gradient(180deg, #6366f1, #a855f7);
}

/* ---------- 选择身份 ---------- */
.picker { border-color: #ddd6fe; box-shadow: var(--shadow-lg); }
.picker-body { max-height: 46vh; overflow: auto; }
.grp { font-size: 12px; color: var(--muted); margin: 12px 0 7px; }
.pgrid { display: flex; flex-wrap: wrap; gap: 8px; }
.pbtn {
  border: 1.5px solid var(--line);
  background: #fafbfe;
  border-radius: 11px;
  padding: 9px 15px;
  font: inherit;
  cursor: pointer;
  transition: all .16s ease;
}
.pbtn:hover { border-color: #c7d2fe; background: #eef2ff; }
.pbtn.on {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px rgba(79, 70, 229, .3);
}

/* ---------- 选项卡 ---------- */
.tabs, .nav {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(233, 236, 245, .9);
  padding: 4px;
  border-radius: 14px;
  margin-bottom: 13px;
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
}
.tabs button, .nav button {
  flex: 1 0 auto;
  border: 0;
  background: transparent;
  padding: 10px 13px;
  border-radius: 10px;
  font: inherit;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all .16s ease;
}
.tabs button.on, .nav button.on {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(79, 70, 229, .28);
}

.seg { display: inline-flex; background: #f1f3fa; border-radius: 11px; padding: 3px; margin-bottom: 13px; }
.seg button {
  border: 0; background: transparent; padding: 7px 18px; border-radius: 9px;
  font: inherit; font-size: 13px; color: var(--muted); cursor: pointer;
  transition: all .16s ease;
}
.seg button.on { background: #fff; color: var(--indigo); font-weight: 650; box-shadow: 0 2px 6px rgba(79, 70, 229, .14); }

/* ---------- 看板 ---------- */
.board-date { font-size: 12px; color: var(--muted); letter-spacing: .3px; }
.board-sum { display: flex; gap: 9px; margin: 11px 0 17px; }
.board-sum > div {
  flex: 1; border-radius: 14px; padding: 12px; text-align: center;
  background: linear-gradient(160deg, #f8faff, #eef2ff);
  border: 1px solid #e8ecfb;
}
.board-sum > div:nth-child(1) { background: linear-gradient(160deg, #ecfdf5, #d1fae5); border-color: #bbf7d0; }
.board-sum > div:nth-child(1) b { color: #047857; }
.board-sum > div:nth-child(2) { background: linear-gradient(160deg, #fff7ed, #ffedd5); border-color: #fed7aa; }
.board-sum > div:nth-child(2) b { color: #b45309; }
.board-sum > div:nth-child(3) { background: linear-gradient(160deg, #f5f3ff, #ede9fe); border-color: #ddd6fe; }
.board-sum > div:nth-child(3) b { color: #6d28d9; }
.board-sum b { display: block; font-size: 19px; font-weight: 700; }
.board-sum span { font-size: 12px; color: var(--muted); }

.gblock { margin-bottom: 15px; }
.gt { font-size: 13px; font-weight: 650; margin-bottom: 9px; }
.gt em { font-style: normal; color: var(--muted); font-weight: 500; margin-left: 8px; font-size: 12px; }
.mlist { display: flex; flex-wrap: wrap; gap: 8px; }
.mlist span {
  border: 1.5px solid #eef0f7;
  color: #9aa1ae;
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 13px;
  background: #fbfcff;
  transition: all .16s ease;
}
.mlist .on {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border-color: #a7f3d0;
  color: #047857;
  font-weight: 600;
  box-shadow: 0 3px 10px rgba(16, 185, 129, .16);
}
.mlist .leave {
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  border-color: #fed7aa;
  color: #b45309;
}
.mlist .me { box-shadow: 0 0 0 2.5px rgba(124, 58, 237, .3); }

/* ---------- 榜单 ---------- */
.rank-range { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.rank-row { display: flex; align-items: center; gap: 13px; padding: 10px 6px; border-bottom: 1px solid #f4f6fb; border-radius: 10px; }
.rank-row:last-child { border-bottom: 0; }
.rank-row:hover { background: #fafbff; }
.no {
  width: 26px; height: 26px; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 9px;
  color: var(--muted); font-size: 13px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: #f4f6fb;
}
.no.top { color: #fff; }
#rankPerson .rank-row:nth-child(1) .no { background: linear-gradient(135deg, #fbbf24, #f59e0b); box-shadow: 0 4px 12px rgba(245, 158, 11, .38); }
#rankPerson .rank-row:nth-child(2) .no { background: linear-gradient(135deg, #cbd5e1, #94a3b8); box-shadow: 0 4px 12px rgba(148, 163, 184, .35); }
#rankPerson .rank-row:nth-child(3) .no { background: linear-gradient(135deg, #d9a06b, #b87333); box-shadow: 0 4px 12px rgba(184, 115, 51, .32); }
.nm { flex: 1; min-width: 0; font-size: 14px; font-weight: 550; }
.nm small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; margin-top: 1px; }
.bar { height: 6px; background: #eef1f8; border-radius: 999px; margin-top: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #6366f1, #a855f7); transition: width .4s ease; }
.bar i.run { background: linear-gradient(90deg, #f59e0b, #f97316); }
#rankPerson .rank-row:nth-child(1) .bar i { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
#rankPerson .rank-row:nth-child(2) .bar i { background: linear-gradient(90deg, #94a3b8, #cbd5e1); }
#rankPerson .rank-row:nth-child(3) .bar i { background: linear-gradient(90deg, #b87333, #d9a06b); }
.ct { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 15px; color: #374151; }
.crown {
  font-size: 11px; border-radius: 7px; padding: 2px 7px; font-weight: 650; vertical-align: 1px;
  background: linear-gradient(135deg, #fef3c7, #fde68a); color: #92400e;
  box-shadow: 0 2px 6px rgba(245, 158, 11, .22);
}

/* ---------- 精句墙 ---------- */
.note-item { padding: 13px 0 13px 13px; border-left: 3px solid #e0e7ff; margin-bottom: 2px; }
.note-item:nth-child(3n+1) { border-left-color: #c7d2fe; }
.note-item:nth-child(3n+2) { border-left-color: #fbcfe8; }
.note-item:nth-child(3n) { border-left-color: #a7f3d0; }
.note-item .by { font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.note-item p { margin: 0; font-size: 14px; line-height: 1.7; color: #2c3244; }

/* ---------- 我的记录 ---------- */
.rec-row { display: flex; gap: 11px; padding: 10px 0; border-bottom: 1px solid #f4f6fb; align-items: flex-start; }
.rec-row:last-child { border-bottom: 0; }
.rec-row .ico {
  width: 28px; height: 28px; flex: 0 0 auto; border-radius: 9px;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  display: grid; place-items: center; font-size: 12px; font-weight: 600; color: #4f46e5;
}
.rec-row .body { font-size: 14px; }
.rec-row .body small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }

.tag { font-size: 11px; border-radius: 7px; padding: 2px 7px; margin-left: 5px; background: #f1f3fa; color: #4b5563; }
.tag.leave { background: #fff7ed; color: #b45309; }
.tag.admin { background: #eef2ff; color: #4338ca; }
.tag.off { background: #f3f4f6; color: #9ca3af; }
.book { font-size: 11px; background: linear-gradient(135deg, #eef2ff, #e0e7ff); color: #4338ca; border-radius: 7px; padding: 2px 7px; white-space: nowrap; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; margin-top: 8px; border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid #f4f6fb; white-space: nowrap; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: #fafbff; }
tbody tr:hover { background: #fafbff; }
td.note { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
tr.dim { opacity: .45; }
.warn { color: var(--danger); font-weight: 600; }
.link {
  border: 0; background: none; color: var(--indigo); font: inherit; font-size: 12px;
  cursor: pointer; padding: 2px 5px; border-radius: 6px;
}
.link:hover { background: #eef2ff; }
.link.danger { color: var(--danger); }
.link.danger:hover { background: #fff1f2; }
.ops { display: flex; gap: 2px; }

/* ---------- 其他 ---------- */
.foot { text-align: center; margin-top: 20px; font-size: 12px; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--indigo); }

.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 20px);
  background: linear-gradient(135deg, #312e81, #4c1d95);
  color: #fff; padding: 11px 20px; border-radius: 13px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: all .24s ease;
  max-width: 82vw; text-align: center; z-index: 50;
  box-shadow: 0 12px 30px rgba(49, 46, 129, .34);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

details.makeup summary {
  cursor: pointer; font-weight: 650; list-style: none;
  display: flex; align-items: center; gap: 8px; justify-content: space-between;
}
details.makeup summary::-webkit-details-marker { display: none; }
details.makeup summary::after { content: "＋"; color: var(--muted); font-weight: 400; }
details.makeup[open] summary::after { content: "－"; }
details.makeup[open] summary { margin-bottom: 13px; }

.code {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 13px;
  padding: 15px;
  font: 12.5px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0 0 12px;
}

.no-running .col-run { display: none !important; }
.no-groups .col-group { display: none !important; }
.book-pick { margin-bottom: 9px; }

@media (max-width: 480px) {
  .form.grid2 { grid-template-columns: 1fr; }
  body { padding: 12px 10px 34px; }
  .hero { padding: 17px 16px 15px; border-radius: 19px; }
  .card { padding: 15px; }
}
