:root {
  --bg: #f3f4f6;
  --card: #ffffff;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #2563eb;
  --accent-soft: #eef2ff;
  --danger: #dc2626;
  --ok: #059669;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 8px 24px rgba(17, 24, 39, .04);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

h1, h2, h3, p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
img { display: block; max-width: 100%; }

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 14px 14px 104px;
}

.admin .wrap { max-width: 1240px; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

/* ---------------------------------------------------------------- 顶栏 */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 54px;
  padding: 0 14px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--ink);
  font-size: 16px;
}

.topnav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13.5px;
}

.navlink { color: var(--muted); }
.navlink:hover { color: var(--ink); }
.who { color: var(--muted); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.subnav {
  position: sticky;
  top: 54px;
  z-index: 29;
  display: flex;
  gap: 6px;
  padding: 8px 14px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.subnav a {
  padding: 5px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13.5px;
}

.subnav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* ---------------------------------------------------------------- 通用 */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  margin: 6px 0 14px;
}

.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.page-head .page-title { margin: 0; }

.hint {
  margin: -6px 0 14px;
  line-height: 1.7;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  background: #f3f4f6;
  color: var(--ink);
  transition: background .15s, opacity .15s, transform .05s;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: #1d4ed8; }
.btn.ghost { background: #f3f4f6; color: #374151; }
.btn.ghost:hover { background: #e5e7eb; }
.btn.block { width: 100%; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }

.link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
}

.link.danger { color: var(--danger); }
.linkbtn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 13.5px;
  color: var(--muted);
  cursor: pointer;
}

form.inline { display: inline; }

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  color: var(--muted);
}

.field input,
.field select {
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  outline: none;
}

.field input:focus,
.field select:focus,
textarea:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.field.sm input,
.field.sm select { height: 36px; font-size: 14px; }
.field.sm { font-size: 12.5px; }
.field.tiny input { width: 64px; height: 32px; font-size: 13px; }
.field.grow { flex: 1 1 180px; }

.stack { display: flex; flex-direction: column; gap: 14px; }

.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--muted);
  cursor: pointer;
}

/* ---------------------------------------------------------------- 提示 */

.flashes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }

.flash {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  transition: opacity .4s, transform .4s;
}

.flash.err { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.flash.gone { opacity: 0; transform: translateY(-4px); }

.alert {
  padding: 11px 14px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 14px;
}

/* ---------------------------------------------------------------- 发布框 */

.composer { padding: 12px; margin-bottom: 14px; }

.composer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.chip-select {
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f9fafb;
  font: inherit;
  font-size: 13px;
  color: #374151;
  outline: none;
}

.composer textarea {
  width: 100%;
  border: 0;
  outline: none;
  resize: vertical;
  padding: 6px 2px;
  font: inherit;
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: transparent;
}

.composer textarea::placeholder { color: #9ca3af; }

.picked {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 8px 0 4px;
}

.picked img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.composer-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid #f3f4f6;
}

.composer-foot .btn.primary { margin-left: auto; }

.filebtn { position: relative; overflow: hidden; }

.filebtn input[type=file] {
  position: absolute;
  inset: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  cursor: pointer;
}

/* ---------------------------------------------------------------- 记录卡片 */

.list { display: flex; flex-direction: column; gap: 12px; }

.rec { padding: 14px; }

.rec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #3730a3;
  font-size: 12px;
  white-space: nowrap;
}

.rec-body {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 15px;
  line-height: 1.7;
  margin: 2px 0 8px;
}

.thumbs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 8px 0;
}

.thumb {
  position: relative;
  display: block;
  border-radius: 10px;
  overflow: hidden;
  background: #f3f4f6;
  aspect-ratio: 1 / 1;
}

.thumb img { width: 100%; height: 100%; object-fit: cover; }

.thumb.keep input {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  accent-color: var(--danger);
}

.thumb.keep .keep-x {
  position: absolute;
  inset: auto 0 0 0;
  padding: 2px 0;
  text-align: center;
  font-size: 11px;
  color: #fff;
  background: rgba(17, 24, 39, .35);
  opacity: 0;
  transition: opacity .15s;
}

