/* ==========================================================================
   电池包维修工单系统 · 样式
   ========================================================================== */

:root {
  --bg: #eef1f6;
  --bg-2: #f7f9fb;
  --card: #ffffff;
  --ink: #0e1c2b;
  --ink-2: #33485c;
  --muted: #6b8098;
  --line: #e3e9ef;
  --line-2: #eef2f6;
  --brand: #0d9488;
  --brand-d: #0b7c72;
  --brand-l: #e6f6f4;
  --brand-g: linear-gradient(135deg, #0ea396, #0d9488 45%, #12b3a2);
  --amber: #d97c00;
  --amber-l: #fdf4e3;
  --danger: #d93b53;
  --danger-l: #fdeef0;
  --ok: #128a5b;
  --ok-l: #e8f6ef;
  --blue: #2563a8;
  --blue-l: #eaf1fa;
  --radius: 16px;
  --radius-s: 10px;
  --shadow: 0 1px 2px rgba(16, 38, 56, .04), 0 4px 16px rgba(16, 38, 56, .07);
  --shadow-l: 0 12px 40px rgba(16, 38, 56, .18);
  --nav-h: 62px;
  --head-h: 56px;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: linear-gradient(180deg, #f2f5f9 0%, var(--bg) 260px);
  background-attachment: fixed;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; font-size: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: 15px; color: var(--ink); }
img { display: block; max-width: 100%; }
svg { width: 1em; height: 1em; display: inline-block; vertical-align: -0.14em; }

/* ---------- 顶部 ---------- */
.head {
  position: sticky; top: 0; z-index: 40;
  height: var(--head-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.head .title {
  font-size: 17px; font-weight: 700; letter-spacing: .2px;
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.head .title small {
  display: block; font-size: 11px; font-weight: 500; color: var(--muted);
  letter-spacing: 0; line-height: 1.1;
}
.icon-btn {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  color: var(--ink-2); background: transparent;
  transition: background .15s;
}
.icon-btn:hover { background: var(--line-2); }
.icon-btn svg { width: 20px; height: 20px; }
.who {
  display: flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 11px 0 6px; border-radius: 20px;
  background: var(--brand-l); color: var(--brand-d);
  font-size: 12.5px; font-weight: 600;
}
.who i {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: grid; place-items: center; font-size: 11px; font-style: normal;
}

/* ---------- 主体 ---------- */
main { max-width: 1180px; margin: 0 auto; padding: 14px 14px 30px; }
.section { margin: 0 0 18px; }
.section-head {
  display: flex; align-items: center; gap: 8px;
  padding: 0 2px 9px;
}
.section-head h2 {
  margin: 0; font-size: 14px; font-weight: 700; letter-spacing: .3px;
  color: var(--ink-2); flex: 1;
  display: flex; align-items: center; gap: 7px;
}
.section-head h2::before {
  content: ''; width: 4px; height: 15px; border-radius: 3px;
  background: var(--brand-g); flex: none;
}
.section-head h2 svg { width: 16px; height: 16px; color: var(--brand); }
.section-head .more { font-size: 12.5px; color: var(--brand); font-weight: 600; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(16, 38, 56, .045);
  overflow: hidden;
}
.card + .card { margin-top: 12px; }
.card-pad { padding: 14px; }

/* ---------- 统计 ---------- */
.stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
.stat {
  background: var(--card); border-radius: 14px; padding: 12px 13px;
  box-shadow: var(--shadow); border: 1px solid rgba(16, 38, 56, .045);
  position: relative; overflow: hidden;
}
.stat .k { font-size: 11.5px; color: var(--muted); font-weight: 600; letter-spacing: .3px; }
.stat .v {
  font-size: 23px; font-weight: 800; letter-spacing: -.6px; margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.stat .v small { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.stat .u { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.stat.acc .v { color: var(--brand-d); }
.stat.warn .v { color: var(--amber); }
.stat.bad .v { color: var(--danger); }
.stat .bar {
  position: absolute; left: 0; bottom: 0; height: 3px; width: 46%;
  background: linear-gradient(90deg, var(--brand), #4ecdc4);
  border-radius: 3px;
}
.stat.warn .bar { background: linear-gradient(90deg, var(--amber), #f5c26b); }
.stat.bad .bar { background: linear-gradient(90deg, var(--danger), #f08a9b); }

/* ---------- 提醒 ---------- */
.alert {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 12px 13px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow);
  margin-bottom: 9px;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}
.alert:active { transform: scale(.99); }
.alert .ico {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
}
.alert .ico svg { width: 18px; height: 18px; }
.alert .t { font-size: 14px; font-weight: 650; line-height: 1.35; }
.alert .d { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.alert.warn { background: linear-gradient(180deg, #fffdf7, #fff); border-color: #f4e3c0; }
.alert.warn .ico { background: var(--amber-l); color: var(--amber); }
.alert.danger { background: linear-gradient(180deg, #fff9fa, #fff); border-color: #f7d3d9; }
.alert.danger .ico { background: var(--danger-l); color: var(--danger); }
.alert.info { background: linear-gradient(180deg, #f8fbff, #fff); border-color: #d6e4f3; }
.alert.info .ico { background: var(--blue-l); color: var(--blue); }

/* ---------- 快捷操作 ---------- */
.quick {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px;
}
.quick a, .quick button {
  background: var(--card); border-radius: 14px; padding: 13px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  box-shadow: var(--shadow); border: 1px solid rgba(16, 38, 56, .045);
  font-size: 12px; font-weight: 600; color: var(--ink-2);
  transition: transform .12s;
}
.quick a:active { transform: scale(.97); }
.quick .qi {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  background: var(--brand-l); color: var(--brand-d);
}
.quick .qi.amber { background: var(--amber-l); color: var(--amber); }
.quick .qi.blue { background: var(--blue-l); color: var(--blue); }
.quick .qi.danger { background: var(--danger-l); color: var(--danger); }
.quick svg { width: 19px; height: 19px; }

/* ---------- 工单卡 ---------- */
.wo {
  display: block; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid rgba(16, 38, 56, .045);
  padding: 13px 14px 13px 17px; margin-bottom: 10px;
  position: relative; overflow: hidden;
  transition: transform .12s, box-shadow .15s;
}
.wo::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--amber);
}
.wo.status-done::before { background: var(--ok); }
.wo.status-draft::before { background: #b9c6d2; }
.wo:active { transform: scale(.995); }
.wo .code {
  font-size: 10.5px; font-weight: 650; color: var(--muted);
  font-variant-numeric: tabular-nums; letter-spacing: .3px;
  background: var(--bg-2); padding: 1px 7px; border-radius: 6px;
}
.wo .r1 { display: flex; align-items: center; gap: 8px; }
.wo .plate {
  font-size: 16px; font-weight: 800; letter-spacing: .3px;
  font-variant-numeric: tabular-nums;
}
.wo .st {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; flex: none;
}
.st.ongoing { background: var(--amber-l); color: var(--amber); }
.st.done { background: var(--ok-l); color: var(--ok); }
.st.draft { background: var(--line-2); color: var(--muted); }
.wo .r2 { font-size: 12.5px; color: var(--muted); margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; }
.wo .r2 span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.wo .r3 {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px;
  padding-top: 10px; border-top: 1px dashed var(--line);
}
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 650; padding: 3px 8px; border-radius: 8px;
  background: var(--bg-2); color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.pill svg { width: 13px; height: 13px; }
.pill.g { background: var(--ok-l); color: var(--ok); }
.pill.a { background: var(--amber-l); color: var(--amber); }
.pill.r { background: var(--danger-l); color: var(--danger); }
.pill.b { background: var(--blue-l); color: var(--blue); }
.pill.t { background: var(--brand-l); color: var(--brand-d); }

/* ---------- 筛选 chips ---------- */
.chips { display: flex; gap: 7px; overflow-x: auto; padding: 2px 2px 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 32px; padding: 0 13px; border-radius: 20px;
  background: var(--card); border: 1px solid var(--line);
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 5px;
  white-space: nowrap;
}
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip .n { font-size: 11px; opacity: .7; }

/* ---------- 搜索框 ---------- */
.searchbox {
  display: flex; align-items: center; gap: 9px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 13px; padding: 0 12px; height: 44px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.searchbox svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.searchbox input {
  flex: 1; border: none; outline: none; background: none; height: 100%;
  font-size: 14.5px; min-width: 0;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 42px; padding: 0 18px; border-radius: 12px;
  font-size: 14.5px; font-weight: 650;
  background: var(--card); color: var(--ink-2);
  border: 1px solid var(--line);
  transition: transform .12s, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn svg { width: 17px; height: 17px; }
.btn.primary {
  background: var(--brand-g); color: #fff; border-color: transparent;
  box-shadow: 0 4px 14px rgba(13, 148, 136, .3);
}
.btn.primary:hover { filter: brightness(.96); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--brand-d); }
.btn.danger { color: var(--danger); border-color: #f3d2d7; background: #fff; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; }

.fab {
  position: fixed; right: 16px; z-index: 45;
  bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom, 0px));
  width: 54px; height: 54px; border-radius: 18px;
  background: var(--brand-g); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(13, 148, 136, .4);
}
.fab svg { width: 26px; height: 26px; }

/* ---------- 底部导航 ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex; align-items: stretch;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px rgba(16, 38, 56, .06);
}
.nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 10.5px; font-weight: 600; color: var(--muted);
  position: relative;
}
.nav a svg { width: 22px; height: 22px; }
.nav a.on { color: var(--brand); }
.nav a.on::before {
  content: ''; position: absolute; top: 0; width: 24px; height: 3px;
  border-radius: 0 0 3px 3px; background: var(--brand);
}
.nav a .dot {
  position: absolute; top: 8px; right: 50%; margin-right: -16px;
  min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px;
  background: var(--danger); color: #fff; font-size: 9.5px; font-weight: 700;
  display: grid; place-items: center; line-height: 1;
}

/* ---------- 表单 ---------- */
.form { display: grid; gap: 13px; }
.field { display: grid; gap: 6px; }
.field > label { font-size: 12.5px; font-weight: 650; color: var(--muted); letter-spacing: .2px; }
.field .hint { font-size: 11.5px; color: var(--muted); }
.inp {
  height: 44px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--card); padding: 0 12px; outline: none; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
textarea.inp { height: auto; min-height: 84px; padding: 10px 12px; line-height: 1.6; resize: vertical; }
select.inp { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b8098' stroke-width='2.4'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; background-size: 16px; padding-right: 34px; }
.inp:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(13, 148, 136, .12); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }

/* ---------- 列表行 ---------- */
.row {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 14px; border-bottom: 1px solid var(--line-2);
}
.row:last-child { border-bottom: none; }
.row .body { flex: 1; min-width: 0; }
.row .body .t { font-size: 14px; font-weight: 600; }
.row .body .d { font-size: 12px; color: var(--muted); margin-top: 1px; }
.row .amt { font-size: 15px; font-weight: 750; font-variant-numeric: tabular-nums; }
.row .chev { color: #c3cfda; }

/* ---------- tab ---------- */
.tabs {
  display: flex; gap: 4px; background: var(--line-2);
  padding: 4px; border-radius: 13px; margin-bottom: 14px;
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1; min-width: 62px; height: 36px; border-radius: 10px;
  font-size: 13px; font-weight: 650; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  white-space: nowrap;
}
.tab.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(16, 38, 56, .1); }
.tab .n {
  font-size: 10.5px; padding: 0 5px; border-radius: 6px; background: var(--line);
  color: var(--muted); font-weight: 700; line-height: 15px;
}
.tab.on .n { background: var(--brand-l); color: var(--brand-d); }

/* ---------- 照片 ---------- */
.photo-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.slot {
  position: relative; aspect-ratio: 1 / 1; border-radius: 12px;
  background: var(--bg-2); border: 1.5px dashed #cfdae4;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 6px; text-align: center; cursor: pointer;
  overflow: hidden;
}
.slot .lb { font-size: 11.5px; font-weight: 650; color: var(--ink-2); line-height: 1.25; }
.slot .req {
  position: absolute; top: 5px; left: 5px;
  font-size: 9.5px; font-weight: 700; padding: 1px 5px; border-radius: 5px;
  background: var(--danger); color: #fff;
}
.slot .req.ok { background: var(--ok); }
.slot .cnt {
  position: absolute; top: 5px; right: 5px;
  font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 8px;
  background: rgba(15, 31, 46, .55); color: #fff;
}
.slot .plus { color: #a9bacb; }
.slot .plus svg { width: 26px; height: 26px; }
.slot.has { border-style: solid; border-color: transparent; }
.slot.has img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slot.has .mask {
  position: absolute; inset: auto 0 0 0; padding: 14px 5px 4px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .66));
  color: #fff; font-size: 10.5px; font-weight: 650; text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.slot.missing { background: #fffdfd; border-color: #f0ccd2; }
.slot.missing .lb { color: #b9435a; }

.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.thumb {
  position: relative; aspect-ratio: 1/1; border-radius: 10px; overflow: hidden;
  background: var(--bg-2); border: 1px solid var(--line);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .del {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(15, 31, 46, .62); color: #fff; display: grid; place-items: center;
}
.thumb .del svg { width: 12px; height: 12px; }

/* ---------- 进度条 ---------- */
.prog { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.prog > i { display: block; height: 100%; border-radius: 6px; background: var(--brand); transition: width .3s; }
.prog.a > i { background: var(--amber); }
.prog.r > i { background: var(--danger); }

/* ---------- 工具清单 ---------- */
.tool-list { display: grid; gap: 6px; }
.tool {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 11px; background: var(--card);
  border: 1px solid var(--line);
}
.tool .nm { flex: 1; font-size: 13.5px; font-weight: 600; min-width: 0; }
.tool .cat { font-size: 10.5px; color: var(--muted); }
.cbs { display: flex; gap: 6px; }
.cb {
  width: 38px; height: 32px; border-radius: 9px;
  border: 1.5px solid var(--line); display: grid; place-items: center;
  color: #b9c6d2; background: var(--bg-2);
}
.cb svg { width: 15px; height: 15px; }
.cb.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.cb.on.out { background: var(--brand); border-color: var(--brand); }
.tool.warn { border-color: #f2cdd4; background: #fffafb; }

/* ---------- 空状态 ---------- */
.empty {
  text-align: center; padding: 46px 20px; color: var(--muted);
}
.empty .e {
  font-size: 40px; margin: 0 auto 12px; opacity: .9; width: 72px; height: 72px;
  border-radius: 50%; background: var(--line-2); color: #9fb2c4;
  display: grid; place-items: center;
}
.empty .e svg { width: 32px; height: 32px; }
.empty .t { font-size: 14px; font-weight: 650; color: var(--ink-2); }
.empty .d { font-size: 12.5px; margin-top: 3px; }

/* ---------- 弹窗 ---------- */
.mask {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(11, 26, 38, .45); backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.sheet {
  width: 100%; max-width: 560px; max-height: 92vh;
  background: var(--card); border-radius: 20px 20px 0 0;
  box-shadow: var(--shadow-l);
  display: flex; flex-direction: column;
  animation: up .24s cubic-bezier(.22, 1, .36, 1);
  position: relative;
}
.sheet::before {
  content: ''; position: absolute; top: 7px; left: 50%; margin-left: -18px;
  width: 36px; height: 4px; border-radius: 3px;
  background: var(--line); pointer-events: none;
}
@keyframes up { from { transform: translateY(24px); opacity: .6 } to { transform: none; opacity: 1 } }
.sheet .sh {
  padding: 19px 16px 11px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--line-2);
}
.sheet .sh h3 { margin: 0; font-size: 16px; font-weight: 700; flex: 1; }
.sheet .sb { padding: 15px 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet .sf {
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line-2); display: flex; gap: 10px;
}
.sheet .sf .btn { flex: 1; }

/* ---------- toast ---------- */
.toast-wrap {
  position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + 24px);
  z-index: 120; display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}
.toast {
  background: rgba(15, 31, 46, .93); color: #fff;
  padding: 10px 16px; border-radius: 12px; font-size: 13.5px; font-weight: 600;
  box-shadow: var(--shadow-l); max-width: 84vw;
  animation: tin .2s ease;
}
.toast.ok { background: rgba(15, 122, 82, .95); }
.toast.err { background: rgba(190, 48, 68, .95); }
@keyframes tin { from { transform: translateY(8px); opacity: 0 } to { transform: none; opacity: 1 } }

/* ---------- 知识卡片 ---------- */
.kb {
  background: var(--card); border-radius: 14px; padding: 14px;
  box-shadow: var(--shadow); border: 1px solid rgba(16, 38, 56, .045);
  margin-bottom: 10px;
}
.kb .r1 { display: flex; align-items: flex-start; gap: 8px; }
.kb .tt { font-size: 15px; font-weight: 700; line-height: 1.4; flex: 1; }
.kb .ex { font-size: 12.5px; color: var(--muted); margin-top: 5px; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kb .r3 { display: flex; align-items: center; gap: 6px; margin-top: 9px; flex-wrap: wrap; }

/* markdown 渲染 */
.md { font-size: 14.5px; line-height: 1.75; word-break: break-word; }
.md h1, .md h2, .md h3 { margin: 18px 0 8px; line-height: 1.35; }
.md h1 { font-size: 19px; } .md h2 { font-size: 17px; } .md h3 { font-size: 15.5px; }
.md p { margin: 8px 0; }
.md ul, .md ol { margin: 8px 0; padding-left: 22px; }
.md li { margin: 3px 0; }
.md code { background: var(--line-2); padding: 1px 5px; border-radius: 5px; font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.md pre { background: #0f1f2e; color: #e6edf3; padding: 12px; border-radius: 10px; overflow-x: auto; }
.md pre code { background: none; color: inherit; padding: 0; }
.md blockquote { margin: 8px 0; padding: 6px 12px; border-left: 3px solid var(--brand);
  background: var(--brand-l); border-radius: 0 8px 8px 0; color: var(--ink-2); }
.md a { color: var(--brand-d); text-decoration: underline; }
.md hr { border: none; border-top: 1px solid var(--line); margin: 14px 0; }

/* ---------- 手册 ---------- */
.file {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-bottom: 1px solid var(--line-2);
}
.file:last-child { border-bottom: none; }
.file .fi {
  width: 40px; height: 40px; border-radius: 10px; flex: none;
  display: grid; place-items: center; font-size: 10px; font-weight: 800;
  letter-spacing: .3px; color: #fff; text-transform: uppercase;
  background: var(--blue);
}
.file .fi.pdf { background: #d94a4a; }
.file .fi.doc, .file .fi.docx { background: #2b579a; }
.file .fi.xls, .file .fi.xlsx, .file .fi.csv { background: #1d7044; }
.file .fi.ppt, .file .fi.pptx { background: #c4582a; }
.file .fi.jpg, .file .fi.jpeg, .file .fi.png, .file .fi.webp { background: #7b5bd6; }
.file .fi.zip, .file .fi.rar, .file .fi.'7z' { background: #7a6a5a; }
.file .body { flex: 1; min-width: 0; }
.file .t { font-size: 14px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file .d { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

/* ---------- 发票 ---------- */
.inv {
  display: flex; gap: 11px; padding: 11px 13px; border-bottom: 1px solid var(--line-2);
  align-items: center;
}
.inv:last-child { border-bottom: none; }
.inv .pic {
  width: 48px; height: 48px; border-radius: 9px; background: var(--bg-2);
  flex: none; overflow: hidden; border: 1px solid var(--line);
  display: grid; place-items: center; color: #b9c6d2;
}
.inv .pic img { width: 100%; height: 100%; object-fit: cover; }
.inv .body { flex: 1; min-width: 0; }
.inv .t { font-size: 13.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv .d { font-size: 11.5px; color: var(--muted); margin-top: 1px; display: flex; gap: 6px; flex-wrap: wrap; }
.inv .amt { font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; flex: none; }
.unlinked-badge {
  font-size: 10px; font-weight: 750; padding: 1px 6px; border-radius: 5px;
  background: var(--danger-l); color: var(--danger);
}

/* ---------- 详情头 ---------- */
.detail-head {
  background: linear-gradient(135deg, #0f766e, #0d9488 55%, #14a89a);
  color: #fff; border-radius: var(--radius); padding: 16px;
  margin-bottom: 14px; box-shadow: 0 10px 26px rgba(13, 148, 136, .22);
  position: relative; overflow: hidden;
}
.detail-head::after {
  content: ''; position: absolute; right: -40px; top: -40px;
  width: 150px; height: 150px; border-radius: 50%;
  background: rgba(255, 255, 255, .09);
  /* 纯装饰：必须放行点击，否则会盖住右上角的编辑 / 更多按钮 */
  pointer-events: none;
}
/* 内容层压到装饰圆环之上，保证按钮一定能点到 */
.detail-head .top,
.detail-head .sub,
.detail-head .mini { position: relative; z-index: 2; }
.detail-head .top { display: flex; align-items: center; gap: 9px; }
.detail-head .icon-btn { position: relative; z-index: 3; }
.detail-head .plate { font-size: 22px; font-weight: 800; letter-spacing: .5px; }
.detail-head .st {
  font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 20px;
  background: rgba(255, 255, 255, .22);
}
.detail-head .sub { font-size: 12.5px; opacity: .88; margin-top: 3px; }
.detail-head .mini {
  display: flex; gap: 16px; margin-top: 14px;
  padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .2);
}
.detail-head .mini div { font-size: 11px; opacity: .82; }
.detail-head .mini b { display: block; font-size: 16px; font-weight: 800; opacity: 1; letter-spacing: -.3px; }

/* ---------- 桌面端 ---------- */
.sidebar { display: none; }

@media (min-width: 900px) {
  body { padding-bottom: 0; padding-left: 216px; }
  .nav { display: none; }
  .sidebar {
    display: flex; flex-direction: column;
    position: fixed; left: 0; top: 0; bottom: 0; width: 216px; z-index: 60;
    background: #0f2231; padding: 18px 12px;
  }
  .sidebar .brand {
    display: flex; align-items: center; gap: 9px; padding: 4px 8px 20px;
    color: #fff; font-size: 14.5px; font-weight: 750; letter-spacing: .3px;
  }
  .sidebar .brand i {
    width: 30px; height: 30px; border-radius: 9px; flex: none;
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    display: grid; place-items: center; font-style: normal; font-size: 15px;
  }
  .sidebar a {
    display: flex; align-items: center; gap: 10px;
    height: 42px; padding: 0 12px; border-radius: 10px;
    color: #a9c0d1; font-size: 13.5px; font-weight: 600; margin-bottom: 3px;
    transition: background .15s, color .15s;
  }
  .sidebar a svg { width: 18px; height: 18px; }
  .sidebar a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
  .sidebar a.on { background: rgba(20, 184, 166, .18); color: #5eead4; }
  .sidebar .fill { flex: 1; }
  .sidebar .tip {
    font-size: 11px; color: #6f8aa0; padding: 10px 12px; line-height: 1.6;
    border-top: 1px solid rgba(255, 255, 255, .08);
  }
  .sidebar .tip b { color: #5eead4; display: block; font-size: 12px; }
  .head { padding-left: 22px; }
  main { padding: 20px 24px 60px; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .quick { grid-template-columns: repeat(6, 1fr); }
  .photo-grid { grid-template-columns: repeat(5, 1fr); }
  .thumbs { grid-template-columns: repeat(6, 1fr); }
  .fab { bottom: 28px; right: 28px; }
  .mask { align-items: center; }
  .sheet { border-radius: 20px; max-height: 86vh; }
  .col-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
}

@media (max-width: 380px) {
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .thumbs { grid-template-columns: repeat(3, 1fr); }
  .quick { grid-template-columns: repeat(3, 1fr); }
}

.hide { display: none !important; }
.mono { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.center { text-align: center; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; }
.flex { display: flex; gap: 8px; align-items: center; }
.spacer { flex: 1; }
.wrap { flex-wrap: wrap; }
.divider { height: 1px; background: var(--line-2); margin: 12px 0; }

/* ==========================================================================
   登录 / 权限 / 离线
   ========================================================================== */

body.auth-mode { padding-left: 0; padding-bottom: 0; background: #eef2f5; }
body.auth-mode .head, body.auth-mode .nav, body.auth-mode .sidebar { display: none !important; }

.auth-wrap {
  max-width: 420px; margin: 0 auto; padding: 34px 18px 40px;
  animation: fade .25s ease;
}
.auth-brand {
  width: 56px; height: 56px; border-radius: 17px; margin: 0 auto 14px;
  background: linear-gradient(135deg, #14b8a6, #0d9488);
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 10px 26px rgba(13, 148, 136, .3);
}
.auth-brand svg { width: 30px; height: 30px; }
.auth-wrap h1 { font-size: 21px; text-align: center; margin: 0 0 6px; letter-spacing: -.2px; }
.auth-sub { text-align: center; font-size: 13px; color: var(--muted); margin: 0 0 18px; line-height: 1.6; }
.auth-tip {
  text-align: center; font-size: 12px; color: var(--muted);
  margin: 16px 0 0; line-height: 1.7;
}

.who .pm {
  font-size: 9.5px; font-weight: 800; font-style: normal;
  padding: 1px 5px; border-radius: 5px; margin-left: 2px;
  background: rgba(13, 148, 136, .16); color: var(--brand-d);
}
.who .pm.admin { background: rgba(217, 59, 83, .14); color: var(--danger); }
.who .pm.viewer { background: rgba(107, 128, 152, .16); color: var(--muted); }

.offline-bar {
  position: sticky; top: var(--head-h); z-index: 39;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 14px; font-size: 12px; font-weight: 600;
  background: var(--amber-l); color: #8a5a00;
  border-bottom: 1px solid #f0dcbb;
}
.offline-bar svg { width: 15px; height: 15px; flex: none; }
.offline-bar span { flex: 1; min-width: 0; }
.offline-bar b {
  font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 20px;
  background: rgba(140, 90, 0, .13);
}
.offline-bar.sync { background: var(--brand-l); color: var(--brand-d); border-bottom-color: #c9e9e4; }
.offline-bar.sync b { background: rgba(13, 148, 136, .14); }

@media (min-width: 900px) {
  body.auth-mode { padding-left: 0; }
  .offline-bar { padding-left: 232px; }
}

/* 成员管理 / 清单管理行 */
.mrow {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 13px; border-bottom: 1px solid var(--line-2);
}
.mrow:last-child { border-bottom: none; }
.mrow .av {
  width: 34px; height: 34px; border-radius: 11px; flex: none;
  display: grid; place-items: center; font-weight: 800; font-size: 14px;
  background: var(--brand-l); color: var(--brand-d);
}
.mrow .body { flex: 1; min-width: 0; }
.mrow .t { font-size: 14px; font-weight: 650; display: flex; align-items: center; gap: 6px; }
.mrow .d { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.tag-p {
  font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 5px;
  background: var(--brand-l); color: var(--brand-d);
}
.tag-p.admin { background: var(--danger-l); color: var(--danger); }
.tag-p.viewer { background: var(--bg-2); color: var(--muted); }

.slot-row {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 13px; border-bottom: 1px solid var(--line-2);
}
.slot-row:last-child { border-bottom: none; }
.slot-row .nm { flex: 1; font-size: 13.5px; font-weight: 600; min-width: 0; }
.slot-row .st { font-size: 10.5px; font-weight: 750; padding: 1px 6px; border-radius: 5px; }
.slot-row .st.req { background: var(--danger-l); color: var(--danger); }
.slot-row .st.opt { background: var(--bg-2); color: var(--muted); }

/* ---------- 设备授权 / 授权码 / 等待授权 ---------- */
.wait-spin{width:38px;height:38px;margin:16px auto 0;border-radius:50%;
  border:3.5px solid #e3e9ee;border-top-color:#0d9488;animation:wspin 1s linear infinite}
@keyframes wspin{to{transform:rotate(360deg)}}
.code-big{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:26px;font-weight:800;
  letter-spacing:4px;text-align:center;color:#0d9488;background:#e6f7f4;
  border-radius:12px;padding:14px 8px;margin-top:10px;user-select:all}

/* ==========================================================================
   UI 精致化（v8）：问候横幅 / 进场动画 / 桌面端精修
   ========================================================================== */

/* 页面进场：每个页面加载时轻微上浮淡入，观感更顺 */
#view > * { animation: pageIn .26s ease both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #view > * { animation: none; } }

/* 首页问候横幅：像主流工单系统一样，先告诉你「现在几点、活有多少」 */
.hero {
  background: linear-gradient(135deg, #0f766e, #0d9488 52%, #14b3a2);
  border-radius: 18px; padding: 18px 18px 16px;
  color: #fff; margin-bottom: 14px;
  box-shadow: 0 10px 26px rgba(13, 148, 136, .24);
  position: relative; overflow: hidden;
}
.hero::after {
  content: ''; position: absolute; right: -46px; top: -56px;
  width: 170px; height: 170px; border-radius: 50%;
  background: rgba(255, 255, 255, .08); pointer-events: none;
}
.hero .r { display: flex; align-items: center; gap: 12px; position: relative; z-index: 2; }
.hero .hi {
  width: 46px; height: 46px; border-radius: 14px; flex: none;
  background: rgba(255, 255, 255, .16); display: grid; place-items: center;
}
.hero .hi svg { width: 24px; height: 24px; }
.hero .ht { font-size: 17px; font-weight: 800; letter-spacing: .2px; line-height: 1.3; }
.hero .hd { font-size: 12.5px; opacity: .88; margin-top: 2px; }
.hero .hs {
  display: flex; gap: 22px; margin-top: 14px; padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, .18);
  position: relative; z-index: 2;
}
.hero .hs div { font-size: 11px; opacity: .82; }
.hero .hs b { display: block; font-size: 18px; font-weight: 800; opacity: 1; letter-spacing: -.3px; }
.hero .hs b small { font-size: 11px; font-weight: 600; margin-left: 1px; }

/* 统计卡：桌面端悬停轻微上浮 */
@media (hover: hover) {
  .stat:hover, .wo:hover, .alert:hover { box-shadow: 0 4px 18px rgba(16, 38, 56, .11); }
  .wo:hover { transform: translateY(-1px); }
}

/* 筛选 chip 选中态更立体 */
.chip.on { box-shadow: 0 3px 10px rgba(13, 148, 136, .32); }

/* 详情头（v8 微调）：去装饰、加内容层级 */
.detail-head::before {
  content: ''; position: absolute; left: -50px; bottom: -70px;
  width: 160px; height: 160px; border-radius: 50%;
  background: rgba(255, 255, 255, .06); pointer-events: none;
}

/* 桌面侧栏：深色渐变 + 更清晰的品牌区 */
@media (min-width: 900px) {
  .sidebar {
    background: linear-gradient(180deg, #0c1d2b, #10263a 60%, #0e2337);
  }
  .sidebar a.on {
    background: linear-gradient(90deg, rgba(20, 184, 166, .22), rgba(20, 184, 166, .1));
    box-shadow: inset 3px 0 0 #14b8a6;
  }
  .wo:hover { transform: translateY(-1px); }
}
