/* ============================================================
   湖北合信智能包装科技有限公司 · 访客预约登记系统
   设计令牌取自公司 LOGO：深蓝 #030249 / 正红 #d02d26
   ============================================================ */
:root {
  --bg: #f3f4f9;
  --bg-grad: radial-gradient(1200px 520px at 50% -220px, #e9ebf7 0%, rgba(243, 244, 249, 0) 68%);
  --card: #ffffff;

  --ink: #111230;
  --ink-1: #111230;
  --ink-2: #454a66;
  --ink-3: #8b90a8;

  --line: #e3e6f0;
  --line-2: #eef0f7;

  --brand: #030249;
  --brand-2: #1b1e78;
  --brand-soft: #eef0fb;
  --brand-line: #d6d9f1;

  --accent: #d02d26;
  --accent-2: #b52019;
  --accent-soft: #fdeeec;

  --ok: #12854a;
  --ok-bg: #e9f8f0;
  --warn: #b8730a;
  --warn-bg: #fff7e8;
  --danger: #c9302c;
  --danger-bg: #fdeeed;

  --radius: 12px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(17, 18, 48, .05), 0 10px 28px rgba(17, 18, 48, .06);
  --shadow-lg: 0 24px 64px rgba(17, 18, 48, .18);
}

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

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  background-image: var(--bg-grad);
  background-repeat: no-repeat;
  color: var(--ink);
  font: 15px/1.6 -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--brand); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.1px; }
p { margin: 0; }
button, input, select, textarea { font-family: inherit; font-size: 15px; }

.wrap { max-width: 920px; margin: 0 auto; padding: 24px 16px 64px; }
.wrap-wide { max-width: 1280px; margin: 0 auto; padding: 20px 16px 64px; }

/* ---------- LOGO ---------- */
.brand-logo-link { display: flex; align-items: center; }
.brand-logo { height: 23px; width: auto; display: block; }
.brand-sep { width: 1px; height: 18px; background: var(--line); display: inline-block; }

