/* 鸣鸣很忙 IP 漫画风 门店投保填报系统 */
:root {
  --yellow: #ffd21e;
  --yellow-deep: #f5b800;
  --red: #e63b2e;
  --red-deep: #c6281c;
  --blue: #2e7fe0;
  --blue-deep: #1f5fb5;
  --ink: #232323;
  --paper: #fffdf5;
  --bg: #fff6d9;
  --green: #22a06b;
  --gray: #8a8a8a;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

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

html, body {
  margin: 0;
  padding: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 210, 30, .35) 0 60px, transparent 61px),
    radial-gradient(circle at 88% 8%, rgba(230, 59, 46, .18) 0 48px, transparent 49px),
    radial-gradient(circle at 80% 92%, rgba(46, 127, 224, .18) 0 70px, transparent 71px),
    var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
}

body {
  /* 微信 iOS 底部安全区（刘海屏/Home 指示条） */
  padding-bottom: env(safe-area-inset-bottom);
}

.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 14px calc(36px + env(safe-area-inset-bottom));
  padding-left: max(14px, env(safe-area-inset-left));
  padding-right: max(14px, env(safe-area-inset-right));
  position: relative;
  z-index: 1;
  overflow-x: hidden;
}

/* 授权承诺 */
.agree-line {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 12.5px;
  line-height: 1.7;
  color: #444;
}
.agree-line input[type=checkbox] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--red);
}
.agree-line b { color: var(--red-deep); }

/* 顶部 */
.hero {
  text-align: center;
  padding: 18px 0 6px;
}
.hero img.logo {
  width: 132px;
  height: auto;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: #fff;
  box-shadow: 4px 4px 0 var(--ink);
}
.hero h1 {
  display: inline-block;
  margin: 12px 0 4px;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 1px;
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: 12px;
  padding: 6px 16px;
  box-shadow: 4px 4px 0 var(--ink);
  transform: rotate(-1deg);
}
.hero .sub {
  font-size: 13px;
  color: #555;
  margin: 8px 0 0;
}

