/* ============ 装修垃圾清运 · 后台管理 ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green: #17a673;
  --green-light: #e8f8f1;
  --green-grad: linear-gradient(135deg, #6fe0b8 0%, #22c08a 55%, #12a877 100%);
  --ink: #16302a;
  --ink-2: #4b615a;
  --muted: #93a5a0;
  --line: #e8efec;
  --bg: #f2f6f4;
  --sidebar: #0d2b23;
  --danger: #e8534a;
  --warn: #f0a020;
  --blue: #2f8fe0;
  --radius: 14px;
  --shadow: 0 6px 22px rgba(21, 78, 60, .06);
}

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; font-size: 14px; outline: none; }
a { color: var(--green); text-decoration: none; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 10%, #b9f2dd 0%, transparent 45%),
              radial-gradient(circle at 85% 90%, #c8f0ff 0%, transparent 45%),
              linear-gradient(135deg, #eefaf4 0%, #e6f4ff 100%);
  padding: 24px;
}
.login-card {
  width: 400px;
  background: #fff;
  border-radius: 22px;
  padding: 38px 34px 32px;
  box-shadow: 0 24px 60px rgba(15, 70, 55, .12);
}
.login-logo {
  width: 54px; height: 54px; border-radius: 16px;
  background: var(--green-grad);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 24px; font-weight: 700;
  box-shadow: 0 10px 22px rgba(23, 166, 115, .28);
}
.login-card h1 { font-size: 22px; margin: 18px 0 6px; letter-spacing: .5px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 26px; }
.login-field { margin-bottom: 16px; }
.login-field label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 7px; }
.login-field input {
  width: 100%; height: 46px; border-radius: 12px; border: 1px solid var(--line);
  background: #f8fbfa; padding: 0 14px; transition: .2s;
}
.login-field input:focus { border-color: var(--green); background: #fff; box-shadow: 0 0 0 3px rgba(23,166,115,.1); }
.login-btn {
  width: 100%; height: 48px; border: 0; border-radius: 12px; margin-top: 8px;
  background: var(--green-grad); color: #fff; font-size: 16px; font-weight: 600;
  cursor: pointer; box-shadow: 0 10px 24px rgba(23,166,115,.25); transition: .2s;
}
.login-btn:hover { transform: translateY(-1px); }
.login-tip { margin-top: 18px; font-size: 12px; color: var(--muted); text-align: center; line-height: 1.8; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 218px; flex: 0 0 218px; background: var(--sidebar); color: #cfe6dd;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 22px 20px 18px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px; background: var(--green-grad);
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700;
}
.brand-text b { display: block; color: #fff; font-size: 14px; letter-spacing: .5px; }
.brand-text span { font-size: 11px; color: #7fa89b; }
.nav { flex: 1; padding: 8px 12px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 12px;
  border-radius: 10px; cursor: pointer; font-size: 13.5px; color: #b6d2c8;
  margin-bottom: 3px; transition: .18s; user-select: none;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: var(--green-grad); color: #fff; font-weight: 600; box-shadow: 0 8px 18px rgba(23,166,115,.28); }
.nav-item svg { width: 17px; height: 17px; flex: 0 0 17px; }
.nav-group { font-size: 11px; color: #5d8277; padding: 14px 12px 6px; letter-spacing: 1px; }
.sidebar-foot { padding: 14px 18px 20px; font-size: 11px; color: #5d8277; line-height: 1.7; border-top: 1px solid rgba(255,255,255,.06); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 66px; background: rgba(255,255,255,.85); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center;
  justify-content: space-between; padding: 0 26px; position: sticky; top: 0; z-index: 10;
}
.topbar h2 { font-size: 17px; font-weight: 600; }
.topbar .crumb { font-size: 12px; color: var(--muted); margin-top: 3px; }
.top-right { display: flex; align-items: center; gap: 14px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--green-light);
  color: var(--green); display: flex; align-items: center; justify-content: center; font-weight: 600;
}
.user-meta { font-size: 13px; line-height: 1.35; }
.user-meta span { display: block; font-size: 11px; color: var(--muted); }
.btn-ghost {
  height: 32px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); cursor: pointer; transition: .18s;
}
.btn-ghost:hover { border-color: var(--green); color: var(--green); }
.content { padding: 22px 26px 40px; flex: 1; }

/* ---------- 卡片 / 表格 ---------- */
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid #eff4f2; }
.card + .card { margin-top: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 15px; font-weight: 600; }
.card-head .sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.card-body { padding: 18px 20px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.stat {
  background: #fff; border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow);
  border: 1px solid #eff4f2; position: relative; overflow: hidden;
}
.stat .label { font-size: 12.5px; color: var(--muted); }
.stat .value { font-size: 28px; font-weight: 700; margin: 8px 0 2px; letter-spacing: .5px; }
.stat .foot { font-size: 12px; color: var(--muted); }
.stat::after {
  content: ''; position: absolute; right: -28px; top: -28px; width: 86px; height: 86px;
  border-radius: 50%; background: var(--green-light); opacity: .8;
}
.stat.blue::after { background: #e8f2fe; }
.stat.amber::after { background: #fef5e5; }
.stat.pink::after { background: #feeeee; }
.stat .value.green { color: var(--green); }
.stat .value.blue { color: var(--blue); }
.stat .value.amber { color: var(--warn); }
.stat .value.pink { color: var(--danger); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
.input, .select {
  height: 36px; border-radius: 9px; border: 1px solid var(--line); background: #fafcfb;
  padding: 0 12px; color: var(--ink); min-width: 130px;
}
.input:focus, .select:focus { border-color: var(--green); background: #fff; }
.btn {
  height: 36px; padding: 0 16px; border-radius: 9px; border: 0; cursor: pointer;
  background: var(--green-grad); color: #fff; font-weight: 600; transition: .18s;
  box-shadow: 0 8px 18px rgba(23,166,115,.22); display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { transform: translateY(-1px); }
.btn.plain { background: #fff; color: var(--ink-2); border: 1px solid var(--line); box-shadow: none; }
.btn.plain:hover { border-color: var(--green); color: var(--green); }
.btn.danger { background: #fff; color: var(--danger); border: 1px solid #f6d4d1; box-shadow: none; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 12px; font-size: 13px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; background: #fbfdfc; font-size: 12.5px; white-space: nowrap; }
tbody tr:hover { background: #fafdfc; }
td .link { color: var(--green); cursor: pointer; }
td .link + .link { margin-left: 12px; }
td .link.danger { color: var(--danger); }
.empty { text-align: center; color: var(--muted); padding: 46px 0; font-size: 13px; }
.tag { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 12px; line-height: 1.5; }
.tag.green { background: var(--green-light); color: var(--green); }
.tag.gray { background: #f1f4f3; color: #8b9b96; }
.tag.amber { background: #fef5e5; color: #c9820f; }
.tag.red { background: #fdeceb; color: var(--danger); }
.tag.blue { background: #eaf3fd; color: var(--blue); }

.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 4px 4px; color: var(--muted); font-size: 12.5px; }
.pager button {
  min-width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; color: var(--ink-2);
}
.pager button.on { background: var(--green); border-color: var(--green); color: #fff; }
.pager button:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- 图表 ---------- */
.chart { display: flex; align-items: flex-end; gap: 14px; height: 170px; padding: 10px 4px 0; }
.chart .bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.chart .bar {
  width: 100%; max-width: 38px; border-radius: 8px 8px 4px 4px; background: var(--green-grad);
  min-height: 4px; transition: height .5s ease; position: relative;
}
.chart .bar span { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--green); font-weight: 600; }
.chart .bar-label { font-size: 11px; color: var(--muted); }

/* ---------- 弹窗 ---------- */
.mask {
  position: fixed; inset: 0; background: rgba(12, 35, 28, .42); display: flex;
  align-items: center; justify-content: center; z-index: 100; padding: 24px;
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff; border-radius: 18px; width: 560px; max-width: 100%; max-height: 88vh;
  display: flex; flex-direction: column; box-shadow: 0 30px 70px rgba(8, 40, 30, .28);
  animation: pop .2s ease;
}
@keyframes pop { from { transform: translateY(14px) scale(.98); opacity: 0; } }
.modal.wide { width: 720px; }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--line); font-size: 16px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.modal-head .close { cursor: pointer; color: var(--muted); font-size: 20px; line-height: 1; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.form-row { margin-bottom: 15px; display: flex; flex-direction: column; gap: 7px; }
.form-row label { font-size: 13px; color: var(--ink-2); }
.form-row label i { color: var(--danger); font-style: normal; margin-left: 2px; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #fafcfb;
  padding: 10px 12px; min-height: 40px;
}
.form-row textarea { min-height: 88px; resize: vertical; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { border-color: var(--green); background: #fff; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-tip { font-size: 12px; color: var(--muted); }

.upload-box {
  border: 1px dashed #cfded8; border-radius: 12px; padding: 12px; display: flex;
  align-items: center; gap: 12px; background: #fafcfb; cursor: pointer; transition: .18s;
}
.upload-box:hover { border-color: var(--green); background: #f4fdf9; }
.upload-box img { width: 64px; height: 44px; object-fit: cover; border-radius: 8px; background: #eef4f1; }
.upload-box .ph { width: 64px; height: 44px; border-radius: 8px; background: #eef4f1; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 11px; }
.upload-box .txt { font-size: 12.5px; color: var(--ink-2); line-height: 1.6; }
.upload-box .txt span { color: var(--muted); font-size: 11.5px; }

.detail-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.detail-list .item { font-size: 13px; line-height: 1.7; }
.detail-list .item b { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.detail-list .full { grid-column: 1 / -1; }

.toast {
  position: fixed; left: 50%; top: 28px; transform: translateX(-50%); z-index: 300;
  background: rgba(16, 48, 38, .92); color: #fff; padding: 10px 20px; border-radius: 30px;
  font-size: 13px; box-shadow: 0 12px 30px rgba(0,0,0,.18); animation: fade .2s;
}
.toast.err { background: rgba(196, 62, 52, .95); }

@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