.thumb.keep:hover .keep-x { opacity: 1; }
.thumb.keep.marked { outline: 3px solid var(--danger); outline-offset: -3px; }
.thumb.keep.marked .keep-x { opacity: 1; background: var(--danger); }

.rec-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 8px;
  border-top: 1px solid #f3f4f6;
  font-size: 13.5px;
}

.keepimgs { margin: 4px 0 6px; }

.empty {
  padding: 44px 20px;
  text-align: center;
  color: var(--muted);
}

.empty p + p { margin-top: 6px; }
.empty-icon { font-size: 30px; margin-bottom: 8px; color: #d1d5db; }
.err-code { font-size: 42px; font-weight: 700; color: #e5e7eb; margin-bottom: 6px; }

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 18px 0 4px;
}

/* ---------------------------------------------------------------- 后台 */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.stat { padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 22px; line-height: 1.2; }
.stat span { font-size: 12.5px; color: var(--muted); }

.filters { padding: 12px 14px; margin-bottom: 12px; }

.frow { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.fbtns { display: flex; gap: 8px; margin-left: auto; }

.exports {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.tablewrap { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.table th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  background: #f9fafb;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: top;
}

.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #fafafa; }
.table .row-del td { background: #fef2f2; color: #7f1d1d; }
.table .row-del:hover td { background: #fee2e2; }

.c-time { width: 118px; }
.c-user { width: 96px; }
.c-cat { width: 96px; }
.c-kind { width: 72px; }
.c-student { width: 118px; }
.c-img { width: 150px; }
.c-act { width: 130px; }

.kind {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  background: #eef2ff;
  color: #3730a3;
  white-space: nowrap;
}

.kind.reception { background: #ecfdf5; color: #047857; }
.kind.signup { background: #fff7ed; color: #c2410c; }

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
  color: #6b7280;
}

.meta .ok { color: #059669; }
.meta .warn { color: #b45309; }
.meta .pay2 { color: #b45309; }

.hukou {
  color: #64748b;
}

.table td form.inline { margin-left: 10px; }
.table td form.inline:first-child { margin-left: 0; }

.cell-text {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  white-space: pre-wrap;
  max-width: 520px;
}

.tag-del { display: inline-block; margin-top: 4px; font-size: 11.5px; color: var(--danger); }

.mini { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.mini img { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; }
.mini .more { font-size: 12px; color: var(--muted); }

.empty-row { padding: 34px 0; text-align: center; color: var(--muted); }

.addrow {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.mini-input {
  height: 28px;
  width: 88px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
}

.catlist { display: flex; flex-direction: column; gap: 8px; }

.catrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
}

.cat-name {
  flex: 1 1 160px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
}

.movebtns {
  display: flex;
  gap: 4px;
  flex: 0 0 auto;
}

.btn.icon {
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 15px;
  line-height: 1;
}

.btn[disabled] {
  opacity: .3;
  cursor: default;
  pointer-events: none;
}

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 4px;
}

.dot.ok { background: #10b981; }
.dot.off { background: #d1d5db; }

/* ---------------------------------------------------------------- 登录 */

.login-page { background: #f3f4f6; }

.login-card {
  max-width: 370px;
  margin: 9vh auto 0;
  padding: 28px 24px 22px;
  text-align: center;
}

.login-card h1 { font-size: 21px; margin-bottom: 4px; }
.login-card .stack { margin-top: 20px; text-align: left; }

.login-logo {
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  border-radius: 16px;
  background: var(--accent);
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .28);
}

.tip { margin-top: 16px; font-size: 12.5px; color: var(--muted); }

/* ---------------------------------------------------------------- 大图 */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(9, 11, 16, .94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }

/* ---------------------------------------------------------------- 底部标签栏 */

.tabbar { display: none; }

@media (max-width: 640px) {
  .topnav { display: none; }
  .subnav { top: 54px; overflow-x: auto; }
  .wrap { padding: 12px 12px 96px; }

  .tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: flex;
    align-items: stretch;
    background: rgba(255, 255, 255, .97);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
    backdrop-filter: blur(10px);
  }

  .tabbar .tab {
    flex: 1;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: none;
    font: inherit;
    font-size: 13px;
    color: var(--muted);
    cursor: pointer;
  }

  .tabbar .tab.on { color: var(--accent); font-weight: 600; }
  .tabform { flex: 1; display: flex; }

  .stats { grid-template-columns: repeat(2, 1fr); }
  .fbtns { margin-left: 0; width: 100%; }
  .c-time, .c-user, .c-cat, .c-img, .c-act { width: auto; }
  .cell-text { max-width: 260px; }
  .login-card { margin-top: 6vh; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------------------------------------------------------------- 后台顶部图表 */

.dash {
  display: grid;
  grid-template-columns: minmax(300px, 1.05fr) 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.chart-card { padding: 16px 18px; }

.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.chart-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #334155;
}

.chart-body {
  display: flex;
  align-items: center;
  gap: 20px;
}

.donut {
  width: 168px;
  height: 168px;
  flex: 0 0 auto;
}

.donut .ring {
  fill: none;
  stroke: #eef2f6;
  stroke-width: 14;
}

.donut .seg {
  fill: none;
  stroke-width: 14;
  transform: rotate(-90deg);
  transform-origin: 60px 60px;
  transition: opacity .15s;
}

.donut .seg.memo { stroke: #6366f1; }
.donut .seg.reception { stroke: #10b981; }
.donut .seg.signup { stroke: #f59e0b; }

.donut-num {
  font-size: 21px;
  font-weight: 700;
  fill: #0f172a;
}

.donut-cap {
  font-size: 9px;
  fill: #94a3b8;
}

.legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 8px;
  color: #334155;
  font-size: 13px;
}

.legend-row:hover { background: #f8fafc; }

.legend-row .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.dot.memo { background: #6366f1; }
.dot.reception { background: #10b981; }
.dot.signup { background: #f59e0b; }

.legend-label { flex: 1; }
.legend-num { font-weight: 600; }
.legend-pct { width: 38px; text-align: right; }

.dash .stats {
  grid-template-columns: repeat(2, 1fr);
  margin-bottom: 0;
}

/* 列表行可点 */
tr.row-link { cursor: pointer; }
tr.row-link:hover td { background: #f8fafc; }
.cell-title { font-weight: 500; }
.c-amount { width: 100px; }

/* ---------------------------------------------------------------- 详情页 */

.detail-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 4px 0 14px;
}

.detail-card { padding: 20px 24px; margin-bottom: 12px; }

.detail-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 2px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 28px;
  margin-top: 14px;
}

.detail-row {
  display: flex;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed #eef2f6;
  min-width: 0;
}

.detail-row .k {
  flex: 0 0 92px;
  color: #64748b;
  font-size: 13px;
}

.detail-row .v {
  flex: 1;
  font-size: 14px;
  color: #0f172a;
  word-break: break-all;
}

.detail-block { margin-top: 16px; }

.detail-block .k {
  color: #64748b;
  font-size: 13px;
  margin-bottom: 6px;
}

.detail-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14.5px;
  line-height: 1.75;
}

.detail-section {
  font-size: 13.5px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 12px;
}

.detail-section .muted { font-weight: 400; margin-left: 6px; }

.imgwall {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.imgwall a {
  display: block;
  width: 148px;
  height: 148px;
  border-radius: 10px;
  overflow: hidden;
  background: #f3f4f6;
  border: 1px solid #eef1f6;
}

.imgwall img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-actions {
  display: flex;
  gap: 10px;
  margin: 18px 0 30px;
}

.btn.danger {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

.btn.danger:hover { background: #fee2e2; }

@media (max-width: 900px) {
  .dash { grid-template-columns: 1fr; }
  .dash .stats { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 640px) {
  .dash .stats { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .imgwall a { width: 104px; height: 104px; }
}

.dash .stat {
  justify-content: center;
}

.detail-actions .btn {
  min-width: 96px;
}

.detail-title {
  line-height: 1.5;
}

.img-group {
  margin-bottom: 18px;
}

.img-group:last-child {
  margin-bottom: 4px;
}

.img-group-label {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 8px;
}

.imgwall .shot {
  margin: 0;
  width: 148px;
}

.imgwall .shot figcaption {
  margin-top: 6px;
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
}

/* 序号与批量选择 */
.c-check {
  width: 38px;
  text-align: center;
}

.c-check input {
  width: 15px;
  height: 15px;
  accent-color: #2563eb;
  cursor: pointer;
}

.c-no {
  width: 54px;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

.bulkbar {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 60;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  background: #0f172a;
  border-radius: 999px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.28);
  color: #ffffff;
}

.bulkbar[hidden] { display: none; }

.bulk-count {
  font-size: 13px;
  white-space: nowrap;
}

.bulk-count b {
  font-size: 15px;
  margin: 0 2px;
}

.bulkbar .btn.sm {
  height: 32px;
  padding: 0 14px;
  font-size: 13px;
  white-space: nowrap;
}

.bulkbar .btn.ghost {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.bulkbar .btn.ghost:hover { background: rgba(255, 255, 255, 0.2); }

.bulkbar .btn.danger {
  background: #dc2626;
  color: #ffffff;
  border-color: transparent;
}

body.bulk-open { padding-bottom: 84px; }

/* ---------------------------------------------------------------- 用户端（网页） */

.ufilter { padding: 14px 16px; margin-bottom: 12px; }
.ufilter .frow { align-items: flex-end; }
.u-count { margin-top: 8px; }

.urec {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 18px;
  margin-bottom: 10px;
  color: inherit;
}

.urec:hover { border-color: #dbeafe; }
.urec-main { flex: 1; min-width: 0; }

.urec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.urec-line { display: flex; align-items: baseline; gap: 12px; }

.urec-title {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 600;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.urec-amount { font-size: 15px; font-weight: 600; }
.chev { color: #cbd5e1; font-size: 20px; }

.fab {
  position: fixed;
  right: 24px;
  bottom: 88px;
  z-index: 30;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  font-size: 28px;
  line-height: 56px;
  text-align: center;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.35);
}

/* 类型选择 */
.kinds {
  display: flex;
  padding: 5px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.kindbtn {
  position: relative;
  flex: 1;
  padding: 9px 0;
  text-align: center;
  border-radius: 999px;
  font-size: 14px;
  color: #64748b;
  cursor: pointer;
}

.kindbtn input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.kindbtn.on { background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff; font-weight: 600; }

/* 表单 */
.card.form { padding: 4px 18px 10px; }

.section {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.section::before {
  content: "";
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--accent);
}

.card.form .frow {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  min-height: 52px;
  border-bottom: 1px solid #f1f5f9;
}

.card.form .frow:last-child { border-bottom: none; }

.flabel { flex: 0 0 108px; font-size: 13.5px; color: #64748b; }
.req { color: #dc2626; font-style: normal; margin-left: 2px; }

.finput {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  font-size: 14.5px;
  color: #0f172a;
  text-align: right;
  outline: none;
}

select.finput { text-align: right; }

.finput:focus {
  border-color: #bfdbfe;
  background: #f8fafc;
}

.ftextarea {
  width: 100%;
  padding: 4px 0 8px;
  border: 0;
  outline: none;
  resize: vertical;
  background: transparent;
  font: inherit;
  font-size: 15px;
  line-height: 1.7;
}

.imgrow { padding: 10px 0; border-bottom: 1px solid #f1f5f9; }
.imgrow:last-child { border-bottom: none; }

.imgrow-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.imglabel { font-size: 13.5px; color: #334155; }

.form-actions { display: flex; gap: 10px; margin: 4px 0 20px; }
.form-actions .btn { min-width: 110px; }

/* 详情 */
.udetail { padding: 18px; }
.udetail-title { font-size: 22px; font-weight: 700; margin-top: 6px; }

/* 户籍弹窗 */
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.45);
}

.modal[hidden] { display: none; }

.modal-box {
  display: flex;
  flex-direction: column;
  width: min(430px, 100%);
  max-height: 76vh;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.3);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.modal-close {
  border: 0;
  background: none;
  font-size: 22px;
  color: #94a3b8;
  cursor: pointer;
}

.area-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 16px;
  font-size: 12.5px;
  color: var(--accent);
  border-bottom: 1px solid #f1f5f9;
}

.area-crumbs span { cursor: pointer; }

.area-list { overflow-y: auto; padding: 4px 8px 10px; }

.area-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}

.area-item:hover { background: #f8fafc; }
.area-item .muted { font-size: 12px; }

@media (min-width: 641px) {
  .fab { bottom: 32px; }
}

.area-tip { padding: 8px; }

[hidden] { display: none !important; }


.card.form input[type=date].finput {
  flex: 0 0 auto;
  width: 168px;
  margin-left: auto;
}

.tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.inline-form { display: inline; }

.tools .btn.ghost {
  background: #ffffff;
  border-color: var(--line);
}

.tools .btn.ghost:hover { background: #f8fafc; }

/* 批量导入页 */
.steps { display: flex; flex-direction: column; gap: 22px; }

.step { display: flex; gap: 14px; }

.step-no {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #eef2ff;
  color: #3730a3;
  font-size: 14px;
  font-weight: 700;
  line-height: 30px;
  text-align: center;
}

.step-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.step-body { flex: 1; min-width: 0; }
.step-body p { margin: 4px 0 10px; }

.rules { margin: 6px 0 0; padding-left: 18px; }
.rules li { margin-bottom: 5px; }

.import-form { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 8px 0 4px; }

.login-card .login-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 12px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
}

.login-logo.admin {
  background: #0f172a;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.28);
}

/* 用户端：列表勾选 */
.urec .pick {
  width: 18px;
  height: 18px;
  margin-right: 12px;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.urec.picked {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.urec .pick, .urec .chev { cursor: default; }

@media (max-width: 640px) {
  .bulkbar { bottom: 76px; }
}

/* 列表里的新建 / 修改时间 */
.urec-times {
  margin-top: 6px;
  font-size: 12px;
}

.time-sub {
  margin-top: 2px;
  font-size: 12px;
  color: #94a3b8;
}

.blank-miss {
  font-size: 12.5px;
  color: #dc2626;
}

.blank-ok {
  font-size: 12.5px;
  color: #94a3b8;
}

/* 操作日志 */
.log-act {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.log-act.create { background: #ecfdf5; color: #047857; }
.log-act.update { background: #eff6ff; color: #1d4ed8; }
.log-act.delete { background: #fef2f2; color: #b91c1c; }

.urec-blank {
  margin-top: 4px;
  font-size: 12px;
  color: #dc2626;
}

.picked-note {
  margin-top: 6px;
  color: #2563eb;
  word-break: break-all;
}

.picked-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.picked-preview img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.captcha-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.captcha-row input { flex: 1; min-width: 0; }

.captcha-row img {
  border-radius: 8px;
  border: 1px solid var(--line);
  cursor: pointer;
  flex: 0 0 auto;
}

.captcha-row .btn { flex: 0 0 auto; }

/* ---------------------------------------------------------------- 详情页（重新设计） */

.detail-page .wrap { max-width: 1040px; }

.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 10px;
  font-size: 13px;
}

.crumb-sep { color: #cbd5e1; }

.hero { padding: 24px 26px 20px; }

.hero-top { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

.hero-time { margin-left: auto; color: #94a3b8; font-size: 12.5px; }

.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: #f1f5f9;
  color: #475569;
}

.pill.ok { background: #ecfdf5; color: #047857; }
.pill.warn { background: #fff7ed; color: #c2410c; }

.hero-name {
  margin: 12px 0 8px;
  font-size: 30px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #0f172a;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.chip {
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid #eef2f7;
  background: #f8fafc;
  font-size: 12.5px;
  color: #475569;
}

.hero-amount {
  margin-left: auto;
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
}

.hero-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed #eef2f6;
  font-size: 12.5px;
  color: #94a3b8;
}

.hero-foot .dot { color: #cbd5e1; }

.detail-grid2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  align-items: start;
  gap: 14px;
  margin: 14px 0;
}

.panel { padding: 18px 22px 10px; margin-bottom: 14px; }

.panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

.panel-title::before {
  content: "";
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--accent);
}

.kv { margin: 4px 0 0; }

.kv-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
}

.kv-row:last-child { border-bottom: none; }

.kv-row dt { color: #64748b; font-size: 13px; flex: 0 0 auto; }

.kv-row dd {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: #0f172a;
  text-align: right;
  word-break: break-all;
}

.prose {
  margin: 6px 0 14px;
  font-size: 15px;
  line-height: 1.85;
  color: #1e293b;
  white-space: pre-wrap;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  padding: 8px 0 14px;
}

.gallery .shot { margin: 0; }

.gallery .shot a {
  display: block;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: #f1f5f9;
}

.gallery .shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.gallery .shot a:hover img { transform: scale(1.04); }

.gallery figcaption {
  margin-top: 6px;
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
}

.actionbar {
  display: flex;
  gap: 10px;
  margin: 6px 0 24px;
}

.danger-text { color: #b91c1c; border-color: #fecaca; }
.danger-text:hover { background: #fef2f2; }

@media (max-width: 640px) {
  .hero { padding: 18px; }
  .hero-name { font-size: 24px; }
  .hero-amount { margin-left: 0; }
  .detail-grid2 { grid-template-columns: 1fr; }
  .panel { padding: 16px 16px 8px; }

  .actionbar {
    position: sticky;
    bottom: 78px;
    padding: 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.10);
  }
}

@media (min-width: 900px) {
  .hero-name { font-size: 34px; }
}

/* ---------------------------------------------------------------- 用户端布局（列表 + 侧栏） */

.user-page .wrap { max-width: 1280px; }

.user-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.user-side { display: none; }

@media (min-width: 900px) {
  .user-shell { grid-template-columns: minmax(0, 1fr) 260px; align-items: start; }
  .user-side {
    display: block;
    position: sticky;
    top: 14px;
  }
}

.side-card { padding: 16px 18px; margin-bottom: 12px; }

.side-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.side-title::before {
  content: "";
  width: 3px;
  height: 13px;
  border-radius: 2px;
  background: var(--accent);
}

.side-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.side-stat {
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
}

.side-stat b { display: block; font-size: 20px; line-height: 1.25; color: #0f172a; }
.side-stat span { font-size: 12px; color: #64748b; }

.side-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
}

.side-bar-label { flex: 0 0 36px; font-size: 12px; color: #475569; }

.side-bar-track { flex: 1; height: 8px; }

.side-bar-fill { fill: #cbd5e1; }
.side-bar-fill.reception { fill: #10b981; }
.side-bar-fill.signup { fill: #f59e0b; }
.side-bar-fill.memo { fill: #3b82f6; }

.side-bar-num { flex: 0 0 22px; text-align: right; font-size: 12px; color: #64748b; }

.side-tip { margin: 0 0 8px; line-height: 1.65; }
.side-tip:last-child { margin-bottom: 0; }


.kind.media { background: #e0f2fe; color: #0369a1; }
.kind.referral { background: #f3e8ff; color: #7e22ce; }
.donut .seg.media { stroke: #0ea5e9; }
.donut .seg.referral { stroke: #a855f7; }
.dot.media { background: #0ea5e9; }
.dot.referral { background: #a855f7; }
.side-bar-fill.media { fill: #0ea5e9; }
.side-bar-fill.referral { fill: #a855f7; }