/* 卡片 */
.card {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: 5px 5px 0 var(--ink);
  padding: 16px;
  margin-top: 16px;
}
.card.red { background: #fff3f2; }
.card.blue { background: #f0f6ff; }
.card-title {
  font-size: 17px;
  font-weight: 900;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title::before {
  content: "";
  width: 10px;
  height: 22px;
  background: var(--red);
  border: 2px solid var(--ink);
  border-radius: 4px;
  display: inline-block;
}
.card-title.blue::before { background: var(--blue); }
.card-title.green::before { background: var(--green); }

/* 提示条 */
.notice {
  background: #fff8d6;
  border: 2.5px dashed var(--yellow-deep);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.7;
  margin: 10px 0;
  color: #6b4d00;
}
.notice.red { background: #ffeceb; border-color: var(--red); color: #8f1d14; }
.notice b { color: var(--red); }

/* 表单 */
label.field { display: block; margin: 12px 0; }
label.field > span {
  display: block;
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 6px;
}
label.field > span .req { color: var(--red); margin-right: 2px; }
input[type=text], input[type=password], input[type=date], input[type=tel], select, textarea {
  width: 100%;
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  padding: 11px 12px;
  /* iOS 微信聚焦输入框时，字号 <16px 会自动放大页面，统一 16px */
  font-size: 16px;
  font-family: inherit;
  background: #fff;
  box-shadow: inset 2px 2px 0 rgba(0,0,0,.06);
  -webkit-appearance: none;
  appearance: none;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(230,59,46,.18);
}
input::placeholder { color: #bbb; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #777 50%), linear-gradient(135deg, #777 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; }

/* 按钮 */
.btn {
  display: block;
  width: 100%;
  border: 3px solid var(--ink);
  border-radius: 12px;
  padding: 13px 16px;
  font-size: 17px;
  font-weight: 900;
  font-family: inherit;
  letter-spacing: 1px;
  text-align: center;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform .06s ease, box-shadow .06s ease;
  background: var(--yellow);
  color: var(--ink);
  touch-action: manipulation;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn.red { background: var(--red); color: #fff; }
.btn.blue { background: var(--blue); color: #fff; }
.btn.green { background: var(--green); color: #fff; }
.btn.gray { background: #e9e9e9; color: #555; }
.btn.small { display: inline-block; width: auto; padding: 8px 14px; font-size: 13px; border-width: 2px; box-shadow: 3px 3px 0 var(--ink); }
.btn + .btn { margin-top: 12px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* 人员行 */
.person-row {
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  padding: 10px;
  margin: 10px 0;
  background: #fff;
  position: relative;
}
.person-row.add { background: #f0fbf5; }
.person-row .row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 900;
  font-size: 14px;
  margin-bottom: 8px;
}
.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 900;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 1px 9px;
}
.tag.green { background: #c9f3df; color: #13714b; }
.tag.red { background: #ffd5d1; color: #a51f14; }
.tag.gray { background: #ececec; color: #666; }
.tag.blue { background: #d6e6ff; color: #15509e; }
.person-row input { margin-top: 6px; }
.person-row .del-x {
  position: absolute;
  right: -10px;
  top: -12px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  border: 2.5px solid var(--ink);
  font-weight: 900;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
}

/* 减少人员勾选列表 */
.check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 8px 10px;
  margin: 8px 0;
  background: #fff;
}
.check-item input[type=checkbox], .check-item input[type=radio] {
  width: 20px;
  height: 20px;
  accent-color: var(--red);
  flex-shrink: 0;
}
.check-item .info { flex: 1; min-width: 0; }
.check-item .info .nm { font-weight: 800; font-size: 15px; }
.check-item .info .idno { font-size: 12px; color: #777; }
.check-item .leave { width: 140px; flex-shrink: 0; }
.check-item.checked { background: #fff0ef; }

/* 状态 */
.status-pill { font-size: 12px; font-weight: 900; border: 2px solid var(--ink); border-radius: 999px; padding: 2px 10px; }
.st-pending_manager { background: #ffe9a8; }
.st-pending_admin { background: #ffd0c9; }
.st-approved { background: #c9f3df; }
.st-rejected { background: #e5e5e5; }

/* 弹窗 */
.mask {
  position: fixed; inset: 0;
  background: rgba(20,20,20,.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
  padding: 24px;
}
.dialog {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: 6px 6px 0 rgba(0,0,0,.35);
  padding: 22px;
  max-width: 420px;
  width: 100%;
  max-height: 85vh;
  max-height: 85dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.dialog h3 { margin: 0 0 12px; font-size: 19px; }

/* 成功页 */
.success-box { text-align: center; padding: 26px 10px 10px; }
.success-box .circle {
  width: 88px; height: 88px; margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--yellow);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  font-size: 48px;
  line-height: 82px;
  font-weight: 900;
}
.success-box h2 { font-size: 21px; margin: 6px 0; }
.success-box p { font-size: 14px; color: #555; line-height: 1.7; }

/* 底部入口 */
.foot-entry {
  text-align: center;
  margin-top: 22px;
  font-size: 13px;
}
.foot-entry a {
  color: #555;
  text-decoration: none;
  border-bottom: 2px dashed #aaa;
  padding: 4px 2px;
}

.muted { color: #888; font-size: 12px; }
.warn-line { color: var(--red-deep); font-size: 12px; margin-top: 4px; }

/* 后台 */
.hero.admin h1 { background: var(--red); color: #fff; }
.tabs { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.tab {
  flex: 1;
  min-width: 90px;
  text-align: center;
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  padding: 9px 6px;
  font-weight: 900;
  font-size: 13px;
  background: #fff;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
}
.tab.active { background: var(--blue); color: #fff; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.stat-box {
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  background: #fff;
  text-align: center;
  padding: 12px 4px;
  box-shadow: 3px 3px 0 var(--ink);
}
.stat-box .num { font-size: 26px; font-weight: 900; }
.stat-box .lbl { font-size: 12px; color: #666; margin-top: 2px; }
.stat-box.warn .num { color: var(--red); }
.stat-box.ok .num { color: var(--green); }

.list-item {
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  margin: 10px 0;
  box-shadow: 3px 3px 0 var(--ink);
}
.list-item .li-head {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  font-weight: 900; font-size: 15px;
}
.list-item .li-meta { font-size: 12px; color: #777; margin: 6px 0; line-height: 1.6; }
.person-chip {
  display: inline-block;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fafafa;
  padding: 3px 8px;
  margin: 3px 4px 3px 0;
  font-size: 12.5px;
}
.person-chip.add { background: #dff5e9; }
.person-chip.rem { background: #ffe2df; }
.li-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.li-actions .btn { width: auto; flex: 1; padding: 9px 8px; font-size: 14px; }

.wording-box {
  white-space: pre-wrap;
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  padding: 12px;
  font-size: 14px;
  line-height: 1.9;
  margin: 10px 0;
}

table.sheet {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 13px;
}
table.sheet th, table.sheet td {
  border: 2px solid var(--ink);
  padding: 7px 8px;
  text-align: left;
}
table.sheet th { background: var(--yellow); }
table.sheet td.num { font-family: Consolas, monospace; font-size: 12px; }
.table-scroll { overflow-x: auto; }

.toast {
  position: fixed;
  left: 50%;
  top: 18%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 99;
  border: 2px solid #fff;
  max-width: 86%;
  text-align: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.3);
}
.toast.err { background: var(--red-deep); }
.toast.ok { background: var(--green); }

/* 桌面端/大屏（如在电脑上打开后台）放宽版心 */
@media (min-width: 760px) {
  .wrap { max-width: 720px; }
}

/* 小屏手机（360px 及以下，如 iPhone SE / 老款安卓）紧凑适配 */
@media (max-width: 360px) {
  .wrap { padding: 0 10px calc(28px + env(safe-area-inset-bottom)); }
  .hero { padding: 12px 0 4px; }
  .hero img.logo { width: 116px; }
  .hero h1 { font-size: 20px; padding: 5px 12px; }
  .hero .sub { font-size: 12px; }
  .card { padding: 13px; border-radius: 14px; }
  .card-title { font-size: 16px; }
  .btn { font-size: 16px; padding: 12px 12px; }
  .check-item { gap: 8px; padding: 8px; }
  .check-item .leave { width: 118px; }
  .check-item .info .nm { font-size: 14px; }
  table.sheet { font-size: 12px; }
  table.sheet th, table.sheet td { padding: 6px 6px; }
  .tab { min-width: 72px; font-size: 12px; padding: 8px 4px; }
  .stat-grid { gap: 7px; }
  .stat-box { padding: 10px 2px; }
  .stat-box .num { font-size: 22px; }
  .stat-box .lbl { font-size: 11px; }
}

/* 超窄屏（320px，如 iPhone 5/SE1） */
@media (max-width: 330px) {
  .check-item .leave { width: 104px; }
  .check-item .info .idno { font-size: 11px; }
  .hero h1 { font-size: 18px; }
}

/* 横屏矮高度手机，避免首屏挤压 */
@media (max-height: 480px) and (orientation: landscape) {
  .hero { padding: 10px 0 2px; }
  .hero img.logo { width: 90px; }
}
