* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: #f3f5f9;
  color: #1f2733;
  line-height: 1.5;
}
a { color: #2563eb; text-decoration: none; }
h1, h2, h3 { margin: 0 0 8px; }

.navbar { background: #1e3a8a; color: #fff; }
.nav-inner { max-width: 1240px; margin: 0 auto; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.brand { font-weight: 700; font-size: 16px; }
.navbar nav { display: flex; gap: 14px; align-items: center; }
.navbar nav a { color: #e0e7ff; }
.navbar nav a:hover { color: #fff; }
.navbar .who { color: #93c5fd; font-size: 13px; }

.container { max-width: 1240px; margin: 16px auto; padding: 0 16px 40px; }

.card { background: #fff; border-radius: 10px; padding: 16px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.card.narrow { max-width: 420px; margin: 40px auto; }

.summary { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.stats { display: flex; gap: 20px; }
.stat { text-align: center; }
.stat .num { display: block; font-size: 26px; font-weight: 700; }
.stat .lbl { font-size: 12px; color: #6b7280; }

.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar input { flex: 1; min-width: 200px; }

.hint { color: #6b7280; font-size: 13px; }
.strong { font-weight: 600; }
.green { color: #16a34a; }
.orange { color: #ea580c; }

.btn {
  display: inline-block; padding: 8px 14px; border: 1px solid #d1d5db; background: #fff;
  border-radius: 8px; cursor: pointer; font-size: 14px; color: #1f2733;
}
.btn:hover { background: #f9fafb; }
.btn.primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.btn.primary:hover { background: #1d4ed8; }
.btn.ghost { border: none; background: transparent; font-size: 18px; padding: 0 8px; }
.btn.small { padding: 4px 10px; font-size: 13px; }
button.btn.primary { display: block; width: 100%; margin-top: 4px; }

input[type=text], input[type=password], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 8px;
  font-size: 14px; background: #fff; margin-bottom: 12px;
}
label { display: block; font-size: 13px; color: #374151; margin-bottom: 4px; }
label em { color: #dc2626; font-style: normal; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: center; padding: 8px 10px; border-bottom: 1px solid #eef0f3; white-space: nowrap; vertical-align: middle; }
th { color: #6b7280; font-weight: 600; font-size: 13px; background: #f9fafb; }
tbody tr:hover { background: #f8fafc; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.hukou-local { background: #e0f2fe; color: #0369a1; }
.hukou-nonlocal { background: #fef3c7; color: #b45309; }
.hukou-other { background: #f3f4f6; color: #6b7280; }
.status-green { background: #dcfce7; color: #16a34a; }
.status-orange { background: #ffedd5; color: #ea580c; }
.status-blue { background: #e0f2fe; color: #0369a1; }
.status-red { background: #fee2e2; color: #dc2626; }
.status-gray { background: #f3f4f6; color: #6b7280; }

.progress { background: #eef0f3; border-radius: 999px; height: 8px; overflow: hidden; }
.progress .bar { background: #2563eb; height: 100%; border-radius: 999px; }

/* 登录页 */
.auth-bg { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; background: linear-gradient(135deg, #1e3a8a, #2563eb); }
.auth-card { background: #fff; border-radius: 14px; padding: 32px; width: 100%; max-width: 360px; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.auth-card h1 { font-size: 22px; }
.auth-card .sub { color: #6b7280; margin-bottom: 20px; }
.auth-card .hint { margin-top: 16px; }

.alert { padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; font-size: 14px; }
.alert.error { background: #fee2e2; color: #b91c1c; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal-mask[hidden] { display: none; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 460px; max-height: 90vh; overflow: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid #eef0f3; }
.modal-body { padding: 16px; }
.modal-foot { padding: 12px 16px; border-top: 1px solid #eef0f3; display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.modal-foot .hint { margin-right: auto; }
.m-info { background: #f8fafc; border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; font-size: 14px; }
.m-info-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.m-info-head .t { font-weight: 600; font-size: 14px; }
.m-info-head .m-info-state { font-size: 12px; }
.m-info-head .m-info-grow { flex: 1; }
.m-info-grid { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; align-items: baseline; }
.m-info-grid .k { color: #6b7280; font-size: 13px; white-space: nowrap; }
.m-info-grid .v { font-size: 14px; word-break: break-all; }
.m-info-grid-edit .v select, .m-info-grid-edit .v input {
  width: 100%; margin-bottom: 0; padding: 6px 8px; font-size: 14px; min-height: 34px;
}

/* 移动端响应式（iPhone / 安卓 / 鸿蒙） */
@media (max-width: 640px) {
  .nav-inner { flex-direction: column; align-items: center; gap: 10px; }
  .navbar nav { flex-wrap: wrap; justify-content: center; gap: 10px; }
  .container { padding: 0 10px 32px; }
  .card { padding: 12px; border-radius: 8px; }
  .summary { flex-direction: column; align-items: center; text-align: center; }
  .stats { gap: 14px; justify-content: center; }
  .stat .num { font-size: 22px; }
  .toolbar { justify-content: center; }
  table { font-size: 13px; }
  th, td { padding: 7px 8px; }
  .modal { max-width: none; margin: 8px; }
  .auth-card { padding: 24px 20px; }
  .m-info-grid { grid-template-columns: 88px 1fr; }
}

.btn.reg-btn { background: #2563eb; border-color: #2563eb; color: #fff; }
.btn.reg-btn:hover { background: #1d4ed8; }

/* ===== 响应式卡片：窄屏(手机/平板/小笔记本)表格自动转为卡片，避免横向滑动 ===== */
@media (max-width: 1150px) {
  table.rt { border: none; }
  table.rt, table.rt thead, table.rt tbody, table.rt tr, table.rt td { display: block; width: 100%; box-sizing: border-box; }
  table.rt thead { display: none; }
  table.rt tr {
    border: 1px solid #e3e7ef; border-radius: 12px; margin: 0 0 10px; padding: 6px 4px;
    background: #fff; box-shadow: 0 1px 2px rgba(15,23,42,.05);
  }
  table.rt td {
    border: none; white-space: normal; text-align: right; vertical-align: middle;
    padding: 5px 10px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 14px;
  }
  table.rt td::before {
    content: attr(data-label); flex: 0 0 auto; text-align: left;
    color: #6b7280; font-weight: 600; font-size: 12px; min-width: 64px;
  }
  table.rt td.act { display: block; border-top: 1px dashed #e3e7ef; margin-top: 6px; padding: 8px 10px 4px; text-align: center; }
  table.rt td.act::before { content: none; }
  table.rt td.act button, table.rt td.act a.btn {
    display: block; width: 100%; box-sizing: border-box; margin: 2px 0 4px;
    padding: 10px 12px; font-size: 15px; text-align: center;
  }
  table.rt td.act form { width: 100%; display: block; }
  table.rt td.act button.btn-primary-like,
  table.rt td.act a.btn.primary { background: #2563eb; color: #fff; border-color: #2563eb; }
  /* 让主要动作按钮明显 */
  table.rt .reg-btn { background: #2563eb; border-color: #2563eb; color: #fff; }
  /* 卡片模式下的进度条占满剩余宽度 */
  table.rt td[data-label="进度"] .progress { flex: 1 1 auto; min-width: 80px; }
}
