﻿/* ============================================================
   外出申请 · 样式
   设计基准：408px 宽（原图 816px 的 2 倍图），全部尺寸用 rem，
   根字号随屏宽等比缩放，所以任何手机上都保持同样的比例。
   ============================================================ */

:root {
  --ink: #1a1a1a;
  --muted: #808080;
  --muted-2: #9aa0a6;
  --line: #dfe3e8;
  --line-2: #d9dde3;
  --blue: #4286f5;
  --blue-ink: #3f7fe8;
  --soft: #f7f8fa;
  --page-bg: #ffffff;
}

* { box-sizing: border-box; }

html {
  font-size: clamp(11px, calc(100vw / 25.5), 16px);
  touch-action: pan-y;                 /* 只允许上下滑，禁止缩放 */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html, body { margin: 0; padding: 0; }

body {
  background: var(--page-bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.app {
  position: relative;
  width: 100%;
  max-width: 25.5rem;
  margin: 0 auto;
  background: #fff;
  min-height: 100vh;
  padding-bottom: 5.2rem;              /* 给底部按钮条留位置 */
  overflow: hidden;
}

/* ---------------- 头部 ---------------- */
.hd { position: relative; padding: 1rem 1.25rem 0; }

.hd-title {
  margin: 0;
  font-size: 1.19rem;
  line-height: 1.5;
  font-weight: 700;
  letter-spacing: -.035em;
  color: #111;
}

.hd-sub { display: flex; align-items: center; gap: .4rem; margin-top: .62rem; }

.hd-reporter { font-size: .86rem; color: var(--muted-2); }

.ava {
  display: inline-block;
  flex: none;
  border-radius: 50%;
  background: #eef3fc center/cover no-repeat;
  overflow: hidden;
}
.ava.deng  { background-image: url(../img/av-deng.png); }
.ava.djq   { background-image: url(../img/av-djq.png); }
.ava.huang { background-image: url(../img/av-huang.png); }
.ava-s    { width: 1.3rem; height: 1.3rem; }
.ava-chip { width: 1.15rem; height: 1.15rem; }
.ava-m    { width: 1.32rem; height: 1.32rem; }

/* 已办结 印章（用原图里抠出来的图片） */
.seal {
  position: absolute;
  top: 2.5rem;
  right: 1.22rem;
  width: 4.25rem;
  pointer-events: none;
}
.seal img { display: block; width: 100%; height: auto; }

.hd-chev {
  width: .5rem;
  height: .5rem;
  margin: .95rem auto 0;
  border-right: 1.5px solid #babfc7;
  border-bottom: 1.5px solid #babfc7;
  transform: rotate(45deg);
}

/* ---------------- 标签栏 ---------------- */
.tabs {
  position: relative;
  display: flex;
  align-items: stretch;
  height: 4.25rem;
  background: #fff;
  box-shadow: 0 .35rem .55rem -.4rem rgba(0, 0, 0, .10);
}

.tab {
  position: relative;
  flex: 1;
  border: 0;
  background: none;
  padding: 0;
  font-size: 1.05rem;
  font-family: inherit;
  color: #333;
  cursor: pointer;
}
.tab.on { color: #111; font-weight: 700; }
.tab.on::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: .55rem;
  width: 1.5rem;
  height: .25rem;
  margin-left: -.75rem;
  border-radius: .1rem;
  background: var(--blue);
}

.tabs-ico {
  flex: none;
  width: 2.4rem;
  margin-right: .55rem;
  align-self: center;
  display: flex;
  flex-direction: column;
  gap: .24rem;
}
.tabs-ico i { display: block; height: .19rem; border-radius: .1rem; background: var(--blue); }
.tabs-ico i:nth-child(1) { width: 1.3rem; }
.tabs-ico i:nth-child(2) { width: 1.3rem; background: #6ea6f8; }
.tabs-ico i:nth-child(3) { width: .8rem;  background: #6ea6f8; }

/* ---------------- 表单卡片 ---------------- */
.card {
  margin: .75rem .75rem 0;
  border: 1px solid var(--line-2);
  background: #fff;
}

.card-hd {
  min-height: 3.09rem;
  padding: .78rem .5rem;
  font-size: 1.06rem;
  line-height: 1.4;
  color: #111;
  border-bottom: 1px solid var(--line);
}

.row { display: flex; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }

/* 行高按原图 1:1 还原（408 设计宽） */
.row       { min-height: 3.13rem; }
.r-name    { min-height: 3.19rem; }
.r-time    { min-height: 7.25rem; }
.r-days    { min-height: 6.06rem; }
.r-place   { min-height: 11.69rem; }
.r-yn      { min-height: 3.97rem; }
.r-sign    { min-height: 3.97rem; }
.r-sign2   { min-height: 5.41rem; }
.r-empty   { min-height: 3.16rem; }

/* 日期在上、时间在下 */
.td.stack {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}

/* 共 / 3 / 天 —— 三个字各占一行 */
.th.days {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
}
.th.days .e { line-height: 1.78; }

/* 省 / 市 / 区 逐行 */
.td.place .e { line-height: 1.68; }

/* 是/否 这一行在原图里偏窄 */
.r-yn .th, .r-yn .td { padding-top: .4rem; padding-bottom: .4rem; }
.r-sign2 .td, .r-sign2 .th { padding-top: .36rem; padding-bottom: .36rem; }
.r-days .th { padding-top: .3rem; padding-bottom: .3rem; }
.r-place .th, .r-place .td { padding-top: .56rem; padding-bottom: .56rem; }

.th {
  display: flex;
  flex: none;
  align-items: center;
  width: 33%;
  padding: .78rem .3rem .78rem .5rem;
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--muted);
}

.td {
  flex: 1;
  min-width: 0;
  padding: .78rem .9rem .78rem .75rem;
  border-left: 1px solid var(--line);
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--ink);
}

/* 姓名小药丸 */
.chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin: -.15rem 0;
  padding: .18rem .5rem .18rem .3rem;
  background: #f2f3f5;
  border-radius: .4rem;
  line-height: 1.3;
}

/* 照片行 */
.photo-row { display: block; }
.photo {
  width: 12.5rem;
  height: 14.06rem;
  margin: .25rem .55rem .25rem .62rem;
  background: #e9f0fb;
  overflow: hidden;
}
.photo img { width: 100%; height: 100%; object-fit: contain; object-position: bottom center; }

/* 是 / 否 选项 */
.opt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 1.6rem;
  padding: 0 .6rem;
  margin-right: .75rem;
  border: 1px solid #f1f2f4;
  border-radius: .28rem;
  background: #f5f6f8;
  color: #6b7078;
  font-size: .95rem;
  line-height: 1;
}
.opt.on { background: #eaf1fe; border-color: #a9c7f7; color: #2f6fe4; }

/* 意见签名 */
.opinion { padding-top: .5rem; padding-bottom: .5rem; }
.opinion .sign {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .1rem;
  line-height: 1.34;
}
.opinion .op-text { margin-bottom: .2rem; }

/* ---------------- 流程记录 ---------------- */
.flow { margin-top: 0; background: #fff; }

.flow-hd {
  padding: .55rem 1.1rem;
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a1a;
  background: #fafbfc;
  border-top: 1px solid #eceff3;
  border-bottom: 1px solid #f1f3f6;
}

.entry {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .55rem 1.1rem .55rem 1.5rem;
  border-bottom: 1px solid #f2f4f7;
}
.entry-ico {
  flex: none;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: .3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ico-blue   { background: var(--blue); }
.ico-orange { background: #f6a623; }
.entry-text { flex: 1; font-size: .95rem; color: var(--ink); }

.chev {
  width: .5rem;
  height: .5rem;
  border-right: 1.6px solid #d4b483;
  border-top: 1.6px solid #c9ccd1;
  transform: rotate(45deg);
}

/* 时间轴 */
.tl { position: relative; padding: .55rem 1.05rem .8rem 2.35rem; }
.tl::before {
  content: "";
  position: absolute;
  left: 1.66rem;
  top: 1.9rem;
  bottom: 2.4rem;
  width: 1px;
  background: #e2e6ea;
}

.tl-row { position: relative; margin-bottom: .95rem; }
.tl-row:last-child { margin-bottom: 0; }

.dot {
  position: absolute;
  left: -1.0rem;
  top: .3rem;
  width: .56rem;
  height: .56rem;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 .2rem #fff, 0 0 0 .3rem #d9e6fb;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin-left: -1.15rem;
  padding: .18rem .5rem .18rem .25rem;
  border-radius: 999px;
  background: #a8adb5;
  color: #fff;
  font-size: .68rem;
  line-height: 1;
}
.badge-ico {
  position: relative;
  width: .82rem;
  height: .82rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
}
.badge-ico.play::after {
  content: "";
  position: absolute;
  left: 35%; top: 27%;
  border-left: .26rem solid #8d9299;
  border-top: .18rem solid transparent;
  border-bottom: .18rem solid transparent;
}
.badge-ico.stop::after {
  content: "";
  position: absolute;
  left: 31%; top: 31%;
  width: .34rem;
  height: .34rem;
  background: #8d9299;
}

.node { margin-bottom: .5rem; }
.node-t { font-size: .9rem; color: var(--ink); }

.rec {
  background: var(--soft);
  border: 1px solid #ebedf0;
  border-radius: .35rem;
  overflow: hidden;
}
.rec-hd {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .35rem .5rem;
  border-bottom: 1px solid #ebedf0;
}
.who { display: flex; flex-direction: column; gap: .18rem; min-width: 0; }
.who-n { font-size: .82rem; color: var(--blue-ink); }
.who-t {
  display: flex;
  align-items: center;
  gap: .2rem;
  font-size: .68rem;
  color: #8a8f96;
}
.clk {
  position: relative;
  width: .66rem;
  height: .66rem;
  border: 1.2px solid #b3b8bf;
  border-radius: 50%;
}
.clk::after {
  content: "";
  position: absolute;
  left: 50%; top: 20%;
  width: 1px; height: 34%;
  background: #b3b8bf;
}
.who-x { margin-left: auto; font-size: .68rem; color: #8a8f96; white-space: nowrap; }

.rec-bd {
  padding: .42rem .5rem;
  font-size: .72rem;
  color: #4a4f57;
  text-align: right;
}
.rec-cm { padding: .5rem .55rem .1rem; font-size: .82rem; color: var(--ink); }

.sys {
  border-radius: 50%;
  background: #f6a623;
  width: 1.32rem;
  height: 1.32rem;
}

/* 耗时统计 */
.stat { display: flex; align-items: flex-start; gap: .55rem; padding: 1rem 1.1rem 1.5rem; }
.stat-ico { flex: none; display: inline-flex; }
.stat-main { font-size: .92rem; font-weight: 600; line-height: 1.4; color: var(--ink); }
.stat-sub  { margin-top: .25rem; font-size: .7rem; color: var(--muted-2); }

/* ---------------- 底部按钮 ---------------- */
.foot {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  gap: .45rem;
  width: 100%;
  max-width: 25.5rem;
  margin: 0 auto;
  padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .97);
  border-top: 1px solid #e6e9ee;
  backdrop-filter: blur(8px);
}
.fbtn {
  flex: 1;
  height: 2.78rem;
  border: 1px solid #dfe3e8;
  border-radius: .3rem;
  background: #fff;
  color: var(--ink);
  font-size: 1.05rem;
  font-family: inherit;
  cursor: pointer;
}
.fbtn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.fbtn.fav { color: var(--blue); border-color: #b9d2fb; background: #f3f7ff; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(6.4rem + env(safe-area-inset-bottom));
  z-index: 60;
  padding: .55rem 1rem;
  border-radius: 999px;
  background: rgba(28, 32, 40, .9);
  color: #fff;
  font-size: .85rem;
  opacity: 0;
  transform: translate(-50%, .6rem);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
  white-space: nowrap;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ============================================================
   可编辑文字：只改文字，样式由上面的类固定
   ============================================================ */
.e { white-space: pre-wrap; overflow-wrap: anywhere; }

body:not(.edit) .e { -webkit-user-select: none; user-select: none; }

body.edit .e[contenteditable="true"] { cursor: text; }

/* 编辑时页面里的按钮不响应点击，但里面的文字仍可点开编辑 */
body.edit .app button { pointer-events: none; }
body.edit .app button > .e { pointer-events: auto; }

body.edit .e[contenteditable="true"]:focus {
  outline: none;
  background: rgba(47, 124, 246, .09);
  box-shadow: 0 0 0 2px rgba(47, 124, 246, .35);
  border-radius: 3px;
}

body.edit .e:empty::before { content: "空"; opacity: .3; }

/* 样式锁：编辑时混进来的任何标签都继承外层样式，改不动颜色/字号/字体。
   只锁「文字块内部」的标签，文字块自己的字号/颜色由上面各处的类决定 */
.e * {
  font-family: inherit !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  font-style: inherit !important;
  color: inherit !important;
  background: transparent !important;
  text-decoration: none !important;
  text-shadow: none !important;
  letter-spacing: inherit !important;
  line-height: inherit !important;
}

/* ---------------- 编辑工具条 ---------------- */
.bar {
  position: fixed;
  left: 50%;
  bottom: calc(4.1rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .6rem;
  background: rgba(28, 32, 40, .9);
  color: #fff;
  border-radius: 999px;
  font-size: .85rem;
  box-shadow: 0 .4rem 1.4rem rgba(0, 0, 0, .25);
  white-space: nowrap;
}
.bar[hidden] { display: none; }
.bar-btn {
  border: 0;
  border-radius: 999px;
  padding: .45rem .85rem;
  font-size: .85rem;
  font-family: inherit;
  background: var(--blue);
  color: #fff;
}
.bar-btn.ghost { background: rgba(255, 255, 255, .18); }
.bar-status { opacity: .9; font-size: .78rem; padding-right: .3rem; }

/* ---------------- 登录框 ---------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(20, 24, 30, .45);
}
.modal[hidden] { display: none; }
.modal-card {
  width: 100%;
  max-width: 20rem;
  padding: 1.35rem 1.1rem 1rem;
  background: #fff;
  border-radius: .9rem;
  box-shadow: 0 1.1rem 3rem rgba(0, 0, 0, .25);
  text-align: center;
}
.modal-title { margin: 0 0 .35rem; font-size: 1.05rem; font-weight: 600; }
.modal-tip { margin: 0 0 .9rem; font-size: .8rem; color: #6b7280; line-height: 1.5; }
.modal-input {
  width: 100%;
  height: 2.8rem;
  padding: 0 .75rem;
  border: 1px solid #d6dae2;
  border-radius: .6rem;
  font-size: 1.06rem;            /* ≥16px，iOS 聚焦时不放大页面 */
  font-family: inherit;
  text-align: center;
  letter-spacing: .25em;
  outline: none;
}
.modal-input:focus { border-color: var(--blue); }
.modal-err { margin: .5rem 0 0; font-size: .8rem; color: #d93025; }
.modal-err[hidden] { display: none; }
.modal-btn {
  width: 100%;
  height: 2.8rem;
  margin-top: .75rem;
  border: 0;
  border-radius: .6rem;
  background: var(--blue);
  color: #fff;
  font-size: 1rem;
  font-family: inherit;
}
.modal-btn.ghost { background: #f1f3f6; color: #333; margin-top: .5rem; }

/* ============================================================
   水印层：和原图一样斜着铺满整页（纯装饰，不参与编辑）
   ============================================================ */
.wm {
  position: absolute;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  background: url(../img/wm.svg) repeat;
  background-size: 205px 156px;
  background-repeat: repeat;
}