:root {
  --green: #1f7a4d;
  --green-dark: #155c39;
  --green-soft: #e8f4ec;
  --green-line: #cfe6d7;
  --orange: #ef8b2e;
  --orange-soft: #fdf1e2;
  --bg: #f4f7f4;
  --card: #ffffff;
  --text: #1e2d27;
  --muted: #6c7d75;
  --border: #e3ebe5;
  --danger: #c0392b;
  --danger-soft: #fdeceb;
  --warning: #b7791f;
  --warning-soft: #fdf6e7;
  --blue: #2f6f9f;
  --blue-soft: #eaf2f8;
  --shadow: 0 10px 30px rgba(31, 77, 52, 0.08);
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--green); text-decoration: none; }
button { font-family: inherit; }
input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 122, 77, .12);
}
textarea { resize: vertical; min-height: 90px; }
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
label.field > span em { color: var(--danger); font-style: normal; margin-left: 2px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all .18s;
  background: #fff;
  color: var(--text);
  white-space: nowrap;
  line-height: 1.2;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--green); color: #fff; box-shadow: 0 6px 16px rgba(31, 122, 77, .22); }
.btn-primary:hover { background: var(--green-dark); }
.btn-ghost { border-color: var(--border); background: #fff; }
.btn-ghost:hover { border-color: var(--green); color: var(--green); }
.btn-soft { background: var(--green-soft); color: var(--green); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn-icon { width: 34px; height: 34px; padding: 0; border-radius: 9px; }
.btn svg { width: 16px; height: 16px; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: #f7faf8; }
.login-brand {
  position: relative;
  overflow: hidden;
  background: linear-gradient(150deg, #174d31 0%, #1f7a4d 52%, #2f8f5d 100%);
  color: #fff;
  padding: 64px 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-brand::before, .login-brand::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.12);
}
.login-brand::before { width: 520px; height: 520px; right: -180px; top: -160px; }
.login-brand::after { width: 760px; height: 760px; right: -300px; top: -280px; }
.brand-logo { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 700; letter-spacing: 1px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px;
  background: rgba(255,255,255,.16);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.22);
}
.brand-mark svg { width: 24px; height: 24px; }
.login-brand h1 { font-size: 40px; line-height: 1.25; margin: 0 0 18px; font-weight: 700; letter-spacing: 1px; position: relative; }
.login-brand p.lead { font-size: 16px; color: rgba(255,255,255,.82); max-width: 460px; margin: 0 0 34px; }
.login-points { display: grid; gap: 16px; position: relative; }
.login-points div { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: rgba(255,255,255,.9); }
.login-points .dot { width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.16); display: flex; align-items: center; justify-content: center; flex: none; font-size: 12px; }
.login-foot { font-size: 12px; color: rgba(255,255,255,.6); position: relative; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: 26px; margin: 0 0 6px; }
.login-card .sub { color: var(--muted); margin-bottom: 30px; }
.login-card .btn-primary { width: 100%; padding: 12px; font-size: 15px; margin-top: 6px; }
.login-hint { margin-top: 22px; padding: 14px 16px; background: var(--green-soft); border-radius: 10px; color: var(--green-dark); font-size: 12.5px; line-height: 1.7; }

/* ---------- Shell ---------- */
.shell { min-height: 100vh; }
.sidebar {
  position: fixed; z-index: 40;
  left: 0; top: 0; bottom: 0;
  width: 236px;
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  transition: transform .25s;
}
.sidebar-brand { padding: 22px 22px 18px; display: flex; align-items: center; gap: 11px; }
.sidebar-brand .brand-mark { background: var(--green); color: #fff; width: 38px; height: 38px; border-radius: 11px; }
.sidebar-brand .name { font-weight: 700; font-size: 16px; letter-spacing: .5px; }
.sidebar-brand .tag { font-size: 10.5px; color: var(--muted); letter-spacing: 1.5px; }
.side-nav { flex: 1; overflow-y: auto; padding: 8px 12px; }
.side-nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 10px;
  color: #4d5f57; font-size: 14px; margin-bottom: 3px;
  transition: all .16s;
}
.side-nav a svg { width: 18px; height: 18px; color: #7d8f86; transition: color .16s; }
.side-nav a:hover { background: #f4f8f5; color: var(--green); }
.side-nav a.active { background: var(--green-soft); color: var(--green-dark); font-weight: 600; }
.side-nav a.active svg { color: var(--green); }
.side-nav .group-title { font-size: 11px; color: #9aa9a1; padding: 16px 12px 6px; letter-spacing: 1.5px; }
.sidebar-foot { padding: 14px; border-top: 1px solid var(--border); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; }
.user-chip .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--green-soft); color: var(--green-dark); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.user-chip .meta { flex: 1; min-width: 0; }
.user-chip .meta b { display: block; font-size: 13px; }
.user-chip .meta span { display: block; font-size: 11px; color: var(--muted); }
.user-chip .logout { background: none; border: none; color: #93a29a; cursor: pointer; padding: 6px; border-radius: 8px; }
.user-chip .logout:hover { color: var(--danger); background: var(--danger-soft); }

.main { margin-left: 236px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: 64px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px; padding: 0 28px;
}
.topbar h2 { font-size: 17px; margin: 0; font-weight: 600; }
.topbar .crumb { font-size: 12.5px; color: var(--muted); }
.topbar .spacer { flex: 1; }
.menu-btn { display: none; background: #fff; border: 1px solid var(--border); border-radius: 9px; width: 38px; height: 38px; align-items: center; justify-content: center; cursor: pointer; }
.content { padding: 26px 28px 60px; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: .3px; }
.page-head p { margin: 0; color: var(--muted); font-size: 13px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 16px; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 18px 16px; position: relative; overflow: hidden; }
.stat-card .ic { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; background: var(--green-soft); color: var(--green); margin-bottom: 14px; }
.stat-card .ic svg { width: 19px; height: 19px; }
.stat-card .label { color: var(--muted); font-size: 12.5px; }
.stat-card .value { font-size: 28px; font-weight: 700; letter-spacing: .5px; line-height: 1.2; margin-top: 2px; }
.stat-card .value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.stat-card .hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.stat-card.accent .ic { background: var(--orange-soft); color: var(--orange); }
.stat-card.info .ic { background: var(--blue-soft); color: var(--blue); }
.stat-card.danger .ic { background: var(--danger-soft); color: var(--danger); }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(31, 77, 52, .02); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card-head .sub { font-size: 12px; color: var(--muted); }
.card-body { padding: 18px; }
.two-col { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; }
.two-col-even { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- Chart ---------- */
.chart-wrap { padding: 6px 4px 0; }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); padding: 4px 10px 0; }
.chart-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--green); margin-right: 6px; }

.region-list { display: grid; gap: 14px; }
.region-item .row { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.region-item .row span:last-child { color: var(--muted); }
.region-bar { height: 7px; border-radius: 5px; background: #eef4ef; overflow: hidden; }
.region-bar i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, #2f8f5d, #7fc49a); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 11px 16px; background: #f8fbf8; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data td { padding: 13px 16px; border-bottom: 1px solid #eef4ef; vertical-align: middle; }
table.data tbody tr:hover { background: #fafdfb; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data .mono { font-family: "SFMono-Regular", Consolas, monospace; font-size: 12.5px; letter-spacing: .3px; }
table.data .strong { font-weight: 600; }
table.data .muted { color: var(--muted); font-size: 12.5px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.link { color: var(--green); cursor: pointer; font-weight: 500; }
.link:hover { text-decoration: underline; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.green { background: var(--green-soft); color: var(--green-dark); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.orange { background: var(--warning-soft); color: var(--warning); }
.badge.gray { background: #f0f3f1; color: var(--muted); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.plain::before { display: none; }

/* ---------- Filters ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters input, .filters select { width: auto; min-width: 150px; }
.filters .search { min-width: 240px; }
.filters .spacer { flex: 1; }

/* ---------- Modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(18, 38, 28, .45); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow-y: auto; animation: fade .16s ease; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 620px; box-shadow: 0 30px 70px rgba(0,0,0,.2); animation: pop .18s ease; margin: auto 0; }
.modal.wide { max-width: 900px; }
.modal.narrow { max-width: 440px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px 14px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-head p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }
.modal-close { border: none; background: #f3f6f4; width: 32px; height: 32px; border-radius: 9px; cursor: pointer; color: var(--muted); font-size: 18px; line-height: 1; flex: none; }
.modal-close:hover { background: #e9efeb; color: var(--text); }
.modal-body { padding: 20px 22px; }
.modal-foot { padding: 14px 22px 20px; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.form-note { font-size: 12px; color: var(--muted); margin-top: -6px; margin-bottom: 14px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); padding: 0 18px; }
.tabs button { background: none; border: none; padding: 14px 14px 12px; font-size: 14px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tabs button.active { color: var(--green-dark); border-bottom-color: var(--green); }

/* ---------- Detail ---------- */
.detail-hero { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 16px; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.detail-hero h1 { margin: 0 0 8px; font-size: 22px; }
.detail-hero .meta { display: flex; gap: 20px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.detail-hero .meta b { color: var(--text); font-weight: 600; }
.kv { display: grid; grid-template-columns: 92px 1fr; gap: 10px 12px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.mini-stat { background: #f8fbf8; border: 1px solid #eef4ef; border-radius: 11px; padding: 12px 14px; }
.mini-stat b { display: block; font-size: 20px; line-height: 1.3; }
.mini-stat span { font-size: 12px; color: var(--muted); }

.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: #e3eee7; }
.timeline-item { position: relative; padding: 0 0 20px; }
.timeline-item::before { content: ""; position: absolute; left: -24px; top: 5px; width: 11px; height: 11px; border-radius: 50%; background: #fff; border: 3px solid var(--green); }
.timeline-item .t-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.timeline-item .t-head b { font-size: 14px; }
.timeline-item .t-head span { font-size: 12px; color: var(--muted); }
.timeline-item p { margin: 5px 0 0; font-size: 13.5px; color: #46574f; }
.timeline-item .del { margin-left: auto; }

/* ---------- Report items ---------- */
.report-banner { display: flex; align-items: center; gap: 18px; padding: 18px; border-radius: 12px; background: var(--green-soft); border: 1px solid var(--green-line); margin-bottom: 16px; }
.report-banner.bad { background: var(--danger-soft); border-color: #f3cfcb; }
.report-banner .seal { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--green); color: #fff; font-weight: 700; font-size: 15px; flex: none; }
.report-banner.bad .seal { background: var(--danger); }
.report-banner h3 { margin: 0 0 3px; font-size: 19px; }
.report-banner p { margin: 0; font-size: 13px; color: #4d6357; }
.report-banner.bad p { color: #7d3f38; }
.report-banner .spacer { flex: 1; }
.item-grid { display: grid; gap: 10px; }
.item-row { display: grid; grid-template-columns: 1.1fr 1fr 1fr .8fr; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 10px; background: #f8fbf8; font-size: 13px; }
.item-row .nm { font-weight: 600; }
.item-row .vals { color: var(--muted); }
.item-row .ok { color: var(--green); font-weight: 600; }
.item-row .no { color: var(--danger); font-weight: 600; }
.item-row.bad { background: var(--danger-soft); }

/* ---------- Code cells ---------- */
.code-pill { font-family: Consolas, monospace; background: #f3f8f4; border: 1px dashed #cfe3d7; border-radius: 7px; padding: 2px 8px; font-size: 12.5px; letter-spacing: .5px; }

/* ---------- Empty ---------- */
.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty .ic { width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 50%; background: #f1f6f2; display: flex; align-items: center; justify-content: center; color: #a6b7ad; }
.empty .ic svg { width: 26px; height: 26px; }
.empty h4 { margin: 0 0 4px; color: var(--text); font-size: 15px; }
.empty p { margin: 0 0 14px; font-size: 13px; }

/* ---------- Pagination ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.pager .pages { display: flex; gap: 6px; }
.pager button { border: 1px solid var(--border); background: #fff; border-radius: 8px; min-width: 32px; height: 32px; cursor: pointer; color: var(--text); }
.pager button.active { background: var(--green); color: #fff; border-color: var(--green); }
.pager button:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Toast ---------- */
#toast-box { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #1f2d27; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 13.5px; box-shadow: 0 12px 30px rgba(0,0,0,.18); animation: drop .2s ease; max-width: 90vw; }
.toast.ok { background: var(--green-dark); }
.toast.err { background: var(--danger); }
.toast.warn { background: #8a6416; }

/* ---------- QR ---------- */
.qr-box { text-align: center; padding: 18px; }
.qr-box .code { font-family: Consolas, monospace; font-size: 16px; letter-spacing: 1px; margin-top: 12px; font-weight: 600; }
.qr-box canvas, .qr-box img { border-radius: 8px; }
.qr-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.qr-label { border: 1px dashed #b9d3c2; border-radius: 10px; padding: 10px; text-align: center; break-inside: avoid; }
.qr-label .code { font-family: Consolas, monospace; font-size: 11px; margin-top: 5px; letter-spacing: .5px; }
.qr-label .batch { font-size: 10px; color: var(--muted); }
.qr-label img, .qr-label canvas { width: 100% !important; height: auto !important; max-width: 110px; }

/* ---------- Misc ---------- */
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
.loading-page { padding: 80px; text-align: center; color: var(--muted); }
.loading-page .spin { width: 30px; height: 30px; border: 3px solid #dbe9df; border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 12px; }
.alert-list { display: grid; gap: 10px; }
.alert-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--warning-soft); border: 1px solid #f0e3c4; font-size: 13px; }
.alert-item.red { background: var(--danger-soft); border-color: #f3d6d2; }
.alert-item .ico { flex: none; width: 26px; height: 26px; border-radius: 8px; background: rgba(183,121,31,.14); color: var(--warning); display: flex; align-items: center; justify-content: center; }
.alert-item.red .ico { background: rgba(192,57,43,.12); color: var(--danger); }
.alert-item b { display: block; font-size: 13px; }
.alert-item span { color: var(--muted); font-size: 12px; }
.hide { display: none !important; }
.text-right { text-align: right; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mb16 { margin-bottom: 16px; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { background: #f2f7f3; border: 1px solid #e4eee7; border-radius: 7px; padding: 2px 9px; font-size: 12px; color: #53655c; }

.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.category-card .card-head h3 { display: flex; align-items: center; gap: 8px; }
.item-edit { display: grid; grid-template-columns: 1.2fr 1fr 1fr .8fr .8fr 34px; gap: 8px; align-items: center; padding: 5px 0; }
.item-edit input, .item-edit select { padding: 7px 9px; font-size: 13px; }
.item-edit .btn-icon { width: 32px; height: 32px; }
.item-edit > span { font-size: 12px; color: var(--muted); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.99); } }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } }

/* ---------------- 页面装修编辑器 ---------------- */
.pe-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.pe-main { min-width: 0; }
.pe-toolbar { padding: 14px 16px; background: #f2f8f4; border: 1px solid #e2efe7; }
.pe-hint { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #4d6357; line-height: 1.6; }
.pe-hint svg { width: 16px; height: 16px; color: #1f7a4d; flex: none; }
.pe-block { padding: 0; overflow: hidden; }
.pe-block-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: #f7faf8; border-bottom: 1px solid #edf3ee; }
.pe-type { font-size: 13px; font-weight: 600; color: #1f7a4d; background: #e6f4eb; border-radius: 6px; padding: 3px 10px; }
.pe-block-idx { font-size: 12px; color: #9aa9a1; }
.pe-block-actions { display: flex; gap: 4px; }
.pe-body { padding: 16px; }
.pe-body .field:last-child { margin-bottom: 0; }
.pe-empty { text-align: center; padding: 44px 20px; color: #7b8b83; }
.pe-empty svg { width: 40px; height: 40px; color: #b7c8be; margin-bottom: 10px; }
.pe-empty b { display: block; color: #1e2d27; font-size: 15px; margin-bottom: 4px; }
.pe-empty p { font-size: 13px; margin: 0 0 16px; }
.pe-palette-card { margin-top: 2px; }
.pe-palette-title { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.pe-palette-group { margin-bottom: 12px; }
.pe-group-label { display: block; font-size: 12px; color: #9aa9a1; margin-bottom: 8px; }
.pe-palette { display: flex; flex-wrap: wrap; gap: 8px; }
.pe-pal-btn { display: inline-flex; align-items: center; gap: 5px; border: 1px dashed #cfe3d7; background: #fff; color: #3c4d45; border-radius: 8px; padding: 7px 12px; font-size: 13px; cursor: pointer; transition: .15s; }
.pe-pal-btn:hover { border-color: #2f8f5d; color: #1f7a4d; background: #f2f8f4; }
.pe-pal-btn svg { width: 14px; height: 14px; }
.pe-thumb { position: relative; display: inline-block; margin-bottom: 8px; }
.pe-thumb img { width: 120px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid #e6eee8; display: block; }
.pe-thumb-x { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; background: #c0392b; color: #fff; border: none; cursor: pointer; font-size: 13px; line-height: 20px; text-align: center; padding: 0; }
.pe-imgrow { display: flex; gap: 8px; align-items: center; }
.pe-imgrow .pe-path { flex: 1; }
.pe-path { height: 38px; border: 1px solid #dbe6df; border-radius: 8px; padding: 0 10px; font-size: 13px; }
.pe-upload { display: inline-flex; align-items: center; gap: 5px; border: 1px solid #cfe3d7; background: #f2f8f4; color: #1f7a4d; border-radius: 8px; padding: 8px 12px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.pe-upload svg { width: 15px; height: 15px; }
.pe-gallery { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 6px; }
.pe-gal-item { position: relative; }
.pe-gal-item img { width: 92px; height: 92px; object-fit: cover; border-radius: 8px; border: 1px solid #e6eee8; display: block; }
.pe-gal-add { height: 92px; width: 92px; flex-direction: column; justify-content: center; border-style: dashed; }
.pe-sub-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.pe-sub { display: flex; gap: 8px; align-items: flex-start; }
.pe-sub input, .pe-sub select, .pe-sub textarea { flex: 1; border: 1px solid #dbe6df; border-radius: 8px; padding: 7px 10px; font-size: 13px; font-family: inherit; }
.pe-sub .btn { flex: none; }
.pe-side { position: sticky; top: 16px; }
.pe-side-card { padding: 16px; }
.pe-side-title { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.pe-kv { margin: 0; }
.pe-side-note { margin-top: 12px; font-size: 12px; line-height: 1.6; color: #6c7d75; background: #f7faf8; border-radius: 8px; padding: 10px; }
.pe-empty-mini { text-align: center; color: #9aa9a1; padding: 40px 0; }

/* 预览 */
.pe-preview { background: #f4f7f4; border-radius: 12px; overflow: hidden; font-size: 13px; }
.pv-brand { height: 150px; background-size: cover; background-position: center; background-color: #1f7a4d; }
.pv-brand-mask { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; padding: 14px; background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,.55)); color: #fff; }
.pv-brand-name { font-size: 18px; font-weight: 700; }
.pv-brand-slogan { font-size: 12px; opacity: .9; margin-top: 2px; }
.pv-title { font-size: 16px; font-weight: 700; padding: 14px 16px 4px; }
.pv-sub { font-size: 12px; color: #8a9a92; padding: 0 16px 6px; }
.pv-text { padding: 8px 16px; line-height: 1.8; color: #3c4d45; }
.pv-img { padding: 8px 16px; }
.pv-img img { width: 100%; border-radius: 10px; display: block; }
.pv-cap { font-size: 12px; color: #8a9a92; text-align: center; margin-top: 6px; }
.pv-gallery { display: flex; gap: 8px; padding: 8px 16px; overflow-x: auto; }
.pv-gallery img { width: 120px; height: 90px; object-fit: cover; border-radius: 8px; flex: none; }
.pv-video { margin: 8px 16px; background: #10231a; color: #cfe3d7; border-radius: 10px; padding: 30px 16px; text-align: center; }
.pv-notice { margin: 8px 16px; border-radius: 10px; padding: 10px 12px; line-height: 1.6; font-size: 12.5px; }
.pv-notice.info { background: #e9f6ee; color: #1f7a4d; }
.pv-notice.warn { background: #fdf3e4; color: #b7791f; }
.pv-notice.danger { background: #fdeceb; color: #c0392b; }
.pv-notice b { display: block; margin-bottom: 2px; }
.pv-card { margin: 10px 16px; background: #fff; border-radius: 12px; padding: 12px 14px; box-shadow: 0 2px 10px rgba(31,77,52,.06); }
.pv-h { font-weight: 700; margin-bottom: 8px; color: #1e2d27; }
.pv-kv { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px dashed #eef4ef; font-size: 12.5px; }
.pv-kv:last-child { border-bottom: none; }
.pv-kv span { color: #8a9a92; }
.pv-point { padding: 3px 0; color: #3c4d45; }
.pv-qa { padding: 6px 0; border-bottom: 1px dashed #eef4ef; }
.pv-qa:last-child { border-bottom: none; }
.pv-qa b { display: block; margin-bottom: 2px; }
.pv-qa div { color: #6c7d75; }
.pv-btn { margin: 8px 16px; background: #1f7a4d; color: #fff; text-align: center; border-radius: 10px; padding: 12px; font-weight: 600; }
.pv-divider { height: 1px; background: #e6eee8; margin: 12px 16px; }

/* ---------------- 数据库升级执行结果 ---------------- */
.upg-result-group { margin-bottom: 16px; }
.upg-group-title { font-size: 13px; font-weight: 600; color: #53655c; margin-bottom: 8px; }
.upg-line { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 8px; margin-bottom: 6px; font-size: 12px; }
.upg-line svg { width: 15px; height: 15px; flex: none; }
.upg-line b { overflow-wrap: anywhere; }
.upg-line .muted { margin-left: auto; text-align: right; }
.upg-line.ok { background: #edf7f0; color: #1f7a4d; }
.upg-line.skip { background: #f4f6f5; color: #6c7d75; }
.upg-line.warn { background: #fdf7e9; color: #b7791f; }
.upg-line.err { background: #fdf0ef; color: #c0392b; }

@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col, .two-col-even { grid-template-columns: 1fr; }
  .pe-layout { grid-template-columns: 1fr; }
  .pe-side { position: static; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow); }
  body.nav-open .sidebar { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-btn { display: flex; }
  .content { padding: 20px 16px 50px; }
  .topbar { padding: 0 16px; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .mini-stats { grid-template-columns: repeat(2, 1fr); }
  .item-row { grid-template-columns: 1fr 1fr; }
  .qr-grid { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat-card .value { font-size: 23px; }
}

@media print {
  body * { visibility: hidden; }
  #print-area, #print-area * { visibility: visible; }
  #print-area { position: absolute; left: 0; top: 0; width: 100%; padding: 10mm; display: block !important; }
  .qr-grid { grid-template-columns: repeat(4, 1fr); gap: 6mm; }
  .qr-label { border: 1px solid #999; }
}

/* bulk selection */
.sel-cell{width:42px;text-align:center;}
.sel-cell input[type="checkbox"]{width:16px;height:16px;cursor:pointer;vertical-align:middle;}
.filters .strong{font-weight:600;}

