* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f5f6f8;
  color: #222;
  font-size: 16px;
  padding-bottom: 40px;
}
.topbar {
  background: #2f6fed;
  color: #fff;
  padding: 14px 16px;
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.topbar-main { min-width: 0; }
.topbar h1 { font-size: 18px; font-weight: 700; }
.topbar p { font-size: 12px; opacity: .85; margin-top: 2px; }
.topbar .back { color: #fff; text-decoration: none; font-size: 13px; opacity: .9; }
.container { max-width: 680px; margin: 0 auto; padding: 12px; }

.card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  margin-bottom: 12px;
  overflow: hidden;
}
.card-title {
  background: #eef2fb;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 650;
  color: #2f6fed;
  border-bottom: 1px solid #e3e8f5;
}
.row {
  display: flex;
  align-items: flex-start;
  border-bottom: 1px solid #f0f0f0;
  min-height: 48px;
}
.row:last-child { border-bottom: none; }
.row label {
  flex: 0 0 34%;
  padding: 14px 10px 14px 14px;
  font-size: 14px;
  color: #555;
  font-weight: 550;
  line-height: 26px;
}
.row .input-wrap { flex: 1; padding: 8px 14px 8px 0; }
.row input, .row select, .row textarea {
  width: 100%;
  border: none;
  outline: none;
  font-size: 16px;
  color: #222;
  background: transparent;
  padding: 6px 0;
}
.row input::placeholder, .row textarea::placeholder { color: #bbb; }
.row select {
  appearance: none;
  -webkit-appearance: none;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%238b93a5' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 2px center;
  padding-right: 22px;
}
.row textarea { resize: vertical; min-height: 64px; }

.op-card { padding: 0; }
.op-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f7f8fb;
  padding: 8px 14px;
  border-bottom: 1px solid #eee;
}
.op-head .idx { font-size: 13px; color: #888; font-weight: 620; }
.op-head .del {
  color: #e5484d;
  font-size: 13px;
  background: none;
  border: none;
  padding: 4px 8px;
}
.btn-add {
  width: 100%;
  padding: 13px;
  background: #fff;
  color: #2f6fed;
  border: 1px dashed #2f6fed;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 660;
  margin-bottom: 12px;
}
.btn-submit {
  width: 100%;
  padding: 14px;
  background: #2f6fed;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 670;
}
.btn-submit:active { background: #245bd0; }
.btn-submit:disabled { background: #a9c3f5; }
.foot-note { text-align: center; font-size: 12px; color: #aaa; margin-top: 12px; }

/* 模板列表 */
.tpl-list { padding: 12px; }
.tpl-item {
  display: block;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  padding: 16px;
  margin-bottom: 12px;
  text-decoration: none;
  color: inherit;
}
.tpl-item h3 { font-size: 16px; color: #2f6fed; font-weight: 690; }
.tpl-item p { font-size: 13px; color: #777; margin-top: 4px; }
.tpl-item .go { float: right; color: #2f6fed; font-size: 14px; }

/* 提示 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%);
  background: rgba(0,0,0,.82);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 99;
  max-width: 86vw;
  text-align: center;
}
.hidden { display: none; }
.loading { text-align: center; color: #999; padding: 40px 0; font-size: 14px; }

/* 提交查看 */
.sub-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sub-table th, .sub-table td { border: 1px solid #eee; padding: 8px 10px; text-align: left; vertical-align: top; }
.sub-table th { background: #f7f8fb; color: #666; font-weight: 560; white-space: nowrap; }
.sub-table td pre { white-space: pre-wrap; word-break: break-all; margin: 0; font-family: inherit; }

/* ---------- 表单页补充 ---------- */
.req { color: #e5484d; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 4px 2px 8px;
  font-size: 14px;
  font-weight: 650;
  color: #2f6fed;
}
.section-head em { font-style: normal; font-size: 12px; color: #999; font-weight: 400; }
.row.invalid { background: #fff6f6; box-shadow: inset 3px 0 0 #e5484d; }

/* ---------- 记录页 ---------- */
.filter-card .filter-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px 12px;
}
.count { font-size: 13px; color: #888; }
.btn-ghost {
  display: inline-block;
  padding: 7px 12px;
  border: 1px solid #cfdcf9;
  border-radius: 8px;
  background: #fff;
  color: #2f6fed;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.btn-ghost:active { background: #eef3ff; }

.record { overflow: hidden; }
.record-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  background: #eef2fb;
  border-bottom: 1px solid #e3e8f5;
  padding: 10px 14px;
}
.record-head strong { font-size: 14px; color: #2f6fed; }
.record-meta { font-size: 12px; color: #8a93a5; }
.record-body { margin: 0; }
.rec-row {
  display: flex;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid #f2f3f6;
  font-size: 14px;
}
.rec-row:last-child { border-bottom: none; }
.rec-row dt { flex: 0 0 96px; color: #7a8194; font-size: 13px; line-height: 20px; }
.rec-row dd { flex: 1; min-width: 0; margin: 0; word-break: break-word; line-height: 20px; }
.rec-row dd pre { white-space: pre-wrap; word-break: break-all; margin: 0; font-family: inherit; font-size: 12px; }
.rec-row dd.muted { color: #bbb; }
.rec-group {
  background: #fafbfe;
  border: 1px solid #eef1f8;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
}
.rec-group:last-child { margin-bottom: 0; }
.rec-group-title { font-size: 12px; color: #2f6fed; font-weight: 650; margin-bottom: 4px; }
.rec-sub { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: #7a8194; padding: 1px 0; }
.rec-sub b { color: #222; font-weight: 560; text-align: right; word-break: break-word; }

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 4px 0 12px;
}
.pager.hidden { display: none; }
.btn-page {
  padding: 9px 14px;
  background: #fff;
  border: 1px solid #dbe3f4;
  border-radius: 8px;
  color: #2f6fed;
  font-size: 14px;
  font-weight: 600;
}
.btn-page:disabled { color: #c3c8d2; border-color: #eceef3; }
.page-info { font-size: 13px; color: #888; }

.empty {
  text-align: center;
  color: #999;
  padding: 46px 12px;
  font-size: 14px;
  line-height: 1.9;
}
.empty a { color: #2f6fed; text-decoration: none; }
