:root {
  --green: #0f6b4c;
  --green-dark: #0c3d30;
  --ink: #1c2b26;
  --muted: #6b7c75;
  --line: #e3ebe6;
  --bg: #f3f6f4;
  --danger: #c2453a;
  --ok: #0f6b4c;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.6 "Microsoft YaHei", "PingFang SC", sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--green); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.layout { display: flex; align-items: flex-start; min-height: 100vh; }
.side { position: sticky; top: 0; width: 220px; height: 100vh; flex: none; overflow-y: auto; background: var(--green-dark); color: #fff; padding: 22px 14px; }
.brand { padding: 0 10px 18px; font-size: 16px; font-weight: 700; letter-spacing: .04em; }
.brand small { display: block; margin-top: 4px; font-weight: 400; color: rgba(255,255,255,.62); font-size: 12px; }
.nav-label { margin: 16px 10px 6px; font-size: 12px; color: rgba(255,255,255,.45); }
.nav-link { display: flex; align-items: center; justify-content: space-between; margin: 2px 0; padding: 8px 10px; border-radius: 8px; color: rgba(255,255,255,.86); }
.nav-link:hover, .nav-link.on { background: rgba(255,255,255,.12); color: #fff; }
.badge { min-width: 18px; padding: 0 6px; border-radius: 99px; background: #e15b4c; color: #fff; font-size: 12px; text-align: center; }
.main { flex: 1; min-width: 0; }
.top { display: flex; justify-content: flex-end; align-items: center; gap: 16px; padding: 16px 28px; background: #fff; border-bottom: 1px solid var(--line); }
.top a { color: var(--muted); }
.content { padding: 24px 28px 48px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
h1 { margin: 0; font-size: 22px; font-weight: 700; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 16px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.stat b { display: block; font-size: 28px; line-height: 1.2; }
.stat span { color: var(--muted); }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
.thumb { width: 72px; height: 48px; object-fit: cover; border-radius: 6px; background: #eef3f0; }
.preview { display: block; width: auto; max-width: 360px; height: auto; max-height: 140px; object-fit: contain; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #f7faf8; }
.preview.on-dark { background: var(--green-dark); border-color: transparent; }
.filters { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filters input, .filters select { width: auto; height: 36px; padding: 0 12px; }
.filters input[type="text"] { width: 240px; }
.filters .btn { flex: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; height: 36px; padding: 0 14px; border: 0; border-radius: 8px; background: var(--green); color: #fff; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(1.05); }
.btn.ghost { background: #e7f3ee; color: var(--green); }
.btn-text { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border: 1px solid #f0d4d1; border-radius: 6px; background: #fff; color: var(--danger); cursor: pointer; }
.inline { display: inline-flex; margin: 0; vertical-align: middle; }
.ops { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.ops > a { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border: 1px solid #d5e6de; border-radius: 6px; background: #f3faf6; }
.alert { margin-bottom: 12px; padding: 10px 12px; border-radius: 8px; }
.alert.ok { background: #e7f6ef; color: var(--ok); }
.alert.err { background: #fdecea; color: var(--danger); }
.form { display: grid; gap: 14px; max-width: 820px; }
.field { display: grid; gap: 6px; }
.field span { font-weight: 600; }
input[type="text"], input[type="password"], input[type="number"], input[type="date"], input[type="email"], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.pick { position: relative; width: 100%; }
.filters .pick { width: auto; }
.pick.open { z-index: 30; }
.pick-native { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.pick-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: 100%; height: 40px; padding: 0 12px 0 14px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink); cursor: pointer; text-align: left; white-space: nowrap;
}
.filters .pick-btn { width: auto; min-width: 140px; height: 36px; }
.pick-btn::after {
  content: ""; width: 7px; height: 7px; flex: none; margin-top: -3px;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg);
}
.pick.open .pick-btn { border-color: var(--green); }
.pick-menu {
  position: absolute; z-index: 1; top: calc(100% + 6px); left: 0; min-width: 100%; width: max-content;
  padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 10px 28px rgba(12, 61, 48, .12);
}
.pick-item {
  display: block; width: 100%; padding: 8px 12px; border: 0; border-radius: 6px;
  background: transparent; color: var(--ink); text-align: left; white-space: nowrap; cursor: pointer;
}
.pick-item:hover { background: #f3faf6; }
.pick-item.on { background: #e7f3ee; color: var(--green); font-weight: 600; }
textarea { min-height: 120px; resize: vertical; }
input[type="file"] { width: auto; max-width: 100%; padding: 0; border: 0; background: transparent; color: var(--muted); }
input[type="file"]::file-selector-button,
input[type="file"]::-webkit-file-upload-button {
  height: 36px; margin-right: 12px; padding: 0 16px; border: 0; border-radius: 8px;
  background: var(--green); color: #fff; font: inherit; cursor: pointer;
}
input[type="file"]::file-selector-button:hover,
input[type="file"]::-webkit-file-upload-button:hover { filter: brightness(1.05); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 120px 100px 1fr; gap: 8px; margin-bottom: 8px; }
.row-chain { display: grid; grid-template-columns: 80px 160px 1fr; gap: 8px; margin-bottom: 8px; }
.help { color: var(--muted); font-size: 12px; }
.pager { margin-top: 16px; }
.pager ul { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.pager li { list-style: none; margin: 0; }
.pager li a, .pager li span { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 10px; margin: 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
.pager li a:hover { border-color: var(--green); color: var(--green); }
.pager li.active span { background: var(--green); border-color: var(--green); color: #fff; }
.pager li.disabled span { color: #b7c4be; background: #f7faf8; }
.pics { display: flex; flex-wrap: wrap; gap: 10px; }
.pic { width: 120px; }
.pic img { width: 120px; height: 80px; object-fit: cover; border-radius: 8px; display: block; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 99px; background: #e7f3ee; color: var(--green); font-size: 12px; }
.tag.off { background: #f3f3f3; color: var(--muted); }
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(160deg, #0c3d30, #147a56); }
.login-card { width: 380px; background: #fff; border-radius: 16px; padding: 32px; }
.login-card h1 { font-size: 22px; margin-bottom: 6px; }
.login-card p { margin: 0 0 18px; color: var(--muted); }
.clip { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message { white-space: pre-wrap; line-height: 1.8; }
@media (max-width: 900px) {
  .layout { display: block; }
  .side { position: static; width: auto; height: auto; overflow: visible; }
  .stats, .row, .row3, .row-chain { grid-template-columns: 1fr; }
}
