/* 光学研发任务管理 · 企业微信自建应用 H5 样式 */
:root {
  --brand: #1e5fd0;
  --brand-2: #3d80ef;
  --bg: rgba(140, 146, 156, 0.4);   /* 淡灰色 · 40% 透明（叠在白底上呈浅灰） */
  --card: #ffffff;
  --line: #e8ecf2;
  --text: #1f2329;
  --muted: #7a8699;
  --muted-2: #a8b1c1;
  --danger: #f04438;
  --warn: #ff8f1f;
  --ok: #00b42a;
  --purple: #7d3ce8;
  --gray: #86909c;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 14px rgba(16, 24, 40, .05);
}

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

/* ── 黄红渐变标语条（进入页顶部）── */
:root { --slogan-grad: linear-gradient(90deg, #ffd34d 0%, #ff8a3d 55%, #e8484d 100%); }
.slogan {
  background: var(--slogan-grad);
  color: #fff;
  font-size: 29px; font-weight: 700; letter-spacing: 5px;
  text-align: center; padding: 12px 10px;
  text-shadow: 0 1px 2px rgba(150, 60, 0, 0.35);
}

/* ── 进入页（splash）：打开应用先见品牌页，点「进 入」淡出 ── */
#splash {
  position: fixed; inset: 0;
  top: 0; right: 0; bottom: 0; left: 0; /* 老内核（iOS <14.1 / 旧企微 webview）不认 inset 简写，这里显式补齐 */
  z-index: 100;
  background: linear-gradient(180deg, #f6fafe 0%, #e3eefb 60%, #d8e9f9 100%);
  display: flex; flex-direction: column; align-items: center;
  transition: opacity .35s ease;
}
#splash.hide { opacity: 0; pointer-events: none; }
#splash .splash-slogan { width: 100%; flex: none; }
.splash-inner {
  text-align: center; padding: 6vh 20px 20px; max-width: 400px; width: 100%;
  display: flex; flex-direction: column; align-items: center; /* 所有子元素共用一条垂直中心线 */
}
.splash-logo { width: 180px; max-width: 56%; margin-bottom: 4px; flex: none; }
.splash-code { font-size: 12px; font-weight: 700; letter-spacing: 4px; color: var(--muted); margin-bottom: 18px; flex: none; }
/* 启动图标：透明底插图放在白色圆角卡片里，避免阴影悬空 */
.splash-icon {
  width: 88px; height: 88px; padding: 9px; object-fit: contain;
  background: #fff; border-radius: 20px;
  box-shadow: 0 6px 18px rgba(30, 95, 208, .25);
  display: block; margin: 0 auto 16px; flex: none;
}
.splash-title { font-size: 22px; letter-spacing: 4px; margin: 0 0 6px; color: var(--text); font-weight: 700; }
.splash-sub { font-size: 13px; letter-spacing: 6px; color: var(--muted); margin-bottom: 28px; }
.splash-enter { width: 180px; padding: 12px 0; font-size: 15px; letter-spacing: 6px; border-radius: 999px; }
html, body {
  margin: 0; padding: 0; background: var(--bg); color: var(--text);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.app { max-width: 680px; margin: 0 auto; min-height: 100vh; padding-bottom: 86px; background: var(--bg); }
.hidden { display: none !important; }

/* ── 头部 ─────────────────────────── */
.hd {
  position: sticky; top: 0; z-index: 30;
  background: linear-gradient(135deg, var(--brand), #3d78e6);
  color: #fff; padding: 13px 16px 15px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 2px 10px rgba(30, 95, 208, .22);
}
.hd .hd-t { flex: 1; min-width: 0; }
.hd .hd-title { font-size: 17px; font-weight: 600; letter-spacing: .3px; }
.hd .hd-sub { font-size: 11.5px; opacity: .84; margin-top: 2px; }
.hd .hd-back {
  width: 28px; height: 28px; border: 0; border-radius: 8px; background: rgba(255,255,255,.18);
  color: #fff; font-size: 15px; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.hd .hd-user { display: flex; align-items: center; gap: 6px; background: rgba(255,255,255,.18); padding: 5px 10px; border-radius: 20px; font-size: 12px; white-space: nowrap; }

/* ── 通用 ─────────────────────────── */
.wrap { padding: 12px 12px 0; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 12px; overflow: hidden; }
.card-h { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.card-h .t { font-weight: 600; font-size: 14.5px; flex: 1; min-width: 0; }
.card-h .t small { font-weight: 400; color: var(--muted); font-size: 11.5px; margin-left: 6px; }
.card-b { padding: 12px 14px; }
.card-b.tight { padding: 4px 14px; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.65; }
.empty { text-align: center; color: var(--muted-2); padding: 30px 16px; font-size: 13px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.row.wrap2 { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.mt4 { margin-top: 4px; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mb8 { margin-bottom: 8px; }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sec-title { font-size: 12.5px; color: var(--muted); font-weight: 600; margin: 16px 4px 8px; letter-spacing: .4px; }
.mono { font-variant-numeric: tabular-nums; }

/* ── 按钮 ─────────────────────────── */
.btn {
  border: 1px solid var(--line); background: #fff; color: var(--text);
  padding: 8px 14px; border-radius: 9px; font-size: 13.5px; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px; cursor: pointer;
}
.btn:active { opacity: .72; }
.btn.pri { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.warn { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn.dg { background: #fff; border-color: #f7c9c5; color: var(--danger); }
.btn.ghost { background: #eef3fd; border-color: transparent; color: var(--brand); }
.btn.sm { padding: 6px 10px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; }
.btn-row { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.btn-row .btn { flex: 1; min-width: 96px; }

/* ── 标签 / 徽标 ───────────────────── */
.tag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 20px; font-size: 11.5px; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.tone-info { background: #e8f1ff; color: #1e5fd0; }
.tone-ok { background: #e3f8e9; color: #0a9c34; }
.tone-warn { background: #fff2e2; color: #d97a08; }
.tone-danger { background: #fdeceb; color: #d92d20; }
.tone-muted { background: #f1f3f6; color: #7a8699; }
.tone-purple { background: #f2ebff; color: var(--purple); }

/* ── 进度条 ───────────────────────── */
.bar { height: 6px; border-radius: 6px; background: #eceff4; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #4f92ff); border-radius: 6px; transition: width .3s; }
.bar.ok > i { background: linear-gradient(90deg, #00b42a, #37d066); }
.bar.danger > i { background: linear-gradient(90deg, #f04438, #ff7a70); }

/* ── 物料三类（光学 / 机械 / 电控）分别进度 ───── */
.mat-doms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 9px; }
.mat-dom { border: 1px solid var(--line); border-radius: 10px; padding: 6px 9px; background: #fafbfd; }
.mat-dom .n { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mat-dom .v { font-size: 15px; font-weight: 700; margin-top: 1px; color: var(--muted); }
.mat-dom.ok { border-color: #b7ebc6; background: #f2fdf5; }
.mat-dom.ok .v { color: var(--ok); }
.mat-dom.part { border-color: #ffd9ab; background: #fffaf3; }
.mat-dom.part .v { color: var(--warn); }
.mat-dom.none .v { font-size: 12px; font-weight: 500; }
.mat-grp { margin-top: 10px; }
.mat-grp-h { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 1px; }
.mat-grp-h .cnt { font-weight: 500; color: var(--muted); font-size: 11.5px; }

/* ── 表单 ─────────────────────────── */
.field { padding: 11px 14px; border-bottom: 1px solid var(--line); }
.field:last-child { border-bottom: 0; }
.field > label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.field > label b { color: var(--danger); font-weight: 700; margin-left: 2px; }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line); background: #fafbfd; color: var(--text);
  border-radius: 9px; padding: 9px 11px; font-size: 14px; font-family: inherit; outline: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand-2); background: #fff; }
.textarea { min-height: 76px; resize: vertical; line-height: 1.6; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.inline { display: flex; gap: 8px; align-items: center; }
.chip { padding: 6px 12px; border-radius: 18px; border: 1px solid var(--line); background: #fff; font-size: 12.5px; color: var(--muted); }
.chip.on { background: #eef3fd; border-color: #bcd3fb; color: var(--brand); font-weight: 600; }
.form-err { background: #fdeceb; color: #d92d20; border-radius: 9px; padding: 10px 12px; font-size: 12.5px; line-height: 1.7; margin: 0 12px 12px; }

/* ── 指标编辑行 ────────────────────── */
.metric { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 8px; background: #fbfcfe; }
.metric .m-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.metric .m-no { width: 20px; height: 20px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.metric .m-del { border: 0; background: transparent; color: var(--danger); font-size: 12px; }
.metric .grid2, .metric .grid3 { margin-top: 6px; }
.metric .mini-label { font-size: 11px; color: var(--muted-2); margin-bottom: 3px; }
.contract-ref { font-size: 11.5px; color: var(--purple); }

/* ── 指标比对表 ────────────────────── */
.cmp { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.cmp th { text-align: left; color: var(--muted); font-weight: 500; font-size: 11.5px; padding: 6px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.cmp td { padding: 8px 6px; border-bottom: 1px solid #f4f6f9; vertical-align: top; }
.cmp tr:last-child td { border-bottom: 0; }
.cmp .nm { font-weight: 600; }
.cmp .exp { color: var(--muted); font-size: 11.5px; }
.cmp .val-pass { color: var(--ok); font-weight: 700; }
.cmp .val-fail { color: var(--danger); font-weight: 700; }
.cmp .val-none { color: var(--muted-2); }
.cmp .grp { background: #f7f9fc; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.verdict-banner { padding: 12px 14px; font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.verdict-banner.ok { background: #eafaf0; color: #0a9c34; }
.verdict-banner.bad { background: #fdeceb; color: #d92d20; }
.verdict-banner .sub { font-weight: 400; font-size: 12px; opacity: .85; }

/* ── 列表项 ───────────────────────── */
.item { display: block; padding: 12px 14px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.item:last-child { border-bottom: 0; }
.item .it-top { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.item .it-no { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.item .it-title { font-size: 14.5px; font-weight: 600; margin-bottom: 5px; }
.item .it-meta { font-size: 11.5px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }

/* ── 上传 ─────────────────────────── */
.uploader { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.up-box {
  border: 1px dashed #c8d2e0; border-radius: 10px; background: #fafbfd; color: var(--muted);
  aspect-ratio: 1/1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11.5px;
}
.up-box .ic { font-size: 20px; color: var(--brand); }
.up-thumb { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 1/1; background: #f7f9fc; }
.up-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.up-thumb .pdf { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 4px; color: var(--danger); font-size: 11.5px; }
.up-thumb .x { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; border: 0; font-size: 12px; line-height: 1; }
.up-thumb .kind { position: absolute; left: 0; bottom: 0; right: 0; background: rgba(0,0,0,.5); color: #fff; font-size: 10.5px; padding: 2px 6px; }

/* ── 弹层 / 提示 ───────────────────── */
.sheet { position: fixed; inset: 0; z-index: 60; }
.sheet-mask { position: absolute; inset: 0; background: rgba(0,0,0,.42); }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 84vh; background: #fff;
  border-radius: 16px 16px 0 0; display: flex; flex-direction: column; max-width: 680px; margin: 0 auto;
  animation: sheetUp .22s ease;
}
@keyframes sheetUp { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); font-weight: 600; }
.sheet-head > span { flex: 1; }
.sheet-x { border: 0; background: #f2f4f7; width: 26px; height: 26px; border-radius: 50%; color: var(--muted); font-size: 13px; }
.sheet-body { overflow-y: auto; padding-bottom: 12px; -webkit-overflow-scrolling: touch; }
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 90;
  background: rgba(28,33,42,.92); color: #fff; padding: 9px 16px; border-radius: 20px; font-size: 13px; max-width: 78vw; text-align: center;
}
.loading { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px 20px; color: var(--muted); font-size: 13px; }
.spinner { width: 32px; height: 32px; border: 3px solid #e3e9f2; border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.steps { font-size: 12px; color: var(--muted-2); line-height: 1.9; }

/* ── 底部导航 / 悬浮主操作 ──────────── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex;
  background: rgba(255,255,255,.97); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  backdrop-filter: blur(8px);
}
.tabbar .tb { flex: 1; text-align: center; padding: 8px 0 7px; color: var(--muted); text-decoration: none; font-size: 10.5px; }
.tabbar .tb .ic { font-size: 19px; display: block; line-height: 1.25; }
.tabbar .tb.on { color: var(--brand); font-weight: 600; }
.tabbar .tb .dot { position: absolute; margin-left: 12px; margin-top: -2px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); }
.tabbar-inner { max-width: 680px; margin: 0 auto; display: flex; width: 100%; }

.fab {
  position: fixed; bottom: 74px; right: 16px; z-index: 41;
  right: max(16px, calc(50% - 340px + 16px));
  background: var(--brand); color: #fff; border: 0; border-radius: 24px; padding: 11px 18px;
  font-size: 13.5px; font-weight: 600; box-shadow: 0 6px 18px rgba(30,95,208,.36);
  display: inline-flex; align-items: center; gap: 5px;
}
.fab:active { transform: scale(.97); }
.fab.warn { background: var(--warn); box-shadow: 0 6px 18px rgba(255,143,31,.36); }
.fab.ok { background: var(--ok); box-shadow: 0 6px 18px rgba(0,180,42,.32); }

/* ── 统计卡 ───────────────────────── */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { background: #fff; border-radius: 10px; box-shadow: var(--shadow); padding: 10px 6px; text-align: center; }
.stat .n { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 11px; color: var(--muted); margin-top: 2px; }
.stat.warn .n { color: var(--warn); }
.stat.danger .n { color: var(--danger); }
.stat.ok .n { color: var(--ok); }

/* ── 时间线 ───────────────────────── */
.tl { padding: 4px 14px 10px; }
.tl-item { display: flex; gap: 10px; padding: 7px 0; }
.tl-item .dot { width: 7px; height: 7px; border-radius: 50%; background: #cdd6e2; margin-top: 7px; flex: 0 0 auto; }
.tl-item .dot.on { background: var(--brand); }
.tl-item .dot.ok { background: var(--ok); }
.tl-item .dot.bad { background: var(--danger); }
.tl-item .tx { flex: 1; min-width: 0; font-size: 12.5px; }
.tl-item .tm { font-size: 11px; color: var(--muted-2); margin-top: 2px; }

/* ── 登录页 ───────────────────────── */
.login { padding: 40px 20px; }
.login .brand { text-align: center; margin-bottom: 26px; }
.login .brand .logo { width: 62px; height: 62px; border-radius: 16px; background: linear-gradient(135deg, var(--brand), #5a9bff); color: #fff; font-size: 26px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.login .brand h1 { font-size: 19px; margin: 0 0 6px; }
.login .brand p { font-size: 12.5px; color: var(--muted); margin: 0; }
.who { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.who:last-child { border-bottom: 0; }
.who .av { width: 34px; height: 34px; border-radius: 50%; background: #e8f1ff; color: var(--brand); font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.who .nm { font-weight: 600; font-size: 14px; }
.who .pos { font-size: 11.5px; color: var(--muted); }
.notice { background: #fff8e8; border: 1px solid #ffe2b0; color: #a26a06; border-radius: 10px; padding: 10px 12px; font-size: 12.5px; line-height: 1.7; margin-bottom: 12px; }
.notice.blue { background: #eef3fd; border-color: #cddefb; color: #23539b; }
.notice.red { background: #fdeceb; border-color: #f9cbc7; color: #b32318; }
.kv { display: flex; font-size: 12.5px; padding: 5px 0; }
.kv .k { color: var(--muted); width: 82px; flex: 0 0 auto; }
.kv .v { flex: 1; min-width: 0; word-break: break-all; }
.rawbox { background: #f7f9fc; border: 1px solid var(--line); border-radius: 9px; padding: 10px; font-size: 11.5px; line-height: 1.7; max-height: 220px; overflow: auto; white-space: pre-wrap; word-break: break-all; color: #46536b; }

/* ── 起始页：欢迎区 / 单号速查 / 功能入口宫格 ───────────── */
.hero {
  background: linear-gradient(135deg, #eaf1fd, #f8fbff);
  border: 1px solid #dbe7fb; border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 12px;
}
.hero .hero-hi { font-size: 17px; font-weight: 700; }
.hero .hero-role { font-size: 12px; color: var(--muted); margin-top: 3px; }
.hero .hero-duty {
  font-size: 12.5px; color: #23539b; background: rgba(255,255,255,.72);
  border-radius: 8px; padding: 7px 10px; margin-top: 9px; line-height: 1.6;
}
.search { display: flex; gap: 8px; align-items: center; }
.search .input { flex: 1; min-width: 0; }
.mod-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.mod {
  background: var(--card); border-radius: 10px; box-shadow: var(--shadow);
  padding: 12px 8px; text-align: center; text-decoration: none; color: inherit; display: block;
}
.mod:active { opacity: .75; }
.mod .mi { display: block; font-size: 20px; line-height: 1.3; color: var(--brand); }
.mod .ml { display: block; font-size: 12.5px; font-weight: 600; margin-top: 4px; }
.mod .md { display: block; font-size: 10.5px; color: var(--muted-2); margin-top: 2px; line-height: 1.4; }
a.stat { text-decoration: none; color: inherit; display: block; }
a.stat:active { opacity: .75; }
code { background: #eef2f8; border-radius: 4px; padding: 1px 5px; font-size: 11.5px; }
.code {
  background: #f7f9fc; border: 1px solid var(--line); border-radius: 9px; padding: 10px;
  font-size: 11px; line-height: 1.65; overflow: auto; white-space: pre; color: #46536b;
  margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ── 项目统计：机械 / 电控 / 光学 专业进展行 ── */
.prow {
  display: flex; gap: 10px; align-items: center;
  padding: 9px 2px; border-bottom: 1px dashed var(--line);
}
.prow:last-of-type { border-bottom: 0; }
.prow-name { flex: none; width: 62px; font-size: 13px; font-weight: 700; color: var(--text); }
.prow-edit { flex: none; font-size: 11.5px; color: var(--brand); border: 1px solid var(--brand); border-radius: 6px; padding: 2px 8px; }
.prow[data-g]:active { opacity: .7; }
