/* 南宸园区绿化消杀运维管理系统 V1.0 — 样式表 */
:root {
  --brand: #14875a;
  --brand-dark: #0e6642;
  --brand-light: #e8f6ef;
  --brand-soft: #f2fbf6;
  --accent: #e39b1c;
  --danger: #d9483b;
  --warn: #e08c1a;
  --info: #2b7cc4;
  --text: #1d2a24;
  --text-2: #5c6f66;
  --text-3: #90a29a;
  --line: #e3ebe6;
  --bg: #f4f7f5;
  --sidebar: #12261d;
  --sidebar-2: #0c1c15;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 40, 30, .04), 0 8px 24px rgba(16, 40, 30, .06);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Segoe UI", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: 14px; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c8d6cf; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ============ 登录页 ============ */
.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  background: #0c1c15;
}
.login-brand {
  position: relative;
  padding: 64px 60px;
  color: #fff;
  background:
    radial-gradient(900px 520px at 12% 8%, rgba(38, 168, 116, .38), transparent 62%),
    radial-gradient(700px 480px at 88% 92%, rgba(227, 155, 28, .18), transparent 60%),
    linear-gradient(150deg, #0d2a1e 0%, #103627 48%, #0a2018 100%);
  overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
}
.login-brand::after {
  content: "";
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 30% 30%, #000 20%, transparent 78%);
  pointer-events: none;
}
.login-brand .logo { display: flex; align-items: center; gap: 12px; position: relative; z-index: 2; }
.login-brand .logo-mark {
  width: 42px; height: 42px; border-radius: 11px;
  background: linear-gradient(140deg, #29b57c, #14875a);
  display: grid; place-items: center; font-weight: 700; font-size: 18px; letter-spacing: .5px;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}
.login-brand h1 { font-size: 30px; line-height: 1.35; margin: 0 0 18px; font-weight: 600; letter-spacing: .5px; position: relative; z-index: 2; }
.login-brand .slogan { color: rgba(255,255,255,.72); line-height: 1.9; max-width: 520px; font-size: 14px; position: relative; z-index: 2; }
.login-brand .feature-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 30px; position: relative; z-index: 2; }
.login-brand .feature-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: 10px;
  background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.1);
  font-size: 13px; color: rgba(255,255,255,.86); line-height: 1.5;
}
.login-brand .feature-item i { color: #38c98c; font-style: normal; font-weight: 700; }
.login-brand .foot { font-size: 12px; color: rgba(255,255,255,.42); position: relative; z-index: 2; }
.login-form-side { background: #fff; display: grid; place-items: center; padding: 40px; }
.login-card { width: 100%; max-width: 360px; }
.login-card h2 { margin: 0 0 6px; font-size: 22px; }
.login-card .sub { color: var(--text-3); font-size: 13px; margin-bottom: 28px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 7px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: #fbfdfc; outline: none; transition: .18s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(20,135,90,.1); }
.field textarea { min-height: 78px; resize: vertical; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 8px; border: 1px solid transparent;
  background: var(--brand); color: #fff; cursor: pointer; transition: .18s; font-size: 14px;
  white-space: nowrap;
}
.btn:hover { background: var(--brand-dark); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--text-2); border-color: var(--line); }
.btn.ghost:hover { color: var(--brand); border-color: #b9dccb; background: var(--brand-soft); }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #b93a2f; }
.btn.sm { padding: 5px 11px; font-size: 13px; border-radius: 7px; }
.btn.block { width: 100%; padding: 11px; font-size: 15px; }
.btn-link { background: none; border: none; color: var(--brand); cursor: pointer; padding: 0 4px; font-size: 13px; }
.btn-link:hover { text-decoration: underline; }
.btn-link.danger { color: var(--danger); }
.login-hint { margin-top: 22px; padding: 12px 14px; border-radius: 8px; background: var(--brand-soft); border: 1px dashed #b9dccb; font-size: 12px; color: var(--text-2); line-height: 1.9; }
.login-hint b { color: var(--brand-dark); }
.role-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.role-pick button {
  padding: 5px 10px; font-size: 12px; border-radius: 20px; border: 1px solid var(--line);
  background: #fff; color: var(--text-2); cursor: pointer;
}
.role-pick button.on { background: var(--brand-light); border-color: #9fd0b9; color: var(--brand-dark); font-weight: 600; }

/* ============ 主框架 ============ */
.app { display: grid; grid-template-columns: 226px 1fr; min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
  color: #cfe0d7; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { padding: 20px 18px 16px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid rgba(255,255,255,.07); }
.sidebar .brand-mark {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: linear-gradient(140deg, #29b57c, #0f6d46); display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 15px;
}
.sidebar .brand-txt b { display: block; font-size: 14px; color: #fff; letter-spacing: .3px; }
.sidebar .brand-txt span { font-size: 11px; color: rgba(255,255,255,.4); }
.nav { padding: 10px 10px 20px; overflow-y: auto; flex: 1; }
.nav .nav-group { font-size: 11px; color: rgba(255,255,255,.32); padding: 14px 10px 6px; letter-spacing: 1px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 8px;
  color: #b9cec4; font-size: 13.5px; margin-bottom: 2px; transition: .15s; position: relative;
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: linear-gradient(90deg, rgba(41,181,124,.22), rgba(41,181,124,.06)); color: #fff; }
.nav a.active::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: #35c98d; }
.nav a .dot { width: 6px; height: 6px; border-radius: 50%; background: #3f6152; flex: none; }
.nav a.active .dot { background: #35c98d; box-shadow: 0 0 0 3px rgba(53,201,141,.18); }
.nav a .badge-n { margin-left: auto; background: #d9483b; color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 10px; }
.sidebar .userbox { padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.07); display: flex; gap: 10px; align-items: center; }
.sidebar .avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(140deg,#2fa876,#1a6d4a); display: grid; place-items: center; color: #fff; font-size: 13px; flex: none; }
.sidebar .userbox b { font-size: 13px; color: #fff; font-weight: 500; display: block; }
.sidebar .userbox span { font-size: 11px; color: rgba(255,255,255,.42); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 58px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 0 22px; position: sticky; top: 0; z-index: 20;
}
.topbar .crumb { font-size: 13px; color: var(--text-3); }
.topbar .crumb b { color: var(--text); font-weight: 600; font-size: 15px; }
.topbar .spacer { flex: 1; }
.topbar .pill { font-size: 12px; color: var(--text-2); background: var(--bg); padding: 5px 11px; border-radius: 20px; }
.topbar .avatar-sm { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-light); color: var(--brand-dark); display: grid; place-items: center; font-size: 12px; font-weight: 600; }
.content { padding: 20px 22px 40px; flex: 1; }

/* ============ 通用组件 ============ */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card-head .sub { font-size: 12px; color: var(--text-3); }
.card-head .spacer { flex: 1; }
.card-body { padding: 16px 18px; }
.card-body.tight { padding: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 14px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 16px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat::after { content: ""; position: absolute; right: -18px; bottom: -22px; width: 72px; height: 72px; border-radius: 50%; background: var(--brand-light); opacity: .6; }
.stat .k { font-size: 12.5px; color: var(--text-3); position: relative; z-index: 1; }
.stat .v { font-size: 26px; font-weight: 700; margin-top: 6px; letter-spacing: -.5px; position: relative; z-index: 1; }
.stat .v small { font-size: 12px; font-weight: 400; color: var(--text-3); margin-left: 3px; }
.stat .foot { font-size: 11.5px; color: var(--text-3); margin-top: 4px; position: relative; z-index: 1; }
.stat.b1 .v { color: var(--brand); } .stat.b1::after { background: #e3f6ec; }
.stat.b2 .v { color: var(--info); } .stat.b2::after { background: #e6f1fb; }
.stat.b3 .v { color: var(--warn); } .stat.b3::after { background: #fdf2e0; }
.stat.b4 .v { color: var(--danger); } .stat.b4::after { background: #fbe8e6; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-12 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
@media (max-width: 1180px) { .grid-2, .grid-3, .grid-12 { grid-template-columns: 1fr; } }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
.toolbar input, .toolbar select {
  padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; outline: none; min-width: 130px;
}
.toolbar input:focus, .toolbar select:focus { border-color: var(--brand); }
.toolbar input.search { min-width: 210px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button {
  background: none; border: none; padding: 9px 15px; cursor: pointer; font-size: 14px; color: var(--text-2);
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: .15s;
}
.tabs button:hover { color: var(--brand); }
.tabs button.on { color: var(--brand-dark); font-weight: 600; border-bottom-color: var(--brand); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; font-size: 13px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: #fafcfb; color: var(--text-2); font-weight: 600; font-size: 12.5px; white-space: nowrap; }
tbody tr:hover { background: var(--brand-soft); }
td.num { font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.empty { padding: 46px 20px; text-align: center; color: var(--text-3); font-size: 13px; }
.empty .ico { font-size: 30px; opacity: .5; display: block; margin-bottom: 8px; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; line-height: 1.7; white-space: nowrap; }
.tag.green { background: #e6f7ee; color: #12805a; }
.tag.blue { background: #e8f1fb; color: #2268a8; }
.tag.orange { background: #fdf1e0; color: #b8710c; }
.tag.red { background: #fbeae8; color: #c0392b; }
.tag.gray { background: #eff2f0; color: #6a7d74; }
.tag.purple { background: #f0ebfa; color: #6a45b5; }

.progress { height: 6px; border-radius: 6px; background: #edf2ef; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #2fae7c, #14875a); }

.chart-bars { display: flex; align-items: flex-end; gap: 18px; height: 170px; padding: 8px 4px 0; }
.chart-bars .bar-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart-bars .bar-col { width: 100%; max-width: 46px; display: flex; flex-direction: column; justify-content: flex-end; gap: 3px; height: 100%; }
.chart-bars .bar-col i { display: block; border-radius: 4px 4px 0 0; min-height: 3px; transition: .3s; }
.chart-bars .bar-col i.g { background: linear-gradient(180deg, #4ccb95, #14875a); }
.chart-bars .bar-col i.p { background: linear-gradient(180deg, #f0b44a, #d18a12); }
.chart-bars .lbl { font-size: 11px; color: var(--text-3); }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--text-2); }
.legend span { display: flex; align-items: center; gap: 5px; }
.legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }

.list-line { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.list-line:last-child { border-bottom: none; }
.list-line .grow { flex: 1; min-width: 0; }
.list-line .grow b { font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-line .grow span { font-size: 11.5px; color: var(--text-3); }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(14, 30, 23, .44); backdrop-filter: blur(2px);
  display: flex; align-items: flex-start; justify-content: center; padding: 46px 20px; z-index: 100; overflow-y: auto;
  animation: fade .16s ease;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.modal {
  background: #fff; border-radius: 12px; width: 100%; max-width: 620px; box-shadow: 0 24px 60px rgba(0,0,0,.22);
  animation: pop .18s ease; margin: auto;
}
@keyframes pop { from { transform: translateY(-8px); opacity: .6 } to { transform: none; opacity: 1 } }
.modal.wide { max-width: 880px; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-head .x { margin-left: auto; background: none; border: none; font-size: 20px; color: var(--text-3); cursor: pointer; line-height: 1; }
.modal-body { padding: 18px 20px; max-height: 66vh; overflow-y: auto; }
.modal-foot { padding: 13px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 9px; background: #fbfdfc; border-radius: 0 0 12px 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } }
.field .req { color: var(--danger); margin-left: 2px; }
.field .hint { font-size: 11.5px; color: var(--text-3); margin-top: 5px; }

.toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #1d2a24; color: #fff; padding: 9px 18px; border-radius: 8px; font-size: 13px;
  box-shadow: 0 10px 26px rgba(0,0,0,.22); animation: pop .2s ease;
}
.toast.ok { background: #14875a; }
.toast.err { background: #c0392b; }

/* 详情列表 */
.detail-list { display: grid; grid-template-columns: 108px 1fr; gap: 10px 14px; font-size: 13px; }
.detail-list dt { color: var(--text-3); }
.detail-list dd { margin: 0; color: var(--text); word-break: break-word; }
.photo-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.photo-box {
  width: 132px; height: 100px; border-radius: 8px; border: 1px dashed #c9dbd2; background: #f7fbf9;
  display: grid; place-items: center; color: var(--text-3); font-size: 12px; overflow: hidden; text-align: center; padding: 4px;
}
.photo-box img { width: 100%; height: 100%; object-fit: cover; }
.photo-box.filled { border-style: solid; }

.section-title { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 18px 0 10px; padding-left: 9px; border-left: 3px solid var(--brand); }
.section-title:first-child { margin-top: 0; }

.info-banner {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 15px; border-radius: 9px;
  background: var(--brand-soft); border: 1px solid #d5ece0; font-size: 13px; color: var(--text-2); line-height: 1.75;
}
.info-banner.warn { background: #fdf6ec; border-color: #f3e2c4; color: #8a6414; }
.info-banner.danger { background: #fdf0ee; border-color: #f5d7d3; color: #a3382c; }
.info-banner b { color: inherit; }

.mini-table th, .mini-table td { padding: 7px 9px; font-size: 12.5px; }

.role-matrix th, .role-matrix td { padding: 9px 11px; font-size: 12.5px; text-align: center; }
.role-matrix td:first-child, .role-matrix th:first-child { text-align: left; }
.role-matrix .yes { color: var(--brand); font-weight: 600; }
.role-matrix .no { color: #cfd9d4; }

/* 打 印 / 导出 PDF */
@media print {
  .sidebar, .topbar, .toolbar, .no-print, .modal-foot { display: none !important; }
  .app { display: block; }
  .content { padding: 0; }
  .card { box-shadow: none; border-color: #d5d5d5; page-break-inside: auto; }
  body { background: #fff; }
  .print-title { display: block !important; }
  th, td { font-size: 10.5px; padding: 5px 6px; }
}
.print-title { display: none; text-align: center; margin-bottom: 10px; }
.print-title h2 { margin: 0 0 4px; font-size: 18px; }
.print-title div { font-size: 12px; color: #666; }

.fade-in { animation: fadein .22s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px) } to { opacity: 1; transform: none } }

.form-inline { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.form-inline .field { margin-bottom: 0; }