/* ---------- 顶栏 ---------- */
.topbar {
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.topbar::before {
  content: ''; display: block; height: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, #e8544d 38%, var(--brand) 100%);
}
.topbar-in {
  max-width: 1280px; margin: 0 auto; padding: 0 16px;
  height: 57px; display: flex; align-items: center; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 600; color: var(--ink); font-size: 14.5px; }
.brand .t2 { color: var(--ink-2); font-weight: 500; letter-spacing: .2px; }
.nav { display: flex; gap: 4px; margin-left: 6px; flex: 1; overflow-x: auto; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  padding: 7px 13px; border-radius: 8px; color: var(--ink-2); font-size: 14px; white-space: nowrap;
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--brand-soft); color: var(--brand); }
.nav a.on { background: var(--brand); color: #fff; font-weight: 600; box-shadow: 0 2px 8px rgba(3, 2, 73, .22); }
.who { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.who b { color: var(--ink-2); font-weight: 600; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px;
}
.card + .card { margin-top: 16px; }
.card-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.card-h h2 { font-size: 16px; }
.card-h .sub { font-size: 13px; color: var(--ink-3); }

/* ---------- 表单 ---------- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px 20px; }
.grid .full { grid-column: 1 / -1; }
/* 只作用于字段标题，避免命中 .chk 这类「包裹型 label」 */
.field > label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 7px; font-weight: 600; letter-spacing: .2px; }
.field > label .req { color: var(--accent); margin-left: 3px; font-weight: 700; }
.field .hint { font-size: 12px; color: var(--ink-3); margin-top: 6px; line-height: 1.5; }
input[type=text], input[type=tel], input[type=password], input[type=number], input[type=datetime-local], input[type=date], select, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid #d8dceb; border-radius: var(--radius-sm);
  background: #fff; color: var(--ink); outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input[type=text]:hover, input[type=tel]:hover, input[type=password]:hover,
input[type=number]:hover, input[type=datetime-local]:hover, select:hover, textarea:hover {
  border-color: #c3c8dd;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand-2); box-shadow: 0 0 0 3.5px rgba(27, 30, 120, .11); background: #fff;
}
input::placeholder, textarea::placeholder { color: #a9aec3; }
input:disabled, select:disabled { background: #f4f5f9; color: var(--ink-3); }
textarea { resize: vertical; min-height: 88px; line-height: 1.65; }
input.err, textarea.err, select.err { border-color: var(--danger); box-shadow: 0 0 0 3.5px rgba(201, 48, 44, .1); }

/* 复选组（如「允许进入区域」） */
.chk-row { display: flex; flex-wrap: wrap; gap: 10px; }
.chk {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; border: 1px solid #d8dceb; border-radius: var(--radius-sm);
  background: #fff; cursor: pointer; font-size: 14px; color: var(--ink-2);
  transition: border-color .15s, background .15s, color .15s;
  user-select: none;
}
.chk:hover { border-color: var(--brand-line); background: var(--brand-soft); }
.chk input { appearance: none; -webkit-appearance: none; width: 16px; height: 16px; margin: 0;
  border: 1.5px solid #c3c8dd; border-radius: 4px; background: #fff; flex: 0 0 auto; }
.chk input:checked {
  border-color: var(--brand);
  background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.6 8.5l2.9 2.9 5.9-6' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 13px 13px no-repeat;
}
.chk:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 600; }

/* 标签旁的可选说明 */
.label-opt { font-weight: 400; color: var(--ink-3); font-size: 12px; letter-spacing: 0; }

/* 快捷标签（如「客户类型」预设值） */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.chip-btn {
  padding: 5px 13px; border: 1px solid #d8dceb; border-radius: 999px;
  background: #fff; color: var(--ink-2); font-size: 13px; line-height: 1.6;
  cursor: pointer; font-family: inherit; white-space: nowrap;
  transition: border-color .15s, background .15s, color .15s;
}
.chip-btn:hover { border-color: var(--brand-line); background: var(--brand-soft); color: var(--brand); }
.chip-btn.on {
  border-color: var(--brand); background: var(--brand); color: #fff; font-weight: 600;
  box-shadow: 0 2px 8px rgba(3, 2, 73, .18);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: var(--brand); color: #fff; font-weight: 600; font-size: 14px;
  cursor: pointer; transition: background .15s, box-shadow .15s, transform .05s; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(3, 2, 73, .18);
}
.btn:hover { background: var(--brand-2); box-shadow: 0 4px 14px rgba(3, 2, 73, .24); }
.btn:active { transform: translateY(1px); box-shadow: 0 1px 4px rgba(3, 2, 73, .2); }
.btn:disabled { background: #c2c6d6; box-shadow: none; cursor: not-allowed; }
.btn.ghost { background: #fff; border-color: #d8dceb; color: var(--ink-2); box-shadow: none; }
.btn.ghost:hover { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand); box-shadow: none; }
.btn.ok { background: var(--ok); box-shadow: 0 2px 8px rgba(18, 133, 74, .22); }
.btn.ok:hover { background: #0d7340; }
.btn.danger { background: var(--danger); box-shadow: 0 2px 8px rgba(201, 48, 44, .22); }
.btn.danger:hover { background: #b02723; }
.btn.accent { background: var(--accent); box-shadow: 0 2px 8px rgba(208, 45, 38, .22); }
.btn.accent:hover { background: var(--accent-2); }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 7px; }
.btn.block { width: 100%; padding: 14px; font-size: 16px; letter-spacing: .5px; }

/* ---------- 提示条 ---------- */
.msg { padding: 11px 15px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px; display: none; line-height: 1.55; }
.msg.show { display: block; }
.msg.error { background: var(--danger-bg); color: #96231f; border: 1px solid #f5cbc9; }
.msg.ok { background: var(--ok-bg); color: #0f6b3c; border: 1px solid #bfe9d3; }
.msg.warn { background: var(--warn-bg); color: #8b5506; border: 1px solid #f3ddb5; }

/* ---------- 徽章 ---------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; line-height: 1.7; }
.b-pending { background: var(--warn-bg); color: var(--warn); }
.b-ok { background: var(--ok-bg); color: #0f6b3c; }
.b-reject { background: var(--danger-bg); color: #96231f; }
.b-draft { background: #eef0f6; color: var(--ink-2); }
.b-void { background: #eceef3; color: #6c7288; }
.b-gm { background: var(--brand-soft); color: var(--brand); }
.b-type { background: rgba(208, 45, 38, .09); color: #b3261f; }

/* ---------- 表格 ---------- */
.tbl-wrap { overflow-x: auto; margin: 0 -24px; padding: 0 24px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
th {
  font-size: 12.5px; color: var(--ink-3); font-weight: 600; background: #fafbfe;
  white-space: nowrap; border-bottom: 1px solid var(--line);
}
tbody tr { transition: background .12s; }
tbody tr:hover { background: #f8f9fd; }
td.nowrap { white-space: nowrap; }
td .mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; color: var(--ink-2); }

.empty { text-align: center; padding: 46px 16px; color: var(--ink-3); font-size: 14px; }
.empty svg { display: block; margin: 0 auto 12px; opacity: .5; }

/* ---------- 弹层 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(10, 12, 36, .5); z-index: 90;
  display: none; align-items: center; justify-content: center; padding: 16px;
  backdrop-filter: blur(2px);
}
.modal-mask.show { display: flex; animation: maskIn .18s ease-out both; }
@keyframes maskIn { from { opacity: 0 } to { opacity: 1 } }
.modal {
  background: #fff; border-radius: 14px; width: 100%; max-width: 560px;
  max-height: 88vh; overflow-y: auto; padding: 24px; box-shadow: var(--shadow-lg);
  animation: modalIn .22s cubic-bezier(.2, 1.15, .4, 1) both;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.985) } to { opacity: 1; transform: none } }
.modal h3 { font-size: 16px; margin-bottom: 5px; }
.modal .modal-sub { font-size: 13px; color: var(--ink-3); margin-bottom: 16px; line-height: 1.6; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }

/* ---------- 登记表预览弹层（后台） ---------- */
.sheet-modal {
  background: #fff; border-radius: 14px; width: 100%; max-width: 880px;
  max-height: 93vh; display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg); overflow: hidden;
  animation: modalIn .22s cubic-bezier(.2, 1.15, .4, 1) both;
}
.sheet-modal-h {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 15px 20px; border-bottom: 1px solid var(--line);
  flex-wrap: wrap; background: #fff;
}
.sheet-modal-h h3 { font-size: 15.5px; margin: 0 0 3px; }
.sheet-modal-sub { font-size: 12.5px; color: var(--ink-3); }
.sheet-modal-acts { display: flex; gap: 8px; }
.sheet-modal-body {
  padding: 18px 16px; overflow: auto; background: #eceef4; flex: 1;
  -webkit-overflow-scrolling: touch;
}

/* PDF 预览：iframe 内是浏览器自带 PDF 阅读器 */
.sheet-modal-body:has(.sheet-pdf) { padding: 0; background: #f4f5f9; overflow: hidden; }
.sheet-pdf {
  display: block; width: 100%; height: 72vh; border: 0; background: #f4f5f9;
}
.sheet-loading { text-align: center; padding: 70px 16px; color: var(--ink-3); font-size: 14px; }
.sheet-modal-f {
  padding: 9px 20px; font-size: 11.5px; color: var(--ink-3);
  border-top: 1px solid var(--line); background: #fafbfe; text-align: center;
}

/* docx-preview 输出覆盖：去掉默认灰底大内边距，改为居中白纸 */
.sheet-modal-body .docx-wrapper {
  background: transparent !important;
  padding: 0 !important;
  display: block !important;
}
.sheet-modal-body .docx-wrapper > section.docx {
  margin: 0 auto 14px !important;
  box-shadow: 0 2px 12px rgba(17, 18, 48, .13) !important;
  border-radius: 2px;
  background: #fff;
}
.sheet-modal-body .docx-wrapper > section.docx:last-child { margin-bottom: 0 !important; }

/* ---------- 详情键值 ---------- */
.kv { display: grid; grid-template-columns: 92px 1fr; gap: 10px 14px; font-size: 14px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; color: var(--ink); word-break: break-word; }

/* ---------- 首页 Hero ---------- */
.hero {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 34px 24px 30px;
  text-align: center;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hero::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px;
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand-2) 45%, var(--accent) 100%);
}
.hero::after {
  content: ''; position: absolute; right: -70px; top: -70px;
  width: 210px; height: 210px; border-radius: 50%;
  background: radial-gradient(circle, rgba(208, 45, 38, .045) 0%, rgba(208, 45, 38, 0) 70%);
  pointer-events: none;
}
.hero-logo { height: 30px; width: auto; margin: 0 auto 18px; display: block; }
.hero h1 { font-size: 23px; letter-spacing: 1px; color: var(--brand); }
.hero .hero-sub { font-size: 13px; color: var(--ink-3); margin-top: 8px; letter-spacing: .3px; }
.hero .hero-line {
  width: 42px; height: 3px; border-radius: 2px; margin: 15px auto 0;
  background: var(--accent);
}

.notice {
  display: flex; gap: 10px;
  background: linear-gradient(180deg, #f7f8ff 0%, #fbfbff 100%);
  border: 1px solid var(--brand-line); border-radius: var(--radius-sm);
  padding: 13px 15px; font-size: 13px; color: var(--ink-2); line-height: 1.75; margin-bottom: 22px;
}
.notice .ico { flex: 0 0 auto; color: var(--brand); margin-top: 1px; }
.notice b { color: var(--brand); }


/* ---------- 成功页 ---------- */
.success-hero {
  position: relative; text-align: center; padding: 42px 20px 32px;
  background: linear-gradient(180deg, #f1fbf6 0%, #ffffff 78%);
  border-radius: var(--radius); border: 1px solid #d6efe1; overflow: hidden;
}
.check-ring {
  width: 96px; height: 96px; border-radius: 50%;
  background: linear-gradient(150deg, #19a35c, #0f7c45);
  display: grid; place-items: center; margin: 0 auto 22px;
  box-shadow: 0 12px 30px rgba(18, 133, 74, .3);
  animation: pop .42s cubic-bezier(.2, 1.3, .5, 1) both;
}
.check-ring svg { width: 52px; height: 52px; }
.check-ring svg path {
  stroke: #fff; stroke-width: 6.5; fill: none; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 60; stroke-dashoffset: 60;
  animation: draw .46s .3s ease-out forwards;
}
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.success-hero h1 { font-size: 22px; color: #0d6b3b; margin-bottom: 12px; }
.success-hero .lead { font-size: 16px; line-height: 1.9; color: var(--ink); }
.success-hero .lead b { color: #0d6b3b; font-size: 18px; letter-spacing: .3px; }
.success-hero .tip { font-size: 13px; color: var(--ink-3); margin-top: 12px; }

/* 可进入区域标签 */
.area-chip {
  display: inline-flex; align-items: center; gap: 9px;
  margin-top: 16px; padding: 9px 18px; border-radius: 999px;
  font-size: 14.5px; font-weight: 700; line-height: 1.5;
  background: #eafaf0; border: 1px solid #b9e7cd; color: #0d6b3b;
}
.area-chip .area-k {
  font-size: 12px; font-weight: 500; padding-right: 9px;
  border-right: 1px solid currentColor; opacity: .7;
}

/* 黄色主题：可进入区域未同时包含「办公区域 + 生产车间」 */
.success-hero.warn {
  background: linear-gradient(180deg, #fff8e8 0%, #ffffff 78%);
  border-color: #f2e2b8;
}
.success-hero.warn .check-ring {
  background: linear-gradient(150deg, #f2ad33, #d98c06);
  box-shadow: 0 12px 30px rgba(217, 140, 6, .28);
}
.success-hero.warn h1 { color: #8a5a05; }
.success-hero.warn .lead b { color: #8a5a05; }
.success-hero.warn .tip { color: #a3762a; }
.success-hero.warn .area-chip { background: #fff5dc; border-color: #f0d9a4; color: #8a5a05; }

/* 预约信息卡底部的联系提示：跟随成功页主题 */
.contact-tip {
  margin-top: 18px; border-radius: var(--radius-sm);
  padding: 13px 15px; font-size: 13px; line-height: 1.75;
}
.contact-tip.ok { background: var(--ok-bg); border: 1px solid #bce8ce; color: #0d6b3b; }
.contact-tip.warn { background: #fff6e2; border: 1px solid #f2e2b8; color: #8a5a05; }
.contact-tip b { font-weight: 700; }

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin-top: 20px; }
.info-item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 15px; }
.info-item .k { font-size: 12px; color: var(--ink-3); letter-spacing: .2px; }
.info-item .v { font-size: 14.5px; font-weight: 600; margin-top: 3px; word-break: break-all; color: var(--ink); }

.steps { display: flex; align-items: flex-start; gap: 0; margin: 18px 0 6px; }
.step { flex: 1; text-align: center; position: relative; }
.step .bar { height: 3px; background: var(--line); margin: 11px 0 10px; }
.step.done .bar { background: var(--ok); }
.step.cur .bar { background: linear-gradient(90deg, var(--ok) 0 50%, var(--line) 50% 100%); }
.step .dot2 {
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); background: #fff;
  margin: 0 auto; display: grid; place-items: center; font-size: 12px; color: var(--ink-3);
  position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 2;
}
.step.done .dot2 { background: var(--ok); border-color: var(--ok); color: #fff; }
.step.cur .dot2 { border-color: var(--ok); color: var(--ok); background: #fff; font-weight: 700; }
.step .lb { font-size: 12.5px; color: var(--ink-3); padding-top: 8px; }
.step.done .lb, .step.cur .lb { color: var(--ink-2); }
.steps-wrap { padding-top: 6px; }

/* ---------- 签名板 ---------- */
#sigpad {
  width: 100%; height: 220px; background: #fff; border: 1.5px dashed #c9cede;
  border-radius: 10px; touch-action: none; cursor: crosshair; display: block;
}
.sig-guide { position: relative; }
.sig-guide .ph {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: #c3c8da; font-size: 15px; pointer-events: none;
}
.sig-preview {
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fbfcff;
  padding: 10px; display: flex; align-items: center; justify-content: center; min-height: 64px;
}
.sig-preview img { max-height: 56px; max-width: 100%; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(900px 420px at 50% -160px, #e6e8f6 0%, rgba(243, 244, 249, 0) 70%),
    linear-gradient(170deg, #f3f4f9 0%, #f7f8fc 100%);
}
.login-card {
  width: 100%; max-width: 404px; background: #fff; border-radius: 16px;
  padding: 36px 32px; box-shadow: 0 22px 60px rgba(17, 18, 48, .13);
  position: relative; overflow: hidden; border: 1px solid var(--line);
}
.login-card::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}
.login-card .logo { height: 30px; width: auto; display: block; margin-bottom: 20px; }
.login-card h1 { font-size: 19px; margin-bottom: 5px; color: var(--brand); }
.login-card .sub { font-size: 13px; color: var(--ink-3); margin-bottom: 26px; }

/* ---------- 移动端数据卡片（替代宽表格） ---------- */
.mob-only { display: none !important; }
.mcard-list { display: flex; flex-direction: column; gap: 10px; }
.mcard {
  background: #fff; border: 1px solid var(--line); border-radius: 13px;
  padding: 14px 15px; box-shadow: 0 1px 3px rgba(16, 20, 60, .05);
}
.mcard-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.mcard-name { font-size: 16.5px; font-weight: 700; color: var(--ink); line-height: 1.35; }
.mcard-comp { font-size: 13px; color: var(--ink-2); margin-top: 3px; line-height: 1.5; word-break: break-word; }
.mcard-rows { margin-top: 11px; padding-top: 11px; border-top: 1px dashed var(--line-2); display: grid; gap: 7px; }
.mcard-row { display: flex; gap: 10px; font-size: 13.5px; line-height: 1.55; }
.mcard-row .k { flex: 0 0 60px; color: var(--ink-3); }
.mcard-row .v { flex: 1; min-width: 0; color: var(--ink-2); word-break: break-word; }
.mcard-row .v.em { color: var(--ink); font-weight: 600; }
.mcard-acts { display: flex; gap: 8px; margin-top: 13px; }
.mcard-acts .btn { flex: 1; padding: 10px 0; font-size: 14.5px; border-radius: 10px; }
.mcard-acts .btn.ghost { flex: 0 0 88px; }
.mcard-foot { margin-top: 11px; padding-top: 10px; border-top: 1px dashed var(--line-2); font-size: 12px; color: var(--ink-3); }

/* ---------- 移动端底部标签栏（仿小程序） ---------- */
.tabbar { display: none; }

/* ---------- 设置页 ---------- */
.set-user { display: flex; align-items: center; gap: 14px; }
.set-avatar {
  width: 50px; height: 50px; border-radius: 14px; flex: 0 0 auto;
  background: var(--brand); color: #fff; font-size: 20px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.set-name { font-size: 17px; font-weight: 700; color: var(--ink); }
.set-sub { font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.set-list { padding: 0; overflow: hidden; }
.set-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; padding: 15px 17px; border: 0; border-bottom: 1px solid var(--line-2);
  background: #fff; font-size: 15px; color: var(--ink); font-family: inherit;
  cursor: pointer; text-align: left; text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.set-item:last-child { border-bottom: 0; }
.set-item:active { background: #f6f7fb; }
.set-item .v { font-size: 13.5px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.set-item .v::after { content: ''; width: 7px; height: 7px; border-right: 1.5px solid #c3c8dd; border-bottom: 1.5px solid #c3c8dd; transform: rotate(-45deg); }
.set-item .v.dot:not(:empty)::after { margin-left: 2px; }
.set-logout { margin-top: 16px; }

/* ---------- 移动端 ---------- */
@media (max-width: 720px) {
  .wrap, .wrap-wide { padding: 14px 12px 48px; }
  .card { padding: 17px; border-radius: 11px; }
  .grid { grid-template-columns: 1fr; gap: 15px; }
  .tbl-wrap { margin: 0 -17px; padding: 0 17px; }
  .topbar-in { height: 52px; gap: 10px; padding: 0 12px; }
  .brand .t2, .brand-sep { display: none; }
  .brand-logo { height: 21px; }
  .nav { gap: 2px; }
  .nav a { padding: 6px 9px; font-size: 13px; }
  .who .hide-sm { display: none; }
  .hero { padding: 28px 16px 24px; border-radius: 14px; }
  .hero-logo { height: 25px; }
  .hero h1 { font-size: 20px; }
  .success-hero { padding: 32px 14px 24px; }
  .success-hero h1 { font-size: 19px; }
  .success-hero .lead { font-size: 14.5px; line-height: 1.9; }
  .success-hero .lead b { font-size: 16px; }
  .area-chip { font-size: 13.5px; padding: 8px 15px; gap: 7px; }
  .info-grid { grid-template-columns: 1fr; }
  #sigpad { height: 180px; }
  .kv { grid-template-columns: 80px 1fr; font-size: 13.5px; }
  .sheet-modal { max-width: none; border-radius: 12px; max-height: 94vh; }
  .sheet-modal-h { padding: 12px 14px; }
  .sheet-modal-body { padding: 12px 8px; }
  .sheet-modal-body:has(.sheet-pdf) { padding: 0; }
  .sheet-pdf { height: 78vh; }
  .login-card { padding: 30px 22px; }

  /* 宽表格在手机上无法阅读，统一改用卡片 */
  .desk-only { display: none !important; }
  .mob-only { display: flex !important; }
  .mcard-list { gap: 10px; }

  /* 底部标签栏页面：隐藏顶栏导航与退出，让位给底部 tabbar */
  body.has-tabbar { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
  body.has-tabbar .topbar .nav,
  body.has-tabbar .who .btn { display: none; }
  body.has-tabbar .wrap-wide { padding-bottom: 18px; }

  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    display: flex; align-items: stretch;
    background: rgba(255, 255, 255, .97);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar button {
    position: relative; flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 3px;
    height: 56px; padding: 0; border: 0; background: none;
    font-family: inherit; font-size: 11px; color: var(--ink-3);
    cursor: pointer; -webkit-tap-highlight-color: transparent;
    transition: color .15s;
  }
  .tabbar button svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar button.on { color: var(--brand); font-weight: 600; }
  .tabbar .tab-dot {
    position: absolute; top: 7px; left: 50%; margin-left: 6px;
    min-width: 16px; height: 16px; padding: 0 4px; border-radius: 9px;
    background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 700;
    line-height: 16px; text-align: center; display: none;
  }
  .tabbar .tab-dot.show { display: block; }

  /* 只有 tab 页面才做的分栏显隐 */
  .pane { display: none; }
  .pane.on { display: block; }
}

@media (min-width: 721px) {
  .pane-settings { display: none; }
}


/* ---------- 打印 ---------- */
@media print {
  .topbar, .no-print { display: none !important; }
  body { background: #fff; background-image: none; }
  .card { box-shadow: none; border: none; }

  /* 只输出登记表本体。
     页面边距与模板 pgMar 保持一致（上下 2.54cm / 左右 3.17cm），
     再清掉 docx-preview 给 section 加的内边距——否则会双倍留白。
     不锁定每页高度，内容按 A4 自然分页，与 Word 里的结果一致。 */
  @page { size: A4 portrait; margin: 25.4mm 31.7mm; }
  body.printing-sheet > *:not(.modal-mask) { display: none !important; }
  body.printing-sheet .modal-mask {
    position: static; background: #fff; display: block !important; padding: 0; backdrop-filter: none;
  }
  body.printing-sheet .sheet-modal {
    box-shadow: none; max-height: none; max-width: none; border-radius: 0; display: block; animation: none;
  }
  body.printing-sheet .sheet-modal-h { display: none !important; }
  body.printing-sheet .sheet-modal-f { display: none !important; }
  body.printing-sheet .sheet-modal-body { padding: 0; background: #fff; overflow: visible; zoom: 1 !important; }
  body.printing-sheet .sheet-modal-body .docx-wrapper {
    display: block !important; padding: 0 !important; background: #fff !important; zoom: 1 !important;
  }
  body.printing-sheet .docx-wrapper > section.docx {
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0;
    box-shadow: none !important;
    overflow: visible !important;
    break-after: auto !important;
    page-break-after: auto !important;
  }
  body.printing-sheet .docx-wrapper > section.docx article { margin-bottom: 0 !important; }
  /* 表格行不跨页断开（Word 默认行为） */
  body.printing-sheet .docx-wrapper tr { break-inside: avoid; page-break-inside: avoid; }
}
