/* ================= 精益生产管理系统 · 科技蓝主题 ================= */
:root {
  --brand: #1523DD;
  --brand-600: #0f1bbf;
  --brand-400: #3a47ff;
  --brand-soft: #e9ecfd;
  --brand-50: #f0f2ff;
  --brand-100: #e0e4ff;
  --brand-200: #c9d0ff;
  --ink: #12142b;
  --ink-2: #4a4f6a;
  --ink-3: #858aa5;
  --line: #e6e8f2;
  --bg: #f4f6fb;
  --card: #ffffff;
  --ok: #12b76a;
  --warn: #f79009;
  --danger: #e5372b;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 2px 10px rgba(16, 24, 64, 0.06);
  --shadow-lg: 0 12px 40px rgba(16, 24, 64, 0.14);
  --nav-h: 58px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4 { margin: 0; font-weight: 600; }
a { color: var(--brand); text-decoration: none; }
.hidden { display: none !important; }
.only-mobile { display: none; }

/* ---------------- 登录页 ---------------- */
.login-view {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 20% 10%, #3a47ff 0%, #1523DD 45%, #0f1bbf 100%);
  overflow: auto; padding: 20px 20px 78px;
}
.login-bg {
  position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 46px 46px, 46px 46px;
  mask-image: radial-gradient(circle at 30% 20%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(circle at 30% 20%, #000 0%, transparent 70%);
}
.login-card {
  position: relative; width: 100%; max-width: 410px;
  background: #fff; border-radius: 20px; padding: 34px 30px 26px;
  box-shadow: 0 30px 70px rgba(0, 8, 80, .45);
}
.login-brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; margin-bottom: 26px; }
.login-logo {
  width: 54px; height: 54px; border-radius: 16px; flex: 0 0 54px;
  background: linear-gradient(135deg, var(--brand-400), var(--brand));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(21, 35, 221, .3);
}
.login-brand-text { text-align: center; }
.login-title { font-size: 22px; letter-spacing: 1px; color: var(--ink); }
.login-sub { margin: 3px 0 0; font-size: 10.5px; color: var(--ink-3); letter-spacing: 1.1px; }
.login-form .field { margin-bottom: 16px; }
.login-form label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 7px; font-weight: 500; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .i { position: absolute; left: 12px; color: var(--ink-3); }
.input-wrap input {
  width: 100%; height: 46px; border: 1px solid var(--line); border-radius: 12px;
  padding: 0 42px 0 38px; font-size: 15px; outline: none; color: var(--ink); background: #fbfcff;
  transition: border-color .15s, box-shadow .15s;
}
.input-wrap input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(21, 35, 221,.12); background: #fff; }
.eye { position: absolute; right: 8px; background: none; border: 0; color: var(--ink-3); cursor: pointer; padding: 6px; }
.login-extra { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin: 6px 0 18px; color: var(--ink-2); }
.check { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.check input { accent-color: var(--brand); width: 15px; height: 15px; }
.link { background: none; border: 0; color: var(--brand); font-size: 13px; cursor: pointer; padding: 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 42px; padding: 0 18px; border: 1px solid transparent; border-radius: 12px;
  font-size: 15px; cursor: pointer; font-weight: 500; transition: .15s; white-space: nowrap;
  background: #fff; color: var(--ink);
}
.btn:active { transform: scale(.98); }
.btn-primary { background: linear-gradient(135deg, var(--brand-400), var(--brand)); color: #fff; box-shadow: 0 6px 16px rgba(21, 35, 221,.28); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-outline { border-color: var(--brand); color: var(--brand); background: #fff; }
.btn-outline:hover { background: var(--brand-50); }
.btn-ghost { background: #f3f4fb; color: var(--ink-2); border-color: var(--line); }
.btn-danger { background: #fff; color: var(--danger); border-color: #ffd5d2; }
.btn-danger:hover { background: #fff5f4; }
.btn-success { background: var(--ok); color: #fff; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
#btn-login { height: 48px; font-size: 16px; letter-spacing: 3px; font-weight: 600; }
.login-footer {
  position: absolute; bottom: 16px; left: 0; right: 0; text-align: center;
  color: rgba(255,255,255,.62); font-size: 12px; line-height: 1.7; padding: 0 16px;
}
.login-footer > div + div { color: rgba(255,255,255,.5); font-size: 11.5px; }
.login-view .login-card { position: relative; z-index: 2; }

/* 大屏登录页品牌区 */
.login-hero { display: none; color: #fff; max-width: 470px; position: relative; z-index: 2; }
.hero-badge { display: inline-block; font-size: 12px; letter-spacing: 2px; padding: 5px 12px; border-radius: 20px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.22); margin-bottom: 22px; }
.hero-title { font-size: 38px; line-height: 1.32; letter-spacing: 1px; font-weight: 700; }
.hero-desc { margin: 18px 0 22px; font-size: 14.5px; line-height: 1.85; color: rgba(255,255,255,.82); max-width: 420px; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-tags span { font-size: 13px; padding: 5px 13px; border-radius: 8px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.16); }
.hero-meta { display: flex; gap: 34px; margin-top: 40px; }
.hero-meta div { display: flex; flex-direction: column; }
.hero-meta b { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hero-meta small { font-size: 12px; color: rgba(255,255,255,.7); margin-top: 2px; }

@media (min-width: 1024px) {
  .login-view { justify-content: space-between; padding: 0 8vw 78px; }
  .login-hero { display: block; }
  .login-card { max-width: 400px; }
}

/* ---------------- 应用框架 ---------------- */
.app { min-height: 100%; }
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--nav-h);
  background: linear-gradient(135deg, #1523DD, #0f1bbf); color: #fff;
  display: flex; align-items: center; padding: 0 14px; gap: 8px;
  padding-top: env(safe-area-inset-top, 0px);
  box-shadow: 0 2px 12px rgba(0,0,140,.18);
}
.topbar-title { font-size: 16px; font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title .t-desc { font-weight: 400; opacity: .78; font-size: 13.5px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.who { font-size: 12.5px; opacity: .92; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { background: none; border: 0; color: #fff; cursor: pointer; padding: 6px; display: flex; border-radius: 9px; }
.icon-btn:active { background: rgba(255,255,255,.16); }
/* 退出系统：图标 + 文字，比普通图标按钮更醒目 */
.btn-logout {
  display: inline-flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 17px; border-radius: 11px; cursor: pointer;
  background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.42);
  color: #fff; font-size: 14.5px; font-weight: 600; letter-spacing: .4px; font-family: inherit;
  transition: background .15s, border-color .15s;
}
.btn-logout svg { opacity: .95; }
.btn-logout:hover { background: rgba(255,255,255,.28); border-color: rgba(255,255,255,.55); }
.btn-logout:active { transform: scale(.98); }
.btn-logout-side {
  margin-top: 8px; height: 41px; font-size: 14.5px; font-weight: 600; letter-spacing: .4px;
  background: #fff; color: var(--danger); border: 1px solid #ffd5d2;
}
.btn-logout-side:hover { background: #fff5f4; }

.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: 222px; z-index: 60;
  background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; transition: transform .25s ease;
}
.sidebar-head {
  height: var(--nav-h); display: flex; align-items: center; gap: 10px; padding: 0 14px;
  background: linear-gradient(135deg, #1523DD, #0f1bbf); color: #fff;
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex: 0 0 34px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; overflow: hidden; }
.brand-text b { font-size: 14px; }
.brand-text small { font-size: 11px; opacity: .8; }
.nav { flex: 1; overflow-y: auto; padding: 10px 10px 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  color: var(--ink-2); cursor: pointer; margin-bottom: 3px; font-size: 14.5px; position: relative;
}
.nav-item svg { flex: 0 0 20px; opacity: .8; }
.nav-item:hover { background: #f3f4fb; }
.nav-item.active { background: var(--brand-50); color: var(--brand); font-weight: 600; }
.nav-item.active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--brand); }
.nav-badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 11px; min-width: 18px; height: 18px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 5px; font-weight: 600; }
.sidebar-foot { padding: 10px; border-top: 1px solid var(--line); }
.ver { text-align: center; font-size: 11px; color: var(--ink-3); margin-top: 8px; }
.mask { position: fixed; inset: 0; background: rgba(10,14,40,.5); z-index: 55; opacity: 0; pointer-events: none; transition: opacity .2s; }
.mask.show { opacity: 1; pointer-events: auto; }

.main { margin-left: 222px; padding: 18px; min-height: calc(100vh - var(--nav-h)); }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: #fff; border-top: 1px solid var(--line);
  display: flex; padding-bottom: var(--safe-b);
  box-shadow: 0 -2px 12px rgba(16,24,64,.06);
}
.tab-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 7px 2px 6px; color: var(--ink-3); font-size: 11px; cursor: pointer; }
.tab-item.active { color: var(--brand); font-weight: 600; }
.tab-item svg { width: 22px; height: 22px; }
.fab {
  position: fixed; right: 16px; bottom: calc(72px + var(--safe-b)); z-index: 49;
  width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--brand-400), var(--brand)); color: #fff;
  box-shadow: 0 8px 22px rgba(21, 35, 221,.4); display: flex; align-items: center; justify-content: center;
}

/* ---------------- 通用组件 ---------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.page-head h2 { font-size: 19px; }
.page-head .desc { color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid #f0f1f7; }
.card + .card { margin-top: 14px; }
.card-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card-head h3 { font-size: 15px; }
.card-body { padding: 14px 16px; }
.grid { display: grid; gap: 18px; }
.grid > * { min-width: 0; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }

.form-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.form-item { margin-bottom: 14px; }
.form-item label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; font-weight: 500; }
.form-item label .req { color: var(--danger); margin-left: 2px; }
.form-item input, .form-item select, .form-item textarea {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 14.5px; outline: none; background: #fff; color: var(--ink);
  font-family: inherit; transition: border-color .15s, box-shadow .15s;
}
.form-item textarea { min-height: 92px; resize: vertical; line-height: 1.6; }
.form-item input:focus, .form-item select:focus, .form-item textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(21, 35, 221,.1);
}
.form-item select { appearance: none; background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23858aa5'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 20px; padding-right: 32px; }
.hint { font-size: 12px; color: var(--ink-3); margin-top: 4px; }

/* ---- 改善费用：自由输入 + 快捷标签 ---- */
.cost-field { position: relative; }
.cost-field input { padding-right: 34px; }
.cost-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; line-height: 1; border-radius: 50%; border: none; cursor: pointer;
  background: #eceefa; color: var(--ink-3); font-size: 16px; display: none;
}
.cost-field input:not(:placeholder-shown) ~ .cost-clear { display: block; }
.cost-clear:hover { background: #dfe2f4; color: var(--ink); }
.cost-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 14px; border-radius: 999px; font-size: 13px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  transition: all .15s; user-select: none;
}
.chip:hover { border-color: var(--brand-400); color: var(--brand); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(21, 35, 221,.22); }
.upload-block { background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 12px; padding: 12px 14px 14px; }
.upload-block .photo-add { background: #fff; }
.modal-foot textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px;
  font-size: 14px; min-height: 54px; max-height: 110px; resize: none; font-family: inherit;
  outline: none; color: var(--ink); background: #fbfcff;
}
.modal-foot textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(21, 35, 221,.1); background: #fff; }
.foot-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar .grow { flex: 1; min-width: 120px; }
.spacer { flex: 1; }

.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.filters label { font-size: 12px; color: var(--ink-2); display: block; margin-bottom: 4px; }
.filters select, .filters input {
  width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 9px; padding: 0 10px; font-size: 14px; outline: none; background: #fff;
}
.filters select:focus, .filters input:focus { border-color: var(--brand); }

table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th, table.tbl td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
table.tbl th { background: #fafbff; color: var(--ink-2); font-weight: 600; font-size: 13px; white-space: nowrap; position: sticky; top: 0; z-index: 1; }
table.tbl tbody tr:hover { background: #fafbff; }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* 可勾选表格 */
.tbl-select .col-chk { width: 40px; text-align: center; padding-left: 8px; padding-right: 4px; }
.tbl-select .col-chk input { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; vertical-align: middle; }
.tbl-select tbody tr.row-on { background: var(--brand-50); }

/* 行内操作按钮组（详情 / 修改 / 删除） */
.cell-actions { white-space: nowrap; display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
.row-acts { display: inline-flex; gap: 5px; flex-wrap: wrap; }
.btn.is-disabled { opacity: .45; cursor: not-allowed; }
/* 禁用态统一灰化，避免危险按钮看起来仍可点击 */
.btn-danger.is-disabled, .btn-outline.is-disabled {
  background: #f1f2f6; color: #9aa0b4; border-color: #e3e5ee; opacity: 1;
}
.tbl-select tbody tr.row-on:hover { background: #e2e4fb; }
.tbl-select td { white-space: nowrap; }
.tbl-select td:nth-child(3) { font-variant-numeric: tabular-nums; }
.cell-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 320px; }
.money { font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }

.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 8px; border-radius: 20px; background: #f0f1f8; color: var(--ink-2); white-space: nowrap; }
.tag-blue { background: var(--brand-100); color: var(--brand); }
.tag-green { background: #e6f8ef; color: #07783d; }
.tag-orange { background: #fff2e0; color: #b25e09; }
.tag-red { background: #ffeceb; color: #c4271c; }
.tag-gray { background: #f0f1f5; color: var(--ink-2); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(166px, 1fr)); gap: 12px; }
.stat-grid.cols4 { grid-template-columns: repeat(4, 1fr); }
@media (min-width: 901px) {
  .grid.charts > *:first-child { padding-right: 22px; }
}
.stat-grid.cols3 { grid-template-columns: repeat(3, 1fr); }
.stat-card { background: #fff; border-radius: var(--radius); padding: 14px 16px; border: 1px solid #eceafd; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; right: -18px; top: -18px; width: 70px; height: 70px; border-radius: 50%; background: rgba(21, 35, 221, .13); }
.stat-card .k { font-size: 12.5px; color: var(--ink-3); position: relative; z-index: 1; }
.stat-card .v { font-size: 21px; font-weight: 700; color: var(--ink); margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.3px; position: relative; z-index: 1; white-space: nowrap; }
.stat-card .sub { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.stat-card .ico { position: absolute; right: 14px; top: 14px; color: var(--brand); opacity: .25; }
.stat-card.accent { border-color: #d9d8fb; }
.stat-card.accent::after { background: rgba(21, 35, 221, .22); }

.empty { text-align: center; padding: 46px 16px; color: var(--ink-3); }
.empty svg { opacity: .35; margin-bottom: 8px; }

/* 列表卡片（移动端） */
.plist { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 1000px) { .plist { grid-template-columns: repeat(2, 1fr); gap: 12px; } }
.pcard {
  background: #fff; border: 1px solid #eef0f7; border-radius: var(--radius); padding: 12px 14px;
  box-shadow: var(--shadow); cursor: pointer; transition: .15s;
}
.pcard:active { transform: scale(.995); }
.pcard-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.pcard-no { font-weight: 700; color: var(--brand); font-size: 14px; font-variant-numeric: tabular-nums; }
.pcard-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; line-height: 1.45; }
.pcard-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--ink-3); }
.pcard-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 13px; }

/* 照片 */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.photo-detail { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.photo-item { position: relative; aspect-ratio: 1/1; border-radius: 10px; overflow: hidden; background: #f2f3f8; border: 1px solid var(--line); }
.photo-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-del { position: absolute; right: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; border: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 15px; line-height: 1; }
.photo-add {
  aspect-ratio: 1/1; border: 1.5px dashed var(--brand-200); border-radius: 10px; background: var(--brand-50);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--brand); font-size: 12px; cursor: pointer;
}
.photo-add:active { background: var(--brand-100); }
.section-title { font-size: 14px; font-weight: 600; margin: 16px 0 8px; display: flex; align-items: center; gap: 6px; }
.section-title::before { content: ""; width: 3px; height: 14px; background: var(--brand); border-radius: 2px; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }

/* 详情抽屉/弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(10,14,40,.5); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 0; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 520px; max-height: 88vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-lg); }
.modal-head { padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 16px; }
.modal-body { padding: 14px 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal-foot { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; padding-bottom: calc(12px + var(--safe-b)); }
.close-x { background: none; border: 0; font-size: 22px; color: var(--ink-3); cursor: pointer; line-height: 1; }

.kv { display: grid; grid-template-columns: 92px 1fr; gap: 8px 10px; font-size: 14px; }
.kv .k { color: var(--ink-3); }
.kv .v { color: var(--ink); word-break: break-word; }

/* Toast / Loading */
.toast {
  position: fixed; left: 50%; top: 22%; transform: translate(-50%, -10px);
  background: rgba(18,20,43,.92); color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 14px; z-index: 500; opacity: 0; pointer-events: none; transition: .22s; max-width: 80vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.loading { position: fixed; inset: 0; background: rgba(255,255,255,.55); z-index: 400; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 10px; color: var(--brand); font-size: 14px; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--brand-200); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 分页 */
.pager { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 0; font-size: 13px; color: var(--ink-2); }
.pager button { height: 32px; min-width: 32px; padding: 0 10px; border: 1px solid var(--line); background: #fff; border-radius: 8px; cursor: pointer; color: var(--ink-2); }
.pager button:disabled { opacity: .45; cursor: not-allowed; }
.pager .cur { background: var(--brand); color: #fff; border-color: var(--brand); }

/* 图表 */
.chart-legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--ink-2); margin-top: 10px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }
.bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; font-size: 13px; }
.bar-label { width: 156px; flex: 0 0 156px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.bar-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1; min-width: 0; height: 18px; background: #f1f2f8; border-radius: 9px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 9px; background: linear-gradient(90deg, var(--brand-400), var(--brand)); transition: width .6s ease; }
.bar-val { flex: 0 0 auto; text-align: right; color: var(--brand); font-weight: 600; font-variant-numeric: tabular-nums; font-size: 12.5px; white-space: nowrap; }

/* ---------------- 响应式：移动端 ---------------- */
@media (max-width: 900px) {
  body { font-size: 14.5px; }
  .only-mobile { display: flex; }
  .tabbar { display: flex; }
  .fab { display: flex; }
  .sidebar { transform: translateX(-100%); width: 250px; }
  .sidebar.open { transform: translateX(0); }
  .topbar-title { font-size: 15px; }
  .topbar-title .t-desc { display: none; }
  .who { display: none; }
  .btn-logout { height: 37px; padding: 0 13px; font-size: 13.5px; gap: 5px; border-radius: 10px; }
  .btn-logout svg { width: 18px; height: 18px; }
  .main { margin-left: 0; padding: 12px 12px calc(88px + var(--safe-b)); }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .g2, .g3, .g4 { grid-template-columns: repeat(2, 1fr); }
  .stat-grid, .stat-grid.cols3, .stat-grid.cols4 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 12px 13px; }
  .stat-card .v { font-size: 18px; }
  .stat-card .v { overflow: hidden; text-overflow: ellipsis; }
  .filters { grid-template-columns: repeat(2, 1fr); }
  .card { border-radius: 12px; }
  .login-card { padding: 26px 20px 20px; border-radius: 18px; }
  .login-view { padding: 20px 14px 74px; }
  .login-footer { bottom: 12px; font-size: 11px; line-height: 1.65; }
  .login-footer > div + div { font-size: 10.5px; }
  .photo-grid { grid-template-columns: repeat(3, 1fr); }
  .photo-detail { grid-template-columns: repeat(2, 1fr); }
  .modal-mask { align-items: flex-end; padding: 0; }
  .modal { max-width: 100%; border-radius: 16px 16px 0 0; max-height: 92vh; }
  .kv { grid-template-columns: 84px 1fr; }
  .cell-clamp { max-width: 180px; }
  .grid.charts { grid-template-columns: 1fr; }
  .bar-label { width: 132px; flex: 0 0 132px; font-size: 12px; }
  .bar-val { font-size: 11.5px; }
}
@media (min-width: 901px) {
  .only-mobile { display: none !important; }
  .topbar { margin-left: 222px; }
}
@media (max-width: 380px) {
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ================= 分析报告（报表预览） ================= */
.rpt { background: #fff; border: 1px solid #e3e8f0; border-radius: 10px; overflow: hidden; }
.rpt-title {
  background: linear-gradient(180deg, #16ab55, #0f9447);
  color: #fff; text-align: center; font-size: 19px; font-weight: 700;
  padding: 13px 10px; letter-spacing: .5px;
}
.rpt-period {
  background: #f2f8f4; color: #4b5a72; font-size: 12.5px;
  padding: 7px 14px; border-bottom: 1px solid #e3eee7;
}
.rpt-summary {
  display: grid; grid-template-columns: repeat(6, 1fr);
  border-bottom: 1px solid #e3e8f0;
}
.rpt-sum-item { padding: 12px 10px; text-align: center; border-right: 1px solid #eef1f7; }
.rpt-sum-item:last-child { border-right: none; }
.rpt-sum-item .k { font-size: 11.5px; color: #6b7590; line-height: 1.35; }
.rpt-sum-item .v { font-size: 21px; font-weight: 700; color: #1b2440; margin-top: 4px; font-variant-numeric: tabular-nums; }
.rpt-sum-item .v.green { color: #0f9447; }
.rpt-sum-item .v.orange { color: #d97706; }
.rpt-sum-item .v.brand { color: #1523DD; font-size: 18px; }

.rpt-section {
  margin: 16px 14px 8px; font-size: 13.5px; font-weight: 700; color: #0b5d2e;
  padding-left: 9px; border-left: 3px solid #16ab55; line-height: 1.2;
}
.rpt-sub {
  margin: 12px 14px 6px; font-size: 12.5px; font-weight: 600; color: #0b5d2e;
  padding-left: 8px; border-left: 3px solid #9ed3b2; line-height: 1.2;
}
.rpt-wrap { margin: 0 14px; overflow-x: auto; }
.rpt-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.rpt-tbl th {
  background: #eaf6ee; color: #0b5d2e; font-weight: 600;
  padding: 7px 8px; text-align: center; border: 1px solid #cfe6d8; white-space: nowrap;
}
.rpt-tbl td { padding: 6px 8px; border: 1px solid #dfeae3; color: #22304a; }
.rpt-tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.rpt-tbl td.left { text-align: left; }
.rpt-tbl tbody tr:nth-child(even) { background: #fbfdfc; }
.rpt-tbl tr.rpt-total td { background: #eaf6ee; font-weight: 700; color: #0b5d2e; }
.rpt-point { display: block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 价值计算依据：整段完整显示（自动换行），不再截断成省略号 */
.rpt-basis { display: block; min-width: 220px; max-width: 460px; white-space: normal; word-break: break-word; line-height: 1.6; }
.rpt-text { margin: 0 14px 6px; }
.rpt-text p { font-size: 13px; line-height: 1.9; color: #22304a; margin: 0 0 2px; }
.rpt-text p b { color: #1523DD; font-weight: 600; margin-right: 2px; }
.rpt-text p.rpt-sug { padding-left: 2px; }

.btn-ai {
  background: linear-gradient(135deg, #4254ff, #1523DD);
  color: #fff; border: none; box-shadow: 0 3px 10px rgba(21, 35, 221,.25);
}
.btn-ai:hover { filter: brightness(1.08); }
.btn-ai:disabled { opacity: .65; cursor: default; }

.filters-report { grid-template-columns: repeat(3, minmax(140px, 220px)) !important; }
.hint-inline { display: inline-block; font-size: 13px; color: var(--ink-3); padding-top: 9px; }

@media (max-width: 900px) {
  .rpt-title { font-size: 15.5px; padding: 11px 8px; }
  .rpt-summary { grid-template-columns: repeat(2, 1fr); }
  .rpt-sum-item { border-bottom: 1px solid #eef1f7; }
  .rpt-sum-item:nth-child(2n) { border-right: none; }
  .rpt-tbl { font-size: 11.5px; }
  .rpt-tbl th, .rpt-tbl td { padding: 5px 6px; }
  .rpt-wrap { margin: 0 10px; }
  .rpt-text { margin: 0 10px 6px; }
  .rpt-text p { font-size: 12.5px; line-height: 1.8; }
  .filters-report { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ================= 权限矩阵 ================= */
.perm-box { overflow-x: auto; }
.perm-tbl th, .perm-tbl td { text-align: center; }
.perm-tbl td:nth-child(1), .perm-tbl td:nth-child(2) { text-align: left; }
.perm-tbl th:nth-child(1), .perm-tbl th:nth-child(2) { text-align: left; }
.perm-cell { text-align: center !important; }
.perm-check { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.perm-check input { width: 17px; height: 17px; accent-color: #1523DD; cursor: pointer; }
.perm-check.lock input { cursor: not-allowed; opacity: .5; }
.perm-tbl tbody tr:hover { background: #fafbff; }

@media (max-width: 900px) {
  .tbl-select .col-chk {
    position: sticky; left: 0; z-index: 3; background: #fff;
    box-shadow: 4px 0 6px -4px rgba(16,24,64,.18);
  }
  .tbl-select tbody tr.row-on .col-chk { background: var(--brand-50); }
  .tbl-select thead th.col-chk { background: #fafbff; }
  .rpt-tbl { min-width: 560px; }
  .rpt-wrap { padding-bottom: 4px; }
}

/* ================= v8 · 汇总看板 KPI 卡片：科技蓝 ================= */
.stat-card {
  background: linear-gradient(135deg, #101a66 0%, #1523DD 52%, #3a47ff 100%);
  border: 1px solid rgba(150, 170, 255, .34);
  box-shadow: 0 8px 22px -6px rgba(16, 24, 120, .45), inset 0 1px 0 rgba(255, 255, 255, .14);
  color: #fff;
  isolation: isolate;
  transition: transform .18s ease, box-shadow .18s ease;
}
.stat-card::before {                    /* 科技网格纹理 */
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .10) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(160deg, #000 0%, transparent 70%);
  mask-image: linear-gradient(160deg, #000 0%, transparent 70%);
  opacity: .85;
}
.stat-card::after {                     /* 右上角科技光核 + 双环 */
  right: -22px; top: -30px; width: 92px; height: 92px; border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, transparent 44%, rgba(162, 176, 255, .32) 46%, transparent 49%),
    radial-gradient(circle at 50% 50%, transparent 66%, rgba(162, 176, 255, .20) 68%, transparent 71%),
    radial-gradient(circle at 42% 42%, rgba(186, 196, 255, .92) 0%, rgba(58, 71, 255, .45) 46%, rgba(21, 35, 221, 0) 74%);
}
.stat-card > * { position: relative; z-index: 1; }
.stat-card .k { color: rgba(230, 233, 255, .86); }
.stat-card .v { color: #fff; text-shadow: 0 1px 10px rgba(0, 18, 66, .38); }
.stat-card .sub { color: rgba(202, 209, 255, .76); }
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px -10px rgba(16, 24, 120, .58), inset 0 1px 0 rgba(255, 255, 255, .2);
}
/* 强调卡（年创造价值 / 净收益）：偏青蓝的高光 */
.stat-card.accent {
  border-color: rgba(162, 176, 255, .56);
  background: linear-gradient(135deg, #0d1660 0%, #1e2ee8 46%, #4254ff 100%);
}
/* 已通过：原绿色卡统一为科技蓝，避免与整体割裂 */
.stat-card.tag-green {
  background: linear-gradient(135deg, #101a66 0%, #1523DD 52%, #3a47ff 100%);
  color: #fff;
}

/* ================= v9 · 首页（年度 / 月度 / 5日 分析报告） ================= */
.home-hero {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
}
.home-hero .home-hello { font-size: 18px; font-weight: 700; letter-spacing: .3px; }
.home-hero .home-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.home-quick { display: flex; gap: 8px; flex-wrap: wrap; }
.home-quick .qb {
  display: flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 13px; border-radius: 10px;
  border: 1px solid var(--line); background: #f7f8fd; color: var(--ink-2);
  font-size: 13.5px; font-family: inherit; cursor: pointer;
  transition: all .16s ease;
}
.home-quick .qb:hover {
  border-color: var(--brand-200); color: var(--brand);
  background: var(--brand-50); box-shadow: 0 4px 12px -4px rgba(21, 35, 221, .22);
}
.home-quick .qb svg { opacity: .85; }

.hp-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.hp-tabs .hpt {
  height: 38px; padding: 0 18px; border-radius: 10px;
  border: 1px solid var(--line); background: #f7f8fd; color: var(--ink-2);
  font-size: 14px; font-weight: 500; font-family: inherit; cursor: pointer;
  transition: all .16s ease;
}
.hp-tabs .hpt:hover { border-color: var(--brand-200); color: var(--brand); background: var(--brand-50); }
.hp-tabs .hpt.on {
  background: linear-gradient(135deg, var(--brand-400), var(--brand));
  color: #fff; border-color: var(--brand);
  box-shadow: 0 6px 16px -6px rgba(21, 35, 221, .5);
}

.hp-sub {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 12px; padding: 10px 12px;
  background: #f7f8fd; border: 1px solid var(--line); border-radius: 10px;
}
.hp-sub label { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.hp-sub select {
  height: 34px; padding: 0 30px 0 10px; border-radius: 9px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  font-size: 13.5px; font-family: inherit; cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23858aa5'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 20px;
}
.hp-sub select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(21, 35, 221, .12); }
.hp-sep { width: 1px; height: 22px; background: var(--line); }
.hp-segs { display: flex; gap: 7px; flex-wrap: wrap; }
.hp-segs .sg {
  height: 34px; padding: 0 12px; border-radius: 9px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  font-size: 13px; font-family: inherit; cursor: pointer;
  transition: all .16s ease; white-space: nowrap;
}
.hp-segs .sg:hover { border-color: var(--brand-200); color: var(--brand); }
.hp-segs .sg.on {
  background: var(--brand); border-color: var(--brand); color: #fff;
  box-shadow: 0 4px 12px -4px rgba(21, 35, 221, .4);
}
.hp-report { margin-top: 14px; }

@media (max-width: 900px) {
  .home-hero .home-hello { font-size: 16.5px; }
  .home-quick .qb { height: 34px; padding: 0 11px; font-size: 13px; }
  .hp-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .hp-tabs .hpt { height: 36px; padding: 0 4px; font-size: 12.5px; min-width: 0; text-align: center; }
  .hp-sub { padding: 9px 10px; }
  .hp-sep { display: none; }
  .hp-segs .sg { height: 32px; padding: 0 10px; font-size: 12.5px; }
}

/* ================= 培训模块 ================= */
.form-row > .form-item.span2 { grid-column: span 2; }
.inp-sm {
  border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px;
  font-size: 13.5px; font-family: inherit; color: var(--ink); background: #fff; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.inp-sm:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(21, 35, 221, .1); }

/* 签到二维码弹窗 */
.qr-box { display: flex; gap: 16px; align-items: flex-start; }
.qr-box img { width: 190px; height: 190px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.qr-info { flex: 1; min-width: 0; }
.qr-topic { font-size: 15.5px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.qr-meta { font-size: 13px; color: var(--ink-3); margin-bottom: 8px; }
.qr-url {
  font-size: 12.5px; color: var(--brand); background: var(--brand-50); border: 1px dashed var(--brand-200);
  border-radius: 8px; padding: 6px 8px; word-break: break-all; margin-bottom: 8px;
}
.qr-tip { font-size: 12.5px; color: var(--ink-2); line-height: 1.7; }

/* ============ 培训签到页（扫码进入，无需登录） ============ */
.signin-view {
  min-height: 100vh; background: linear-gradient(180deg, #f4f6fb 0%, #eef1fb 100%);
  padding: 18px 14px calc(24px + var(--safe-b));
}
.sg-loading { text-align: center; color: var(--ink-3); padding: 60px 0; font-size: 14px; }
.sg-wrap { max-width: 560px; margin: 0 auto; }
.sg-head { text-align: center; padding: 10px 0 16px; }
.sg-badge {
  display: inline-block; background: var(--brand); color: #fff; font-size: 12px;
  padding: 4px 12px; border-radius: 999px; letter-spacing: .5px; margin-bottom: 10px;
}
.sg-topic { margin: 0; font-size: 19px; line-height: 1.45; color: var(--ink); }
.sg-sub { margin-top: 6px; font-size: 12.5px; color: var(--ink-3); }
.sg-card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px; margin-bottom: 12px;
}
.sg-card-title { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.sg-row { display: flex; gap: 10px; font-size: 14px; padding: 5px 0; }
.sg-k { width: 74px; flex: none; color: var(--ink-3); }
.sg-v { flex: 1; color: var(--ink); word-break: break-all; }
.sg-content { font-size: 14px; line-height: 1.85; color: var(--ink-2); white-space: pre-wrap; }
.sg-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.sg-photos img { width: 100%; height: 84px; object-fit: cover; border-radius: 8px; background: #f0f2f7; }
.sg-foot { text-align: center; font-size: 12px; color: var(--ink-3); padding: 6px 0 4px; }
.sg-tip { text-align: center; color: var(--ink-2); font-size: 13.5px; }
.sg-error, .sg-done { text-align: center; padding: 28px 18px; }
.sg-err-icon, .sg-done-icon {
  width: 54px; height: 54px; border-radius: 50%; margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; color: #fff;
}
.sg-err-icon { background: var(--danger); }
.sg-done-icon { background: var(--ok); }
.sg-error h3, .sg-done h3 { margin: 0 0 6px; font-size: 17px; color: var(--ink); }
.sg-error p, .sg-done p { margin: 0; font-size: 14px; color: var(--ink-2); }
.sg-done-meta { margin-top: 10px; font-size: 13.5px; color: var(--ink); }
.sg-done-tip { margin-top: 10px; font-size: 12.5px; color: var(--ink-3); }

@media (max-width: 900px) {
  .form-row > .form-item.span2 { grid-column: auto; }
  .qr-box { flex-direction: column; align-items: center; }
  .qr-box img { width: 200px; height: 200px; }
  .qr-info { width: 100%; }
}

/* ---------------- 精益包装模块 ---------------- */
.pkg-sum {
  display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px;
}
.pkg-sum-item {
  flex: 1 1 150px; padding: 10px 14px; border-radius: 10px;
  background: #f7f8fd; border: 1px solid var(--line);
}
.pkg-sum-item .k { font-size: 12.5px; color: var(--ink-3); }
.pkg-sum-item .v { font-size: 18px; font-weight: 700; margin-top: 3px; color: var(--ink); }
.pkg-sum-item .v.brand { color: var(--brand); }
/* 自动计算字段：只读且高亮，便于与手填项区分 */
.pkg-calc {
  background: #f1f5ff !important; color: var(--brand) !important;
  font-weight: 700 !important; cursor: default;
}
@media (max-width: 900px) {
  .pkg-sum-item { flex: 1 1 100%; }
}
